From owner-svn-src-all@freebsd.org Sun Jul 9 00:24:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D73DA5BD4; Sun, 9 Jul 2017 00:24:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C43A070C3D; Sun, 9 Jul 2017 00:24:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v690Oqoj084257; Sun, 9 Jul 2017 00:24:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v690Oqlq084256; Sun, 9 Jul 2017 00:24:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707090024.v690Oqlq084256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 9 Jul 2017 00:24: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: r320821 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 320821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 00:24:54 -0000 Author: emaste Date: Sun Jul 9 00:24:52 2017 New Revision: 320821 URL: https://svnweb.freebsd.org/changeset/base/320821 Log: MFC r320069: Add ZFS to Linux statfs ftype PR: 220086 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/compat/linux/linux_stats.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Sat Jul 8 21:15:46 2017 (r320820) +++ stable/11/sys/compat/linux/linux_stats.c Sun Jul 9 00:24:52 2017 (r320821) @@ -318,6 +318,7 @@ struct l_statfs { #define LINUX_NTFS_SUPER_MAGIC 0x5346544EL #define LINUX_PROC_SUPER_MAGIC 0x9fa0L #define LINUX_UFS_SUPER_MAGIC 0x00011954L /* XXX - UFS_MAGIC in Linux */ +#define LINUX_ZFS_SUPER_MAGIC 0x2FC12FC1 #define LINUX_DEVFS_SUPER_MAGIC 0x1373L #define LINUX_SHMFS_MAGIC 0x01021994 @@ -327,6 +328,7 @@ bsd_to_linux_ftype(const char *fstypename) int i; static struct {const char *bsd_name; long linux_type;} b2l_tbl[] = { {"ufs", LINUX_UFS_SUPER_MAGIC}, + {"zfs", LINUX_ZFS_SUPER_MAGIC}, {"cd9660", LINUX_ISOFS_SUPER_MAGIC}, {"nfs", LINUX_NFS_SUPER_MAGIC}, {"ext2fs", LINUX_EXT2_SUPER_MAGIC}, From owner-svn-src-all@freebsd.org Sun Jul 9 03:54:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A684EDAA700; Sun, 9 Jul 2017 03:54:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 623ED7691C; Sun, 9 Jul 2017 03:54:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v693sAqj071463; Sun, 9 Jul 2017 03:54:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v693sAIg071462; Sun, 9 Jul 2017 03:54:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707090354.v693sAIg071462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Jul 2017 03:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320822 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 320822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 03:54:11 -0000 Author: kib Date: Sun Jul 9 03:54:10 2017 New Revision: 320822 URL: https://svnweb.freebsd.org/changeset/base/320822 Log: MFC r320570: Correct signatures of several pthreads stubs. Modified: stable/11/lib/libc/gen/_pthread_stubs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/11/lib/libc/gen/_pthread_stubs.c Sun Jul 9 00:24:52 2017 (r320821) +++ stable/11/lib/libc/gen/_pthread_stubs.c Sun Jul 9 03:54:10 2017 (r320822) @@ -279,10 +279,11 @@ STUB_FUNC2(pthread_kill, PJT_KILL, int, void *, int) STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *) STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *) STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) -STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int) -STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *); -STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int) -STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int) +STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, void, int) +STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *, + void *, void *); +STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) +STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) static int stub_zero(void) From owner-svn-src-all@freebsd.org Sun Jul 9 03:57:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41173DAA7A9; Sun, 9 Jul 2017 03:57:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0500076A6A; Sun, 9 Jul 2017 03:57:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v693vPdf071638; Sun, 9 Jul 2017 03:57:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v693vPJP071637; Sun, 9 Jul 2017 03:57:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707090357.v693vPJP071637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Jul 2017 03:57:25 +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: r320823 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 320823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 03:57:26 -0000 Author: kib Date: Sun Jul 9 03:57:24 2017 New Revision: 320823 URL: https://svnweb.freebsd.org/changeset/base/320823 Log: MFC r320570: Correct signatures of several pthreads stubs. Modified: stable/10/lib/libc/gen/_pthread_stubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/10/lib/libc/gen/_pthread_stubs.c Sun Jul 9 03:54:10 2017 (r320822) +++ stable/10/lib/libc/gen/_pthread_stubs.c Sun Jul 9 03:57:24 2017 (r320823) @@ -271,10 +271,11 @@ STUB_FUNC2(pthread_kill, PJT_KILL, int, void *, int) STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *) STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *) STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) -STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int) -STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *); -STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int) -STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int) +STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, void, int) +STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *, + void *, void *); +STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) +STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) static int stub_zero(void) From owner-svn-src-all@freebsd.org Sun Jul 9 04:13:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD2B8DAAB2A; Sun, 9 Jul 2017 04:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF71770D5; Sun, 9 Jul 2017 04:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v694DYL0079404; Sun, 9 Jul 2017 04:13:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v694DYsC079402; Sun, 9 Jul 2017 04:13:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707090413.v694DYsC079402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 9 Jul 2017 04:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320824 - in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb X-SVN-Commit-Revision: 320824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 04:13:35 -0000 Author: jhb Date: Sun Jul 9 04:13:33 2017 New Revision: 320824 URL: https://svnweb.freebsd.org/changeset/base/320824 Log: MFC 320675: Add deprecation notices for gdb and kgdb. Even though gdb and kgdb may not be removed for 12.0 on some architectures, the notice is unconditional as these tools will likely be removed at some point in the future when adequate replacements are available (gdb in ports or lldb in base). Modified: stable/11/gnu/usr.bin/gdb/gdb/gdb.1 stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/gnu/usr.bin/gdb/gdb/gdb.1 stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Directory Properties: stable/10/ (props changed) Modified: stable/11/gnu/usr.bin/gdb/gdb/gdb.1 ============================================================================== --- stable/11/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 03:57:24 2017 (r320823) +++ stable/11/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 04:13:33 2017 (r320824) @@ -44,6 +44,11 @@ gdb \- The GNU Debugger .IR core \||\| procID\c \&\|]\&\|] .ad b +.SH DEPRECATION NOTICE +This version of gdb is deprecated and will be removed from future versions +of the FreeBSD base system. +A newer version of gdb is available from ports or packages +(devel/gdb). .SH DESCRIPTION The purpose of a debugger such as GDB is to allow you to see what is going on ``inside'' another program while it executes\(em\&or what another Modified: stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 03:57:24 2017 (r320823) +++ stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 04:13:33 2017 (r320824) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2006 +.Dd July 5, 2017 .Dt KGDB 1 .Os .Sh NAME @@ -40,6 +40,16 @@ .Op Fl d Ar crashdir .Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device .Op Ar kernel Op Ar core +.Sh DEPRECATION NOTICE +This version of +.Nm +is deprecated and will be removed from future versions of the +.Fx +base system. +A newer version of +.Nm +is available from ports or packages +(devel/gdb). .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Sun Jul 9 04:13:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BFC4DAAB24; Sun, 9 Jul 2017 04:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 310B5770D4; Sun, 9 Jul 2017 04:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v694DYUa079397; Sun, 9 Jul 2017 04:13:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v694DYZt079395; Sun, 9 Jul 2017 04:13:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707090413.v694DYZt079395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 9 Jul 2017 04:13:34 +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: r320824 - in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb X-SVN-Commit-Revision: 320824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 04:13:35 -0000 Author: jhb Date: Sun Jul 9 04:13:33 2017 New Revision: 320824 URL: https://svnweb.freebsd.org/changeset/base/320824 Log: MFC 320675: Add deprecation notices for gdb and kgdb. Even though gdb and kgdb may not be removed for 12.0 on some architectures, the notice is unconditional as these tools will likely be removed at some point in the future when adequate replacements are available (gdb in ports or lldb in base). Modified: stable/10/gnu/usr.bin/gdb/gdb/gdb.1 stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/gnu/usr.bin/gdb/gdb/gdb.1 stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 Directory Properties: stable/11/ (props changed) Modified: stable/10/gnu/usr.bin/gdb/gdb/gdb.1 ============================================================================== --- stable/10/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 03:57:24 2017 (r320823) +++ stable/10/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 04:13:33 2017 (r320824) @@ -44,6 +44,11 @@ gdb \- The GNU Debugger .IR core \||\| procID\c \&\|]\&\|] .ad b +.SH DEPRECATION NOTICE +This version of gdb is deprecated and will be removed from future versions +of the FreeBSD base system. +A newer version of gdb is available from ports or packages +(devel/gdb). .SH DESCRIPTION The purpose of a debugger such as GDB is to allow you to see what is going on ``inside'' another program while it executes\(em\&or what another Modified: stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 03:57:24 2017 (r320823) +++ stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 04:13:33 2017 (r320824) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2006 +.Dd July 5, 2017 .Dt KGDB 1 .Os .Sh NAME @@ -40,6 +40,16 @@ .Op Fl d Ar crashdir .Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device .Op Ar kernel Op Ar core +.Sh DEPRECATION NOTICE +This version of +.Nm +is deprecated and will be removed from future versions of the +.Fx +base system. +A newer version of +.Nm +is available from ports or packages +(devel/gdb). .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Sun Jul 9 04:28:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58EDDAAEFC; Sun, 9 Jul 2017 04:28:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2EA777638; Sun, 9 Jul 2017 04:28:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v694Shiw070145; Sat, 8 Jul 2017 21:28:43 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v694Shij070144; Sat, 8 Jul 2017 21:28:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707090428.v694Shij070144@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320824 - in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb In-Reply-To: <201707090413.v694DYZt079395@repo.freebsd.org> To: John Baldwin Date: Sat, 8 Jul 2017 21:28:43 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 04:28:48 -0000 > Author: jhb > Date: Sun Jul 9 04:13:33 2017 > New Revision: 320824 > URL: https://svnweb.freebsd.org/changeset/base/320824 > > Log: > MFC 320675: Add deprecation notices for gdb and kgdb. > > Even though gdb and kgdb may not be removed for 12.0 on some architectures, > the notice is unconditional as these tools will likely be removed at some > point in the future when adequate replacements are available (gdb in ports > or lldb in base). Thanks for doing this, but we are still falling slightly short of 17.4 on deprecation on the aspect of "Use of the deprecated feature generates a warning". > Modified: > stable/10/gnu/usr.bin/gdb/gdb/gdb.1 > stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 > Directory Properties: > stable/10/ (props changed) > > Changes in other areas also in this revision: > Modified: > stable/11/gnu/usr.bin/gdb/gdb/gdb.1 > stable/11/gnu/usr.bin/gdb/kgdb/kgdb.1 > Directory Properties: > stable/11/ (props changed) > > Modified: stable/10/gnu/usr.bin/gdb/gdb/gdb.1 > ============================================================================== > --- stable/10/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 03:57:24 2017 (r320823) > +++ stable/10/gnu/usr.bin/gdb/gdb/gdb.1 Sun Jul 9 04:13:33 2017 (r320824) > @@ -44,6 +44,11 @@ gdb \- The GNU Debugger > .IR core \||\| procID\c > \&\|]\&\|] > .ad b > +.SH DEPRECATION NOTICE > +This version of gdb is deprecated and will be removed from future versions > +of the FreeBSD base system. > +A newer version of gdb is available from ports or packages > +(devel/gdb). > .SH DESCRIPTION > The purpose of a debugger such as GDB is to allow you to see what is > going on ``inside'' another program while it executes\(em\&or what another > > Modified: stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 > ============================================================================== > --- stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 03:57:24 2017 (r320823) > +++ stable/10/gnu/usr.bin/gdb/kgdb/kgdb.1 Sun Jul 9 04:13:33 2017 (r320824) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 11, 2006 > +.Dd July 5, 2017 > .Dt KGDB 1 > .Os > .Sh NAME > @@ -40,6 +40,16 @@ > .Op Fl d Ar crashdir > .Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device > .Op Ar kernel Op Ar core > +.Sh DEPRECATION NOTICE > +This version of > +.Nm > +is deprecated and will be removed from future versions of the > +.Fx > +base system. > +A newer version of > +.Nm > +is available from ports or packages > +(devel/gdb). > .Sh DESCRIPTION > The > .Nm > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jul 9 04:34:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F045CDAB0D9; Sun, 9 Jul 2017 04:34:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8481C77A24; Sun, 9 Jul 2017 04:34:23 +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 v694YMHf087570; Sun, 9 Jul 2017 04:34:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v694YMuq087569; Sun, 9 Jul 2017 04:34:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707090434.v694YMuq087569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Jul 2017 04:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320825 - releng/11.1/lib/libc/gen X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.1/lib/libc/gen X-SVN-Commit-Revision: 320825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 04:34:24 -0000 Author: kib Date: Sun Jul 9 04:34:22 2017 New Revision: 320825 URL: https://svnweb.freebsd.org/changeset/base/320825 Log: MFC r320570 MFS r320822: Correct signatures of several pthreads stubs. Approved by: re (gjb) Modified: releng/11.1/lib/libc/gen/_pthread_stubs.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/lib/libc/gen/_pthread_stubs.c ============================================================================== --- releng/11.1/lib/libc/gen/_pthread_stubs.c Sun Jul 9 04:13:33 2017 (r320824) +++ releng/11.1/lib/libc/gen/_pthread_stubs.c Sun Jul 9 04:34:22 2017 (r320825) @@ -279,10 +279,11 @@ STUB_FUNC2(pthread_kill, PJT_KILL, int, void *, int) STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *) STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *) STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) -STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int) -STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *); -STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int) -STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int) +STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, void, int) +STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *, + void *, void *); +STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) +STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) static int stub_zero(void) From owner-svn-src-all@freebsd.org Sun Jul 9 06:40:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FD9DAC1E0; Sun, 9 Jul 2017 06:40:17 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A57EE79BB5; Sun, 9 Jul 2017 06:40:17 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v696eGJ3036326; Sun, 9 Jul 2017 06:40:16 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v696eG59036325; Sun, 9 Jul 2017 06:40:16 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201707090640.v696eG59036325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sun, 9 Jul 2017 06:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320826 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 320826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 06:40:17 -0000 Author: netchild Date: Sun Jul 9 06:40:16 2017 New Revision: 320826 URL: https://svnweb.freebsd.org/changeset/base/320826 Log: - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look how much flags we still have available to use in the future. - Add kmem_access flag as a placeholder (reserve it), not used yet. Differential Revision: D11451 Reviewed by: jamie Sponsored by: Hackathon Essen 2017 Modified: head/sys/sys/jail.h Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sun Jul 9 04:34:22 2017 (r320825) +++ head/sys/sys/jail.h Sun Jul 9 06:40:16 2017 (r320826) @@ -215,23 +215,24 @@ struct prison_racct { /* by this jail or an ancestor */ /* Flags for pr_allow */ -#define PR_ALLOW_SET_HOSTNAME 0x0001 -#define PR_ALLOW_SYSVIPC 0x0002 -#define PR_ALLOW_RAW_SOCKETS 0x0004 -#define PR_ALLOW_CHFLAGS 0x0008 -#define PR_ALLOW_MOUNT 0x0010 -#define PR_ALLOW_QUOTAS 0x0020 -#define PR_ALLOW_SOCKET_AF 0x0040 -#define PR_ALLOW_MOUNT_DEVFS 0x0080 -#define PR_ALLOW_MOUNT_NULLFS 0x0100 -#define PR_ALLOW_MOUNT_ZFS 0x0200 -#define PR_ALLOW_MOUNT_PROCFS 0x0400 -#define PR_ALLOW_MOUNT_TMPFS 0x0800 -#define PR_ALLOW_MOUNT_FDESCFS 0x1000 -#define PR_ALLOW_MOUNT_LINPROCFS 0x2000 -#define PR_ALLOW_MOUNT_LINSYSFS 0x4000 -#define PR_ALLOW_RESERVED_PORTS 0x8000 -#define PR_ALLOW_ALL 0xffff +#define PR_ALLOW_SET_HOSTNAME 0x00000001 +#define PR_ALLOW_SYSVIPC 0x00000002 +#define PR_ALLOW_RAW_SOCKETS 0x00000004 +#define PR_ALLOW_CHFLAGS 0x00000008 +#define PR_ALLOW_MOUNT 0x00000010 +#define PR_ALLOW_QUOTAS 0x00000020 +#define PR_ALLOW_SOCKET_AF 0x00000040 +#define PR_ALLOW_MOUNT_DEVFS 0x00000080 +#define PR_ALLOW_MOUNT_NULLFS 0x00000100 +#define PR_ALLOW_MOUNT_ZFS 0x00000200 +#define PR_ALLOW_MOUNT_PROCFS 0x00000400 +#define PR_ALLOW_MOUNT_TMPFS 0x00000800 +#define PR_ALLOW_MOUNT_FDESCFS 0x00001000 +#define PR_ALLOW_MOUNT_LINPROCFS 0x00002000 +#define PR_ALLOW_MOUNT_LINSYSFS 0x00004000 +#define PR_ALLOW_RESERVED_PORTS 0x00008000 +#define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved, not used yet */ +#define PR_ALLOW_ALL 0x0001ffff /* * OSD methods From owner-svn-src-all@freebsd.org Sun Jul 9 06:50:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F5FDAC465; Sun, 9 Jul 2017 06:50:16 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44CC379FF2; Sun, 9 Jul 2017 06:50:16 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v696oFYx040444; Sun, 9 Jul 2017 06:50:15 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v696oFW5040443; Sun, 9 Jul 2017 06:50:15 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201707090650.v696oFW5040443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sun, 9 Jul 2017 06:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320827 - head/sys/dev/drm X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/sys/dev/drm X-SVN-Commit-Revision: 320827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 06:50:16 -0000 Author: netchild Date: Sun Jul 9 06:50:15 2017 New Revision: 320827 URL: https://svnweb.freebsd.org/changeset/base/320827 Log: Switch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem). Access to the dri device gives effectively access to the entire memory of the machine (you can program the graphic card to do DMA). For current/stable/release this is a NOP, as access to memory is not allowed in a jail. This puts the dri device into the same (in)security class than /dev/mem for future use. Discussed with: anholt(?) several years ago Sponsored by: Hackathon Essen 2017 Modified: head/sys/dev/drm/drmP.h Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Sun Jul 9 06:40:16 2017 (r320826) +++ head/sys/dev/drm/drmP.h Sun Jul 9 06:50:15 2017 (r320827) @@ -220,7 +220,7 @@ enum { #define PAGE_ALIGN(addr) round_page(addr) /* DRM_SUSER returns true if the user is superuser */ -#define DRM_SUSER(p) (priv_check(p, PRIV_DRIVER) == 0) +#define DRM_SUSER(p) (priv_check(p, PRIV_KMEM_WRITE) == 0) #define DRM_AGP_FIND_DEVICE() agp_find_device() #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks From owner-svn-src-all@freebsd.org Sun Jul 9 12:13:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68683DB1115; Sun, 9 Jul 2017 12:13:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4287C824B4; Sun, 9 Jul 2017 12:13:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69CDbBl078029; Sun, 9 Jul 2017 12:13:37 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69CDbOm078028; Sun, 9 Jul 2017 12:13:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201707091213.v69CDbOm078028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 9 Jul 2017 12:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320829 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 320829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 12:13:38 -0000 Author: bde Date: Sun Jul 9 12:13:37 2017 New Revision: 320829 URL: https://svnweb.freebsd.org/changeset/base/320829 Log: Move open coding of construction of attributes for cut regions and text cursors to functions so that it is easier to fix and improve. This commit doesn't fix anything except for removing unnecessary complications and adding comments. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Sun Jul 9 10:34:31 2017 (r320828) +++ head/sys/dev/syscons/scvgarndr.c Sun Jul 9 12:13:37 2017 (r320829) @@ -344,6 +344,46 @@ static int vga_aspect_scale= 100; SYSCTL_INT(_machdep, OID_AUTO, vga_aspect_scale, CTLFLAG_RW, &vga_aspect_scale, 0, "Aspect scale ratio (3:4):actual times 100"); +static u_short +vga_flipattr(u_short a, int blink) +{ + if (blink) + a = (a & 0x8800) | ((a & 0x7000) >> 4) | + ((a & 0x0700) << 4); + else + a = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4); + return (a); +} + +static u_short +vga_cursorattr_adj(u_short a, int blink) +{ + /* + * !blink means pixel mode, and the cursor attribute in that case + * is simplistic reverse video. + */ + if (!blink) + return (vga_flipattr(a, blink)); + + /* + * The cursor attribute is usually that of the underlying char + * with the bg changed to white. If the bg is already white, + * then the bg is changed to black. The fg is usually not + * changed, but if it is the same as the new bg then it is + * changed to the inverse of the new bg. + */ + if ((a & 0x7000) == 0x7000) { + a &= 0x8f00; + if ((a & 0x0700) == 0) + a |= 0x0700; + } else { + a |= 0x7000; + if ((a & 0x0700) == 0x0700) + a &= 0xf000; + } + return (a); +} + static void vga_setmdp(scr_stat *scp) { @@ -436,8 +476,7 @@ vga_txtdraw(scr_stat *scp, int from, int count, int fl for (p = sc_vtb_pointer(&scp->scr, from); count-- > 0; ++from) { c = sc_vtb_getc(&scp->vtb, from); a = sc_vtb_geta(&scp->vtb, from); - a = (a & 0x8800) | ((a & 0x7000) >> 4) - | ((a & 0x0700) << 4); + a = vga_flipattr(a, TRUE); p = sc_vtb_putchar(&scp->scr, p, c, a); } } else { @@ -482,8 +521,7 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u if (scp->curs_attr.base >= h) return; if (flip) - a = (a & 0x8800) - | ((a & 0x7000) >> 4) | ((a & 0x0700) << 4); + a = vga_flipattr(a, TRUE); bcopy(font + c*h, font + sc->cursor_char*h, h); font = font + sc->cursor_char*h; for (i = imax(h - scp->curs_attr.base - scp->curs_attr.height, 0); @@ -496,18 +534,9 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u } else #endif /* SC_NO_FONT_LOADING */ { - if ((a & 0x7000) == 0x7000) { - a &= 0x8f00; - if ((a & 0x0700) == 0) - a |= 0x0700; - } else { - a |= 0x7000; - if ((a & 0x0700) == 0x0700) - a &= 0xf000; - } + a = vga_cursorattr_adj(a, TRUE); if (flip) - a = (a & 0x8800) - | ((a & 0x7000) >> 4) | ((a & 0x0700) << 4); + a = vga_flipattr(a, TRUE); sc_vtb_putc(&scp->scr, at, c, a); } } @@ -544,9 +573,7 @@ vga_txtcursor(scr_stat *scp, int at, int blink, int on } else { cursor_attr = sc_vtb_geta(&scp->vtb, at); if (flip) - cursor_attr = (cursor_attr & 0x8800) - | ((cursor_attr & 0x7000) >> 4) - | ((cursor_attr & 0x0700) << 4); + cursor_attr = vga_flipattr(cursor_attr, TRUE); if (scp->status & VR_CURSOR_ON) sc_vtb_putc(&scp->scr, at, sc_vtb_getc(&scp->vtb, at), @@ -875,13 +902,10 @@ vga_vgadraw_direct(scr_stat *scp, int from, int count, for (i = from; count-- > 0; ++i) { a = sc_vtb_geta(&scp->vtb, i); - if (flip) { - col1 = (((a & 0x7000) >> 4) | (a & 0x0800)) >> 8; - col2 = (((a & 0x8000) >> 4) | (a & 0x0700)) >> 8; - } else { - col1 = (a & 0x0f00) >> 8; - col2 = (a & 0xf000) >> 12; - } + if (flip) + a = vga_flipattr(a, TRUE); /* XXX */ + col1 = (a & 0x0f00) >> 8; + col2 = (a & 0xf000) >> 12; e = d; f = &(scp->font[sc_vtb_getc(&scp->vtb, i) * scp->font_size]); @@ -932,13 +956,10 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count, count = scp->xsize*scp->ysize - from; for (i = from; count-- > 0; ++i) { a = sc_vtb_geta(&scp->vtb, i); - if (flip) { - col1 = ((a & 0x7000) >> 4) | (a & 0x0800); - col2 = ((a & 0x8000) >> 4) | (a & 0x0700); - } else { - col1 = (a & 0x0f00); - col2 = (a & 0xf000) >> 4; - } + if (flip) + a = vga_flipattr(a, TRUE); /* XXX */ + col1 = a & 0x0f00; + col2 = (a & 0xf000) >> 4; /* set background color in EGA/VGA latch */ if (bg != col2) { bg = col2; @@ -1002,13 +1023,12 @@ draw_pxlcursor_direct(scr_stat *scp, int at, int on, i a = sc_vtb_geta(&scp->vtb, at); - if (flip) { - col1 = ((on) ? (a & 0x0f00) : ((a & 0xf000) >> 4)) >> 8; - col2 = ((on) ? ((a & 0xf000) >> 4) : (a & 0x0f00)) >> 8; - } else { - col1 = ((on) ? ((a & 0xf000) >> 4) : (a & 0x0f00)) >> 8; - col2 = ((on) ? (a & 0x0f00) : ((a & 0xf000) >> 4)) >> 8; - } + if (flip) + a = vga_flipattr(a, FALSE); + if (on) + a = vga_cursorattr_adj(a, FALSE); + col1 = (a & 0x0f00) >> 8; + col2 = a >> 12; f = &(scp->font[sc_vtb_getc(&scp->vtb, at) * scp->font_size + scp->font_size - scp->curs_attr.base - 1]); @@ -1048,18 +1068,16 @@ draw_pxlcursor_planar(scr_stat *scp, int at, int on, i /* set background color in EGA/VGA latch */ a = sc_vtb_geta(&scp->vtb, at); if (flip) - col = (on) ? ((a & 0xf000) >> 4) : (a & 0x0f00); - else - col = (on) ? (a & 0x0f00) : ((a & 0xf000) >> 4); + a = vga_flipattr(a, FALSE); + if (on) + a = vga_cursorattr_adj(a, FALSE); + col = (a & 0xf000) >> 4; outw(GDCIDX, col | 0x00); /* set/reset */ outw(GDCIDX, 0xff08); /* bit mask */ writeb(d, 0); c = readb(d); /* set bg color in the latch */ /* foreground color */ - if (flip) - col = (on) ? (a & 0x0f00) : ((a & 0xf000) >> 4); - else - col = (on) ? ((a & 0xf000) >> 4) : (a & 0x0f00); + col = a & 0x0f00; outw(GDCIDX, col | 0x00); /* set/reset */ f = &(scp->font[sc_vtb_getc(&scp->vtb, at)*scp->font_size + scp->font_size - scp->curs_attr.base - 1]); From owner-svn-src-all@freebsd.org Sun Jul 9 12:35:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E90DB17B4; Sun, 9 Jul 2017 12:35:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 984F682D5C; Sun, 9 Jul 2017 12:35:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69CZJes086121; Sun, 9 Jul 2017 12:35:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69CZJBf086120; Sun, 9 Jul 2017 12:35:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091235.v69CZJBf086120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 12:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320830 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 320830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 12:35:20 -0000 Author: manu Date: Sun Jul 9 12:35:19 2017 New Revision: 320830 URL: https://svnweb.freebsd.org/changeset/base/320830 Log: if_awg: Add "allwinner,sun50i-a64-emac" compatible string. This enable ethernet on Pine64 with latest DTS. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Sun Jul 9 12:13:37 2017 (r320829) +++ head/sys/arm/allwinner/if_awg.c Sun Jul 9 12:35:19 2017 (r320830) @@ -146,11 +146,13 @@ TUNABLE_INT("hw.awg.rx_batch", &awg_rx_batch); enum awg_type { EMAC_A83T = 1, EMAC_H3, + EMAC_A64, }; static struct ofw_compat_data compat_data[] = { { "allwinner,sun8i-a83t-emac", EMAC_A83T }, { "allwinner,sun8i-h3-emac", EMAC_H3 }, + { "allwinner,sun50i-a64-emac", EMAC_A64 }, { NULL, 0 } }; From owner-svn-src-all@freebsd.org Sun Jul 9 12:53:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C200FDB1C52; Sun, 9 Jul 2017 12:53:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85854836D9; Sun, 9 Jul 2017 12:53:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69Cr2Vb094362; Sun, 9 Jul 2017 12:53:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69Cr25T094360; Sun, 9 Jul 2017 12:53:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091253.v69Cr25T094360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 12:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320831 - in head/sys: arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf X-SVN-Commit-Revision: 320831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 12:53:03 -0000 Author: manu Date: Sun Jul 9 12:53:02 2017 New Revision: 320831 URL: https://svnweb.freebsd.org/changeset/base/320831 Log: arm64: Add Allwinner I2C controller to GENERIC kernel Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Jul 9 12:35:19 2017 (r320830) +++ head/sys/arm64/conf/GENERIC Sun Jul 9 12:53:02 2017 (r320831) @@ -176,6 +176,7 @@ device aw_rsb # Allwinner Reduced Serial Bus device bcm2835_bsc # Broadcom BCM283x I2C bus device iicbus device iic +device twsi # Allwinner I2C controller # Clock and reset controllers device aw_ccu # Allwinner clock controller Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Jul 9 12:35:19 2017 (r320830) +++ head/sys/conf/files.arm64 Sun Jul 9 12:53:02 2017 (r320831) @@ -158,6 +158,8 @@ dev/axgbe/xgbe-dev.c optional axgbe dev/axgbe/xgbe-drv.c optional axgbe dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/iicbus/twsi/a10_twsi.c optional twsi fdt +dev/iicbus/twsi/twsi.c optional twsi fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 From owner-svn-src-all@freebsd.org Sun Jul 9 13:12:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2388EDB1F70; Sun, 9 Jul 2017 13:12:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 791AE83E0E; Sun, 9 Jul 2017 13:12:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69DCqtj002939; Sun, 9 Jul 2017 13:12:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69DCnec002902; Sun, 9 Jul 2017 13:12:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091312.v69DCnec002902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 13:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320832 - in vendor/device-tree/dist: . Bindings Bindings/arm Bindings/arm/firmware Bindings/arm/hisilicon Bindings/arm/mediatek Bindings/arm/tegra Bindings/ata Bindings/auxdisplay Bind... X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in vendor/device-tree/dist: . Bindings Bindings/arm Bindings/arm/firmware Bindings/arm/hisilicon Bindings/arm/mediatek Bindings/arm/tegra Bindings/ata Bindings/auxdisplay Bindings/clock Bindings/crypt... X-SVN-Commit-Revision: 320832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 13:12:54 -0000 Author: manu Date: Sun Jul 9 13:12:48 2017 New Revision: 320832 URL: https://svnweb.freebsd.org/changeset/base/320832 Log: Update the DTS file from Linux 4.12 Added: vendor/device-tree/dist/Bindings/arm/cavium-thunder2.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/firmware/linaro,optee-tz.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/gemini.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/i2se.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra186-pmc.txt (contents, props changed) vendor/device-tree/dist/Bindings/ata/ahci-dm816.txt (contents, props changed) vendor/device-tree/dist/Bindings/auxdisplay/hit,hd44780.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/rockchip,rv1108-cru.txt (contents, props changed) vendor/device-tree/dist/Bindings/crypto/st,stm32-crc.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/amlogic,meson-dw-hdmi.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/lvds-transmitter.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/ampire,am-480272h3tmqw-t01h.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/mitsubishi,aa104xd12.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/mitsubishi,aa121td01.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/panel-common.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/panel-lvds.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/samsung,s6e3ha2.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/sitronix,st7789v.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/winstar,wf35ltiacd.txt (contents, props changed) vendor/device-tree/dist/Bindings/firmware/coreboot.txt (contents, props changed) vendor/device-tree/dist/Bindings/fpga/altera-pr-ip.txt (contents, props changed) vendor/device-tree/dist/Bindings/fpga/lattice-ice40-fpga-mgr.txt (contents, props changed) vendor/device-tree/dist/Bindings/fpga/xilinx-slave-serial.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/faraday,ftgpio010.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/gpio-thunderx.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/gpio-xra1403.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/ni,169445-nand-gpio.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/ads7828.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/aspeed-pwm-tacho.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/lm87.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-mux-ltc4306.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/accel/adxl345.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/aspeed_adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/cpcap-adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/ltc2497.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/max1118.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/max9611.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/ltc2632.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/st,stm32-dac.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/health/max30102.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/light/vl6180.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/proximity/devantech-srf04.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/cpcap-pwrbutton.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/ads7846.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/ar1021.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/max11801-ts.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/arm,nvic.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/faraday,ftintc010.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/mediatek,cirq.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/backlight/arcxcnn_bl.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-cpcap.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-mt6323.txt (contents, props changed) vendor/device-tree/dist/Bindings/mailbox/brcm,iproc-flexrm-mbox.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/ov5645.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/ov5647.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/ov7670.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/mediatek-jpeg-decoder.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/mxs-lradc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/sun4i-gpadc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/ti-lmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/wm831x.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/brcm,bcm2835-sdhost.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/cavium-mmc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/marvell,xenon-sdhci.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/samsung,s3cmci.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/stm32-quadspi.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/can/holt_hi311x.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/can/ti_hecc.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/dsa/lan9303.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/dsa/mt7530.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/faraday,ftmac.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/ftgmac100.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/ieee802154/ca8210.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/mdio.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/nokia-bluetooth.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/ti,wilink-st.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/imx-iim.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/faraday,ftpci100.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/qcom-qmp-phy.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/qcom-qusb2-phy.txt (contents, props changed) vendor/device-tree/dist/Bindings/pinctrl/axis,artpec6-pinctrl.txt (contents, props changed) vendor/device-tree/dist/Bindings/pinctrl/marvell,armada-37xx-pinctrl.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/fsl,imx-gpcv2.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/reset/gemini-poweroff.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/supply/axp20x_battery.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/supply/cpcap-charger.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/supply/lego_ev3_battery.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/supply/max8925_battery.txt (contents, props changed) vendor/device-tree/dist/Bindings/powerpc/ibm,powerpc-cpu-features.txt (contents, props changed) vendor/device-tree/dist/Bindings/pwm/pwm-mediatek.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/tps65132-regulator.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/vctrl.txt (contents, props changed) vendor/device-tree/dist/Bindings/reset/fsl,imx7-src.txt (contents, props changed) vendor/device-tree/dist/Bindings/rng/mtk-rng.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/cpcap-rtc.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/rtc-sh.txt (contents, props changed) vendor/device-tree/dist/Bindings/soc/ti/sci-pm-domain.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/cs35l35.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/dioo,dio2125.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/everest,es7134.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/hisilicon,hi6210-i2s.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/max9892x.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt2701-wm8960.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/nau8824.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/samsung,odroid.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/st,stm32-sai.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/zte,tdm.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-bcm63xx-hsspi.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-bcm63xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/thermal/brcm,ns-thermal vendor/device-tree/dist/Bindings/thermal/da9062-thermal.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/faraday,fttmr010.txt (contents, props changed) vendor/device-tree/dist/Bindings/trivial-devices.txt (contents, props changed) vendor/device-tree/dist/Bindings/watchdog/cortina,gemini-watchdog.txt (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/mt6797-clk.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/rv1108-cru.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/sun8i-r-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/genpd/ vendor/device-tree/dist/include/dt-bindings/genpd/k2g.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/mfd/stm32f7-rcc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/imx7-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/altr,rst-mgr-a10sr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/imx7-reset.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/sun8i-r-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/tegra210-car.h (contents, props changed) vendor/device-tree/dist/src/arm/am335x-baltos-leds.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/armada-385-linksys-shelby.dts (contents, props changed) vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm4708-linksys-ea6300-v1.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47081-tplink-archer-c5-v2.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm4709-linksys-ea9200.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-linksys-panamera.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm953012hr.dts (contents, props changed) vendor/device-tree/dist/src/arm/exynos5420-tmu-sensor-conf.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/gemini-nas4220b.dts (contents, props changed) vendor/device-tree/dist/src/arm/gemini-rut1xx.dts (contents, props changed) vendor/device-tree/dist/src/arm/gemini-sq201.dts (contents, props changed) vendor/device-tree/dist/src/arm/gemini-wbd111.dts (contents, props changed) vendor/device-tree/dist/src/arm/gemini-wbd222.dts (contents, props changed) vendor/device-tree/dist/src/arm/gemini.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx28-duckbill-2-485.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx28-duckbill-2-enocean.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx28-duckbill-2-spi.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx28-duckbill-2.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-gw5903.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-gw5904.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-gw5903.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-gw5904.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-icore-ofcap10.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-icore-ofcap12.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-zii-rdu2.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-gw5903.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-gw5904.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-zii-rdu2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-nitrogen6_som2.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-zii-rdu2.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6ul-isiot-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx7d-sdb-sht11.dts (contents, props changed) vendor/device-tree/dist/src/arm/motorola-cpcap-mapphone.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/omap3-cpu-thermal.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/rk3288-phycore-rdk.dts (contents, props changed) vendor/device-tree/dist/src/arm/rk3288-phycore-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/rk3288-tinker.dts (contents, props changed) vendor/device-tree/dist/src/arm/stm32h743-pinctrl.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32h743.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32h743i-eval.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-neo-air.dts (contents, props changed) vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-orangepi-pc2.dts (contents, props changed) vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-mali.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/cavium/thunder2-99xx.dts (contents, props changed) vendor/device-tree/dist/src/arm64/cavium/thunder2-99xx.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls1088a-qds.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls1088a-rdb.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls1088a.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls2088a-qds.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls2088a-rdb.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls2088a.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa-qds.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa-rdb.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200-poplar.dts (contents, props changed) vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/hisilicon/hikey960-pinctrl.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3328-evb.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3328.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru-kevin.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-opp.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/sprd/sc9860.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/sprd/sp9860g-1h10.dts (contents, props changed) vendor/device-tree/dist/src/arm64/sprd/whale2.dtsi (contents, props changed) Deleted: vendor/device-tree/dist/Bindings/clock/rockchip,rk1108-cru.txt vendor/device-tree/dist/Bindings/gpio/cortina,gemini-gpio.txt vendor/device-tree/dist/Bindings/gpio/moxa,moxart-gpio.txt vendor/device-tree/dist/Bindings/i2c/trivial-devices.txt vendor/device-tree/dist/Bindings/iio/adc/mxs-lradc.txt vendor/device-tree/dist/Bindings/input/ads7846.txt vendor/device-tree/dist/Bindings/input/touchscreen/sun4i.txt vendor/device-tree/dist/Bindings/interrupt-controller/cortina,gemini-interrupt-controller.txt vendor/device-tree/dist/Bindings/net/moxa,moxart-mac.txt vendor/device-tree/dist/Bindings/power/supply/max8925_batter.txt vendor/device-tree/dist/Bindings/sound/max98925.txt vendor/device-tree/dist/Bindings/sound/max98926.txt vendor/device-tree/dist/Bindings/staging/ion/hi6220-ion.txt vendor/device-tree/dist/Bindings/timer/cortina,gemini-timer.txt vendor/device-tree/dist/include/dt-bindings/clock/rk1108-cru.h vendor/device-tree/dist/src/arm64/broadcom/vulcan-eval.dts vendor/device-tree/dist/src/arm64/broadcom/vulcan.dtsi Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt vendor/device-tree/dist/Bindings/arm/atmel-at91.txt vendor/device-tree/dist/Bindings/arm/cpus.txt vendor/device-tree/dist/Bindings/arm/fsl.txt vendor/device-tree/dist/Bindings/arm/hisilicon/hisilicon.txt vendor/device-tree/dist/Bindings/arm/l2c2x0.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt vendor/device-tree/dist/Bindings/arm/rockchip.txt vendor/device-tree/dist/Bindings/arm/shmobile.txt vendor/device-tree/dist/Bindings/arm/sprd.txt vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-flowctrl.txt vendor/device-tree/dist/Bindings/chosen.txt vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt vendor/device-tree/dist/Bindings/clock/armada3700-xtal-clock.txt vendor/device-tree/dist/Bindings/clock/idt,versaclock5.txt vendor/device-tree/dist/Bindings/clock/mvebu-core-clock.txt vendor/device-tree/dist/Bindings/clock/mvebu-gated-clock.txt vendor/device-tree/dist/Bindings/clock/qoriq-clock.txt vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt vendor/device-tree/dist/Bindings/devfreq/exynos-bus.txt vendor/device-tree/dist/Bindings/display/atmel/hlcdc-dc.txt vendor/device-tree/dist/Bindings/display/brcm,bcm-vc4.txt vendor/device-tree/dist/Bindings/display/imx/fsl,imx-fb.txt vendor/device-tree/dist/Bindings/display/imx/fsl-imx-drm.txt vendor/device-tree/dist/Bindings/display/mediatek/mediatek,disp.txt vendor/device-tree/dist/Bindings/display/mediatek/mediatek,dsi.txt vendor/device-tree/dist/Bindings/display/panel/panel-dpi.txt vendor/device-tree/dist/Bindings/display/renesas,du.txt vendor/device-tree/dist/Bindings/display/rockchip/dw_mipi_dsi_rockchip.txt vendor/device-tree/dist/Bindings/display/sunxi/sun4i-drm.txt vendor/device-tree/dist/Bindings/display/tegra/nvidia,tegra20-host1x.txt vendor/device-tree/dist/Bindings/fpga/fpga-region.txt vendor/device-tree/dist/Bindings/gpio/gpio-aspeed.txt vendor/device-tree/dist/Bindings/gpio/gpio-mvebu.txt vendor/device-tree/dist/Bindings/gpio/gpio-pca953x.txt vendor/device-tree/dist/Bindings/gpio/gpio-pcf857x.txt vendor/device-tree/dist/Bindings/gpu/arm,mali-utgard.txt vendor/device-tree/dist/Bindings/gpu/nvidia,gk20a.txt vendor/device-tree/dist/Bindings/i2c/i2c-meson.txt vendor/device-tree/dist/Bindings/i2c/i2c-rk3x.txt vendor/device-tree/dist/Bindings/iio/adc/amlogic,meson-saradc.txt vendor/device-tree/dist/Bindings/iio/adc/qcom,pm8xxx-xoadc.txt vendor/device-tree/dist/Bindings/iio/adc/rockchip-saradc.txt vendor/device-tree/dist/Bindings/iio/adc/st,stm32-adc.txt vendor/device-tree/dist/Bindings/iio/imu/inv_mpu6050.txt vendor/device-tree/dist/Bindings/iio/imu/st_lsm6dsx.txt vendor/device-tree/dist/Bindings/input/gpio-matrix-keypad.txt vendor/device-tree/dist/Bindings/input/hid-over-i2c.txt vendor/device-tree/dist/Bindings/input/pwm-beeper.txt vendor/device-tree/dist/Bindings/input/qcom,pm8xxx-vib.txt vendor/device-tree/dist/Bindings/input/rotary-encoder.txt vendor/device-tree/dist/Bindings/input/touchscreen/ad7879.txt vendor/device-tree/dist/Bindings/input/touchscreen/edt-ft5x06.txt vendor/device-tree/dist/Bindings/input/touchscreen/silead_gsl1680.txt vendor/device-tree/dist/Bindings/interrupt-controller/mediatek,sysirq.txt vendor/device-tree/dist/Bindings/iommu/arm,smmu.txt vendor/device-tree/dist/Bindings/ipmi/aspeed,ast2400-ibt-bmc.txt vendor/device-tree/dist/Bindings/leds/leds-pca9532.txt vendor/device-tree/dist/Bindings/mailbox/brcm,iproc-pdc-mbox.txt vendor/device-tree/dist/Bindings/media/atmel-isi.txt vendor/device-tree/dist/Bindings/media/i2c/ov2640.txt vendor/device-tree/dist/Bindings/media/s5p-cec.txt vendor/device-tree/dist/Bindings/media/s5p-mfc.txt vendor/device-tree/dist/Bindings/media/stih-cec.txt vendor/device-tree/dist/Bindings/media/ti,da850-vpif.txt vendor/device-tree/dist/Bindings/mfd/altera-a10sr.txt vendor/device-tree/dist/Bindings/mfd/atmel-hlcdc.txt vendor/device-tree/dist/Bindings/mfd/axp20x.txt vendor/device-tree/dist/Bindings/mfd/da9062.txt vendor/device-tree/dist/Bindings/mfd/hisilicon,hi655x.txt vendor/device-tree/dist/Bindings/mfd/mt6397.txt vendor/device-tree/dist/Bindings/mfd/samsung,exynos5433-lpass.txt vendor/device-tree/dist/Bindings/mfd/stm32-timers.txt vendor/device-tree/dist/Bindings/mmc/mmc-pwrseq-simple.txt vendor/device-tree/dist/Bindings/mmc/mtk-sd.txt vendor/device-tree/dist/Bindings/mmc/nvidia,tegra20-sdhci.txt vendor/device-tree/dist/Bindings/mmc/renesas,mmcif.txt vendor/device-tree/dist/Bindings/mmc/sdhci-cadence.txt vendor/device-tree/dist/Bindings/mtd/atmel-nand.txt vendor/device-tree/dist/Bindings/mtd/denali-nand.txt vendor/device-tree/dist/Bindings/mtd/gpio-control-nand.txt vendor/device-tree/dist/Bindings/mtd/jedec,spi-nor.txt vendor/device-tree/dist/Bindings/net/brcm,bcmgenet.txt vendor/device-tree/dist/Bindings/net/brcm,unimac-mdio.txt vendor/device-tree/dist/Bindings/net/dsa/b53.txt vendor/device-tree/dist/Bindings/net/dsa/marvell.txt vendor/device-tree/dist/Bindings/net/fsl-fec.txt vendor/device-tree/dist/Bindings/net/marvell,prestera.txt vendor/device-tree/dist/Bindings/net/marvell-orion-mdio.txt vendor/device-tree/dist/Bindings/net/marvell-pp2.txt vendor/device-tree/dist/Bindings/net/nfc/trf7970a.txt vendor/device-tree/dist/Bindings/net/smsc911x.txt vendor/device-tree/dist/Bindings/net/stmmac.txt vendor/device-tree/dist/Bindings/nvmem/allwinner,sunxi-sid.txt vendor/device-tree/dist/Bindings/nvmem/imx-ocotp.txt vendor/device-tree/dist/Bindings/pci/designware-pcie.txt vendor/device-tree/dist/Bindings/pci/fsl,imx6q-pcie.txt vendor/device-tree/dist/Bindings/pci/ti-pci.txt vendor/device-tree/dist/Bindings/phy/phy-mt65xx-usb.txt vendor/device-tree/dist/Bindings/phy/phy-rockchip-inno-usb2.txt vendor/device-tree/dist/Bindings/phy/rockchip-usb-phy.txt vendor/device-tree/dist/Bindings/phy/sun4i-usb-phy.txt vendor/device-tree/dist/Bindings/pinctrl/allwinner,sunxi-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/atmel,at91-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-aspeed.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-bindings.txt vendor/device-tree/dist/Bindings/pinctrl/rockchip,pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/st,stm32-pinctrl.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpc.txt vendor/device-tree/dist/Bindings/power/power_domain.txt vendor/device-tree/dist/Bindings/power/reset/syscon-poweroff.txt vendor/device-tree/dist/Bindings/power/rockchip-io-domain.txt vendor/device-tree/dist/Bindings/power/supply/ltc2941.txt vendor/device-tree/dist/Bindings/pwm/atmel-pwm.txt vendor/device-tree/dist/Bindings/pwm/nvidia,tegra20-pwm.txt vendor/device-tree/dist/Bindings/regulator/anatop-regulator.txt vendor/device-tree/dist/Bindings/regulator/lm363x-regulator.txt vendor/device-tree/dist/Bindings/regulator/pfuze100.txt vendor/device-tree/dist/Bindings/regulator/regulator.txt vendor/device-tree/dist/Bindings/rng/amlogic,meson-rng.txt vendor/device-tree/dist/Bindings/serial/sprd-uart.txt vendor/device-tree/dist/Bindings/soc/fsl/cpm_qe/gpio.txt vendor/device-tree/dist/Bindings/soc/rockchip/grf.txt vendor/device-tree/dist/Bindings/sound/fsl,ssi.txt vendor/device-tree/dist/Bindings/sound/rockchip-i2s.txt vendor/device-tree/dist/Bindings/sound/sgtl5000.txt vendor/device-tree/dist/Bindings/sound/tas2552.txt vendor/device-tree/dist/Bindings/sound/wm8903.txt vendor/device-tree/dist/Bindings/spi/fsl-imx-cspi.txt vendor/device-tree/dist/Bindings/spi/spi_pl022.txt vendor/device-tree/dist/Bindings/thermal/brcm,bcm2835-thermal.txt vendor/device-tree/dist/Bindings/timer/rockchip,rk-timer.txt vendor/device-tree/dist/Bindings/usb/da8xx-usb.txt vendor/device-tree/dist/Bindings/usb/dwc2.txt vendor/device-tree/dist/Bindings/usb/ehci-orion.txt vendor/device-tree/dist/Bindings/usb/generic.txt vendor/device-tree/dist/Bindings/vendor-prefixes.txt vendor/device-tree/dist/Makefile vendor/device-tree/dist/include/dt-bindings/clock/gxbb-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/hi6220-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r7s72100-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a73a4-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7790-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7791-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7792-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7793-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7794-clock.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7795-cpg-mssr.h vendor/device-tree/dist/include/dt-bindings/clock/rk3328-cru.h vendor/device-tree/dist/include/dt-bindings/clock/rk3368-cru.h vendor/device-tree/dist/include/dt-bindings/clock/sun50i-a64-ccu.h vendor/device-tree/dist/include/dt-bindings/clock/sun8i-h3-ccu.h vendor/device-tree/dist/include/dt-bindings/clock/tegra114-car.h vendor/device-tree/dist/include/dt-bindings/clock/tegra124-car-common.h vendor/device-tree/dist/include/dt-bindings/clock/tegra210-car.h vendor/device-tree/dist/include/dt-bindings/clock/tegra30-car.h vendor/device-tree/dist/include/dt-bindings/gpio/gpio.h vendor/device-tree/dist/include/dt-bindings/input/linux-event-codes.h vendor/device-tree/dist/include/dt-bindings/pinctrl/hisi.h vendor/device-tree/dist/include/dt-bindings/pinctrl/mt7623-pinfunc.h vendor/device-tree/dist/include/dt-bindings/power/r8a7795-sysc.h vendor/device-tree/dist/include/dt-bindings/reset/mt2701-resets.h vendor/device-tree/dist/include/dt-bindings/reset/sun8i-h3-ccu.h vendor/device-tree/dist/src/arc/axs10x_mb.dtsi vendor/device-tree/dist/src/arm/alpine.dtsi vendor/device-tree/dist/src/arm/am335x-baltos-ir2110.dts vendor/device-tree/dist/src/arm/am335x-baltos-ir3220.dts vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts vendor/device-tree/dist/src/arm/am335x-boneblack.dts vendor/device-tree/dist/src/arm/am335x-icev2.dts vendor/device-tree/dist/src/arm/am335x-sl50.dts vendor/device-tree/dist/src/arm/am33xx.dtsi vendor/device-tree/dist/src/arm/am3517.dtsi vendor/device-tree/dist/src/arm/am4372.dtsi vendor/device-tree/dist/src/arm/am437x-gp-evm.dts vendor/device-tree/dist/src/arm/am57xx-idk-common.dtsi vendor/device-tree/dist/src/arm/armada-385-linksys.dtsi vendor/device-tree/dist/src/arm/armada-385.dtsi vendor/device-tree/dist/src/arm/armada-388-clearfog.dts vendor/device-tree/dist/src/arm/armada-388.dtsi vendor/device-tree/dist/src/arm/armada-38x.dtsi vendor/device-tree/dist/src/arm/armada-xp-98dx3236.dtsi vendor/device-tree/dist/src/arm/armada-xp-98dx3336.dtsi vendor/device-tree/dist/src/arm/armada-xp-98dx4251.dtsi vendor/device-tree/dist/src/arm/armada-xp-db-dxbc2.dts vendor/device-tree/dist/src/arm/armada-xp-db-xc3-24g4xg.dts vendor/device-tree/dist/src/arm/armada-xp-linksys-mamba.dts vendor/device-tree/dist/src/arm/aspeed-ast2500-evb.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-palmetto.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-romulus.dts vendor/device-tree/dist/src/arm/aspeed-g4.dtsi vendor/device-tree/dist/src/arm/aspeed-g5.dtsi vendor/device-tree/dist/src/arm/at91-sama5d2_xplained.dts vendor/device-tree/dist/src/arm/at91-sama5d3_xplained.dts vendor/device-tree/dist/src/arm/at91-tse850-3.dts vendor/device-tree/dist/src/arm/at91sam9261.dtsi vendor/device-tree/dist/src/arm/at91sam9x5ek.dtsi vendor/device-tree/dist/src/arm/axp209.dtsi vendor/device-tree/dist/src/arm/axp22x.dtsi vendor/device-tree/dist/src/arm/bcm-cygnus.dtsi vendor/device-tree/dist/src/arm/bcm-nsp.dtsi vendor/device-tree/dist/src/arm/bcm2835-rpi.dtsi vendor/device-tree/dist/src/arm/bcm283x-rpi-smsc9512.dtsi vendor/device-tree/dist/src/arm/bcm283x-rpi-smsc9514.dtsi vendor/device-tree/dist/src/arm/bcm283x.dtsi vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac56u.dts vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac68u.dts vendor/device-tree/dist/src/arm/bcm4708-buffalo-wzr-1750dhp.dts vendor/device-tree/dist/src/arm/bcm4708-netgear-r6250.dts vendor/device-tree/dist/src/arm/bcm4708-netgear-r6300-v2.dts vendor/device-tree/dist/src/arm/bcm4708-smartrg-sr400ac.dts vendor/device-tree/dist/src/arm/bcm4708.dtsi vendor/device-tree/dist/src/arm/bcm47081-asus-rt-n18u.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-600dhp2.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-900dhp.dts vendor/device-tree/dist/src/arm/bcm47081.dtsi vendor/device-tree/dist/src/arm/bcm4709-asus-rt-ac87u.dts vendor/device-tree/dist/src/arm/bcm4709-buffalo-wxr-1900dhp.dts vendor/device-tree/dist/src/arm/bcm4709-netgear-r7000.dts vendor/device-tree/dist/src/arm/bcm4709-netgear-r8000.dts vendor/device-tree/dist/src/arm/bcm4709-tplink-archer-c9-v1.dts vendor/device-tree/dist/src/arm/bcm47094-dlink-dir-885l.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3100.dts vendor/device-tree/dist/src/arm/bcm47094-netgear-r8500.dts vendor/device-tree/dist/src/arm/bcm47189-tenda-ac9.dts vendor/device-tree/dist/src/arm/bcm5301x.dtsi vendor/device-tree/dist/src/arm/bcm53573.dtsi vendor/device-tree/dist/src/arm/bcm94708.dts vendor/device-tree/dist/src/arm/bcm94709.dts vendor/device-tree/dist/src/arm/bcm953012er.dts vendor/device-tree/dist/src/arm/bcm953012k.dts vendor/device-tree/dist/src/arm/bcm958522er.dts vendor/device-tree/dist/src/arm/bcm958525er.dts vendor/device-tree/dist/src/arm/bcm958525xmc.dts vendor/device-tree/dist/src/arm/bcm958622hr.dts vendor/device-tree/dist/src/arm/bcm958623hr.dts vendor/device-tree/dist/src/arm/bcm958625hr.dts vendor/device-tree/dist/src/arm/bcm958625k.dts vendor/device-tree/dist/src/arm/bcm988312hr.dts vendor/device-tree/dist/src/arm/da850-evm.dts vendor/device-tree/dist/src/arm/da850-lego-ev3.dts vendor/device-tree/dist/src/arm/da850.dtsi vendor/device-tree/dist/src/arm/dm8168-evm.dts vendor/device-tree/dist/src/arm/dm816x.dtsi vendor/device-tree/dist/src/arm/dra7-evm.dts vendor/device-tree/dist/src/arm/dra7.dtsi vendor/device-tree/dist/src/arm/dra74x.dtsi vendor/device-tree/dist/src/arm/exynos3250-rinato.dts vendor/device-tree/dist/src/arm/exynos3250.dtsi vendor/device-tree/dist/src/arm/exynos4.dtsi vendor/device-tree/dist/src/arm/exynos4210-origen.dts vendor/device-tree/dist/src/arm/exynos4210-trats.dts vendor/device-tree/dist/src/arm/exynos4210.dtsi vendor/device-tree/dist/src/arm/exynos4412-itop-scp-core.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroid-common.dtsi vendor/device-tree/dist/src/arm/exynos4412-origen.dts vendor/device-tree/dist/src/arm/exynos4412-prime.dtsi vendor/device-tree/dist/src/arm/exynos4412-trats2.dts vendor/device-tree/dist/src/arm/exynos4412.dtsi vendor/device-tree/dist/src/arm/exynos5420.dtsi vendor/device-tree/dist/src/arm/exynos5440.dtsi vendor/device-tree/dist/src/arm/exynos5800.dtsi vendor/device-tree/dist/src/arm/imx25-eukrea-mbimxsd25-baseboard.dts vendor/device-tree/dist/src/arm/imx25-pdk.dts vendor/device-tree/dist/src/arm/imx25-pinfunc.h vendor/device-tree/dist/src/arm/imx25.dtsi vendor/device-tree/dist/src/arm/imx28-duckbill.dts vendor/device-tree/dist/src/arm/imx28-m28cu3.dts vendor/device-tree/dist/src/arm/imx28.dtsi vendor/device-tree/dist/src/arm/imx50.dtsi vendor/device-tree/dist/src/arm/imx53-qsb.dts vendor/device-tree/dist/src/arm/imx53-qsrb.dts vendor/device-tree/dist/src/arm/imx6q-b450v3.dts vendor/device-tree/dist/src/arm/imx6q-b650v3.dts vendor/device-tree/dist/src/arm/imx6q-b850v3.dts vendor/device-tree/dist/src/arm/imx6q-bx50v3.dtsi vendor/device-tree/dist/src/arm/imx6q-cm-fx6.dts vendor/device-tree/dist/src/arm/imx6q-icore.dts vendor/device-tree/dist/src/arm/imx6q-utilite-pro.dts vendor/device-tree/dist/src/arm/imx6qdl-icore.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabresd.dtsi vendor/device-tree/dist/src/arm/imx6qdl.dtsi vendor/device-tree/dist/src/arm/imx6qp-sabresd.dts vendor/device-tree/dist/src/arm/imx6qp.dtsi vendor/device-tree/dist/src/arm/imx6sx-sdb.dts vendor/device-tree/dist/src/arm/imx6sx.dtsi vendor/device-tree/dist/src/arm/imx6ul-14x14-evk.dts vendor/device-tree/dist/src/arm/imx6ul-geam.dtsi vendor/device-tree/dist/src/arm/imx6ul-isiot-emmc.dts vendor/device-tree/dist/src/arm/imx6ul-isiot-nand.dts vendor/device-tree/dist/src/arm/imx6ul-isiot.dtsi vendor/device-tree/dist/src/arm/imx7-colibri-eval-v3.dtsi vendor/device-tree/dist/src/arm/imx7-colibri.dtsi vendor/device-tree/dist/src/arm/imx7d-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/imx7s.dtsi vendor/device-tree/dist/src/arm/keystone-k2l-netcp.dtsi vendor/device-tree/dist/src/arm/keystone-k2l.dtsi vendor/device-tree/dist/src/arm/logicpd-torpedo-37xx-devkit.dts vendor/device-tree/dist/src/arm/meson8.dtsi vendor/device-tree/dist/src/arm/meson8b.dtsi vendor/device-tree/dist/src/arm/moxart-uc7112lx.dts vendor/device-tree/dist/src/arm/moxart.dtsi vendor/device-tree/dist/src/arm/mt7623.dtsi vendor/device-tree/dist/src/arm/omap3-gta04.dtsi vendor/device-tree/dist/src/arm/omap3-igep.dtsi vendor/device-tree/dist/src/arm/omap3-n900.dts vendor/device-tree/dist/src/arm/omap3-n950-n9.dtsi vendor/device-tree/dist/src/arm/omap34xx.dtsi vendor/device-tree/dist/src/arm/omap36xx.dtsi vendor/device-tree/dist/src/arm/omap4-droid4-xt894.dts vendor/device-tree/dist/src/arm/omap4-panda-a4.dts vendor/device-tree/dist/src/arm/omap4-panda-es.dts vendor/device-tree/dist/src/arm/omap443x.dtsi vendor/device-tree/dist/src/arm/omap4460.dtsi vendor/device-tree/dist/src/arm/omap5.dtsi vendor/device-tree/dist/src/arm/qcom-apq8060-dragonboard.dts vendor/device-tree/dist/src/arm/qcom-msm8660.dtsi vendor/device-tree/dist/src/arm/qcom-msm8974-sony-xperia-honami.dts vendor/device-tree/dist/src/arm/qcom-msm8974.dtsi vendor/device-tree/dist/src/arm/r7s72100-genmai.dts vendor/device-tree/dist/src/arm/r7s72100-rskrza1.dts vendor/device-tree/dist/src/arm/r7s72100.dtsi vendor/device-tree/dist/src/arm/r8a73a4.dtsi vendor/device-tree/dist/src/arm/r8a7743.dtsi vendor/device-tree/dist/src/arm/r8a7745.dtsi vendor/device-tree/dist/src/arm/r8a7778-bockw.dts vendor/device-tree/dist/src/arm/r8a7779-marzen.dts vendor/device-tree/dist/src/arm/r8a7790-lager.dts vendor/device-tree/dist/src/arm/r8a7790.dtsi vendor/device-tree/dist/src/arm/r8a7791-koelsch.dts vendor/device-tree/dist/src/arm/r8a7791-porter.dts vendor/device-tree/dist/src/arm/r8a7791.dtsi vendor/device-tree/dist/src/arm/r8a7792.dtsi vendor/device-tree/dist/src/arm/r8a7793-gose.dts vendor/device-tree/dist/src/arm/r8a7793.dtsi vendor/device-tree/dist/src/arm/r8a7794-alt.dts vendor/device-tree/dist/src/arm/r8a7794-silk.dts vendor/device-tree/dist/src/arm/r8a7794.dtsi vendor/device-tree/dist/src/arm/rk1108.dtsi vendor/device-tree/dist/src/arm/rk3036.dtsi vendor/device-tree/dist/src/arm/rk3188.dtsi vendor/device-tree/dist/src/arm/rk322x.dtsi vendor/device-tree/dist/src/arm/rk3288-miqi.dts vendor/device-tree/dist/src/arm/rk3288-rock2-som.dtsi vendor/device-tree/dist/src/arm/rk3288-rock2-square.dts vendor/device-tree/dist/src/arm/rk3288.dtsi vendor/device-tree/dist/src/arm/rk3xxx.dtsi vendor/device-tree/dist/src/arm/s3c64xx.dtsi vendor/device-tree/dist/src/arm/s5pv210.dtsi vendor/device-tree/dist/src/arm/sama5d2.dtsi vendor/device-tree/dist/src/arm/socfpga.dtsi vendor/device-tree/dist/src/arm/socfpga_arria10.dtsi vendor/device-tree/dist/src/arm/socfpga_arria10_socdk.dtsi vendor/device-tree/dist/src/arm/socfpga_arria5_socdk.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_de0_sockit.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_mcv.dtsi vendor/device-tree/dist/src/arm/socfpga_cyclone5_mcvevk.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_socdk.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_sockit.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_socrates.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_sodia.dts vendor/device-tree/dist/src/arm/socfpga_cyclone5_vining_fpga.dts vendor/device-tree/dist/src/arm/socfpga_vt.dts vendor/device-tree/dist/src/arm/spear600-evb.dts vendor/device-tree/dist/src/arm/spear600.dtsi vendor/device-tree/dist/src/arm/ste-dbx5x0.dtsi vendor/device-tree/dist/src/arm/stih407-family.dtsi vendor/device-tree/dist/src/arm/stih410.dtsi vendor/device-tree/dist/src/arm/stm32429i-eval.dts vendor/device-tree/dist/src/arm/stm32746g-eval.dts vendor/device-tree/dist/src/arm/stm32f429-disco.dts vendor/device-tree/dist/src/arm/stm32f429.dtsi vendor/device-tree/dist/src/arm/stm32f469-disco.dts vendor/device-tree/dist/src/arm/stm32f746.dtsi vendor/device-tree/dist/src/arm/sun4i-a10-a1000.dts vendor/device-tree/dist/src/arm/sun4i-a10-cubieboard.dts vendor/device-tree/dist/src/arm/sun4i-a10-dserve-dsrv9703c.dts vendor/device-tree/dist/src/arm/sun4i-a10-hackberry.dts vendor/device-tree/dist/src/arm/sun4i-a10-inet1.dts vendor/device-tree/dist/src/arm/sun4i-a10-inet9f-rev03.dts vendor/device-tree/dist/src/arm/sun4i-a10-jesurun-q5.dts vendor/device-tree/dist/src/arm/sun4i-a10-marsboard.dts vendor/device-tree/dist/src/arm/sun4i-a10-mini-xplus.dts vendor/device-tree/dist/src/arm/sun4i-a10-mk802.dts vendor/device-tree/dist/src/arm/sun4i-a10-olinuxino-lime.dts vendor/device-tree/dist/src/arm/sun4i-a10-pcduino.dts vendor/device-tree/dist/src/arm/sun4i-a10-pov-protab2-ips9.dts vendor/device-tree/dist/src/arm/sun4i-a10.dtsi vendor/device-tree/dist/src/arm/sun5i-a10s-auxtek-t003.dts vendor/device-tree/dist/src/arm/sun5i-a10s-auxtek-t004.dts vendor/device-tree/dist/src/arm/sun5i-a10s-olinuxino-micro.dts vendor/device-tree/dist/src/arm/sun5i-a10s-r7-tv-dongle.dts vendor/device-tree/dist/src/arm/sun5i-a10s-wobo-i5.dts vendor/device-tree/dist/src/arm/sun5i-a10s.dtsi vendor/device-tree/dist/src/arm/sun5i-a13-empire-electronix-d709.dts vendor/device-tree/dist/src/arm/sun5i-a13-hsg-h702.dts vendor/device-tree/dist/src/arm/sun5i-a13-licheepi-one.dts vendor/device-tree/dist/src/arm/sun5i-a13-olinuxino-micro.dts vendor/device-tree/dist/src/arm/sun5i-a13-olinuxino.dts vendor/device-tree/dist/src/arm/sun5i-a13.dtsi vendor/device-tree/dist/src/arm/sun5i-gr8-chip-pro.dts vendor/device-tree/dist/src/arm/sun5i-gr8-evb.dts vendor/device-tree/dist/src/arm/sun5i-gr8.dtsi vendor/device-tree/dist/src/arm/sun5i-r8-chip.dts vendor/device-tree/dist/src/arm/sun5i-r8.dtsi vendor/device-tree/dist/src/arm/sun5i.dtsi vendor/device-tree/dist/src/arm/sun6i-a31-app4-evb1.dts vendor/device-tree/dist/src/arm/sun6i-a31-colombus.dts vendor/device-tree/dist/src/arm/sun6i-a31-hummingbird.dts vendor/device-tree/dist/src/arm/sun6i-a31-i7.dts vendor/device-tree/dist/src/arm/sun6i-a31-m9.dts vendor/device-tree/dist/src/arm/sun6i-a31-mele-a1000g-quad.dts vendor/device-tree/dist/src/arm/sun6i-a31.dtsi vendor/device-tree/dist/src/arm/sun6i-a31s-cs908.dts vendor/device-tree/dist/src/arm/sun6i-a31s-primo81.dts vendor/device-tree/dist/src/arm/sun6i-a31s-sina31s-core.dtsi vendor/device-tree/dist/src/arm/sun6i-a31s-sina31s.dts vendor/device-tree/dist/src/arm/sun6i-a31s-sinovoip-bpi-m2.dts vendor/device-tree/dist/src/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts vendor/device-tree/dist/src/arm/sun6i-reference-design-tablet.dtsi vendor/device-tree/dist/src/arm/sun7i-a20-bananapi.dts vendor/device-tree/dist/src/arm/sun7i-a20-cubieboard2.dts vendor/device-tree/dist/src/arm/sun7i-a20-cubietruck.dts vendor/device-tree/dist/src/arm/sun7i-a20-hummingbird.dts vendor/device-tree/dist/src/arm/sun7i-a20-i12-tvbox.dts vendor/device-tree/dist/src/arm/sun7i-a20-icnova-swac.dts vendor/device-tree/dist/src/arm/sun7i-a20-lamobo-r1.dts vendor/device-tree/dist/src/arm/sun7i-a20-m3.dts vendor/device-tree/dist/src/arm/sun7i-a20-mk808c.dts vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som-evb.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime2.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-micro.dts vendor/device-tree/dist/src/arm/sun7i-a20-orangepi-mini.dts vendor/device-tree/dist/src/arm/sun7i-a20-orangepi.dts vendor/device-tree/dist/src/arm/sun7i-a20-pcduino3.dts vendor/device-tree/dist/src/arm/sun7i-a20.dtsi vendor/device-tree/dist/src/arm/sun8i-a23-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a23-evb.dts vendor/device-tree/dist/src/arm/sun8i-a23-ippo-q8h-v1.2.dts vendor/device-tree/dist/src/arm/sun8i-a23-ippo-q8h-v5.dts vendor/device-tree/dist/src/arm/sun8i-a23-q8-tablet.dts vendor/device-tree/dist/src/arm/sun8i-a33-sinlinx-sina33.dts vendor/device-tree/dist/src/arm/sun8i-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a83t.dtsi vendor/device-tree/dist/src/arm/sun8i-h2-plus-orangepi-zero.dts vendor/device-tree/dist/src/arm/sun8i-h3-bananapi-m2-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-beelink-x2.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi.dtsi vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-2.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-lite.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-one.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-pc.dts vendor/device-tree/dist/src/arm/sun8i-h3.dtsi vendor/device-tree/dist/src/arm/sun9i-a80-cubieboard4.dts vendor/device-tree/dist/src/arm/sun9i-a80-optimus.dts vendor/device-tree/dist/src/arm/sun9i-a80.dtsi vendor/device-tree/dist/src/arm/sunxi-common-regulators.dtsi vendor/device-tree/dist/src/arm/sunxi-reference-design-tablet.dtsi vendor/device-tree/dist/src/arm/uniphier-ld4-ref.dts vendor/device-tree/dist/src/arm/uniphier-ld4.dtsi vendor/device-tree/dist/src/arm/uniphier-ld6b-ref.dts vendor/device-tree/dist/src/arm/uniphier-pinctrl.dtsi vendor/device-tree/dist/src/arm/uniphier-pro4-ace.dts vendor/device-tree/dist/src/arm/uniphier-pro4-ref.dts vendor/device-tree/dist/src/arm/uniphier-pro4-sanji.dts vendor/device-tree/dist/src/arm/uniphier-pro4.dtsi vendor/device-tree/dist/src/arm/uniphier-pro5.dtsi vendor/device-tree/dist/src/arm/uniphier-pxs2-gentil.dts vendor/device-tree/dist/src/arm/uniphier-pxs2-vodka.dts vendor/device-tree/dist/src/arm/uniphier-pxs2.dtsi vendor/device-tree/dist/src/arm/uniphier-ref-daughter.dtsi vendor/device-tree/dist/src/arm/uniphier-sld3-ref.dts vendor/device-tree/dist/src/arm/uniphier-sld3.dtsi vendor/device-tree/dist/src/arm/uniphier-sld8-ref.dts vendor/device-tree/dist/src/arm/uniphier-sld8.dtsi vendor/device-tree/dist/src/arm/uniphier-support-card.dtsi vendor/device-tree/dist/src/arm/versatile-pb.dts vendor/device-tree/dist/src/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm/vexpress-v2m.dtsi vendor/device-tree/dist/src/arm/vexpress-v2p-ca15-tc1.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca15_a7.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca5s.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca9.dts vendor/device-tree/dist/src/arm/vf610-zii-dev-rev-b.dts vendor/device-tree/dist/src/arm/vf610-zii-dev-rev-c.dts vendor/device-tree/dist/src/arm/vf610-zii-dev.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-odroidc2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-p200.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-p201.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-p20x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-wetek-hub.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-wetek-play2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-p230.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-p212.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-nexbox-a1.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-q200.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm.dtsi vendor/device-tree/dist/src/arm64/arm/juno-base.dtsi vendor/device-tree/dist/src/arm64/arm/juno-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/juno-r1.dts vendor/device-tree/dist/src/arm64/arm/juno-r2.dts vendor/device-tree/dist/src/arm64/arm/juno.dts vendor/device-tree/dist/src/arm64/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm64/broadcom/bcm2835-rpi.dtsi vendor/device-tree/dist/src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi vendor/device-tree/dist/src/arm64/broadcom/bcm283x.dtsi vendor/device-tree/dist/src/arm64/broadcom/ns2-svk.dts vendor/device-tree/dist/src/arm64/broadcom/ns2-xmc.dts vendor/device-tree/dist/src/arm64/broadcom/ns2.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos5433-bus.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos5433-tm2-common.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos5433-tm2.dts vendor/device-tree/dist/src/arm64/exynos/exynos5433-tm2e.dts vendor/device-tree/dist/src/arm64/exynos/exynos5433.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-frdm.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls2080a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls2080a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls2080a.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3660-hikey960.dts vendor/device-tree/dist/src/arm64/hisilicon/hi6220-hikey.dts vendor/device-tree/dist/src/arm64/hisilicon/hi6220.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip07-d05.dts vendor/device-tree/dist/src/arm64/hisilicon/hip07.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-3720-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-37xx.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-7040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8020.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-8040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap806.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-cp110-master.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-cp110-slave.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8173-evb.dts vendor/device-tree/dist/src/arm64/nvidia/tegra132.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra186-p2771-0000.dts vendor/device-tree/dist/src/arm64/nvidia/tegra186-p3310.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra186.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8994.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795-h3ulcb.dts vendor/device-tree/dist/src/arm64/renesas/r8a7795-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a7795.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7796-m3ulcb.dts vendor/device-tree/dist/src/arm64/renesas/r8a7796-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a7796.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368-px5-evb.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-pinctrl.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ref-daughter.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-support-card.dtsi vendor/device-tree/dist/src/arm64/zte/zx296718-evb.dts vendor/device-tree/dist/src/arm64/zte/zx296718.dtsi vendor/device-tree/dist/src/nios2/10m50_devboard.dts Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/amlogic.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -43,8 +43,11 @@ Board compatible values: - "wetek,hub" (Meson gxbb) - "wetek,play2" (Meson gxbb) - "amlogic,p212" (Meson gxl s905x) + - "khadas,vim" (Meson gxl s905x) + - "amlogic,p230" (Meson gxl s905d) - "amlogic,p231" (Meson gxl s905d) + - "hwacom,amazetv" (Meson gxl s905x) - "amlogic,q200" (Meson gxm s912) - "amlogic,q201" (Meson gxm s912) - "nexbox,a95x" (Meson gxbb or Meson gxl s905x) Modified: vendor/device-tree/dist/Bindings/arm/atmel-at91.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/atmel-at91.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/atmel-at91.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -217,7 +217,8 @@ memory, bridge implementations, processor and other fu elsewhere. required properties: -- compatible: Should be "atmel,-sfr", "syscon". +- compatible: Should be "atmel,-sfr", "syscon" or + "atmel,-sfrbu", "syscon" can be "sama5d3", "sama5d4" or "sama5d2". - reg: Should contain registers location and length Added: vendor/device-tree/dist/Bindings/arm/cavium-thunder2.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/cavium-thunder2.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,8 @@ +Cavium ThunderX2 CN99XX platform tree bindings +---------------------------------------------- + +Boards with Cavium ThunderX2 CN99XX SoC shall have the root property: + compatible = "cavium,thunderx2-cn9900", "brcm,vulcan-soc"; + +These SoC uses the "cavium,thunder2" core which will be compatible +with "brcm,vulcan". Modified: vendor/device-tree/dist/Bindings/arm/cpus.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/cpus.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/cpus.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -170,6 +170,7 @@ nodes to be present and contain the properties describ "brcm,brahma-b15" "brcm,vulcan" "cavium,thunder" + "cavium,thunder2" "faraday,fa526" "intel,sa110" "intel,sa1100" Added: vendor/device-tree/dist/Bindings/arm/firmware/linaro,optee-tz.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/firmware/linaro,optee-tz.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,31 @@ +OP-TEE Device Tree Bindings + +OP-TEE is a piece of software using hardware features to provide a Trusted +Execution Environment. The security can be provided with ARM TrustZone, but +also by virtualization or a separate chip. + +We're using "linaro" as the first part of the compatible property for +the reference implementation maintained by Linaro. + +* OP-TEE based on ARM TrustZone required properties: + +- compatible : should contain "linaro,optee-tz" + +- method : The method of calling the OP-TEE Trusted OS. Permitted + values are: + + "smc" : SMC #0, with the register assignments specified + in drivers/tee/optee/optee_smc.h + + "hvc" : HVC #0, with the register assignments specified + in drivers/tee/optee/optee_smc.h + + + +Example: + firmware { + optee { + compatible = "linaro,optee-tz"; + method = "smc"; + }; + }; Modified: vendor/device-tree/dist/Bindings/arm/fsl.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/fsl.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/fsl.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -179,6 +179,18 @@ LS1046A ARMv8 based RDB Board Required root node properties: - compatible = "fsl,ls1046a-rdb", "fsl,ls1046a"; +LS1088A SoC +Required root node properties: + - compatible = "fsl,ls1088a"; + +LS1088A ARMv8 based QDS Board +Required root node properties: + - compatible = "fsl,ls1088a-qds", "fsl,ls1088a"; + +LS1088A ARMv8 based RDB Board +Required root node properties: + - compatible = "fsl,ls1088a-rdb", "fsl,ls1088a"; + LS2080A SoC Required root node properties: - compatible = "fsl,ls2080a"; @@ -195,3 +207,14 @@ LS2080A ARMv8 based RDB Board Required root node properties: - compatible = "fsl,ls2080a-rdb", "fsl,ls2080a"; +LS2088A SoC +Required root node properties: + - compatible = "fsl,ls2088a"; + +LS2088A ARMv8 based QDS Board +Required root node properties: + - compatible = "fsl,ls2088a-qds", "fsl,ls2088a"; + +LS2088A ARMv8 based RDB Board +Required root node properties: + - compatible = "fsl,ls2088a-rdb", "fsl,ls2088a"; Added: vendor/device-tree/dist/Bindings/arm/gemini.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/gemini.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,86 @@ +Cortina systems Gemini platforms + +The Gemini SoC is the project name for an ARMv4 FA525-based SoC originally +produced by Storlink Semiconductor around 2005. The company was renamed +later renamed Storm Semiconductor. The chip product name is Storlink SL3516. +It was derived from earlier products from Storm named SL3316 (Centroid) and +SL3512 (Bulverde). + +Storm Semiconductor was acquired by Cortina Systems in 2008 and the SoC was +produced and used for NAS and similar usecases. In 2014 Cortina Systems was +in turn acquired by Inphi, who seem to have discontinued this product family. + +Many of the IP blocks used in the SoC comes from Faraday Technology. + +Required properties (in root node): + compatible = "cortina,gemini"; + +Required nodes: + +- soc: the SoC should be represented by a simple bus encompassing all the + onchip devices, this is referred to as the soc bus node. + +- syscon: the soc bus node must have a system controller node pointing to the + global control registers, with the compatible string + "cortina,gemini-syscon", "syscon"; + +- timer: the soc bus node must have a timer node pointing to the SoC timer + block, with the compatible string "cortina,gemini-timer" + See: clocksource/cortina,gemini-timer.txt + +- interrupt-controller: the sob bus node must have an interrupt controller + node pointing to the SoC interrupt controller block, with the compatible + string "cortina,gemini-interrupt-controller" + See interrupt-controller/cortina,gemini-interrupt-controller.txt + +Example: + +/ { + model = "Foo Gemini Machine"; + compatible = "cortina,gemini"; + #address-cells = <1>; + #size-cells = <1>; + + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + ranges; + compatible = "simple-bus"; + interrupt-parent = <&intcon>; + + syscon: syscon@40000000 { + compatible = "cortina,gemini-syscon", "syscon"; + reg = <0x40000000 0x1000>; + }; + + uart0: serial@42000000 { + compatible = "ns16550a"; + reg = <0x42000000 0x100>; + clock-frequency = <48000000>; + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + }; + + timer@43000000 { + compatible = "cortina,gemini-timer"; + reg = <0x43000000 0x1000>; + interrupt-parent = <&intcon>; + interrupts = <14 IRQ_TYPE_EDGE_FALLING>, /* Timer 1 */ + <15 IRQ_TYPE_EDGE_FALLING>, /* Timer 2 */ + <16 IRQ_TYPE_EDGE_FALLING>; /* Timer 3 */ + syscon = <&syscon>; + }; + + intcon: interrupt-controller@48000000 { + compatible = "cortina,gemini-interrupt-controller"; + reg = <0x48000000 0x1000>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; +}; Modified: vendor/device-tree/dist/Bindings/arm/hisilicon/hisilicon.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/hisilicon/hisilicon.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/hisilicon/hisilicon.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -4,6 +4,14 @@ Hi3660 SoC Required root node properties: - compatible = "hisilicon,hi3660"; +Hi3798cv200 SoC +Required root node properties: + - compatible = "hisilicon,hi3798cv200"; + +Hi3798cv200 Poplar Board +Required root node properties: + - compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200"; + Hi4511 Board Required root node properties: - compatible = "hisilicon,hi3620-hi4511"; Added: vendor/device-tree/dist/Bindings/arm/i2se.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/i2se.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,22 @@ +I2SE Device Tree Bindings +------------------------- + +Duckbill Board +Required root node properties: + - compatible = "i2se,duckbill", "fsl,imx28"; + +Duckbill 2 Board +Required root node properties: + - compatible = "i2se,duckbill-2", "fsl,imx28"; + +Duckbill 2 485 Board +Required root node properties: + - compatible = "i2se,duckbill-2-485", "i2se,duckbill-2", "fsl,imx28"; + +Duckbill 2 EnOcean Board +Required root node properties: + - compatible = "i2se,duckbill-2-enocean", "i2se,duckbill-2", "fsl,imx28"; + +Duckbill 2 SPI Board +Required root node properties: + - compatible = "i2se,duckbill-2-spi", "i2se,duckbill-2", "fsl,imx28"; Modified: vendor/device-tree/dist/Bindings/arm/l2c2x0.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/l2c2x0.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/l2c2x0.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -90,6 +90,9 @@ Optional properties: - arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable), <1> (forcibly enable), property absent (OS specific behavior, preferably retain firmware settings) +- arm,early-bresp-disable : Disable the CA9 optimization Early BRESP (PL310) +- arm,full-line-zero-disable : Disable the CA9 optimization Full line of zero + write (PL310) Example: Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-apmixedsys" + - "mediatek,mt6797-apmixedsys" - "mediatek,mt8135-apmixedsys" - "mediatek,mt8173-apmixedsys" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-imgsys", "syscon" + - "mediatek,mt6797-imgsys", "syscon" - "mediatek,mt8173-imgsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -8,6 +8,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-infracfg", "syscon" + - "mediatek,mt6797-infracfg", "syscon" - "mediatek,mt8135-infracfg", "syscon" - "mediatek,mt8173-infracfg", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-mmsys", "syscon" + - "mediatek,mt6797-mmsys", "syscon" - "mediatek,mt8173-mmsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-topckgen" + - "mediatek,mt6797-topckgen" - "mediatek,mt8135-topckgen" - "mediatek,mt8173-topckgen" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-vdecsys", "syscon" + - "mediatek,mt6797-vdecsys", "syscon" - "mediatek,mt8173-vdecsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -5,7 +5,8 @@ The Mediatek vencsys controller provides various clock Required Properties: -- compatible: Should be: +- compatible: Should be one of: + - "mediatek,mt6797-vencsys", "syscon" - "mediatek,mt8173-vencsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/rockchip.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/rockchip.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/rockchip.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -1,5 +1,8 @@ Rockchip platforms device tree bindings --------------------------------------- +- Asus Tinker board + Required root node properties: + - compatible = "asus,rk3288-tinker", "rockchip,rk3288"; - Kylin RK3036 board: Required root node properties: @@ -56,6 +59,17 @@ Rockchip platforms device tree bindings - compatible = "google,veyron-brain-rev0", "google,veyron-brain", "google,veyron", "rockchip,rk3288"; +- Google Gru (dev-board): + Required root node properties: + - compatible = "google,gru-rev15", "google,gru-rev14", + "google,gru-rev13", "google,gru-rev12", + "google,gru-rev11", "google,gru-rev10", + "google,gru-rev9", "google,gru-rev8", + "google,gru-rev7", "google,gru-rev6", + "google,gru-rev5", "google,gru-rev4", + "google,gru-rev3", "google,gru-rev2", + "google,gru", "rockchip,rk3399"; + - Google Jaq (Haier Chromebook 11 and more): Required root node properties: - compatible = "google,veyron-jaq-rev5", "google,veyron-jaq-rev4", @@ -70,6 +84,15 @@ Rockchip platforms device tree bindings "google,veyron-jerry-rev3", "google,veyron-jerry", "google,veyron", "rockchip,rk3288"; +- Google Kevin (Samsung Chromebook Plus): + Required root node properties: + - compatible = "google,kevin-rev15", "google,kevin-rev14", + "google,kevin-rev13", "google,kevin-rev12", + "google,kevin-rev11", "google,kevin-rev10", + "google,kevin-rev9", "google,kevin-rev8", + "google,kevin-rev7", "google,kevin-rev6", + "google,kevin", "google,gru", "rockchip,rk3399"; + - Google Mickey (Asus Chromebit CS10): Required root node properties: - compatible = "google,veyron-mickey-rev8", "google,veyron-mickey-rev7", @@ -103,6 +126,10 @@ Rockchip platforms device tree bindings Required root node properties: - compatible = "mqmaker,miqi", "rockchip,rk3288"; +- Phytec phyCORE-RK3288: Rapid Development Kit + Required root node properties: + - compatible = "phytec,rk3288-pcm-947", "phytec,rk3288-phycore-som", "rockchip,rk3288"; + - Rockchip PX3 Evaluation board: Required root node properties: - compatible = "rockchip,px3-evb", "rockchip,px3", "rockchip,rk3188"; @@ -133,6 +160,10 @@ Rockchip platforms device tree bindings - Rockchip RK3288 Fennec board: Required root node properties: - compatible = "rockchip,rk3288-fennec", "rockchip,rk3288"; + +- Rockchip RK3328 evb: + Required root node properties: + - compatible = "rockchip,rk3328-evb", "rockchip,rk3328"; - Rockchip RK3399 evb: Required root node properties: Modified: vendor/device-tree/dist/Bindings/arm/shmobile.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/shmobile.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/shmobile.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -13,8 +13,12 @@ SoCs: compatible = "renesas,r8a73a4" - R-Mobile A1 (R8A77400) compatible = "renesas,r8a7740" + - RZ/G1H (R8A77420) + compatible = "renesas,r8a7742" - RZ/G1M (R8A77430) compatible = "renesas,r8a7743" + - RZ/G1N (R8A77440) + compatible = "renesas,r8a7744" - RZ/G1E (R8A77450) compatible = "renesas,r8a7745" - R-Car M1A (R8A77781) Modified: vendor/device-tree/dist/Bindings/arm/sprd.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/sprd.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/sprd.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -1,11 +1,14 @@ Spreadtrum SoC Platforms Device Tree Bindings ---------------------------------------------------- -Sharkl64 is a Spreadtrum's SoC Platform which is based -on ARM 64-bit processor. +SC9836 openphone Board +Required root node properties: + - compatible = "sprd,sc9836-openphone", "sprd,sc9836"; -SC9836 openphone board with SC9836 SoC based on the -Sharkl64 Platform shall have the following properties. +SC9860 SoC +Required root node properties: + - compatible = "sprd,sc9860" +SP9860G 3GFHD Board Required root node properties: - - compatible = "sprd,sc9836-openphone", "sprd,sc9836"; + - compatible = "sprd,sp9860g-1h10", "sprd,sc9860"; Added: vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra186-pmc.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra186-pmc.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,34 @@ +NVIDIA Tegra Power Management Controller (PMC) + +Required properties: +- compatible: Should contain one of the following: + - "nvidia,tegra186-pmc": for Tegra186 +- reg: Must contain an (offset, length) pair of the register set for each + entry in reg-names. +- reg-names: Must include the following entries: + - "pmc" + - "wake" + - "aotag" + - "scratch" + +Optional properties: +- nvidia,invert-interrupt: If present, inverts the PMU interrupt signal. + +Example: + +SoC DTSI: + + pmc@c3600000 { + compatible = "nvidia,tegra186-pmc"; + reg = <0 0x0c360000 0 0x10000>, + <0 0x0c370000 0 0x10000>, + <0 0x0c380000 0 0x10000>, + <0 0x0c390000 0 0x10000>; + reg-names = "pmc", "wake", "aotag", "scratch"; + }; + +Board DTS: + + pmc@c360000 { + nvidia,invert-interrupt; + }; Modified: vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-flowctrl.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-flowctrl.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-flowctrl.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -1,7 +1,13 @@ NVIDIA Tegra Flow Controller Required properties: -- compatible: Should be "nvidia,tegra-flowctrl" +- compatible: Should contain one of the following: + - "nvidia,tegra20-flowctrl": for Tegra20 + - "nvidia,tegra30-flowctrl": for Tegra30 + - "nvidia,tegra114-flowctrl": for Tegra114 + - "nvidia,tegra124-flowctrl": for Tegra124 + - "nvidia,tegra132-flowctrl", "nvidia,tegra124-flowctrl": for Tegra132 + - "nvidia,tegra210-flowctrl": for Tegra210 - reg: Should contain one register range (address and length) Example: Added: vendor/device-tree/dist/Bindings/ata/ahci-dm816.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/ata/ahci-dm816.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,21 @@ +Device tree binding for the TI DM816 AHCI SATA Controller +--------------------------------------------------------- + +Required properties: + - compatible: must be "ti,dm816-ahci" + - reg: physical base address and size of the register region used by + the controller (as defined by the AHCI 1.1 standard) + - interrupts: interrupt specifier (refer to the interrupt binding) + - clocks: list of phandle and clock specifier pairs (or only + phandles for clock providers with '0' defined for + #clock-cells); two clocks must be specified: the functional + clock and an external reference clock + +Example: + + sata: sata@4a140000 { + compatible = "ti,dm816-ahci"; + reg = <0x4a140000 0x10000>; + interrupts = <16>; + clocks = <&sysclk5_ck>, <&sata_refclk>; + }; Added: vendor/device-tree/dist/Bindings/auxdisplay/hit,hd44780.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/auxdisplay/hit,hd44780.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,45 @@ +DT bindings for the Hitachi HD44780 Character LCD Controller + +The Hitachi HD44780 Character LCD Controller is commonly used on character LCDs +that can display one or more lines of text. It exposes an M6800 bus interface, +which can be used in either 4-bit or 8-bit mode. + +Required properties: + - compatible: Must contain "hit,hd44780", + - data-gpios: Must contain an array of either 4 or 8 GPIO specifiers, + referring to the GPIO pins connected to the data signal lines DB0-DB7 + (8-bit mode) or DB4-DB7 (4-bit mode) of the LCD Controller's bus interface, + - enable-gpios: Must contain a GPIO specifier, referring to the GPIO pin + connected to the "E" (Enable) signal line of the LCD Controller's bus + interface, + - rs-gpios: Must contain a GPIO specifier, referring to the GPIO pin + connected to the "RS" (Register Select) signal line of the LCD Controller's + bus interface, + - display-height-chars: Height of the display, in character cells, + - display-width-chars: Width of the display, in character cells. + +Optional properties: + - rw-gpios: Must contain a GPIO specifier, referring to the GPIO pin + connected to the "RW" (Read/Write) signal line of the LCD Controller's bus + interface, + - backlight-gpios: Must contain a GPIO specifier, referring to the GPIO pin + used for enabling the LCD's backlight, + - internal-buffer-width: Internal buffer width (default is 40 for displays + with 1 or 2 lines, and display-width-chars for displays with more than 2 + lines). + +Example: + + auxdisplay { + compatible = "hit,hd44780"; + + data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>, + <&hc595 1 GPIO_ACTIVE_HIGH>, + <&hc595 2 GPIO_ACTIVE_HIGH>, + <&hc595 3 GPIO_ACTIVE_HIGH>; + enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>; + rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>; + + display-height-chars = <2>; + display-width-chars = <16>; + }; Modified: vendor/device-tree/dist/Bindings/chosen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/chosen.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/chosen.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -52,3 +52,48 @@ This property is set (currently only on PowerPC, and o book3e) by some versions of kexec-tools to tell the new kernel that it is being booted by kexec, as the booting environment may differ (e.g. a different secondary CPU release mechanism) + +linux,usable-memory-range +------------------------- + +This property (arm64 only) holds a base address and size, describing a +limited region in which memory may be considered available for use by +the kernel. Memory outside of this range is not available for use. + +This property describes a limitation: memory within this range is only +valid when also described through another mechanism that the kernel +would otherwise use to determine available memory (e.g. memory nodes +or the EFI memory map). Valid memory may be sparse within the range. +e.g. + +/ { + chosen { + linux,usable-memory-range = <0x9 0xf0000000 0x0 0x10000000>; + }; +}; + +The main usage is for crash dump kernel to identify its own usable +memory and exclude, at its boot time, any other memory areas that are +part of the panicked kernel's memory. + +While this property does not represent a real hardware, the address +and the size are expressed in #address-cells and #size-cells, +respectively, of the root node. + +linux,elfcorehdr +---------------- + +This property (currently used only on arm64) holds the memory range, +the address and the size, of the elf core header which mainly describes +the panicked kernel's memory layout as PT_LOAD segments of elf format. +e.g. + +/ { + chosen { + linux,elfcorehdr = <0x9 0xfffff000 0x0 0x800>; + }; +}; + +While this property does not represent a real hardware, the address +and the size are expressed in #address-cells and #size-cells, +respectively, of the root node. Modified: vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -5,7 +5,8 @@ controllers within the SoC. Required Properties: -- compatible: should be "amlogic,gxbb-clkc" +- compatible: should be "amlogic,gxbb-clkc" for GXBB SoC, + or "amlogic,gxl-clkc" for GXL and GXM SoC. - reg: physical base address of the clock controller and length of memory mapped region. Modified: vendor/device-tree/dist/Bindings/clock/armada3700-xtal-clock.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/armada3700-xtal-clock.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/armada3700-xtal-clock.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -5,6 +5,7 @@ reading the gpio latch register. This node must be a subnode of the node exposing the register address of the GPIO block where the gpio latch is located. +See Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt Required properties: - compatible : shall be one of the following: @@ -16,9 +17,9 @@ Optional properties: output names ("xtal") Example: -gpio1: gpio@13800 { - compatible = "marvell,armada-3700-gpio", "syscon", "simple-mfd"; - reg = <0x13800 0x1000>; +pinctrl_nb: pinctrl-nb@13800 { + compatible = "armada3710-nb-pinctrl", "syscon", "simple-mfd"; + reg = <0x13800 0x100>, <0x13C00 0x20>; xtalclk: xtal-clk { compatible = "marvell,armada-3700-xtal-clock"; Modified: vendor/device-tree/dist/Bindings/clock/idt,versaclock5.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/idt,versaclock5.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/idt,versaclock5.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -6,18 +6,21 @@ from 3 to 12 output clocks. ==I2C device node== Required properties: -- compatible: shall be one of "idt,5p49v5923" , "idt,5p49v5933". +- compatible: shall be one of "idt,5p49v5923" , "idt,5p49v5933" , + "idt,5p49v5935". - reg: i2c device address, shall be 0x68 or 0x6a. - #clock-cells: from common clock binding; shall be set to 1. - clocks: from common clock binding; list of parent clock handles, - 5p49v5923: (required) either or both of XTAL or CLKIN reference clock. - - 5p49v5933: (optional) property not present (internal + - 5p49v5933 and + - 5p49v5935: (optional) property not present (internal Xtal used) or CLKIN reference clock. - clock-names: from common clock binding; clock input names, can be - 5p49v5923: (required) either or both of "xin", "clkin". - - 5p49v5933: (optional) property not present or "clkin". + - 5p49v5933 and + - 5p49v5935: (optional) property not present or "clkin". ==Mapping between clock specifier and physical pins== @@ -33,6 +36,13 @@ clock specifier, the following mapping applies: 0 -- OUT0_SEL_I2CB 1 -- OUT1 2 -- OUT4 + +5P49V5935: + 0 -- OUT0_SEL_I2CB + 1 -- OUT1 + 2 -- OUT2 + 3 -- OUT3 + 4 -- OUT4 ==Example== Modified: vendor/device-tree/dist/Bindings/clock/mvebu-core-clock.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/mvebu-core-clock.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/mvebu-core-clock.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -31,6 +31,12 @@ The following is a list of provided IDs and clock name 4 = dclk (SDRAM Interface Clock) 5 = refclk (Reference Clock) +The following is a list of provided IDs and clock names on 98dx3236: + 0 = tclk (Internal Bus clock) + 1 = cpuclk (CPU clock) + 2 = ddrclk (DDR clock) + 3 = mpll (MPLL Clock) + The following is a list of provided IDs and clock names on Kirkwood and Dove: 0 = tclk (Internal Bus clock) 1 = cpuclk (CPU0 clock) @@ -49,6 +55,7 @@ Required properties: "marvell,armada-380-core-clock" - For Armada 380/385 SoC core clocks "marvell,armada-390-core-clock" - For Armada 39x SoC core clocks "marvell,armada-xp-core-clock" - For Armada XP SoC core clocks + "marvell,mv98dx3236-core-clock" - For 98dx3236 family SoC core clocks "marvell,dove-core-clock" - for Dove SoC core clocks "marvell,kirkwood-core-clock" - for Kirkwood SoC (except mv88f6180) "marvell,mv88f6180-core-clock" - for Kirkwood MV88f6180 SoC Modified: vendor/device-tree/dist/Bindings/clock/mvebu-gated-clock.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/mvebu-gated-clock.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/mvebu-gated-clock.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -119,6 +119,16 @@ ID Clock Peripheral 29 sata1lnk 30 sata1 SATA Host 1 +The following is a list of provided IDs for 98dx3236: +ID Clock Peripheral +----------------------------------- +3 ge1 Gigabit Ethernet 1 +4 ge0 Gigabit Ethernet 0 +5 pex0 PCIe Cntrl 0 +17 sdio SDHCI Host +18 usb0 USB Host 0 +22 xor0 XOR DMA 0 + The following is a list of provided IDs for Dove: ID Clock Peripheral ----------------------------------- @@ -169,6 +179,7 @@ Required properties: "marvell,armada-380-gating-clock" - for Armada 380/385 SoC clock gating "marvell,armada-390-gating-clock" - for Armada 39x SoC clock gating "marvell,armada-xp-gating-clock" - for Armada XP SoC clock gating + "marvell,mv98dx3236-gating-clock" - for 98dx3236 SoC clock gating "marvell,dove-gating-clock" - for Dove SoC clock gating "marvell,kirkwood-gating-clock" - for Kirkwood SoC clock gating - reg : shall be the register address of the Clock Gating Control register Modified: vendor/device-tree/dist/Bindings/clock/qoriq-clock.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/qoriq-clock.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/qoriq-clock.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -35,6 +35,7 @@ Required properties: * "fsl,ls1021a-clockgen" * "fsl,ls1043a-clockgen" * "fsl,ls1046a-clockgen" + * "fsl,ls1088a-clockgen" * "fsl,ls2080a-clockgen" Chassis-version clock strings include: * "fsl,qoriq-clockgen-1.0": for chassis 1.0 clocks Added: vendor/device-tree/dist/Bindings/clock/rockchip,rv1108-cru.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/clock/rockchip,rv1108-cru.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,59 @@ +* Rockchip RV1108 Clock and Reset Unit + +The RV1108 clock controller generates and supplies clock to various +controllers within the SoC and also implements a reset controller for SoC +peripherals. + +Required Properties: + +- compatible: should be "rockchip,rv1108-cru" +- reg: physical base address of the controller and length of memory mapped + region. +- #clock-cells: should be 1. +- #reset-cells: should be 1. + +Optional Properties: + +- rockchip,grf: phandle to the syscon managing the "general register files" + If missing pll rates are not changeable, due to the missing pll lock status. + +Each clock is assigned an identifier and client nodes can use this identifier +to specify the clock which they consume. All available clocks are defined as +preprocessor macros in the dt-bindings/clock/rv1108-cru.h headers and can be +used in device tree sources. Similar macros exist for the reset sources in +these files. + +External clocks: + +There are several clocks that are generated outside the SoC. It is expected +that they are defined using standard clock bindings with following +clock-output-names: + - "xin24m" - crystal input - required, + - "ext_vip" - external VIP clock - optional + - "ext_i2s" - external I2S clock - optional + - "ext_gmac" - external GMAC clock - optional + - "hdmiphy" - external clock input derived from HDMI PHY - optional + - "usbphy" - external clock input derived from USB PHY - optional + +Example: Clock controller node: + + cru: cru@20200000 { + compatible = "rockchip,rv1108-cru"; + reg = <0x20200000 0x1000>; + rockchip,grf = <&grf>; + + #clock-cells = <1>; + #reset-cells = <1>; + }; + +Example: UART controller node that consumes the clock generated by the clock + controller: + + uart0: serial@10230000 { + compatible = "rockchip,rv1108-uart", "snps,dw-apb-uart"; + reg = <0x10230000 0x100>; + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART0>; + }; Modified: vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -7,9 +7,12 @@ Required properties : - "allwinner,sun8i-a23-ccu" - "allwinner,sun8i-a33-ccu" - "allwinner,sun8i-h3-ccu" + - "allwinner,sun8i-h3-r-ccu" - "allwinner,sun8i-v3s-ccu" - "allwinner,sun9i-a80-ccu" - "allwinner,sun50i-a64-ccu" + - "allwinner,sun50i-a64-r-ccu" + - "allwinner,sun50i-h5-ccu" - reg: Must contain the registers base address and length - clocks: phandle to the oscillators feeding the CCU. Two are needed: @@ -19,12 +22,26 @@ Required properties : - #clock-cells : must contain 1 - #reset-cells : must contain 1 -Example: +For the PRCM CCUs on H3/A64, two more clocks are needed: +- "pll-periph": the SoC's peripheral PLL from the main CCU +- "iosc": the SoC's internal frequency oscillator + +Example for generic CCU: ccu: clock@01c20000 { compatible = "allwinner,sun8i-h3-ccu"; reg = <0x01c20000 0x400>; clocks = <&osc24M>, <&osc32k>; clock-names = "hosc", "losc"; + #clock-cells = <1>; + #reset-cells = <1>; +}; + +Example for PRCM CCU: +r_ccu: clock@01f01400 { + compatible = "allwinner,sun50i-a64-r-ccu"; + reg = <0x01f01400 0x100>; + clocks = <&osc24M>, <&osc32k>, <&iosc>, <&ccu CLK_PLL_PERIPH0>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; #clock-cells = <1>; #reset-cells = <1>; }; Added: vendor/device-tree/dist/Bindings/crypto/st,stm32-crc.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/crypto/st,stm32-crc.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -0,0 +1,16 @@ +* STMicroelectronics STM32 CRC + +Required properties: +- compatible: Should be "st,stm32f7-crc". +- reg: The address and length of the peripheral registers space +- clocks: The input clock of the CRC instance + +Optional properties: none + +Example: + +crc: crc@40023000 { + compatible = "st,stm32f7-crc"; + reg = <0x40023000 0x400>; + clocks = <&rcc 0 12>; +}; Modified: vendor/device-tree/dist/Bindings/devfreq/exynos-bus.txt ============================================================================== --- vendor/device-tree/dist/Bindings/devfreq/exynos-bus.txt Sun Jul 9 12:53:02 2017 (r320831) +++ vendor/device-tree/dist/Bindings/devfreq/exynos-bus.txt Sun Jul 9 13:12:48 2017 (r320832) @@ -202,23 +202,23 @@ Example2 : compatible = "operating-points-v2"; opp-shared; - opp@50000000 { + opp-50000000 { opp-hz = /bits/ 64 <50000000>; opp-microvolt = <800000>; }; - opp@100000000 { + opp-100000000 { opp-hz = /bits/ 64 <100000000>; opp-microvolt = <800000>; }; - opp@134000000 { + opp-134000000 { opp-hz = /bits/ 64 <134000000>; opp-microvolt = <800000>; }; - opp@200000000 { + opp-200000000 { opp-hz = /bits/ 64 <200000000>; opp-microvolt = <825000>; }; - opp@400000000 { + opp-400000000 { opp-hz = /bits/ 64 <400000000>; opp-microvolt = <875000>; }; @@ -292,23 +292,23 @@ Example2 : compatible = "operating-points-v2"; opp-shared; - opp@50000000 { + opp-50000000 { opp-hz = /bits/ 64 <50000000>; opp-microvolt = <900000>; }; - opp@80000000 { + opp-80000000 { opp-hz = /bits/ 64 <80000000>; opp-microvolt = <900000>; }; - opp@100000000 { + opp-100000000 { opp-hz = /bits/ 64 <100000000>; opp-microvolt = <1000000>; }; - opp@134000000 { + opp-134000000 { opp-hz = /bits/ 64 <134000000>; opp-microvolt = <1000000>; }; - opp@200000000 { + opp-200000000 { opp-hz = /bits/ 64 <200000000>; opp-microvolt = <1000000>; }; @@ -318,19 +318,19 @@ Example2 : compatible = "operating-points-v2"; opp-shared; - opp@50000000 { + opp-50000000 { opp-hz = /bits/ 64 <50000000>; }; - opp@80000000 { + opp-80000000 { opp-hz = /bits/ 64 <80000000>; }; - opp@100000000 { + opp-100000000 { opp-hz = /bits/ 64 <100000000>; }; - opp@200000000 { + opp-200000000 { opp-hz = /bits/ 64 <200000000>; }; - opp@400000000 { + opp-400000000 { opp-hz = /bits/ 64 <400000000>; }; }; @@ -339,19 +339,19 @@ Example2 : compatible = "operating-points-v2"; opp-shared; - opp@50000000 { + opp-50000000 { opp-hz = /bits/ 64 <50000000>; }; - opp@80000000 { + opp-80000000 { opp-hz = /bits/ 64 <80000000>; }; - opp@100000000 { + opp-100000000 { opp-hz = /bits/ 64 <100000000>; }; - opp@200000000 { + opp-200000000 { opp-hz = /bits/ 64 <200000000>; }; - opp@300000000 { + opp-300000000 { opp-hz = /bits/ 64 <300000000>; }; }; @@ -360,13 +360,13 @@ Example2 : compatible = "operating-points-v2"; opp-shared; - opp@50000000 { + opp-50000000 { opp-hz = /bits/ 64 <50000000>; }; - opp@80000000 { + opp-80000000 { opp-hz = /bits/ 64 <80000000>; }; - opp@100000000 { + opp-100000000 { opp-hz = /bits/ 64 <100000000>; }; }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 9 13:13:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB67DB1FD3; Sun, 9 Jul 2017 13:13:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D595F83F31; Sun, 9 Jul 2017 13:13:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69DDo6A003018; Sun, 9 Jul 2017 13:13:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69DDoV7003017; Sun, 9 Jul 2017 13:13:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091313.v69DDoV7003017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 13:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320833 - vendor/device-tree/4.12 X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: vendor/device-tree/4.12 X-SVN-Commit-Revision: 320833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 13:13:52 -0000 Author: manu Date: Sun Jul 9 13:13:50 2017 New Revision: 320833 URL: https://svnweb.freebsd.org/changeset/base/320833 Log: Tag import of DTS from Linux 4.12 Added: vendor/device-tree/4.12/ - copied from r320832, vendor/device-tree/dist/ From owner-svn-src-all@freebsd.org Sun Jul 9 13:53:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC744DB2873; Sun, 9 Jul 2017 13:53:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40DDF10B; Sun, 9 Jul 2017 13:53:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69DrYUD019276; Sun, 9 Jul 2017 13:53:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69DrWSi019259; Sun, 9 Jul 2017 13:53:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091353.v69DrWSi019259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 13:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320834 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/genpd include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/mfd include/dt-bindings/pin... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/genpd include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/mfd include/dt-bindings/pinctrl include/dt-bindings/... X-SVN-Commit-Revision: 320834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 13:53:36 -0000 Author: manu Date: Sun Jul 9 13:53:32 2017 New Revision: 320834 URL: https://svnweb.freebsd.org/changeset/base/320834 Log: Update DTS files from Linux 4.12 Notable changes: Allwinner: * H3/H5 were merged into a common dtsi file * include/dt-bindings/sun4i-a10.h is not included anymore in a lot of dts files * Add sun8i-h3-nanopi-neo-air board DTS file Added: head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/am335x-baltos-leds.dtsi head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/armada-385-linksys-shelby.dts head/sys/gnu/dts/arm/armada-385-synology-ds116.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/bcm4708-linksys-ea6300-v1.dts head/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/bcm47081-tplink-archer-c5-v2.dts head/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/bcm4709-linksys-ea9200.dts head/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/bcm47094-linksys-panamera.dts head/sys/gnu/dts/arm/bcm953012hr.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/bcm953012hr.dts head/sys/gnu/dts/arm/exynos5420-tmu-sensor-conf.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/exynos5420-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/gemini-nas4220b.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini-nas4220b.dts head/sys/gnu/dts/arm/gemini-rut1xx.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini-rut1xx.dts head/sys/gnu/dts/arm/gemini-sq201.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini-sq201.dts head/sys/gnu/dts/arm/gemini-wbd111.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini-wbd111.dts head/sys/gnu/dts/arm/gemini-wbd222.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini-wbd222.dts head/sys/gnu/dts/arm/gemini.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/gemini.dtsi head/sys/gnu/dts/arm/imx28-duckbill-2-485.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx28-duckbill-2-485.dts head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx28-duckbill-2-enocean.dts head/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx28-duckbill-2-spi.dts head/sys/gnu/dts/arm/imx28-duckbill-2.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx28-duckbill-2.dts head/sys/gnu/dts/arm/imx6dl-gw5903.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6dl-gw5903.dts head/sys/gnu/dts/arm/imx6dl-gw5904.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6dl-gw5904.dts head/sys/gnu/dts/arm/imx6q-gw5903.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6q-gw5903.dts head/sys/gnu/dts/arm/imx6q-gw5904.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6q-gw5904.dts head/sys/gnu/dts/arm/imx6q-icore-ofcap10.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6q-icore-ofcap10.dts head/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6q-icore-ofcap12.dts head/sys/gnu/dts/arm/imx6q-zii-rdu2.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6q-zii-rdu2.dts head/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6qdl-gw5903.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6qdl-gw5904.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qp-nitrogen6_som2.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6qp-nitrogen6_som2.dts head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6qp-zii-rdu2.dts head/sys/gnu/dts/arm/imx6ul-isiot-common.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx6ul-isiot-common.dtsi head/sys/gnu/dts/arm/imx7d-sdb-sht11.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/imx7d-sdb-sht11.dts head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/motorola-cpcap-mapphone.dtsi head/sys/gnu/dts/arm/omap3-cpu-thermal.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/omap3-cpu-thermal.dtsi head/sys/gnu/dts/arm/rk3288-phycore-rdk.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/rk3288-phycore-rdk.dts head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-tinker.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/rk3288-tinker.dts head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-eval.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts - copied unchanged from r320832, vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-neo-air.dts head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi - copied unchanged from r320832, vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/include/dt-bindings/clock/mt6797-clk.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/clock/mt6797-clk.h head/sys/gnu/dts/include/dt-bindings/clock/rv1108-cru.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/clock/rv1108-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-r-ccu.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/clock/sun8i-r-ccu.h head/sys/gnu/dts/include/dt-bindings/genpd/ - copied from r320832, vendor/device-tree/dist/include/dt-bindings/genpd/ head/sys/gnu/dts/include/dt-bindings/mfd/stm32f7-rcc.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/mfd/stm32f7-rcc.h head/sys/gnu/dts/include/dt-bindings/power/imx7-power.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/power/imx7-power.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10sr.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/reset/altr,rst-mgr-a10sr.h head/sys/gnu/dts/include/dt-bindings/reset/imx7-reset.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/reset/imx7-reset.h head/sys/gnu/dts/include/dt-bindings/reset/sun8i-r-ccu.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/reset/sun8i-r-ccu.h head/sys/gnu/dts/include/dt-bindings/reset/tegra210-car.h - copied unchanged from r320832, vendor/device-tree/dist/include/dt-bindings/reset/tegra210-car.h Deleted: head/sys/gnu/dts/include/dt-bindings/clock/rk1108-cru.h Modified: head/sys/gnu/dts/arm/alpine.dtsi head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts head/sys/gnu/dts/arm/am335x-boneblack.dts head/sys/gnu/dts/arm/am335x-icev2.dts head/sys/gnu/dts/arm/am335x-sl50.dts head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385.dtsi head/sys/gnu/dts/arm/armada-388-clearfog.dts head/sys/gnu/dts/arm/armada-388.dtsi head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3336.dtsi head/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi head/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts head/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/axp22x.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm283x-rpi-smsc9512.dtsi head/sys/gnu/dts/arm/bcm283x-rpi-smsc9514.dtsi head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts head/sys/gnu/dts/arm/bcm4708.dtsi head/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts head/sys/gnu/dts/arm/bcm47081.dtsi head/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts head/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts head/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts head/sys/gnu/dts/arm/bcm4709-netgear-r8000.dts head/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts head/sys/gnu/dts/arm/bcm47094-dlink-dir-885l.dts head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3100.dts head/sys/gnu/dts/arm/bcm47094-netgear-r8500.dts head/sys/gnu/dts/arm/bcm47189-tenda-ac9.dts head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm53573.dtsi head/sys/gnu/dts/arm/bcm94708.dts head/sys/gnu/dts/arm/bcm94709.dts head/sys/gnu/dts/arm/bcm953012er.dts head/sys/gnu/dts/arm/bcm953012k.dts head/sys/gnu/dts/arm/bcm958522er.dts head/sys/gnu/dts/arm/bcm958525er.dts head/sys/gnu/dts/arm/bcm958525xmc.dts head/sys/gnu/dts/arm/bcm958622hr.dts head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/bcm958625k.dts head/sys/gnu/dts/arm/bcm988312hr.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8168-evm.dts head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-prime.dtsi head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos5800.dtsi head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx25-pinfunc.h head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx28-duckbill.dts head/sys/gnu/dts/arm/imx28-m28cu3.dts head/sys/gnu/dts/arm/imx28.dtsi head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx53-qsb.dts head/sys/gnu/dts/arm/imx53-qsrb.dts head/sys/gnu/dts/arm/imx6q-b450v3.dts head/sys/gnu/dts/arm/imx6q-b650v3.dts head/sys/gnu/dts/arm/imx6q-b850v3.dts head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-cm-fx6.dts head/sys/gnu/dts/arm/imx6q-icore.dts head/sys/gnu/dts/arm/imx6q-utilite-pro.dts head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp-sabresd.dts head/sys/gnu/dts/arm/imx6qp.dtsi head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-geam.dtsi head/sys/gnu/dts/arm/imx6ul-isiot-emmc.dts head/sys/gnu/dts/arm/imx6ul-isiot-nand.dts head/sys/gnu/dts/arm/imx6ul-isiot.dtsi head/sys/gnu/dts/arm/imx7-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/keystone-k2l-netcp.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/moxart-uc7112lx.dts head/sys/gnu/dts/arm/moxart.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-igep.dtsi head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap34xx.dtsi head/sys/gnu/dts/arm/omap36xx.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-panda-a4.dts head/sys/gnu/dts/arm/omap4-panda-es.dts head/sys/gnu/dts/arm/omap443x.dtsi head/sys/gnu/dts/arm/omap4460.dtsi head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r7s72100-genmai.dts head/sys/gnu/dts/arm/r7s72100-rskrza1.dts head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7778-bockw.dts head/sys/gnu/dts/arm/r8a7779-marzen.dts head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk1108.dtsi head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3188.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-miqi.dts head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/rk3xxx.dtsi head/sys/gnu/dts/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/s5pv210.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi head/sys/gnu/dts/arm/socfpga_arria5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_de0_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_mcv.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts head/sys/gnu/dts/arm/socfpga_cyclone5_sodia.dts head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts head/sys/gnu/dts/arm/socfpga_vt.dts head/sys/gnu/dts/arm/spear600-evb.dts head/sys/gnu/dts/arm/spear600.dtsi head/sys/gnu/dts/arm/ste-dbx5x0.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stm32429i-eval.dts head/sys/gnu/dts/arm/stm32746g-eval.dts head/sys/gnu/dts/arm/stm32f429-disco.dts head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f469-disco.dts head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts head/sys/gnu/dts/arm/sun5i-a10s.dtsi head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts head/sys/gnu/dts/arm/sun5i-a13-licheepi-one.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun5i-a13.dtsi head/sys/gnu/dts/arm/sun5i-gr8-chip-pro.dts head/sys/gnu/dts/arm/sun5i-gr8-evb.dts head/sys/gnu/dts/arm/sun5i-gr8.dtsi head/sys/gnu/dts/arm/sun5i-r8-chip.dts head/sys/gnu/dts/arm/sun5i-r8.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-app4-evb1.dts head/sys/gnu/dts/arm/sun6i-a31-colombus.dts head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31-i7.dts head/sys/gnu/dts/arm/sun6i-a31-m9.dts head/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-cs908.dts head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s-core.dtsi head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts head/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-m3.dts head/sys/gnu/dts/arm/sun7i-a20-mk808c.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23-evb.dts head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts head/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-common-regulators.dtsi head/sys/gnu/dts/arm/sunxi-reference-design-tablet.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi head/sys/gnu/dts/arm/uniphier-pro4-ace.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi head/sys/gnu/dts/arm/uniphier-sld3-ref.dts head/sys/gnu/dts/arm/uniphier-sld3.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/versatile-pb.dts head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm/vexpress-v2m.dtsi head/sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts head/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts head/sys/gnu/dts/arm/vexpress-v2p-ca5s.dts head/sys/gnu/dts/arm/vexpress-v2p-ca9.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a73a4-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7792-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7793-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7794-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sun50i-a64-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-h3-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/pinctrl/hisi.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt7623-pinfunc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7795-sysc.h head/sys/gnu/dts/include/dt-bindings/reset/mt2701-resets.h head/sys/gnu/dts/include/dt-bindings/reset/sun8i-h3-ccu.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/alpine.dtsi ============================================================================== --- head/sys/gnu/dts/arm/alpine.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/alpine.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -41,28 +41,28 @@ compatible = "arm,cortex-a15"; device_type = "cpu"; reg = <0>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <1700000000>; }; cpu@1 { compatible = "arm,cortex-a15"; device_type = "cpu"; reg = <1>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <1700000000>; }; cpu@2 { compatible = "arm,cortex-a15"; device_type = "cpu"; reg = <2>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <1700000000>; }; cpu@3 { compatible = "arm,cortex-a15"; device_type = "cpu"; reg = <3>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <1700000000>; }; }; @@ -81,7 +81,7 @@ , , ; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <50000000>; }; /* Interrupt Controller */ @@ -120,26 +120,26 @@ ; }; - uart0:uart@fd883000 { + uart0: uart@fd883000 { compatible = "ns16550a"; reg = <0x0 0xfd883000 0x0 0x1000>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <375000000>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; }; - uart1:uart@0xfd884000 { + uart1: uart@fd884000 { compatible = "ns16550a"; reg = <0x0 0xfd884000 0x0 0x1000>; - clock-frequency = <0>; /* Filled by loader */ + clock-frequency = <375000000>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; }; /* Internal PCIe Controller */ - pcie-internal@0xfbc00000 { + pcie@fbc00000 { compatible = "pci-host-ecam-generic"; device_type = "pci"; #size-cells = <2>; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -14,6 +14,7 @@ /dts-v1/; #include "am335x-baltos.dtsi" +#include "am335x-baltos-leds.dtsi" / { model = "OnRISC Baltos iR 2110"; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -14,6 +14,7 @@ /dts-v1/; #include "am335x-baltos.dtsi" +#include "am335x-baltos-leds.dtsi" / { model = "OnRISC Baltos iR 3220"; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -14,6 +14,7 @@ /dts-v1/; #include "am335x-baltos.dtsi" +#include "am335x-baltos-leds.dtsi" / { model = "OnRISC Baltos iR 5221"; Copied: head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi (from r320832, vendor/device-tree/dist/src/arm/am335x-baltos-leds.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi Sun Jul 9 13:53:32 2017 (r320834, copy of r320832, vendor/device-tree/dist/src/arm/am335x-baltos-leds.dtsi) @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * VScom OnRISC + * http://www.vscom.de + */ + +/*#include "am33xx.dtsi"*/ + +/ { + leds { + pinctrl-names = "default"; + pinctrl-0 = <&user_leds>; + + compatible = "gpio-leds"; + + power { + label = "onrisc:red:power"; + linux,default-trigger = "default-on"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + wlan { + label = "onrisc:blue:wlan"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + app { + label = "onrisc:green:app"; + gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + user_leds: pinmux_user_leds { + pinctrl-single,pins = < + AM33XX_IOPAD(0x908, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_col.gpio3_0 PWR LED */ + AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_txd3.gpio0_16 WLAN LED */ + AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_txd2.gpio0_17 APP LED */ + >; + }; +}; Modified: head/sys/gnu/dts/arm/am335x-boneblack.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-boneblack.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -15,3 +15,14 @@ model = "TI AM335x BeagleBone Black"; compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; }; + +&cpu0_opp_table { + /* + * All PG 2.0 silicon may not support 1GHz but some of the early + * BeagleBone Blacks have PG 2.0 silicon which is guaranteed + * to support 1GHz OPP so enable it for PG 2.0 on this board. + */ + oppnitro@1000000000 { + opp-supported-hw = <0x06 0x0100>; + }; +}; Modified: head/sys/gnu/dts/arm/am335x-icev2.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-icev2.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-icev2.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -201,6 +201,69 @@ AM33XX_IOPAD(0x938, PIN_OUTPUT_PULLUP | MUX_MODE1) /* (L16) gmii1_rxd2.uart3_txd */ >; }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1, RMII mode */ + AM33XX_IOPAD(0x90c, (PIN_INPUT_PULLUP | MUX_MODE1)) /* mii1_crs.rmii1_crs_dv */ + AM33XX_IOPAD(0x944, (PIN_INPUT_PULLUP | MUX_MODE0)) /* rmii1_refclk.rmii1_refclk */ + AM33XX_IOPAD(0x940, (PIN_INPUT_PULLUP | MUX_MODE1)) /* mii1_rxd0.rmii1_rxd0 */ + AM33XX_IOPAD(0x93c, (PIN_INPUT_PULLUP | MUX_MODE1)) /* mii1_rxd1.rmii1_rxd1 */ + AM33XX_IOPAD(0x910, (PIN_INPUT_PULLUP | MUX_MODE1)) /* mii1_rxerr.rmii1_rxerr */ + AM33XX_IOPAD(0x928, (PIN_OUTPUT_PULLDOWN | MUX_MODE1)) /* mii1_txd0.rmii1_txd0 */ + AM33XX_IOPAD(0x924, (PIN_OUTPUT_PULLDOWN | MUX_MODE1)) /* mii1_txd1.rmii1_txd1 */ + AM33XX_IOPAD(0x914, (PIN_OUTPUT_PULLDOWN | MUX_MODE1)) /* mii1_txen.rmii1_txen */ + /* Slave 2, RMII mode */ + AM33XX_IOPAD(0x870, (PIN_INPUT_PULLUP | MUX_MODE3)) /* gpmc_wait0.rmii2_crs_dv */ + AM33XX_IOPAD(0x908, (PIN_INPUT_PULLUP | MUX_MODE1)) /* mii1_col.rmii2_refclk */ + AM33XX_IOPAD(0x86c, (PIN_INPUT_PULLUP | MUX_MODE3)) /* gpmc_a11.rmii2_rxd0 */ + AM33XX_IOPAD(0x868, (PIN_INPUT_PULLUP | MUX_MODE3)) /* gpmc_a10.rmii2_rxd1 */ + AM33XX_IOPAD(0x874, (PIN_INPUT_PULLUP | MUX_MODE3)) /* gpmc_wpn.rmii2_rxerr */ + AM33XX_IOPAD(0x854, (PIN_OUTPUT_PULLDOWN | MUX_MODE3)) /* gpmc_a5.rmii2_txd0 */ + AM33XX_IOPAD(0x850, (PIN_OUTPUT_PULLDOWN | MUX_MODE3)) /* gpmc_a4.rmii2_txd1 */ + AM33XX_IOPAD(0x840, (PIN_OUTPUT_PULLDOWN | MUX_MODE3)) /* gpmc_a0.rmii2_txen */ + >; + }; + + cpsw_sleep: cpsw_sleep { + pinctrl-single,pins = < + /* Slave 1 reset value */ + AM33XX_IOPAD(0x90c, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x944, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x940, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x93c, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x910, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x928, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x924, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x914, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + + /* Slave 2 reset value */ + AM33XX_IOPAD(0x870, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x908, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x86c, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x868, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x874, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x854, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x850, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x840, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + AM33XX_IOPAD(0x948, (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, (PIN_OUTPUT_PULLUP | MUX_MODE0)) /* mdio_clk.mdio_clk */ + >; + }; + + davinci_mdio_sleep: davinci_mdio_sleep { + pinctrl-single,pins = < + /* MDIO reset value */ + AM33XX_IOPAD(0x948, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + AM33XX_IOPAD(0x94c, (PIN_INPUT_PULLDOWN | MUX_MODE7)) + >; + }; }; &i2c0 { @@ -245,6 +308,39 @@ spi-max-frequency = <1000000>; spi-cpol; }; + + spi_nor: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "winbond,w25q64", "jedec,spi-nor"; + spi-max-frequency = <80000000>; + m25p,fast-read; + reg = <0>; + + partition@0 { + label = "u-boot-spl"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@1 { + label = "u-boot"; + reg = <0x80000 0x100000>; + read-only; + }; + + partition@2 { + label = "u-boot-env"; + reg = <0x180000 0x20000>; + read-only; + }; + + partition@3 { + label = "misc"; + reg = <0x1A0000 0x660000>; + }; + }; + }; &tscadc { @@ -349,4 +445,62 @@ pinctrl-names = "default"; pinctrl-0 = <&uart3_pins_default>; status = "okay"; +}; + +&gpio3 { + p4 { + gpio-hog; + gpios = <4 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "PR1_MII_CTRL"; + }; + + p10 { + gpio-hog; + gpios = <10 GPIO_ACTIVE_HIGH>; + /* ETH1 mux: Low for MII-PRU, high for RMII-CPSW */ + output-high; + line-name = "MUX_MII_CTL1"; + }; +}; + +&cpsw_emac0 { + phy-handle = <ðphy0>; + phy-mode = "rmii"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + phy-handle = <ðphy1>; + phy-mode = "rmii"; + dual_emac_res_vlan = <2>; +}; + +&mac { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; + status = "okay"; + dual_emac; +}; + +&phy_sel { + rmii-clock-ext; +}; + +&davinci_mdio { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&davinci_mdio_default>; + pinctrl-1 = <&davinci_mdio_sleep>; + status = "okay"; + reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + reset-delay-us = <2>; /* PHY datasheet states 1uS min */ + + ethphy0: ethernet-phy@1 { + reg = <1>; + }; + + ethphy1: ethernet-phy@3 { + reg = <3>; + }; }; Modified: head/sys/gnu/dts/arm/am335x-sl50.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-sl50.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am335x-sl50.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -220,7 +220,7 @@ mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x96c, PIN_INPUT | MUX_MODE7) /* uart0_rtsn.gpio1_9 */ >; }; @@ -280,10 +280,6 @@ AM33XX_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE7) /* nKbdReset - gpmc_ad13.gpio1_13 */ AM33XX_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE7) /* nDispReset - gpmc_ad14.gpio1_14 */ AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7) /* USB1_enPower - gpmc_a1.gpio1_17 */ - /* AVR Programming - SPI Bus (bit bang) - Screen and Keyboard */ - AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattMOSI spi0_d0.gpio0_3 */ - AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattMISO spi0_d1.gpio0_4 */ - AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattSCLK spi0_clk.gpio0_2 */ /* PDI Bus - Battery system */ AM33XX_IOPAD(0x840, PIN_INPUT_PULLUP | MUX_MODE7) /* nBattReset gpmc_a0.gpio1_16 */ AM33XX_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE7) /* BattPDIData gpmc_ad15.gpio1_15 */ @@ -384,7 +380,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; bus-width = <4>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + cd-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; vmmc-supply = <&vmmcsd_fixed>; }; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am33xx.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -46,24 +46,85 @@ device_type = "cpu"; reg = <0>; - /* - * To consider voltage drop between PMIC and SoC, - * tolerance value is reduced to 2% from 4% and - * voltage value is increased as a precaution. - */ - operating-points = < - /* kHz uV */ - 720000 1285000 - 600000 1225000 - 500000 1125000 - 275000 1125000 - >; - voltage-tolerance = <2>; /* 2 percentage */ + operating-points-v2 = <&cpu0_opp_table>; clocks = <&dpll_mpu_ck>; clock-names = "cpu"; clock-latency = <300000>; /* From omap-cpufreq driver */ + }; + }; + + cpu0_opp_table: opp-table { + compatible = "operating-points-v2-ti-cpu"; + syscon = <&scm_conf>; + + /* + * The three following nodes are marked with opp-suspend + * because the can not be enabled simultaneously on a + * single SoC. + */ + opp50@300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <950000 931000 969000>; + opp-supported-hw = <0x06 0x0010>; + opp-suspend; + }; + + opp100@275000000 { + opp-hz = /bits/ 64 <275000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0x00FF>; + opp-suspend; + }; + + opp100@300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0020>; + opp-suspend; + }; + + opp100@500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp100@600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1100000 1078000 1122000>; + opp-supported-hw = <0x06 0x0040>; + }; + + opp120@600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + opp120@720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1200000 1176000 1224000>; + opp-supported-hw = <0x06 0x0080>; + }; + + oppturbo@720000000 { + opp-hz = /bits/ 64 <720000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x01 0xFFFF>; + }; + + oppturbo@800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1260000 1234800 1285200>; + opp-supported-hw = <0x06 0x0100>; + }; + + oppnitro@1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <1325000 1298500 1351500>; + opp-supported-hw = <0x04 0x0200>; }; }; Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am3517.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -13,6 +13,7 @@ / { aliases { serial3 = &uart4; + can = &hecc; }; ocp@68000000 { @@ -71,6 +72,17 @@ interrupt-controller; pinctrl-single,register-width = <16>; pinctrl-single,function-mask = <0xff1f>; + }; + + hecc: can@5c050000 { + compatible = "ti,am3517-hecc"; + status = "disabled"; + reg = <0x5c050000 0x80>, + <0x5c053000 0x180>, + <0x5c052000 0x200>; + reg-names = "hecc", "hecc-ram", "mbx"; + interrupts = <24>; + clocks = <&hecc_ck>; }; }; }; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am4372.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -50,15 +50,14 @@ clock-names = "cpu"; operating-points-v2 = <&cpu0_opp_table>; - ti,syscon-efuse = <&scm_conf 0x610 0x3f 0>; - ti,syscon-rev = <&scm_conf 0x600>; clock-latency = <300000>; /* From omap-cpufreq driver */ }; }; - cpu0_opp_table: opp_table0 { - compatible = "operating-points-v2"; + cpu0_opp_table: opp-table { + compatible = "operating-points-v2-ti-cpu"; + syscon = <&scm_conf>; opp50@300000000 { opp-hz = /bits/ 64 <300000000>; Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Sun Jul 9 13:53:32 2017 (r320834) @@ -501,6 +501,21 @@ AM4372_IOPAD(0x884, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn2.gpio1_31 */ >; }; + + uart0_pins_default: uart0_pins_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x968, PIN_INPUT | MUX_MODE0) /* uart0_ctsn.uart0_ctsn */ + AM4372_IOPAD(0x96C, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_rtsn.uart0_rtsn */ + AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM4372_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; +}; + +&uart0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_default>; }; &i2c0 { Modified: head/sys/gnu/dts/arm/am57xx-idk-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am57xx-idk-common.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/am57xx-idk-common.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -101,6 +101,22 @@ }; }; +&dra7_pmx_core { + dcan1_pins_default: dcan1_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37d0, PIN_OUTPUT_PULLUP | MUX_MODE0) /* dcan1_tx */ + DRA7XX_CORE_IOPAD(0x37d4, PIN_INPUT_PULLUP | MUX_MODE0) /* dcan1_rx */ + >; + }; + + dcan1_pins_sleep: dcan1_pins_sleep { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37d0, MUX_MODE15 | PULL_UP) /* dcan1_tx.off */ + DRA7XX_CORE_IOPAD(0x37d4, MUX_MODE15 | PULL_UP) /* dcan1_rx.off */ + >; + }; +}; + &i2c1 { status = "okay"; clock-frequency = <400000>; @@ -389,6 +405,14 @@ bus-width = <8>; ti,non-removable; max-frequency = <96000000>; +}; + +&dcan1 { + status = "okay"; + pinctrl-names = "default", "sleep", "active"; + pinctrl-0 = <&dcan1_pins_sleep>; + pinctrl-1 = <&dcan1_pins_sleep>; + pinctrl-2 = <&dcan1_pins_default>; }; &qspi { Copied: head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts (from r320832, vendor/device-tree/dist/src/arm/armada-385-linksys-shelby.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts Sun Jul 9 13:53:32 2017 (r320834, copy of r320832, vendor/device-tree/dist/src/arm/armada-385-linksys-shelby.dts) @@ -0,0 +1,114 @@ +/* + * Device Tree file for the Linksys WRT1900ACS (Shelby) + * + * Copyright (C) 2015 Imre Kaloz + * + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "armada-385-linksys.dtsi" + +/ { + model = "Linksys WRT1900ACS"; + compatible = "linksys,shelby", "linksys,armada385", "marvell,armada385", + "marvell,armada380"; + + soc { + internal-regs{ + i2c@11000 { + + pca9635@68 { + #address-cells = <1>; + #size-cells = <0>; + + wan_amber@0 { + label = "shelby:amber:wan"; + reg = <0x0>; + }; + + wan_white@1 { + label = "shelby:white:wan"; + reg = <0x1>; + }; + + wlan_2g@2 { + label = "shelby:white:wlan_2g"; + reg = <0x2>; + }; + + wlan_5g@3 { + label = "shelby:white:wlan_5g"; + reg = <0x3>; + }; + + usb2@5 { + label = "shelby:white:usb2"; + reg = <0x5>; + }; + + usb3_1@6 { + label = "shelby:white:usb3_1"; + reg = <0x6>; + }; + + usb3_2@7 { + label = "shelby:white:usb3_2"; + reg = <0x7>; + }; + + wps_white@8 { + label = "shelby:white:wps"; + reg = <0x8>; + }; + + wps_amber@9 { + label = "shelby:amber:wps"; + reg = <0x9>; + }; + }; + }; + }; + }; + + gpio-leds { + power { + label = "shelby:white:power"; + }; + + sata { + label = "shelby:white:sata"; + }; + }; +}; Modified: head/sys/gnu/dts/arm/armada-385-linksys.dtsi ============================================================================== --- head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sun Jul 9 13:13:50 2017 (r320833) +++ head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sun Jul 9 13:53:32 2017 (r320834) @@ -59,7 +59,8 @@ ranges = ; + MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 + MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; internal-regs { i2c@11000 { @@ -88,6 +89,9 @@ ethernet@70000 { status = "okay"; phy-mode = "rgmii-id"; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; fixed-link { speed = <1000>; full-duplex; @@ -97,6 +101,9 @@ ethernet@34000 { status = "okay"; phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + bm,pool-short = <1>; fixed-link { speed = <1000>; full-duplex; @@ -159,6 +166,10 @@ status = "okay"; }; + bm@c8000 { + status = "okay"; + }; + /* USB part of the eSATA/USB 2.0 port */ usb@58000 { status = "okay"; @@ -241,6 +252,10 @@ }; }; + bm-bppi { + status = "okay"; + }; + pcie-controller { status = "okay"; @@ -305,6 +320,7 @@ sata { gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; default-state = "off"; + linux,default-trigger = "disk-activity"; }; }; Copied: head/sys/gnu/dts/arm/armada-385-synology-ds116.dts (from r320832, vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/armada-385-synology-ds116.dts Sun Jul 9 13:53:32 2017 (r320834, copy of r320832, vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts) @@ -0,0 +1,321 @@ +/* + * Device Tree file for Synology DS116 NAS + * + * Copyright (C) 2017 Willy Tarreau + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "armada-385.dtsi" +#include + +/ { + model = "Synology DS116"; + compatible = "marvell,a385-gp", "marvell,armada385", "marvell,armada380"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x40000000>; /* 1 GB */ + }; + + soc { + ranges = ; + + internal-regs { + i2c@11000 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + clock-frequency = <100000>; + + eeprom@57 { + compatible = "atmel,24c64"; + reg = <0x57>; + }; + }; + + serial@12000 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; + }; + + serial@12100 { + /* A PIC16F1829 is connected to uart1 at 9600 bps, + * and takes single-character orders : + * "1" : power off // already handled by the poweroff node + * "2" : short beep + * "3" : long beep + * "4" : turn the power LED ON + * "5" : flash the power LED + * "6" : turn the power LED OFF + * "7" : turn the status LED OFF + * "8" : turn the status LED ON + * "9" : flash the status LED + * "A" : flash the motherboard LED (D8) + * "B" : turn the motherboard LED OFF + * "C" : hard reset + */ + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; + }; + + poweroff@12100 { + compatible = "synology,power-off"; + reg = <0x12100 0x100>; + clocks = <&coreclk 0>; + }; + + ethernet@70000 { + pinctrl-names = "default"; + phy = <&phy0>; + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + status = "okay"; + }; + + + mdio@72004 { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + phy0: ethernet-phy@1 { + reg = <1>; + }; + }; + + sata@a8000 { + pinctrl-names = "default"; + pinctrl-0 = <&sata0_pins>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + sata0: sata-port@0 { + reg = <0>; + target-supply = <®_5v_sata0>; + }; + }; + + bm@c8000 { + status = "okay"; + }; + + usb3@f0000 { + usb-phy = <&usb3_0_phy>; + status = "okay"; + }; + + usb3@f8000 { + usb-phy = <&usb3_1_phy>; + status = "okay"; + }; + }; + + bm-bppi { + status = "okay"; + }; + + gpio-fan { + compatible = "gpio-fan"; + gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>, + <&gpio1 17 GPIO_ACTIVE_HIGH>, + <&gpio1 16 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = < 0 0 + 1500 1 + 2500 2 + 3000 3 + 3400 4 + 3700 5 + 3900 6 + 4000 7>; + cooling-cells = <2>; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* The green part is on gpio0.20 which is also used by + * sata0, and accesses to SATA disk 0 make it blink so it + * doesn't need to be declared here. + */ + orange { + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + label = "ds116:orange:disk"; + default-state = "off"; + }; + }; + }; + + usb3_0_phy: usb3_0_phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <®_usb3_0_vbus>; + }; + + usb3_1_phy: usb3_1_phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <®_usb3_1_vbus>; + }; + + reg_usb3_0_vbus: usb3-vbus0 { + compatible = "regulator-fixed"; + regulator-name = "usb3-vbus0"; + pinctrl-names = "default"; + pinctrl-0 = <&xhci0_vbus_pins>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>; + }; + + reg_usb3_1_vbus: usb3-vbus1 { + compatible = "regulator-fixed"; + regulator-name = "usb3-vbus1"; + pinctrl-names = "default"; + pinctrl-0 = <&xhci1_vbus_pins>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 9 13:56:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0587DB28FB; Sun, 9 Jul 2017 13:56:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCFEE287; Sun, 9 Jul 2017 13:56:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69DuYfA019614; Sun, 9 Jul 2017 13:56:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69DuYcJ019611; Sun, 9 Jul 2017 13:56:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707091356.v69DuYcJ019611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 9 Jul 2017 13:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320835 - head/sys/boot/fdt/dts/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/boot/fdt/dts/arm X-SVN-Commit-Revision: 320835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 13:56:36 -0000 Author: manu Date: Sun Jul 9 13:56:34 2017 New Revision: 320835 URL: https://svnweb.freebsd.org/changeset/base/320835 Log: dts: arm: Fix our local patches for H3 sun4i-a10.h is not included anymore, define directly the drive strengh of the pins. Modified: head/sys/boot/fdt/dts/arm/h3.dtsi head/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts Modified: head/sys/boot/fdt/dts/arm/h3.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/h3.dtsi Sun Jul 9 13:53:32 2017 (r320834) +++ head/sys/boot/fdt/dts/arm/h3.dtsi Sun Jul 9 13:56:34 2017 (r320835) @@ -96,14 +96,12 @@ "PD7", "PD8", "PD9", "PD10", "PD12", "PD13", "PD15", "PD16", "PD17"; allwinner,function = "emac"; - allwinner,drive = ; - allwinner,pull = ; + allwinner,drive = <40>; }; emac_phy_reset_pin: emac_phy_reset_pin@0 { allwinner,pins = "PD6"; allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; + allwinner,drive = <10>; }; }; Modified: head/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts Sun Jul 9 13:53:32 2017 (r320834) +++ head/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts Sun Jul 9 13:56:34 2017 (r320835) @@ -50,15 +50,13 @@ emac_phy_reset_pin: emac_phy_reset_pin@0 { allwinner,pins = "PD6"; allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; + allwinner,drive = <10>; }; codec_pa_pin: codec_pa_pin@0 { allwinner,pins = "PA16"; allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; + allwinner,drive = <10>; }; }; From owner-svn-src-all@freebsd.org Sun Jul 9 14:15:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF70ADB2E3F; Sun, 9 Jul 2017 14:15:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E47AFEE; Sun, 9 Jul 2017 14:15:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69EFphQ027524; Sun, 9 Jul 2017 14:15:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69EFpbN027523; Sun, 9 Jul 2017 14:15:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707091415.v69EFpbN027523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 9 Jul 2017 14:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320836 - head/sys/fs/fdescfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/fs/fdescfs X-SVN-Commit-Revision: 320836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 14:15:52 -0000 Author: dchagin Date: Sun Jul 9 14:15:51 2017 New Revision: 320836 URL: https://svnweb.freebsd.org/changeset/base/320836 Log: Eliminate the bogus casts. MFC after: 3 weeks Modified: head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 9 13:56:34 2017 (r320835) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 9 14:15:51 2017 (r320836) @@ -162,7 +162,7 @@ loop: * If a forced unmount is progressing, we need to drop it. The flags are * protected by the hashmtx. */ - fmp = (struct fdescmount *)mp->mnt_data; + fmp = mp->mnt_data; if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { mtx_unlock(&fdesc_hashmtx); return (-1); @@ -207,7 +207,7 @@ loop: * If a forced unmount is progressing, we need to drop it. The flags are * protected by the hashmtx. */ - fmp = (struct fdescmount *)mp->mnt_data; + fmp = mp->mnt_data; if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { mtx_unlock(&fdesc_hashmtx); vgone(vp); From owner-svn-src-all@freebsd.org Sun Jul 9 14:18:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF232DB2EB4; Sun, 9 Jul 2017 14:18:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EF421165; Sun, 9 Jul 2017 14:18:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69EIM0o027659; Sun, 9 Jul 2017 14:18:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69EIMLY027658; Sun, 9 Jul 2017 14:18:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707091418.v69EIMLY027658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 9 Jul 2017 14:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320837 - head/sys/fs/fdescfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/fs/fdescfs X-SVN-Commit-Revision: 320837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 14:18:23 -0000 Author: dchagin Date: Sun Jul 9 14:18:22 2017 New Revision: 320837 URL: https://svnweb.freebsd.org/changeset/base/320837 Log: Style(9). Whitespace. MFC after: 3 weeks Modified: head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 9 14:15:51 2017 (r320836) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 9 14:18:22 2017 (r320837) @@ -358,7 +358,7 @@ fdesc_lookup(struct vop_lookup_args *ap) error = vn_vget_ino_gen(dvp, fdesc_get_ino_alloc, &arg, LK_EXCLUSIVE, &fvp); } - + if (error) goto bad; *vpp = fvp; From owner-svn-src-all@freebsd.org Sun Jul 9 15:03:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75467D87C58; Sun, 9 Jul 2017 15:03:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36B51260D; Sun, 9 Jul 2017 15:03:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69F3fxt050481; Sun, 9 Jul 2017 15:03:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69F3fSN050480; Sun, 9 Jul 2017 15:03:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707091503.v69F3fSN050480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 9 Jul 2017 15:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320838 - stable/11/sys/fs/ext2fs X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/fs/ext2fs X-SVN-Commit-Revision: 320838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:03:42 -0000 Author: pfg Date: Sun Jul 9 15:03:41 2017 New Revision: 320838 URL: https://svnweb.freebsd.org/changeset/base/320838 Log: MFC r320079: ext2fs: Enable RO huge_file feature support. We have support for reading ext4 "huge" files but we can't write (anything) on ext4. and some filesystem. Formally enable the feature so that we can mount such filesystems. Submitted by: Fedor Uporov Modified: stable/11/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/11/sys/fs/ext2fs/ext2fs.h Sun Jul 9 14:18:22 2017 (r320837) +++ stable/11/sys/fs/ext2fs/ext2fs.h Sun Jul 9 15:03:41 2017 (r320838) @@ -258,6 +258,7 @@ struct csum { #define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ + EXT2F_ROCOMPAT_HUGE_FILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE #define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ From owner-svn-src-all@freebsd.org Sun Jul 9 15:09:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E47D87D03; Sun, 9 Jul 2017 15:09:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A03279D; Sun, 9 Jul 2017 15:09:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69F9FTD051212; Sun, 9 Jul 2017 15:09:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69F9Fdv051211; Sun, 9 Jul 2017 15:09:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707091509.v69F9Fdv051211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 9 Jul 2017 15:09:15 +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: r320839 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/fs/ext2fs X-SVN-Commit-Revision: 320839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:09:16 -0000 Author: pfg Date: Sun Jul 9 15:09:15 2017 New Revision: 320839 URL: https://svnweb.freebsd.org/changeset/base/320839 Log: MFC r320079: ext2fs: Enable RO huge_file feature support. We have support for reading ext4 "huge" files but we can't write (anything) on ext4. and some filesystem. Formally enable the feature so that we can mount such filesystems. Submitted by: Fedor Uporov Modified: stable/10/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Sun Jul 9 15:03:41 2017 (r320838) +++ stable/10/sys/fs/ext2fs/ext2fs.h Sun Jul 9 15:09:15 2017 (r320839) @@ -258,6 +258,7 @@ struct csum { #define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ + EXT2F_ROCOMPAT_HUGE_FILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE #define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ From owner-svn-src-all@freebsd.org Sun Jul 9 15:13:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4701D87EE9; Sun, 9 Jul 2017 15:13:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83B7C2B4A; Sun, 9 Jul 2017 15:13:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69FDen4055474; Sun, 9 Jul 2017 15:13:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69FDeK6055473; Sun, 9 Jul 2017 15:13:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707091513.v69FDeK6055473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 9 Jul 2017 15:13: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: r320840 - stable/11/sys/fs/ext2fs X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/fs/ext2fs X-SVN-Commit-Revision: 320840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:13:41 -0000 Author: pfg Date: Sun Jul 9 15:13:40 2017 New Revision: 320840 URL: https://svnweb.freebsd.org/changeset/base/320840 Log: MFC r320408: ext2fs: Support e2di_uid_high and e2di_gid_high. The fields exist on all versions of the filesystem and using them is a mount option on linux. For FreeBSD, the corresponding i_uid and i_gid are always long enough so use them by default. Reviewed by: Fedor Uporov Modified: stable/11/sys/fs/ext2fs/ext2_inode_cnv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:09:15 2017 (r320839) +++ stable/11/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:13:40 2017 (r320840) @@ -122,6 +122,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) ip->i_gen = ei->e2di_gen; ip->i_uid = ei->e2di_uid; ip->i_gid = ei->e2di_gid; + ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16; + ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; /* XXX use memcpy */ for (i = 0; i < NDADDR; i++) ip->i_db[i] = ei->e2di_blocks[i]; @@ -166,8 +168,10 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_nblock = ip->i_blocks & 0xffffffff; ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; ei->e2di_gen = ip->i_gen; - ei->e2di_uid = ip->i_uid; - ei->e2di_gid = ip->i_gid; + ei->e2di_uid = ip->i_uid & 0xffff; + ei->e2di_uid_high = ip->i_uid >> 16 & 0xffff; + ei->e2di_gid = ip->i_gid & 0xffff; + ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; /* XXX use memcpy */ for (i = 0; i < NDADDR; i++) ei->e2di_blocks[i] = ip->i_db[i]; From owner-svn-src-all@freebsd.org Sun Jul 9 15:14:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56CF6D87F62; Sun, 9 Jul 2017 15:14:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22AE92C7B; Sun, 9 Jul 2017 15:14:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69FEMp2055612; Sun, 9 Jul 2017 15:14:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69FEMIR055611; Sun, 9 Jul 2017 15:14:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707091514.v69FEMIR055611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 9 Jul 2017 15:14:22 +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: r320841 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/fs/ext2fs X-SVN-Commit-Revision: 320841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:14:23 -0000 Author: pfg Date: Sun Jul 9 15:14:22 2017 New Revision: 320841 URL: https://svnweb.freebsd.org/changeset/base/320841 Log: MFC r320408: ext2fs: Support e2di_uid_high and e2di_gid_high. The fields exist on all versions of the filesystem and using them is a mount option on linux. For FreeBSD, the corresponding i_uid and i_gid are always long enough so use them by default. Reviewed by: Fedor Uporov Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:13:40 2017 (r320840) +++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:14:22 2017 (r320841) @@ -122,6 +122,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) ip->i_gen = ei->e2di_gen; ip->i_uid = ei->e2di_uid; ip->i_gid = ei->e2di_gid; + ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16; + ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; /* XXX use memcpy */ for (i = 0; i < NDADDR; i++) ip->i_db[i] = ei->e2di_blocks[i]; @@ -166,8 +168,10 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_nblock = ip->i_blocks & 0xffffffff; ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; ei->e2di_gen = ip->i_gen; - ei->e2di_uid = ip->i_uid; - ei->e2di_gid = ip->i_gid; + ei->e2di_uid = ip->i_uid & 0xffff; + ei->e2di_uid_high = ip->i_uid >> 16 & 0xffff; + ei->e2di_gid = ip->i_gid & 0xffff; + ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; /* XXX use memcpy */ for (i = 0; i < NDADDR; i++) ei->e2di_blocks[i] = ip->i_db[i]; From owner-svn-src-all@freebsd.org Sun Jul 9 15:19:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C909D87FFD; Sun, 9 Jul 2017 15:19:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6432DD0; Sun, 9 Jul 2017 15:19:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69FJS05056281; Sun, 9 Jul 2017 15:19:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69FJStL056280; Sun, 9 Jul 2017 15:19:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707091519.v69FJStL056280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 9 Jul 2017 15:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320842 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 320842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:19:29 -0000 Author: pfg Date: Sun Jul 9 15:19:28 2017 New Revision: 320842 URL: https://svnweb.freebsd.org/changeset/base/320842 Log: Remove stale comments. There's no real advantage in using memcpy here. Dicussed with: bde (long ago) Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:14:22 2017 (r320841) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jul 9 15:19:28 2017 (r320842) @@ -126,7 +126,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) ip->i_gid = ei->e2di_gid; ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16; ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; - /* XXX use memcpy */ + for (i = 0; i < EXT2_NDADDR; i++) ip->i_db[i] = ei->e2di_blocks[i]; for (i = 0; i < EXT2_NIADDR; i++) @@ -176,7 +176,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_uid_high = ip->i_uid >> 16 & 0xffff; ei->e2di_gid = ip->i_gid & 0xffff; ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; - /* XXX use memcpy */ + for (i = 0; i < EXT2_NDADDR; i++) ei->e2di_blocks[i] = ip->i_db[i]; for (i = 0; i < EXT2_NIADDR; i++) From owner-svn-src-all@freebsd.org Sun Jul 9 15:41:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B23DED8D676; Sun, 9 Jul 2017 15:41:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81E403688; Sun, 9 Jul 2017 15:41:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69FfnVh065637; Sun, 9 Jul 2017 15:41:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69FfnqD065636; Sun, 9 Jul 2017 15:41:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707091541.v69FfnqD065636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Jul 2017 15:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320843 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 320843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 15:41:50 -0000 Author: kib Date: Sun Jul 9 15:41:49 2017 New Revision: 320843 URL: https://svnweb.freebsd.org/changeset/base/320843 Log: Fix loop termination in vm_map_find_min(). Reported by: antoine Tested by: Stefan Ehmann , Jan Kokemueller PR: 220493 Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Jul 9 15:19:28 2017 (r320842) +++ head/sys/vm/vm_map.c Sun Jul 9 15:41:49 2017 (r320843) @@ -1571,7 +1571,7 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o find_space, prot, max, cow); if (rv == KERN_SUCCESS || min_addr >= hint) return (rv); - *addr = min_addr; + *addr = hint = min_addr; } } From owner-svn-src-all@freebsd.org Sun Jul 9 16:57:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3394CD90C74; Sun, 9 Jul 2017 16:57:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id F2AF8656EF; Sun, 9 Jul 2017 16:57:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69GvQVI096959; Sun, 9 Jul 2017 16:57:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69GvOar096942; Sun, 9 Jul 2017 16:57:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707091657.v69GvOar096942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 16:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/modules X-SVN-Commit-Revision: 320844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 16:57:27 -0000 Author: imp Date: Sun Jul 9 16:57:24 2017 New Revision: 320844 URL: https://svnweb.freebsd.org/changeset/base/320844 Log: An MMC/SD/SDIO stack using CAM Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's flexible queueing will make it easier to write non-storage drivers than the legacy stack. SDIO drivers from both the kernel and as userland daemons are possible, though much of that functionality will come later. Some of the CAM integration isn't complete (there are sleeps in the device probe state machine, for example), but those minor issues can be improved in-tree more easily than out of tree and shouldn't gate progress on other fronts. Appologies to reviews if specific items have been overlooked. Submitted by: Ilya Bakulin Reviewed by: emaste, imp, mav, adrian, ian Differential Review: https://reviews.freebsd.org/D4761 merge with first commit, various compile hacks. Added: head/sys/amd64/conf/MMCCAM (contents, props changed) head/sys/arm/conf/BEAGLEBONE-MMCCAM (contents, props changed) head/sys/cam/mmc/ head/sys/cam/mmc/mmc.h - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h head/sys/cam/mmc/mmc_all.h - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h head/sys/cam/mmc/mmc_bus.h (contents, props changed) head/sys/cam/mmc/mmc_da.c (contents, props changed) head/sys/cam/mmc/mmc_sdio.c (contents, props changed) head/sys/cam/mmc/mmc_sdio.h - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h head/sys/cam/mmc/mmc_xpt.c (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/lib/libcam/Makefile head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/ti/ti_sdhci.c head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_pass.c head/sys/conf/files head/sys/conf/options head/sys/dev/mmc/bridge.h head/sys/dev/mmc/mmcbrvar.h head/sys/dev/mmc/mmcreg.h head/sys/dev/sdhci/fsl_sdhci.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c head/sys/modules/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Jul 9 15:41:49 2017 (r320843) +++ head/etc/mtree/BSD.include.dist Sun Jul 9 16:57:24 2017 (r320844) @@ -90,6 +90,8 @@ cam ata .. + mmc + .. nvme .. scsi Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Jul 9 15:41:49 2017 (r320843) +++ head/include/Makefile Sun Jul 9 16:57:24 2017 (r320844) @@ -42,7 +42,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdat LDIRS= bsm cam geom net net80211 netgraph netinet netinet6 \ netipsec netsmb nfs nfsclient nfsserver sys vm -LSUBDIRS= cam/ata cam/nvme cam/scsi \ +LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/mmc dev/nvme \ Modified: head/lib/libcam/Makefile ============================================================================== --- head/lib/libcam/Makefile Sun Jul 9 15:41:49 2017 (r320843) +++ head/lib/libcam/Makefile Sun Jul 9 16:57:24 2017 (r320844) @@ -38,6 +38,7 @@ MLINKS+= cam.3 cam_open_device.3 \ .PATH: ${SRCTOP}/sys/cam \ ${SRCTOP}/sys/cam/ata \ + ${SRCTOP}/sys/cam/mmc \ ${SRCTOP}/sys/cam/scsi CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys Added: head/sys/amd64/conf/MMCCAM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/MMCCAM Sun Jul 9 16:57:24 2017 (r320844) @@ -0,0 +1,36 @@ +# MMCCAM is the kernel config for doing MMC on CAM development +# and testing on bhyve +# $FreeBSD$ + +include MINIMAL + +ident MMCCAM + +# Access GPT-formatted and labeled root volume +options GEOM_PART_GPT +options GEOM_LABEL + +# UART -- for bhyve console +device uart + +# kgdb stub +device bvmdebug + +# VirtIO support, needed for bhyve +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + +# CAM-specific stuff +device pass +device scbus +device da +device mmccam + +options MMCCAM +# Add CAMDEBUG stuff +options CAMDEBUG +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DEBUG_TRACE) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jul 9 16:57:24 2017 (r320844) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include "mmcbr_if.h" #include "sdhci_if.h" +#include "opt_mmccam.h" + #include "bcm2835_dma.h" #include #include "bcm2835_vcbus.h" @@ -253,7 +255,11 @@ bcm_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); +#ifdef MMCCAM + sdhci_cam_start_slot(&sc->sc_slot); +#else sdhci_start_slot(&sc->sc_slot); +#endif return (0); Added: head/sys/arm/conf/BEAGLEBONE-MMCCAM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/BEAGLEBONE-MMCCAM Sun Jul 9 16:57:24 2017 (r320844) @@ -0,0 +1,21 @@ +# +# BEAGLEBONE-MMCCAM +# +# Custom kernel for Beaglebone plus MMCCAM as opposed to the prior MMC stack. It is +# present to keep it building in tree since it wouldn't work in LINT. +# +# $FreeBSD$ + +include BEAGLEBONE + +# Add CAMDEBUG stuff +options CAMDEBUG +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DEBUG_TRACE) + +# pass(4) device +device pass +device mmccam +options MMCCAM + +nodevice mmc +nodevice mmcsd Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/arm/ti/ti_sdhci.c Sun Jul 9 16:57:24 2017 (r320844) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -60,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include "gpio_if.h" +#include "opt_mmccam.h" + struct ti_sdhci_softc { device_t dev; struct sdhci_fdt_gpio * gpio; @@ -122,6 +126,11 @@ static struct ofw_compat_data compat_data[] = { #define MMCHS_SD_CAPA_VS30 (1 << 25) #define MMCHS_SD_CAPA_VS33 (1 << 24) +/* Forward declarations, CAM-relataed */ +// static void ti_sdhci_cam_poll(struct cam_sim *); +// static void ti_sdhci_cam_action(struct cam_sim *, union ccb *); +// static int ti_sdhci_cam_settran_settings(struct ti_sdhci_softc *sc, union ccb *); + static inline uint32_t ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) { @@ -241,6 +250,22 @@ ti_sdhci_write_1(device_t dev, struct sdhci_slot *slot struct ti_sdhci_softc *sc = device_get_softc(dev); uint32_t val32; +#ifdef MMCCAM + uint32_t newval32; + if (off == SDHCI_HOST_CONTROL) { + val32 = ti_mmchs_read_4(sc, MMCHS_CON); + newval32 = val32; + if (val & SDHCI_CTRL_8BITBUS) { + device_printf(dev, "Custom-enabling 8-bit bus\n"); + newval32 |= MMCHS_CON_DW8; + } else { + device_printf(dev, "Custom-disabling 8-bit bus\n"); + newval32 &= ~MMCHS_CON_DW8; + } + if (newval32 != val32) + ti_mmchs_write_4(sc, MMCHS_CON, newval32); + } +#endif val32 = RD4(sc, off & ~3); val32 &= ~(0xff << (off & 3) * 8); val32 |= (val << (off & 3) * 8); @@ -658,8 +683,11 @@ ti_sdhci_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); +#ifdef MMCCAM + sdhci_cam_start_slot(&sc->slot); +#else sdhci_start_slot(&sc->slot); - +#endif return (0); fail: @@ -730,4 +758,7 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, NULL, NULL); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); + +#ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_ti); +#endif Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/cam/cam_ccb.h Sun Jul 9 16:57:24 2017 (r320844) @@ -42,6 +42,7 @@ #include #include #include +#include /* General allocation length definitions for CCB structures */ #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB bytes/pointer */ @@ -208,10 +209,10 @@ typedef enum { XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, /* Execiute the requestred NVMe I/O operation */ - XPT_MMCSD_IO = 0x1d | XPT_FC_DEV_QUEUED, + XPT_MMC_IO = 0x1d | XPT_FC_DEV_QUEUED, /* Placeholder for MMC / SD / SDIO I/O stuff */ - XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB + XPT_SCAN_TGT = 0x1e | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /* Scan Target */ @@ -267,6 +268,7 @@ typedef enum { PROTO_SATAPM, /* SATA Port Multiplier */ PROTO_SEMB, /* SATA Enclosure Management Bridge */ PROTO_NVME, /* NVME */ + PROTO_MMCSD, /* MMC, SD, SDIO */ } cam_proto; typedef enum { @@ -283,6 +285,7 @@ typedef enum { XPORT_ISCSI, /* iSCSI */ XPORT_SRP, /* SCSI RDMA Protocol */ XPORT_NVME, /* NVMe over PCIe */ + XPORT_MMCSD, /* MMC, SD, SDIO card */ } cam_xport; #define XPORT_IS_NVME(t) ((t) == XPORT_NVME) @@ -498,6 +501,7 @@ struct device_match_result { cam_proto protocol; struct scsi_inquiry_data inq_data; struct ata_params ident_data; + struct mmc_params mmc_ident_data; dev_result_flags flags; }; @@ -773,6 +777,16 @@ struct ccb_ataio { uint32_t unused; }; +/* + * MMC I/O Request CCB used for the XPT_MMC_IO function code. + */ +struct ccb_mmcio { + struct ccb_hdr ccb_h; + union ccb *next_ccb; /* Ptr for next CCB for action */ + struct mmc_command cmd; + struct mmc_command stop; +}; + struct ccb_accept_tio { struct ccb_hdr ccb_h; cdb_t cdb_io; /* Union for CDB bytes/pointer */ @@ -1005,7 +1019,28 @@ struct ccb_trans_settings_nvme u_int max_xfer; /* Max transfer size (0 -> unlimited */ u_int caps; }; - + +#include +struct ccb_trans_settings_mmc { + struct mmc_ios ios; +#define MMC_CLK (1 << 1) +#define MMC_VDD (1 << 2) +#define MMC_CS (1 << 3) +#define MMC_BW (1 << 4) +#define MMC_PM (1 << 5) +#define MMC_BT (1 << 6) +#define MMC_BM (1 << 7) + uint32_t ios_valid; +/* The folowing is used only for GET_TRAN_SETTINGS */ + uint32_t host_ocr; + int host_f_min; + int host_f_max; +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ +#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ + uint32_t host_caps; +}; + /* Get/Set transfer rate/width/disconnection/tag queueing settings */ struct ccb_trans_settings { struct ccb_hdr ccb_h; @@ -1019,6 +1054,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_ata ata; struct ccb_trans_settings_scsi scsi; struct ccb_trans_settings_nvme nvme; + struct ccb_trans_settings_mmc mmc; } proto_specific; union { u_int valid; /* Which fields to honor */ @@ -1284,6 +1320,7 @@ union ccb { struct ccb_dev_advinfo cdai; struct ccb_async casync; struct ccb_nvmeio nvmeio; + struct ccb_mmcio mmcio; }; #define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ @@ -1327,6 +1364,13 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t retri uint32_t timeout); static __inline void +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, + struct mmc_data *mmc_d, + uint32_t timeout); + +static __inline void cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, @@ -1412,6 +1456,34 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t retri smpio->smp_request_len = smp_request_len; smpio->smp_response = smp_response; smpio->smp_response_len = smp_response_len; +} + +static __inline void +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, + struct mmc_data *mmc_d, + uint32_t timeout) +{ + mmcio->ccb_h.func_code = XPT_MMC_IO; + mmcio->ccb_h.flags = flags; + mmcio->ccb_h.retry_count = retries; + mmcio->ccb_h.cbfcnp = cbfcnp; + mmcio->ccb_h.timeout = timeout; + mmcio->cmd.opcode = mmc_opcode; + mmcio->cmd.arg = mmc_arg; + mmcio->cmd.flags = mmc_flags; + mmcio->stop.opcode = 0; + mmcio->stop.arg = 0; + mmcio->stop.flags = 0; + if (mmc_d != NULL) { + mmcio->cmd.data = mmc_d; + } else + mmcio->cmd.data = NULL; + mmcio->cmd.resp[0] = 0; + mmcio->cmd.resp[1] = 0; + mmcio->cmd.resp[2] = 0; + mmcio->cmd.resp[3] = 0; } static __inline void Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/cam/cam_periph.c Sun Jul 9 16:57:24 2017 (r320844) @@ -827,6 +827,18 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; numbufs = 1; break; + case XPT_MMC_IO: + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) + return(0); + /* Two mappings: one for cmd->data and one for cmd->data->data */ + data_ptrs[0] = (unsigned char **)&ccb->mmcio.cmd.data; + lengths[0] = sizeof(struct mmc_data *); + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + data_ptrs[1] = (unsigned char **)&ccb->mmcio.cmd.data->data; + lengths[1] = ccb->mmcio.cmd.data->len; + dirs[1] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 2; + break; case XPT_SMP_IO: data_ptrs[0] = &ccb->smpio.smp_request; lengths[0] = ccb->smpio.smp_request_len; Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/cam/cam_xpt.c Sun Jul 9 16:57:24 2017 (r320844) @@ -329,7 +329,6 @@ static xpt_devicefunc_t xptsetasyncfunc; static xpt_busfunc_t xptsetasyncbusfunc; static cam_status xptregister(struct cam_periph *periph, void *arg); -static const char * xpt_action_name(uint32_t action); static __inline int device_is_queued(struct cam_ed *device); static __inline int @@ -412,7 +411,7 @@ xptioctl(struct cdev *dev, u_long cmd, caddr_t addr, i } return (error); } - + static int xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { @@ -820,6 +819,8 @@ xpt_scanner_thread(void *dummy) TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_unlock_buses(); + printf("xpt_scanner_thread is firing on path "); + xpt_print_path(ccb->ccb_h.path);printf("\n"); /* * Since lock can be dropped inside and path freed * by completion callback even before return here, @@ -1503,7 +1504,7 @@ xptdevicematch(struct dev_match_pattern *patterns, u_i cur_pattern = &patterns[i].pattern.device_pattern; - /* Error out if mutually exclusive options are specified. */ + /* Error out if mutually exclusive options are specified. */ if ((cur_pattern->flags & (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) == (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) return(DM_RET_ERROR); @@ -1905,6 +1906,9 @@ xptedtdevicefunc(struct cam_ed *device, void *arg) bcopy(&device->ident_data, &cdm->matches[j].result.device_result.ident_data, sizeof(struct ata_params)); + bcopy(&device->mmc_ident_data, + &cdm->matches[j].result.device_result.mmc_ident_data, + sizeof(struct mmc_params)); /* Let the user know whether this device is unconfigured */ if (device->flags & CAM_DEV_UNCONFIGURED) @@ -2690,6 +2694,8 @@ xpt_action_default(union ccb *start_ccb) if (start_ccb->ccb_h.func_code == XPT_NVME_IO) start_ccb->nvmeio.resid = 0; /* FALLTHROUGH */ + case XPT_MMC_IO: + /* XXX just like nmve_io? */ case XPT_RESET_DEV: case XPT_ENG_EXEC: case XPT_SMP_IO: @@ -2801,11 +2807,12 @@ call_sim: mtx_lock(mtx); else mtx = NULL; + CAM_DEBUG(path, CAM_DEBUG_TRACE, - ("sim->sim_action: func=%#x\n", start_ccb->ccb_h.func_code)); + ("Calling sim->sim_action(): func=%#x\n", start_ccb->ccb_h.func_code)); (*(sim->sim_action))(sim, start_ccb); CAM_DEBUG(path, CAM_DEBUG_TRACE, - ("sim->sim_action: status=%#x\n", start_ccb->ccb_h.status)); + ("sim->sim_action returned: status=%#x\n", start_ccb->ccb_h.status)); if (mtx) mtx_unlock(mtx); break; @@ -5540,7 +5547,7 @@ static struct kv map[] = { { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, { XPT_NVME_IO, "XPT_NVME_IO" }, - { XPT_MMCSD_IO, "XPT_MMCSD_IO" }, + { XPT_MMC_IO, "XPT_MMC_IO" }, { XPT_SMP_IO, "XPT_SMP_IO" }, { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, { XPT_ENG_INQ, "XPT_ENG_INQ" }, @@ -5556,7 +5563,7 @@ static struct kv map[] = { { 0, 0 } }; -static const char * +const char * xpt_action_name(uint32_t action) { static char buffer[32]; /* Only for unknown messages -- racy */ Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/cam/cam_xpt.h Sun Jul 9 16:57:24 2017 (r320844) @@ -141,6 +141,8 @@ void xpt_copy_path(struct cam_path *new_path, void xpt_release_path(struct cam_path *path); +const char * xpt_action_name(uint32_t action); + #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Sun Jul 9 15:41:49 2017 (r320843) +++ head/sys/cam/cam_xpt_internal.h Sun Jul 9 16:57:24 2017 (r320844) @@ -125,6 +125,7 @@ struct cam_ed { uint32_t rcap_len; uint8_t *rcap_buf; struct ata_params ident_data; + struct mmc_params mmc_ident_data; u_int8_t inq_flags; /* * Current settings for inquiry flags. * This allows us to override settings Copied and modified: head/sys/cam/mmc/mmc.h (from r320843, head/sys/dev/mmc/mmcbrvar.h) ============================================================================== --- head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 (r320843, copy source) +++ head/sys/cam/mmc/mmc.h Sun Jul 9 16:57:24 2017 (r320844) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006 Bernd Walter. All rights reserved. - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,77 +48,47 @@ * or the SD Card Association to disclose or distribute any technical * information, know-how or other confidential information to any third party. * + * Inspired coded in sys/dev/mmc. Thanks to Warner Losh , + * Bernd Walter , and other authors. + * * $FreeBSD$ */ -#ifndef DEV_MMC_MMCBRVAR_H -#define DEV_MMC_MMCBRVAR_H +#ifndef CAM_MMC_H +#define CAM_MMC_H #include - -#include "mmcbr_if.h" - -enum mmcbr_device_ivars { - MMCBR_IVAR_BUS_MODE, - MMCBR_IVAR_BUS_WIDTH, - MMCBR_IVAR_CHIP_SELECT, - MMCBR_IVAR_CLOCK, - MMCBR_IVAR_F_MIN, - MMCBR_IVAR_F_MAX, - MMCBR_IVAR_HOST_OCR, - MMCBR_IVAR_MODE, - MMCBR_IVAR_OCR, - MMCBR_IVAR_POWER_MODE, - MMCBR_IVAR_VDD, - MMCBR_IVAR_VCCQ, - MMCBR_IVAR_CAPS, - MMCBR_IVAR_TIMING, - MMCBR_IVAR_MAX_DATA, - MMCBR_IVAR_MAX_BUSY_TIMEOUT -}; - /* - * Simplified accessors for bridge devices + * This structure describes an MMC/SD card */ -#define MMCBR_ACCESSOR(var, ivar, type) \ - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) +struct mmc_params { + u_int8_t model[40]; /* Card model */ -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) -MMCBR_ACCESSOR(clock, CLOCK, int) -MMCBR_ACCESSOR(f_max, F_MAX, int) -MMCBR_ACCESSOR(f_min, F_MIN, int) -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) -MMCBR_ACCESSOR(mode, MODE, int) -MMCBR_ACCESSOR(ocr, OCR, int) -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) -MMCBR_ACCESSOR(vdd, VDD, int) -MMCBR_ACCESSOR(vccq, VCCQ, int) -MMCBR_ACCESSOR(caps, CAPS, int) -MMCBR_ACCESSOR(timing, TIMING, int) -MMCBR_ACCESSOR(max_data, MAX_DATA, int) -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) + /* Card OCR */ + uint32_t card_ocr; -static int __inline -mmcbr_update_ios(device_t dev) -{ + /* OCR of the IO portion of the card */ + uint32_t io_ocr; - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); -} + /* Card CID -- raw and parsed */ + uint32_t card_cid[4]; + struct mmc_cid cid; -static int __inline -mmcbr_switch_vccq(device_t dev) -{ + /* Card CSD -- raw */ + uint32_t card_csd[4]; - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); -} + /* Card RCA */ + uint16_t card_rca; -static int __inline -mmcbr_get_ro(device_t dev) -{ + /* What kind of card is it */ + uint32_t card_features; +#define CARD_FEATURE_MEMORY 0x1 +#define CARD_FEATURE_SDHC 0x1 << 1 +#define CARD_FEATURE_SDIO 0x1 << 2 +#define CARD_FEATURE_SD20 0x1 << 3 +#define CARD_FEATURE_MMC 0x1 << 4 - return (MMCBR_GET_RO(device_get_parent(dev), dev)); -} + uint8_t sdio_func_count; +} __packed; -#endif /* DEV_MMC_MMCBRVAR_H */ +#endif Copied and modified: head/sys/cam/mmc/mmc_all.h (from r320843, head/sys/dev/mmc/mmcbrvar.h) ============================================================================== --- head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 (r320843, copy source) +++ head/sys/cam/mmc/mmc_all.h Sun Jul 9 16:57:24 2017 (r320844) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006 Bernd Walter. All rights reserved. - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,74 +51,20 @@ * $FreeBSD$ */ -#ifndef DEV_MMC_MMCBRVAR_H -#define DEV_MMC_MMCBRVAR_H - -#include - -#include "mmcbr_if.h" - -enum mmcbr_device_ivars { - MMCBR_IVAR_BUS_MODE, - MMCBR_IVAR_BUS_WIDTH, - MMCBR_IVAR_CHIP_SELECT, - MMCBR_IVAR_CLOCK, - MMCBR_IVAR_F_MIN, - MMCBR_IVAR_F_MAX, - MMCBR_IVAR_HOST_OCR, - MMCBR_IVAR_MODE, - MMCBR_IVAR_OCR, - MMCBR_IVAR_POWER_MODE, - MMCBR_IVAR_VDD, - MMCBR_IVAR_VCCQ, - MMCBR_IVAR_CAPS, - MMCBR_IVAR_TIMING, - MMCBR_IVAR_MAX_DATA, - MMCBR_IVAR_MAX_BUSY_TIMEOUT -}; - /* - * Simplified accessors for bridge devices + * MMC function that should be visible to the CAM subsystem + * and are somehow useful should be declared here + * + * Like in other *_all.h, it's also a nice place to include + * some other transport-specific headers. */ -#define MMCBR_ACCESSOR(var, ivar, type) \ - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) -MMCBR_ACCESSOR(clock, CLOCK, int) -MMCBR_ACCESSOR(f_max, F_MAX, int) -MMCBR_ACCESSOR(f_min, F_MIN, int) -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) -MMCBR_ACCESSOR(mode, MODE, int) -MMCBR_ACCESSOR(ocr, OCR, int) -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) -MMCBR_ACCESSOR(vdd, VDD, int) -MMCBR_ACCESSOR(vccq, VCCQ, int) -MMCBR_ACCESSOR(caps, CAPS, int) -MMCBR_ACCESSOR(timing, TIMING, int) -MMCBR_ACCESSOR(max_data, MAX_DATA, int) -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) +#ifndef CAM_MMC_ALL_H +#define CAM_MMC_ALL_H -static int __inline -mmcbr_update_ios(device_t dev) -{ +#include +#include - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); -} +void mmc_print_ident(struct mmc_params *ident_data); -static int __inline -mmcbr_switch_vccq(device_t dev) -{ - - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); -} - -static int __inline -mmcbr_get_ro(device_t dev) -{ - - return (MMCBR_GET_RO(device_get_parent(dev), dev)); -} - -#endif /* DEV_MMC_MMCBRVAR_H */ +#endif Added: head/sys/cam/mmc/mmc_bus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/mmc/mmc_bus.h Sun Jul 9 16:57:24 2017 (r320844) @@ -0,0 +1,5 @@ +/* + * This file is in the public domain. + * $FreeBSD$ + */ +#include Added: head/sys/cam/mmc/mmc_da.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/mmc/mmc_da.c Sun Jul 9 16:57:24 2017 (r320844) @@ -0,0 +1,1432 @@ +/*- + * Copyright (c) 2006 Bernd Walter + * Copyright (c) 2006 M. Warner Losh + * Copyright (c) 2009 Alexander Motin + * Copyright (c) 2015-2017 Ilya Bakulin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Some code derived from the sys/dev/mmc and sys/cam/ata + * Thanks to Warner Losh , Alexander Motin + * Bernd Walter , and other authors. + */ + +#include +__FBSDID("$FreeBSD$"); + +//#include "opt_sdda.h" + +#include + +#ifdef _KERNEL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for PRIu64 */ +#endif /* _KERNEL */ + +#ifndef _KERNEL +#include +#include +#endif /* _KERNEL */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include /* geometry translation */ + +#ifdef _KERNEL + +typedef enum { + SDDA_FLAG_OPEN = 0x0002, + SDDA_FLAG_DIRTY = 0x0004 +} sdda_flags; + +typedef enum { + SDDA_STATE_INIT, + SDDA_STATE_INVALID, + SDDA_STATE_NORMAL +} sdda_state; + +struct sdda_softc { + struct bio_queue_head bio_queue; + int outstanding_cmds; /* Number of active commands */ + int refcount; /* Active xpt_action() calls */ + sdda_state state; + sdda_flags flags; + struct mmc_data *mmcdata; +// sdda_quirks quirks; + struct task start_init_task; + struct disk *disk; + uint32_t raw_csd[4]; + uint8_t raw_ext_csd[512]; /* MMC only? */ + struct mmc_csd csd; + struct mmc_cid cid; + struct mmc_scr scr; + /* Calculated from CSD */ + uint64_t sector_count; + uint64_t mediasize; + + /* Calculated from CID */ + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ + char card_sn_string[16];/* Formatted serial # for disk->d_ident */ + /* Determined from CSD + is highspeed card*/ + uint32_t card_f_max; +}; + +#define ccb_bp ppriv_ptr1 + +static disk_strategy_t sddastrategy; +static periph_init_t sddainit; +static void sddaasync(void *callback_arg, u_int32_t code, + struct cam_path *path, void *arg); +static periph_ctor_t sddaregister; +static periph_dtor_t sddacleanup; +static periph_start_t sddastart; +static periph_oninv_t sddaoninvalidate; +static void sddadone(struct cam_periph *periph, + union ccb *done_ccb); +static int sddaerror(union ccb *ccb, u_int32_t cam_flags, + u_int32_t sense_flags); + +static uint16_t get_rca(struct cam_periph *periph); +static cam_status sdda_hook_into_geom(struct cam_periph *periph); +static void sdda_start_init(void *context, union ccb *start_ccb); +static void sdda_start_init_task(void *context, int pending); + +static struct periph_driver sddadriver = +{ + sddainit, "sdda", + TAILQ_HEAD_INITIALIZER(sddadriver.units), /* generation */ 0 +}; + +PERIPHDRIVER_DECLARE(sdda, sddadriver); + +static MALLOC_DEFINE(M_SDDA, "sd_da", "sd_da buffers"); + +static const int exp[8] = { + 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 +}; + +static const int mant[16] = { + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 +}; + +static const int cur_min[8] = { + 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 +}; + +static const int cur_max[8] = { + 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 +}; + +static uint16_t +get_rca(struct cam_periph *periph) { + return periph->path->device->mmc_ident_data.card_rca; +} + +static uint32_t +mmc_get_bits(uint32_t *bits, int bit_len, int start, int size) +{ + const int i = (bit_len / 32) - (start / 32) - 1; + const int shift = start & 31; + uint32_t retval = bits[i] >> shift; + if (size + shift > 32) + retval |= bits[i - 1] << (32 - shift); + return (retval & ((1llu << size) - 1)); +} + + +static void +mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) +{ + int v; + int m; + int e; + + memset(csd, 0, sizeof(*csd)); + csd->csd_structure = v = mmc_get_bits(raw_csd, 128, 126, 2); + if (v == 0) { + m = mmc_get_bits(raw_csd, 128, 115, 4); + e = mmc_get_bits(raw_csd, 128, 112, 3); + csd->tacc = (exp[e] * mant[m] + 9) / 10; + csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 128, 99, 4); + e = mmc_get_bits(raw_csd, 128, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); + csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; + csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; + csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; + csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; + m = mmc_get_bits(raw_csd, 128, 62, 12); + e = mmc_get_bits(raw_csd, 128, 47, 3); + csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; + csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); + csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; + csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + } else if (v == 1) { + m = mmc_get_bits(raw_csd, 128, 115, 4); + e = mmc_get_bits(raw_csd, 128, 112, 3); + csd->tacc = (exp[e] * mant[m] + 9) / 10; + csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 128, 99, 4); + e = mmc_get_bits(raw_csd, 128, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); + csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + 1) * + 512 * 1024; + csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); + csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; + csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + } else + panic("unknown SD CSD version"); +} + +static void +mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd) +{ + int m; + int e; + + memset(csd, 0, sizeof(*csd)); + csd->csd_structure = mmc_get_bits(raw_csd, 128, 126, 2); + csd->spec_vers = mmc_get_bits(raw_csd, 128, 122, 4); + m = mmc_get_bits(raw_csd, 128, 115, 4); + e = mmc_get_bits(raw_csd, 128, 112, 3); + csd->tacc = exp[e] * mant[m] + 9 / 10; + csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 128, 99, 4); + e = mmc_get_bits(raw_csd, 128, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); + csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; + csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; + csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; + csd->vdd_w_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; + m = mmc_get_bits(raw_csd, 128, 62, 12); + e = mmc_get_bits(raw_csd, 128, 47, 3); + csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; + csd->erase_blk_en = 0; + csd->erase_sector = (mmc_get_bits(raw_csd, 128, 42, 5) + 1) * + (mmc_get_bits(raw_csd, 128, 37, 5) + 1); + csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 5); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); +} + +static void +mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid) +{ + int i; + + /* There's no version info, so we take it on faith */ + memset(cid, 0, sizeof(*cid)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 9 17:02:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA2FBD9100B; Sun, 9 Jul 2017 17:02:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 979EF65AFF; Sun, 9 Jul 2017 17:02:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69H2lSi000854; Sun, 9 Jul 2017 17:02:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69H2lOf000852; Sun, 9 Jul 2017 17:02:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707091702.v69H2lOf000852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 17:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320845 - in head/sys: dev/mmcnull modules/mmcnull X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/mmcnull modules/mmcnull X-SVN-Commit-Revision: 320845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 17:02:49 -0000 Author: imp Date: Sun Jul 9 17:02:47 2017 New Revision: 320845 URL: https://svnweb.freebsd.org/changeset/base/320845 Log: Added mmcnull, an emulated lightweight MMC controller This emulated device attaches to the ISA bus and registers itself as HBA supporting MMC/SD cards. This allows to develop and test MMC XPT and MMC / SDIO peripheral drivers even in the VM such as bhyve. Submitted by: Ilya Babulin Added: head/sys/dev/mmcnull/ head/sys/dev/mmcnull/mmcnull.c (contents, props changed) head/sys/modules/mmcnull/ head/sys/modules/mmcnull/Makefile (contents, props changed) Added: head/sys/dev/mmcnull/mmcnull.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmcnull/mmcnull.c Sun Jul 9 17:02:47 2017 (r320845) @@ -0,0 +1,463 @@ +/*- + * Copyright (c) 2013 Ilya Bakulin. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static int is_sdio_mode = 1; + +struct mmcnull_softc { + device_t dev; + struct mtx sc_mtx; + + struct cam_devq *devq; + struct cam_sim *sim; + struct cam_path *path; + + struct callout tick; + union ccb *cur_ccb; +}; + +static void mmcnull_identify(driver_t *, device_t); +static int mmcnull_probe(device_t); +static int mmcnull_attach(device_t); +static int mmcnull_detach(device_t); +static void mmcnull_action_sd(struct cam_sim *, union ccb *); +static void mmcnull_action_sdio(struct cam_sim *, union ccb *); +static void mmcnull_intr_sd(void *xsc); +static void mmcnull_intr_sdio(void *xsc); +static void mmcnull_poll(struct cam_sim *); + +static void +mmcnull_identify(driver_t *driver, device_t parent) +{ + device_t child; + + if (resource_disabled("mmcnull", 0)) + return; + + if (device_get_unit(parent) != 0) + return; + + /* Avoid duplicates. */ + if (device_find_child(parent, "mmcnull", -1)) + return; + + child = BUS_ADD_CHILD(parent, 20, "mmcnull", 0); + if (child == NULL) { + device_printf(parent, "add MMCNULL child failed\n"); + return; + } +} + + +static int +mmcnull_probe(device_t dev) +{ + device_set_desc(dev, "Emulated MMC controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +mmcnull_attach(device_t dev) +{ + struct mmcnull_softc *sc; + sim_action_func action_func; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->sc_mtx, "mmcnullmtx", NULL, MTX_DEF); + + if ((sc->devq = cam_simq_alloc(1)) == NULL) + return (ENOMEM); + + if (is_sdio_mode) + action_func = mmcnull_action_sdio; + else + action_func = mmcnull_action_sd; + sc->sim = cam_sim_alloc(action_func, mmcnull_poll, "mmcnull", sc, + device_get_unit(dev), &sc->sc_mtx, 1, 1, + sc->devq); + + if (sc->sim == NULL) { + cam_simq_free(sc->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + return (EINVAL); + } + + mtx_lock(&sc->sc_mtx); + if (xpt_bus_register(sc->sim, dev, 0) != 0) { + device_printf(dev, + "cannot register SCSI pass-through bus\n"); + cam_sim_free(sc->sim, FALSE); + cam_simq_free(sc->devq); + mtx_unlock(&sc->sc_mtx); + return (EINVAL); + } + mtx_unlock(&sc->sc_mtx); + + callout_init_mtx(&sc->tick, &sc->sc_mtx, 0); /* Callout to emulate interrupts */ + + device_printf(dev, "attached OK\n"); + + return (0); +} + +static int +mmcnull_detach(device_t dev) +{ + struct mmcnull_softc *sc; + + sc = device_get_softc(dev); + + if (sc == NULL) + return (EINVAL); + + if (sc->sim != NULL) { + mtx_lock(&sc->sc_mtx); + xpt_bus_deregister(cam_sim_path(sc->sim)); + cam_sim_free(sc->sim, FALSE); + mtx_unlock(&sc->sc_mtx); + } + + if (sc->devq != NULL) + cam_simq_free(sc->devq); + + callout_drain(&sc->tick); + mtx_destroy(&sc->sc_mtx); + + device_printf(dev, "detached OK\n"); + return (0); +} + +/* + * The interrupt handler + * This implementation calls it via callout(9) + * with the mutex already taken + */ +static void +mmcnull_intr_sd(void *xsc) { + struct mmcnull_softc *sc; + union ccb *ccb; + struct ccb_mmcio *mmcio; + + sc = (struct mmcnull_softc *) xsc; + mtx_assert(&sc->sc_mtx, MA_OWNED); + + ccb = sc->cur_ccb; + mmcio = &ccb->mmcio; + device_printf(sc->dev, "mmcnull_intr: MMC command = %d\n", + mmcio->cmd.opcode); + + switch (mmcio->cmd.opcode) { + case MMC_GO_IDLE_STATE: + device_printf(sc->dev, "Reset device\n"); + break; + case SD_SEND_IF_COND: + mmcio->cmd.resp[0] = 0x1AA; // To match mmc_xpt expectations :-) + break; + case MMC_APP_CMD: + mmcio->cmd.resp[0] = R1_APP_CMD; + break; + case SD_SEND_RELATIVE_ADDR: + case MMC_SELECT_CARD: + mmcio->cmd.resp[0] = 0x1 << 16; + break; + case ACMD_SD_SEND_OP_COND: + mmcio->cmd.resp[0] = 0xc0ff8000; + mmcio->cmd.resp[0] |= MMC_OCR_CARD_BUSY; + break; + case MMC_ALL_SEND_CID: + /* Note: this is a real CID from Wandboard int mmc */ + mmcio->cmd.resp[0] = 0x1b534d30; + mmcio->cmd.resp[1] = 0x30303030; + mmcio->cmd.resp[2] = 0x10842806; + mmcio->cmd.resp[3] = 0x5700e900; + break; + case MMC_SEND_CSD: + /* Note: this is a real CSD from Wandboard int mmc */ + mmcio->cmd.resp[0] = 0x400e0032; + mmcio->cmd.resp[1] = 0x5b590000; + mmcio->cmd.resp[2] = 0x751f7f80; + mmcio->cmd.resp[3] = 0x0a404000; + break; + case MMC_READ_SINGLE_BLOCK: + case MMC_READ_MULTIPLE_BLOCK: + strcpy(mmcio->cmd.data->data, "WTF?!"); + break; + default: + device_printf(sc->dev, "mmcnull_intr_sd: unknown command\n"); + mmcio->cmd.error = 1; + } + ccb->ccb_h.status = CAM_REQ_CMP; + + sc->cur_ccb = NULL; + xpt_done(ccb); +} + +static void +mmcnull_intr_sdio_newintr(void *xsc) { + struct mmcnull_softc *sc; + struct cam_path *dpath; + + sc = (struct mmcnull_softc *) xsc; + mtx_assert(&sc->sc_mtx, MA_OWNED); + device_printf(sc->dev, "mmcnull_intr_sdio_newintr()\n"); + + /* Our path */ + if (xpt_create_path(&dpath, NULL, cam_sim_path(sc->sim), 0, 0) != CAM_REQ_CMP) { + device_printf(sc->dev, "mmcnull_intr_sdio_newintr(): cannot create path\n"); + return; + } + xpt_async(AC_UNIT_ATTENTION, dpath, NULL); + xpt_free_path(dpath); +} + +static void +mmcnull_intr_sdio(void *xsc) { + struct mmcnull_softc *sc; + union ccb *ccb; + struct ccb_mmcio *mmcio; + + sc = (struct mmcnull_softc *) xsc; + mtx_assert(&sc->sc_mtx, MA_OWNED); + + ccb = sc->cur_ccb; + mmcio = &ccb->mmcio; + device_printf(sc->dev, "mmcnull_intr: MMC command = %d\n", + mmcio->cmd.opcode); + + switch (mmcio->cmd.opcode) { + case MMC_GO_IDLE_STATE: + device_printf(sc->dev, "Reset device\n"); + break; + case SD_SEND_IF_COND: + mmcio->cmd.resp[0] = 0x1AA; // To match mmc_xpt expectations :-) + break; + case MMC_APP_CMD: + mmcio->cmd.resp[0] = R1_APP_CMD; + break; + case IO_SEND_OP_COND: + mmcio->cmd.resp[0] = 0x12345678; + mmcio->cmd.resp[0] |= ~ R4_IO_MEM_PRESENT; + break; + case SD_SEND_RELATIVE_ADDR: + case MMC_SELECT_CARD: + mmcio->cmd.resp[0] = 0x1 << 16; + break; + case ACMD_SD_SEND_OP_COND: + /* TODO: steal valid OCR from somewhere :-) */ + mmcio->cmd.resp[0] = 0x123; + mmcio->cmd.resp[0] |= MMC_OCR_CARD_BUSY; + break; + case MMC_ALL_SEND_CID: + mmcio->cmd.resp[0] = 0x1234; + mmcio->cmd.resp[1] = 0x5678; + mmcio->cmd.resp[2] = 0x9ABC; + mmcio->cmd.resp[3] = 0xDEF0; + break; + case MMC_READ_SINGLE_BLOCK: + case MMC_READ_MULTIPLE_BLOCK: + strcpy(mmcio->cmd.data->data, "WTF?!"); + break; + case SD_IO_RW_DIRECT: + device_printf(sc->dev, "Scheduling interrupt generation...\n"); + callout_reset(&sc->tick, hz / 10, mmcnull_intr_sdio_newintr, sc); + break; + default: + device_printf(sc->dev, "mmcnull_intr_sdio: unknown command\n"); + } + ccb->ccb_h.status = CAM_REQ_CMP; + + sc->cur_ccb = NULL; + xpt_done(ccb); +} + +/* + * This is a MMC IO handler + * It extracts MMC command from CCB and sends it + * to the h/w + */ +static void +mmcnull_handle_mmcio(struct cam_sim *sim, union ccb *ccb) +{ + struct mmcnull_softc *sc; + struct ccb_mmcio *mmcio; + + sc = cam_sim_softc(sim); + mmcio = &ccb->mmcio; + ccb->ccb_h.status = CAM_REQ_INPROG; + sc->cur_ccb = ccb; + + /* Real h/w will wait for the interrupt */ + if (is_sdio_mode) + callout_reset(&sc->tick, hz / 10, mmcnull_intr_sdio, sc); + else + callout_reset(&sc->tick, hz / 10, mmcnull_intr_sd, sc); +} + +static void +mmcnull_action_sd(struct cam_sim *sim, union ccb *ccb) +{ + struct mmcnull_softc *sc; + + sc = cam_sim_softc(sim); + if (sc == NULL) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + return; + } + + mtx_assert(&sc->sc_mtx, MA_OWNED); + + device_printf(sc->dev, "action: func_code %0x\n", ccb->ccb_h.func_code); + + switch (ccb->ccb_h.func_code) { + case XPT_PATH_INQ: + { + struct ccb_pathinq *cpi; + + cpi = &ccb->cpi; + cpi->version_num = 1; + cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE | PI_WIDE_16; + cpi->target_sprt = 0; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; + cpi->hba_eng_cnt = 0; + cpi->max_target = 0; + cpi->max_lun = 0; + cpi->initiator_id = 1; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, "FreeBSD Foundation", HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 100; /* XXX WTF? */ + cpi->protocol = PROTO_MMCSD; + cpi->protocol_version = SCSI_REV_0; + cpi->transport = XPORT_MMCSD; + cpi->transport_version = 0; + + cpi->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ccb_trans_settings_mmc *mcts; + mcts = &ccb->cts.proto_specific.mmc; + + device_printf(sc->dev, "Got XPT_GET_TRAN_SETTINGS\n"); + + cts->protocol = PROTO_MMCSD; + cts->protocol_version = 0; + cts->transport = XPORT_MMCSD; + cts->transport_version = 0; + cts->xport_specific.valid = 0; + mcts->host_f_max = 12000000; + mcts->host_f_min = 200000; + mcts->host_ocr = 1; /* Fix this */ + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_SET_TRAN_SETTINGS: + device_printf(sc->dev, "Got XPT_SET_TRAN_SETTINGS, should update IOS...\n"); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_RESET_BUS: + device_printf(sc->dev, "Got XPT_RESET_BUS, ACK it...\n"); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_IO: + /* + * Here is the HW-dependent part of + * sending the command to the underlying h/w + * At some point in the future an interrupt comes. + * Then the request will be marked as completed. + */ + device_printf(sc->dev, "Got XPT_MMC_IO\n"); + mmcnull_handle_mmcio(sim, ccb); + return; + break; + case XPT_RESET_DEV: + /* This is sent by `camcontrol reset`*/ + device_printf(sc->dev, "Got XPT_RESET_DEV\n"); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + default: + device_printf(sc->dev, "Func code %d is unknown\n", ccb->ccb_h.func_code); + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); + return; +} + +static void +mmcnull_action_sdio(struct cam_sim *sim, union ccb *ccb) { + mmcnull_action_sd(sim, ccb); +} + +static void +mmcnull_poll(struct cam_sim *sim) +{ + return; +} + + +static device_method_t mmcnull_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, mmcnull_identify), + DEVMETHOD(device_probe, mmcnull_probe), + DEVMETHOD(device_attach, mmcnull_attach), + DEVMETHOD(device_detach, mmcnull_detach), + DEVMETHOD_END +}; + +static driver_t mmcnull_driver = { + "mmcnull", mmcnull_methods, sizeof(struct mmcnull_softc) +}; + +static devclass_t mmcnull_devclass; + +DRIVER_MODULE(mmcnull, isa, mmcnull_driver, mmcnull_devclass, 0, 0); Added: head/sys/modules/mmcnull/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mmcnull/Makefile Sun Jul 9 17:02:47 2017 (r320845) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/mmcnull + +KMOD= mmcnull +SRCS= mmcnull.c device_if.h bus_if.h + +.include From owner-svn-src-all@freebsd.org Sun Jul 9 17:02:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15A63D91020; Sun, 9 Jul 2017 17:02:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id AD4B465B09; Sun, 9 Jul 2017 17:02:53 +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 v69H2qCT000906; Sun, 9 Jul 2017 17:02:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69H2qHa000905; Sun, 9 Jul 2017 17:02:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707091702.v69H2qHa000905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 17:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320846 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 320846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 17:02:54 -0000 Author: imp Date: Sun Jul 9 17:02:52 2017 New Revision: 320846 URL: https://svnweb.freebsd.org/changeset/base/320846 Log: New command 'mmcsdcmd' for camcontrol, to allow interacting with SD cards Submitted by: Ilya Babulin Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Jul 9 17:02:47 2017 (r320845) +++ head/sbin/camcontrol/camcontrol.c Sun Jul 9 17:02:52 2017 (r320846) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "camcontrol.h" @@ -104,7 +105,8 @@ typedef enum { CAM_CMD_REPROBE = 0x00000025, CAM_CMD_ZONE = 0x00000026, CAM_CMD_EPC = 0x00000027, - CAM_CMD_TIMESTAMP = 0x00000028 + CAM_CMD_TIMESTAMP = 0x00000028, + CAM_CMD_MMCSD_CMD = 0x00000029 } cam_cmdmask; typedef enum { @@ -205,6 +207,7 @@ static struct camcontrol_opts option_table[] = { {"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL}, #ifndef MINIMALISTIC {"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, + {"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"}, {"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, {"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"}, {"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, @@ -300,6 +303,8 @@ static int scsicmd(struct cam_device *device, int argc int timeout); static int smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +static int mmcsdcmd(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); static int smpreportgeneral(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int smpphycontrol(struct cam_device *device, int argc, char **argv, @@ -592,6 +597,13 @@ getdevtree(int argc, char **argv, char *combinedopt) sizeof(revision)); sprintf(tmpstr, "<%s %s>", product, revision); + } else if (dev_result->protocol == PROTO_MMCSD) { + if (strlen(dev_result->mmc_ident_data.model) > 0) { + sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); + } else { + sprintf(tmpstr, "<%s card>", + dev_result->mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown"); + } } else if (dev_result->protocol == PROTO_SEMB) { struct sep_identify_data *sid; @@ -7335,6 +7347,291 @@ smpcmd_bailout: } static int +mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout) +{ + int c, error = 0; + union ccb *ccb; + int32_t mmc_opcode = 0, mmc_arg = 0; + int32_t mmc_flags = -1; + int retval; + int is_write = 0; + int is_bw_4 = 0, is_bw_1 = 0; + int is_highspeed = 0, is_stdspeed = 0; + int is_info_request = 0; + int flags = 0; + uint8_t mmc_data_byte; + + /* For IO_RW_EXTENDED command */ + uint8_t *mmc_data = NULL; + struct mmc_data mmc_d; + int mmc_data_len = 0; + + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case '4': + is_bw_4 = 1; + break; + case '1': + is_bw_1 = 1; + break; + case 'S': + if (!strcmp(optarg, "high")) + is_highspeed = 1; + else + is_stdspeed = 1; + break; + case 'I': + is_info_request = 1; + break; + case 'c': + mmc_opcode = strtol(optarg, NULL, 0); + if (mmc_opcode < 0) { + warnx("invalid MMC opcode %d", + mmc_opcode); + error = 1; + goto mmccmd_bailout; + } + break; + case 'a': + mmc_arg = strtol(optarg, NULL, 0); + if (mmc_arg < 0) { + warnx("invalid MMC arg %d", + mmc_arg); + error = 1; + goto mmccmd_bailout; + } + break; + case 'f': + mmc_flags = strtol(optarg, NULL, 0); + if (mmc_flags < 0) { + warnx("invalid MMC flags %d", + mmc_flags); + error = 1; + goto mmccmd_bailout; + } + break; + case 'l': + mmc_data_len = strtol(optarg, NULL, 0); + if (mmc_data_len <= 0) { + warnx("invalid MMC data len %d", + mmc_data_len); + error = 1; + goto mmccmd_bailout; + } + break; + case 'W': + is_write = 1; + break; + case 'b': + mmc_data_byte = strtol(optarg, NULL, 0); + break; + default: + break; + } + } + flags |= CAM_DEV_QFRZDIS; /* masks are broken?! */ + + /* If flags are left default, supply the right flags */ + if (mmc_flags < 0) + switch (mmc_opcode) { + case MMC_GO_IDLE_STATE: + mmc_flags = MMC_RSP_NONE | MMC_CMD_BC; + break; + case IO_SEND_OP_COND: + mmc_flags = MMC_RSP_R4; + break; + case SD_SEND_RELATIVE_ADDR: + mmc_flags = MMC_RSP_R6 | MMC_CMD_BCR; + break; + case MMC_SELECT_CARD: + mmc_flags = MMC_RSP_R1B | MMC_CMD_AC; + mmc_arg = mmc_arg << 16; + break; + case SD_IO_RW_DIRECT: + mmc_flags = MMC_RSP_R5 | MMC_CMD_AC; + mmc_arg = SD_IO_RW_ADR(mmc_arg); + if (is_write) + mmc_arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(mmc_data_byte); + break; + case SD_IO_RW_EXTENDED: + mmc_flags = MMC_RSP_R5 | MMC_CMD_ADTC; + mmc_arg = SD_IO_RW_ADR(mmc_arg); + int len_arg = mmc_data_len; + if (mmc_data_len == 512) + len_arg = 0; + + // Byte mode + mmc_arg |= SD_IOE_RW_LEN(len_arg) | SD_IO_RW_INCR; + // Block mode +// mmc_arg |= SD_IOE_RW_BLK | SD_IOE_RW_LEN(len_arg) | SD_IO_RW_INCR; + break; + default: + mmc_flags = MMC_RSP_R1; + break; + } + + // Switch bus width instead of sending IO command + if (is_bw_4 || is_bw_1) { + struct ccb_trans_settings_mmc *cts; + ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + cts = &ccb->cts.proto_specific.mmc; + cts->ios.bus_width = is_bw_4 == 1 ? bus_width_4 : bus_width_1; + cts->ios_valid = MMC_BW; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + } else { + printf("Parameters set OK\n"); + } + cam_freeccb(ccb); + return (retval); + } + + // Switch bus speed instead of sending IO command + if (is_stdspeed || is_highspeed) { + struct ccb_trans_settings_mmc *cts; + ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + cts = &ccb->cts.proto_specific.mmc; + cts->ios.timing = is_highspeed == 1 ? bus_timing_hs : bus_timing_normal; + cts->ios_valid = MMC_BT; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + } else { + printf("Speed set OK (HS: %d)\n", is_highspeed); + } + cam_freeccb(ccb); + return (retval); + } + + // Get information about controller and its settings + if (is_info_request) { + ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + struct ccb_trans_settings_mmc *cts; + cts = &ccb->cts.proto_specific.mmc; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + return (retval); + } + printf("Host controller information\n"); + printf("Host OCR: 0x%x\n", cts->host_ocr); + printf("Min frequency: %u KHz\n", cts->host_f_min / 1000); + printf("Max frequency: %u MHz\n", cts->host_f_max / 1000000); + printf("Supported bus width: "); + if (cts->host_caps & MMC_CAP_4_BIT_DATA) + printf(" 4 bit\n"); + if (cts->host_caps & MMC_CAP_8_BIT_DATA) + printf(" 8 bit\n"); + printf("\nCurrent settings:\n"); + printf("Bus width: "); + switch (cts->ios.bus_width) { + case bus_width_1: + printf("1 bit\n"); + break; + case bus_width_4: + printf("4 bit\n"); + break; + case bus_width_8: + printf("8 bit\n"); + break; + } + printf("Freq: %d.%03d MHz%s\n", + cts->ios.clock / 1000000, + (cts->ios.clock / 1000) % 1000, + cts->ios.timing == bus_timing_hs ? "(high-speed timing)" : ""); + return (0); + } + + printf("CMD %d arg %d flags %02x\n", mmc_opcode, mmc_arg, mmc_flags); + + if (mmc_data_len > 0) { + flags |= CAM_DIR_IN; + mmc_data = malloc(mmc_data_len); + memset(mmc_data, 0, mmc_data_len); + mmc_d.len = mmc_data_len; + mmc_d.data = mmc_data; + mmc_d.flags = MMC_DATA_READ; + } else flags |= CAM_DIR_NONE; + + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*flags*/ flags, + /*mmc_opcode*/ mmc_opcode, + /*mmc_arg*/ mmc_arg, + /*mmc_flags*/ mmc_flags, + /*mmc_data*/ mmc_data_len > 0 ? &mmc_d : NULL, + /*timeout*/ timeout ? timeout : 5000); + + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char warnstr[] = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + } + + if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { + printf("MMCIO: error %d, %08x %08x %08x %08x\n", + ccb->mmcio.cmd.error, ccb->mmcio.cmd.resp[0], + ccb->mmcio.cmd.resp[1], + ccb->mmcio.cmd.resp[2], + ccb->mmcio.cmd.resp[3]); + + switch (mmc_opcode) { + case SD_IO_RW_DIRECT: + printf("IO_RW_DIRECT: resp byte %02x, cur state %d\n", + SD_R5_DATA(ccb->mmcio.cmd.resp), + (ccb->mmcio.cmd.resp[0] >> 12) & 0x3 + ); + break; + case SD_IO_RW_EXTENDED: + printf("IO_RW_EXTENDED: read %d bytes w/o error:\n", mmc_data_len); + hexdump(mmc_data, mmc_data_len, NULL, 0); + break; + case SD_SEND_RELATIVE_ADDR: + printf("SEND_RELATIVE_ADDR: published RCA %02x\n", ccb->mmcio.cmd.resp[0] >> 16); + break; + default: + printf("No command-specific decoder for CMD %d\n", mmc_opcode); + } + } +mmccmd_bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + if (mmc_data_len > 0 && mmc_data != NULL) + free(mmc_data); + + return (error); +} + +static int smpreportgeneral(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -9628,6 +9925,10 @@ main(int argc, char **argv) error = scsicmd(cam_dev, argc, argv, combinedopt, task_attr, retry_count, timeout); break; + case CAM_CMD_MMCSD_CMD: + error = mmcsdcmd(cam_dev, argc, argv, combinedopt, + retry_count, timeout); + break; case CAM_CMD_SMP_CMD: error = smpcmd(cam_dev, argc, argv, combinedopt, retry_count, timeout); From owner-svn-src-all@freebsd.org Sun Jul 9 17:05:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07EA5D91176; Sun, 9 Jul 2017 17:05:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id AB7B865DC7; Sun, 9 Jul 2017 17:05:49 +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 v69H5mgB001082; Sun, 9 Jul 2017 17:05:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69H5mtF001080; Sun, 9 Jul 2017 17:05:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707091705.v69H5mtF001080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 17:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320847 - head/usr.bin/sdiotool X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/sdiotool X-SVN-Commit-Revision: 320847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 17:05:50 -0000 Author: imp Date: Sun Jul 9 17:05:48 2017 New Revision: 320847 URL: https://svnweb.freebsd.org/changeset/base/320847 Log: Added new tool for doing experiments with SDIO card. Due to its experimental nature, it's not yet connected to the build. Submitted by: Ilya Babulin Added: head/usr.bin/sdiotool/ head/usr.bin/sdiotool/Makefile (contents, props changed) head/usr.bin/sdiotool/sdiotool.c (contents, props changed) Added: head/usr.bin/sdiotool/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/Makefile Sun Jul 9 17:05:48 2017 (r320847) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= sdiotool +SRCS= sdiotool.c + +LIBADD= cam util +MAN= + +.include Added: head/usr.bin/sdiotool/sdiotool.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/sdiotool.c Sun Jul 9 17:05:48 2017 (r320847) @@ -0,0 +1,649 @@ +/*- + * Copyright (c) 2016-2017 Ilya Bakulin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +struct cis_info { + uint16_t man_id; + uint16_t prod_id; + uint16_t max_block_size; +}; + +static int sdio_rw_direct(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + uint8_t *data, + uint8_t *resp); +static uint8_t sdio_read_1(struct cam_device *dev, uint8_t func_number, uint32_t addr); +static void sdio_write_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint8_t val); +static int sdio_is_func_ready(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +static int sdio_is_func_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +static int sdio_func_enable(struct cam_device *dev, uint8_t func_number, int enable); +static int sdio_is_func_intr_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +static int sdio_func_intr_enable(struct cam_device *dev, uint8_t func_number, int enable); +static void sdio_card_reset(struct cam_device *dev); +static uint32_t sdio_get_common_cis_addr(struct cam_device *dev); +static void probe_bcrm(struct cam_device *dev); + +/* Use CMD52 to read or write a single byte */ +int +sdio_rw_direct(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + uint8_t *data, uint8_t *resp) { + union ccb *ccb; + uint32_t flags; + uint32_t arg; + int retval = 0; + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + flags = MMC_RSP_R5 | MMC_CMD_AC; + arg = SD_IO_RW_FUNC(func_number) | SD_IO_RW_ADR(addr); + if (is_write) + arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(*data); + + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ CAM_DIR_NONE, + /*mmc_opcode*/ SD_IO_RW_DIRECT, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ 0, + /*timeout*/ 5000); + + if (((retval = cam_send_ccb(dev, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char warnstr[] = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + return (-1); + } + + *resp = ccb->mmcio.cmd.resp[0] & 0xFF; + cam_freeccb(ccb); + return (retval); +} + +#if 0 +/* + * CMD53 -- IO_RW_EXTENDED + * Use to read or write memory blocks + * + * is_increment=1: FIFO mode + * blk_count > 0: block mode + */ +int +sdio_rw_extended(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + uint8_t *data, size_t datalen, + uint8_t is_increment, + uint16_t blk_count) { + union ccb *ccb; + uint32_t flags; + uint32_t arg; + int retval = 0; + + if (blk_count != 0) { + warnx("%s: block mode is not supported yet", __func__); + return (1); + } + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + flags = MMC_RSP_R5 | MMC_CMD_AC; + arg = SD_IO_RW_FUNC(func_number) | SD_IO_RW_ADR(addr); + if (is_write) + arg |= SD_IO_RW_WR; + + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ CAM_DIR_NONE, + /*mmc_opcode*/ SD_IO_RW_DIRECT, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ 0, + /*timeout*/ 5000); + + if (((retval = cam_send_ccb(dev, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char warnstr[] = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + return (-1); + } + + *resp = ccb->mmcio.cmd.resp[0] & 0xFF; + cam_freeccb(ccb); + return (retval); +} +#endif + +static int +sdio_read_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, uint8_t *is_enab) { + uint8_t resp; + int ret; + + ret = sdio_rw_direct(dev, 0, addr, 0, NULL, &resp); + if (ret < 0) + return ret; + + *is_enab = (resp & (1 << func_number)) > 0 ? 1 : 0; + + return (0); +} + +static int +sdio_set_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, int enable) { + uint8_t resp; + int ret; + uint8_t is_enabled; + + ret = sdio_rw_direct(dev, 0, addr, 0, NULL, &resp); + if (ret != 0) + return ret; + + is_enabled = resp & (1 << func_number); + if ((is_enabled !=0 && enable == 1) || (is_enabled == 0 && enable == 0)) + return 0; + + if (enable) + resp |= 1 << func_number; + else + resp &= ~ (1 << func_number); + + ret = sdio_rw_direct(dev, 0, addr, 1, &resp, &resp); + + return ret; +} + +static uint8_t +sdio_read_1(struct cam_device *dev, uint8_t func_number, uint32_t addr) { + uint8_t val; + sdio_rw_direct(dev, func_number, addr, 0, NULL, &val); + return val; +} + +__unused static void +sdio_write_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint8_t val) { + uint8_t _val; + sdio_rw_direct(dev, func_number, addr, 0, &val, &_val); +} + +static int +sdio_is_func_ready(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_FN_READY, func_number, is_enab); +} + +static int +sdio_is_func_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_FN_ENABLE, func_number, is_enab); +} + +static int +sdio_func_enable(struct cam_device *dev, uint8_t func_number, int enable) { + return sdio_set_bool_for_func(dev, SD_IO_CCCR_FN_ENABLE, func_number, enable); +} + +static int +sdio_is_func_intr_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_INT_ENABLE, func_number, is_enab); +} + +static int +sdio_func_intr_enable(struct cam_device *dev, uint8_t func_number, int enable) { + return sdio_set_bool_for_func(dev, SD_IO_CCCR_INT_ENABLE, func_number, enable); +} + +static int +sdio_card_set_bus_width(struct cam_device *dev, enum mmc_bus_width bw) { + int ret; + uint8_t ctl_val; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_BUS_WIDTH, 0, NULL, &ctl_val); + if (ret < 0) { + warn("Error getting CCCR_BUS_WIDTH value"); + return ret; + } + ctl_val &= ~0x3; + switch (bw) { + case bus_width_1: + /* Already set to 1-bit */ + break; + case bus_width_4: + ctl_val |= CCCR_BUS_WIDTH_4; + break; + case bus_width_8: + warn("Cannot do 8-bit on SDIO yet"); + return -1; + break; + } + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_BUS_WIDTH, 1, &ctl_val, &ctl_val); + if (ret < 0) { + warn("Error setting CCCR_BUS_WIDTH value"); + return ret; + } + return ret; +} + +static int +sdio_func_read_cis(struct cam_device *dev, uint8_t func_number, + uint32_t cis_addr, struct cis_info *info) { + uint8_t tuple_id, tuple_len, tuple_count; + uint32_t addr; + + char *cis1_info[4]; + int start, i, ch, count; + char cis1_info_buf[256]; + + tuple_count = 0; /* Use to prevent infinite loop in case of parse errors */ + memset(cis1_info_buf, 0, 256); + do { + addr = cis_addr; + tuple_id = sdio_read_1(dev, 0, addr++); + if (tuple_id == SD_IO_CISTPL_END) + break; + if (tuple_id == 0) { + cis_addr++; + continue; + } + tuple_len = sdio_read_1(dev, 0, addr++); + if (tuple_len == 0 && tuple_id != 0x00) { + warn("Parse error: 0-length tuple %02X\n", tuple_id); + return -1; + } + + switch (tuple_id) { + case SD_IO_CISTPL_VERS_1: + addr += 2; + for (count = 0, start = 0, i = 0; + (count < 4) && ((i + 4) < 256); i++) { + ch = sdio_read_1(dev, 0, addr + i); + printf("count=%d, start=%d, i=%d, Got %c (0x%02x)\n", count, start, i, ch, ch); + if (ch == 0xff) + break; + cis1_info_buf[i] = ch; + if (ch == 0) { + cis1_info[count] = + cis1_info_buf + start; + start = i + 1; + count++; + } + } + printf("Card info:"); + for (i=0; i<4; i++) + if (cis1_info[i]) + printf(" %s", cis1_info[i]); + printf("\n"); + break; + case SD_IO_CISTPL_MANFID: + info->man_id = sdio_read_1(dev, 0, addr++); + info->man_id |= sdio_read_1(dev, 0, addr++) << 8; + + info->prod_id = sdio_read_1(dev, 0, addr++); + info->prod_id |= sdio_read_1(dev, 0, addr++) << 8; + break; + case SD_IO_CISTPL_FUNCID: + /* not sure if we need to parse it? */ + break; + case SD_IO_CISTPL_FUNCE: + if (tuple_len < 4) { + printf("FUNCE is too short: %d\n", tuple_len); + break; + } + if (func_number == 0) { + /* skip extended_data */ + addr++; + info->max_block_size = sdio_read_1(dev, 0, addr++); + info->max_block_size |= sdio_read_1(dev, 0, addr++) << 8; + } else { + info->max_block_size = sdio_read_1(dev, 0, addr + 0xC); + info->max_block_size |= sdio_read_1(dev, 0, addr + 0xD) << 8; + } + break; + default: + printf("Skipping tuple ID %02X len %02X\n", tuple_id, tuple_len); + } + cis_addr += tuple_len + 2; + tuple_count++; + } while (tuple_count < 20); + + return 0; +} + +static uint32_t +sdio_get_common_cis_addr(struct cam_device *dev) { + uint32_t addr; + + addr = sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR); + addr |= sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR + 1) << 8; + addr |= sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR + 2) << 16; + + if (addr < SD_IO_CIS_START || addr > SD_IO_CIS_START + SD_IO_CIS_SIZE) { + warn("Bad CIS address: %04X\n", addr); + addr = 0; + } + + return addr; +} + +static void sdio_card_reset(struct cam_device *dev) { + int ret; + uint8_t ctl_val; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_CTL, 0, NULL, &ctl_val); + if (ret < 0) + errx(1, "Error getting CCCR_CTL value"); + ctl_val |= CCCR_CTL_RES; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_CTL, 1, &ctl_val, &ctl_val); + if (ret < 0) + errx(1, "Error setting CCCR_CTL value"); +} + +/* + * How Linux driver works + * + * The probing begins by calling brcmf_ops_sdio_probe() which is defined as probe function in struct sdio_driver. http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c#L1126 + * + * The driver does black magic by copying func struct for F2 and setting func number to zero there, to create an F0 func structure :) + * Driver state changes to BRCMF_SDIOD_DOWN. + * ops_sdio_probe() then calls brcmf_sdio_probe() -- at this point it has filled in sdiodev struct with the pointers to all three functions (F0, F1, F2). + * + * brcmf_sdiod_probe() sets block sizes for F1 and F2. It sets F1 block size to 64 and F2 to 512, not consulting the values stored in SDIO CCCR / FBR registers! + * Then it increases timeout for F2 (what is this?!) + * Then it enables F1 + * Then it attaches "freezer" (without PM this is NOP) + * Finally it calls brcmf_sdio_probe() http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c#L4082 + * + * Here high-level workqueues and sg tables are allocated. + * It then calls brcmf_sdio_probe_attach() + * + * Here at the beginning there is a pr_debug() call with brcmf_sdiod_regrl() inside to addr #define SI_ENUM_BASE 0x18000000. + * Return value is 0x16044330. + * Then turns off PLL: byte-write BRCMF_INIT_CLKCTL1 (0x28) -> SBSDIO_FUNC1_CHIPCLKCSR (0x1000E) + * Then it reads value back, should be 0xe8. + * Then calls brcmf_chip_attach() + * + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c#L1054 + * This func enumerates and resets all the cores on the dongle. + * - brcmf_sdio_buscoreprep(): force clock to ALPAvail req only: + * SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ -> SBSDIO_FUNC1_CHIPCLKCSR + * Wait up to 15ms to !SBSDIO_ALPAV(clkval) of the value from CLKCSR. + * Force ALP: + * SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_FORCE_ALP (0x21)-> SBSDIO_FUNC1_CHIPCLKCSR + * Disaable SDIO pullups: + * byte 0 -> SBSDIO_FUNC1_SDIOPULLUP (0x0001000f) + * + * Calls brcmf_chip_recognition() + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c#L908 + * Read 0x18000000. Get 0x16044330: chip 4330 rev 4 + * AXI chip, call brcmf_chip_dmp_erom_scan() to get info about all cores. + * Then brcmf_chip_cores_check() to check that CPU and RAM are found, + * + * Setting cores to passive: not clear which of CR4/CA7/CM3 our chip has. + * Quite a few r/w calls to different parts of the chip to reset cores.... + * Finally get_raminfo() called to fill in RAM info: + * brcmf_chip_get_raminfo: RAM: base=0x0 size=294912 (0x48000) sr=0 (0x0) + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c#L700 + * + * Then brcmf_chip_setup() is called, this prints and fills in chipcommon rev and PMU caps: + * brcmf_chip_setup: ccrev=39, pmurev=12, pmucaps=0x19583c0c + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c#L1015 + * Bus-specific setup code is NOP for SDIO. + * + * brcmf_sdio_kso_init() is called. + * Here it first reads 0x1 from SBSDIO_FUNC1_SLEEPCSR 0x18000650 and then writes it back... WTF? + * + * brcmf_sdio_drivestrengthinit() is called + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c#L3630 + * + * Set card control so an SDIO card reset does a WLAN backplane reset + * set PMUControl so a backplane reset does PMU state reload + * === end of brcmf_sdio_probe_attach === + + **** Finished reading at http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c#L4152, line 2025 in the dump + + * === How register reading works === + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c#L357 + * The address to read from is written to three byte-sized registers of F1: + * - SBSDIO_FUNC1_SBADDRLOW 0x1000A + * - SBSDIO_FUNC1_SBADDRMID 0x1000B + * - SBSDIO_FUNC1_SBADDRHIGH 0x1000C + * If this is 32-bit read , a flag is set. The address is ANDed with SBSDIO_SB_OFT_ADDR_MASK which is 0x07FFF. + * Then brcmf_sdiod_regrw_helper() is called to read the reply. + * http://lxr.free-electrons.com/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c#L306 + * Based on the address it figures out where to read it from (CCCR / FBR in F0, or somewhere in F1). + * Reads are retried three times. + * 1-byte IO is done with CMD52, more is read with CMD53 with address increment (not FIFO mode). + * http://lxr.free-electrons.com/source/drivers/mmc/core/sdio_io.c#L458 + * ================================== + * + * + */ +__unused +static void +probe_bcrm(struct cam_device *dev) { + uint32_t cis_addr; + struct cis_info info; + + sdio_card_set_bus_width(dev, bus_width_4); + cis_addr = sdio_get_common_cis_addr(dev); + printf("CIS address: %04X\n", cis_addr); + + memset(&info, 0, sizeof(info)); + sdio_func_read_cis(dev, 0, cis_addr, &info); + printf("Vendor 0x%04X product 0x%04X\n", info.man_id, info.prod_id); +} +__unused +static uint8_t * +mmap_fw() { + const char fw_path[] = "/home/kibab/repos/fbsd-bbb/brcm-firmware/brcmfmac4330-sdio.bin"; + struct stat sb; + uint8_t *fw_ptr; + + int fd = open(fw_path, O_RDONLY); + if (fd < 0) + errx(1, "Cannot open firmware file"); + if (fstat(fd, &sb) < 0) + errx(1, "Cannot get file stat"); + fw_ptr = mmap(NULL, sb.st_size, PROT_READ, 0, fd, 0); + if (fw_ptr == MAP_FAILED) + errx(1, "Cannot map the file"); + + return fw_ptr; +} + +static void +usage() { + printf("sdiotool -u \n"); + exit(0); +} + +static void +get_sdio_card_info(struct cam_device *dev) { + uint32_t cis_addr; + uint32_t fbr_addr; + struct cis_info info; + + cis_addr = sdio_get_common_cis_addr(dev); + + memset(&info, 0, sizeof(info)); + sdio_func_read_cis(dev, 0, cis_addr, &info); + printf("F0: Vendor 0x%04X product 0x%04X max block size %d bytes\n", + info.man_id, info.prod_id, info.max_block_size); + for (int i = 1; i <= 2; i++) { + fbr_addr = SD_IO_FBR_START * i + 0x9; + cis_addr = sdio_read_1(dev, 0, fbr_addr++); + cis_addr |= sdio_read_1(dev, 0, fbr_addr++) << 8; + cis_addr |= sdio_read_1(dev, 0, fbr_addr++) << 16; + memset(&info, 0, sizeof(info)); + sdio_func_read_cis(dev, i, cis_addr, &info); + printf("F%d: Vendor 0x%04X product 0x%04X max block size %d bytes\n", + i, info.man_id, info.prod_id, info.max_block_size); + } +} + +/* Test interrupt delivery when select() */ +__unused static int +sdio_signal_intr(struct cam_device *dev) { + uint8_t resp; + int ret; + + ret = sdio_rw_direct(dev, 0, 0x666, 0, NULL, &resp); + if (ret < 0) + return ret; + return (0); +} + +static void +do_intr_test(__unused struct cam_device *dev) { +} + +int +main(int argc, char **argv) { + char device[] = "pass"; + int unit = 0; + int func = 0; + uint8_t resp; + uint8_t is_enab; + __unused uint8_t *fw_ptr; + int ch; + struct cam_device *cam_dev; + int is_intr_test = 0; + + //fw_ptr = mmap_fw(); + + while ((ch = getopt(argc, argv, "Iu:")) != -1) { + switch (ch) { + case 'u': + unit = (int) strtol(optarg, NULL, 10); + break; + case 'f': + func = (int) strtol(optarg, NULL, 10); + case 'I': + is_intr_test = 1; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if ((cam_dev = cam_open_spec_device(device, unit, O_RDWR, NULL)) == NULL) + errx(1, "Cannot open device"); + + get_sdio_card_info(cam_dev); + if (is_intr_test > 0) + do_intr_test(cam_dev); + exit(0); + sdio_card_reset(cam_dev); + + /* Read Addr 7 of func 0 */ + int ret = sdio_rw_direct(cam_dev, 0, 7, 0, NULL, &resp); + if (ret < 0) + errx(1, "Error sending CAM command"); + printf("Result: %02x\n", resp); + + /* Check if func 1 is enabled */ + ret = sdio_is_func_enabled(cam_dev, 1, &is_enab); + if (ret < 0) + errx(1, "Cannot check if func is enabled"); + printf("F1 enabled: %d\n", is_enab); + ret = sdio_func_enable(cam_dev, 1, 1 - is_enab); + if (ret < 0) + errx(1, "Cannot enable/disable func"); + printf("F1 en/dis result: %d\n", ret); + + /* Check if func 1 is ready */ + ret = sdio_is_func_ready(cam_dev, 1, &is_enab); + if (ret < 0) + errx(1, "Cannot check if func is ready"); + printf("F1 ready: %d\n", is_enab); + + /* Check if interrupts are enabled */ + ret = sdio_is_func_intr_enabled(cam_dev, 1, &is_enab); + if (ret < 0) + errx(1, "Cannot check if func intr is enabled"); + printf("F1 intr enabled: %d\n", is_enab); + ret = sdio_func_intr_enable(cam_dev, 1, 1 - is_enab); + if (ret < 0) + errx(1, "Cannot enable/disable func intr"); + printf("F1 intr en/dis result: %d\n", ret); + + cam_close_spec_device(cam_dev); +} From owner-svn-src-all@freebsd.org Sun Jul 9 17:56:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6433FD91B07; Sun, 9 Jul 2017 17:56:07 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7A366F4B; Sun, 9 Jul 2017 17:56:05 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.37.89]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M8MyE-1dpnUX1nP8-00vygS; Sun, 09 Jul 2017 19:56:03 +0200 Date: Sun, 9 Jul 2017 19:55:55 +0200 From: "O. Hartmann" To: svn-src-head@freebsd.org Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... Message-ID: <20170709195525.188d6fa8@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201707091657.v69GvOar096942@repo.freebsd.org> References: <201707091657.v69GvOar096942@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/bOUleh6WuhKllk7dnQOTs3R"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:gjFQMGe7oFyMOqm7uTxQZDG4QVuC5VcQ+ldOtNuYFR6MhcRFHrN xLomXhuSCFL1W6rlfIi1lMBwct4oe45vwwjxn8yyN0DxpdflQQ+2bguk19TrTJLKIGz4T0E W/nuWxYcwHLk9iuDQoQ9p8Bq6oj66pJgg+0xHtIW26On3e8tgOnpXXb2D3ZoQIiq8fb9dU4 GyoK5NVnBg5Erhbr7dnDg== X-UI-Out-Filterresults: notjunk:1;V01:K0:uh/8ZsGh26M=:d3j06SvRf+BADEZqfg/tIT +ESO13hoiQn3eKgngNXE9dlk9FMAA8wlGRYSrac1gwrsTuXCWrqwTv5BfGclJCoBTfnB7ZwKU bTQS/OReXBeoNDDS7rBzkbnFuXcLKaH7mIxnWGaTV97Dir6QaFHGVXxqI/x8MCiYdmZwJv9xy E09fUgxHw2EaBnf6ov/JneI0wUN21fw5VPPW0ORkSwPzW5od5DsMr2yozYcZrqiSUe3kW+GlI EWbHk+1zmhPAqnojb7ZeN80jZIXpeDa9hrWsX+oFNcXbNDzGJLH3r86orGmd+o7uQOEs8nMpr t27x/gz7qKb+2i79l8xWaeEkwFB8tInz8r2zAq7p8Azh2Csp5dwf5YWUgYAbBuCzTncvRps9M HmfSZYlsXsI/bDZAaShFvvKmGAQMIjap6orUlnosRhauEMHnr2WfCeeMH4F/yC74PbpfOVKBn Ps/owpbO6qvWYIWIdlUPDaLwyA91o+i2gF+IS8G2gntGOmirr4wT2SzvNIYqr1JM2dt6otrwT lKI+xqu44jVRuL4XBpUWAgjrlydvRXRQZ+jTwupPmITKxx7jgVMGp2ky1QUVJ0GjQJuxErPte GyCTU+CLTh0bDlrUH8Mm0yOyIJEeDjySS21hEEmQhFLrUDjzUx27wvdHoxf8uyZQaN8fH5ENb vaSX1wdsW1SAe0azzpHFgEsve0PA9Cun7cmfAcwD825Hn2+f99omTB8BSXn/ilF/5ixPQBLqQ Rl9K3nNqFklFQ3r0Y2KhsaMliUoIwFq0RDLU6RAWiztgjqKJ86u+aj9eZgs= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 17:56:07 -0000 --Sig_/bOUleh6WuhKllk7dnQOTs3R Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sun, 9 Jul 2017 16:57:24 +0000 (UTC) Warner Losh schrieb: > Author: imp > Date: Sun Jul 9 16:57:24 2017 > New Revision: 320844 > URL: https://svnweb.freebsd.org/changeset/base/320844 >=20 > Log: > An MMC/SD/SDIO stack using CAM > =20 > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > flexible queueing will make it easier to write non-storage drivers > than the legacy stack. SDIO drivers from both the kernel and as > userland daemons are possible, though much of that functionality will > come later. > =20 > Some of the CAM integration isn't complete (there are sleeps in the > device probe state machine, for example), but those minor issues can > be improved in-tree more easily than out of tree and shouldn't gate > progress on other fronts. Appologies to reviews if specific items > have been overlooked. > =20 > Submitted by: Ilya Bakulin > Reviewed by: emaste, imp, mav, adrian, ian > Differential Review: https://reviews.freebsd.org/D4761 > =20 > merge with first commit, various compile hacks. >=20 > Added: > head/sys/amd64/conf/MMCCAM (contents, props changed) > head/sys/arm/conf/BEAGLEBONE-MMCCAM (contents, props changed) > head/sys/cam/mmc/ > head/sys/cam/mmc/mmc.h > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > head/sys/cam/mmc/mmc_all.h > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > head/sys/cam/mmc/mmc_bus.h (contents, props changed) > head/sys/cam/mmc/mmc_da.c (contents, props changed) > head/sys/cam/mmc/mmc_sdio.c (contents, props changed) > head/sys/cam/mmc/mmc_sdio.h > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > head/sys/cam/mmc/mmc_xpt.c (contents, props changed) > Modified: > head/etc/mtree/BSD.include.dist > head/include/Makefile > head/lib/libcam/Makefile > head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > head/sys/arm/ti/ti_sdhci.c > head/sys/cam/cam_ccb.h > head/sys/cam/cam_periph.c > head/sys/cam/cam_xpt.c > head/sys/cam/cam_xpt.h > head/sys/cam/cam_xpt_internal.h > head/sys/cam/scsi/scsi_pass.c > head/sys/conf/files > head/sys/conf/options > head/sys/dev/mmc/bridge.h > head/sys/dev/mmc/mmcbrvar.h > head/sys/dev/mmc/mmcreg.h > head/sys/dev/sdhci/fsl_sdhci.c > head/sys/dev/sdhci/sdhci.c > head/sys/dev/sdhci/sdhci.h > head/sys/dev/sdhci/sdhci_acpi.c > head/sys/dev/sdhci/sdhci_pci.c > head/sys/modules/Makefile >=20 > Modified: head/etc/mtree/BSD.include.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/mtree/BSD.include.dist Sun Jul 9 15:41:49 2017 (r320843) > +++ head/etc/mtree/BSD.include.dist Sun Jul 9 16:57:24 2017 (r320844) > @@ -90,6 +90,8 @@ > cam > ata > .. > + mmc > + .. > nvme > .. > scsi >=20 > Modified: head/include/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/include/Makefile Sun Jul 9 15:41:49 2017 (r320843) > +++ head/include/Makefile Sun Jul 9 16:57:24 2017 (r320844) > @@ -42,7 +42,7 @@ LHDRS=3D aio.h errno.h fcntl.h linker_set.h poll.h stdat > LDIRS=3D bsm cam geom net net80211 netgraph netinet netinet6 \ > netipsec netsmb nfs nfsclient nfsserver sys vm > =20 > -LSUBDIRS=3D cam/ata cam/nvme cam/scsi \ > +LSUBDIRS=3D cam/ata cam/mmc cam/nvme cam/scsi \ > dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ > dev/hwpmc dev/hyperv \ > dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/mmc dev/nvme \ >=20 > Modified: head/lib/libcam/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libcam/Makefile Sun Jul 9 15:41:49 2017 (r320843) > +++ head/lib/libcam/Makefile Sun Jul 9 16:57:24 2017 (r320844) > @@ -38,6 +38,7 @@ MLINKS+=3D cam.3 cam_open_device.3 \ > =20 > .PATH: ${SRCTOP}/sys/cam \ > ${SRCTOP}/sys/cam/ata \ > + ${SRCTOP}/sys/cam/mmc \ > ${SRCTOP}/sys/cam/scsi > =20 > CFLAGS+=3D -I${.CURDIR} -I${SRCTOP}/sys >=20 > Added: head/sys/amd64/conf/MMCCAM > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/amd64/conf/MMCCAM Sun Jul 9 16:57:24 2017 (r320844) > @@ -0,0 +1,36 @@ > +# MMCCAM is the kernel config for doing MMC on CAM development > +# and testing on bhyve > +# $FreeBSD$ > + > +include MINIMAL > + > +ident MMCCAM > + > +# Access GPT-formatted and labeled root volume > +options GEOM_PART_GPT > +options GEOM_LABEL > + > +# UART -- for bhyve console > +device uart > + > +# kgdb stub > +device bvmdebug > + > +# VirtIO support, needed for bhyve > +device virtio # Generic VirtIO bus (required) > +device virtio_pci # VirtIO PCI device > +device vtnet # VirtIO Ethernet device > +device virtio_blk # VirtIO Block device > +device virtio_scsi # VirtIO SCSI device > +device virtio_balloon # VirtIO Memory Balloon device > + > +# CAM-specific stuff > +device pass > +device scbus > +device da > +device mmccam > + > +options MMCCAM > +# Add CAMDEBUG stuff > +options CAMDEBUG > +options > CAM_DEBUG_FLAGS=3D(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DE= BUG_TRACE) >=20 > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jul 9 15:41:49 > 2017 (r320843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jul > 9 16:57:24 2017 (r320844) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); > #include "mmcbr_if.h" > #include "sdhci_if.h" > =20 > +#include "opt_mmccam.h" > + > #include "bcm2835_dma.h" > #include > #include "bcm2835_vcbus.h" > @@ -253,7 +255,11 @@ bcm_sdhci_attach(device_t dev) > bus_generic_probe(dev); > bus_generic_attach(dev); > =20 > +#ifdef MMCCAM > + sdhci_cam_start_slot(&sc->sc_slot); > +#else > sdhci_start_slot(&sc->sc_slot); > +#endif > =20 > return (0); > =20 >=20 > Added: head/sys/arm/conf/BEAGLEBONE-MMCCAM > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/conf/BEAGLEBONE-MMCCAM Sun Jul 9 16:57:24 2017 (r320844) > @@ -0,0 +1,21 @@ > +# > +# BEAGLEBONE-MMCCAM > +# > +# Custom kernel for Beaglebone plus MMCCAM as opposed to the prior MMC s= tack. It is > +# present to keep it building in tree since it wouldn't work in LINT. > +# > +# $FreeBSD$ > + > +include BEAGLEBONE > + > +# Add CAMDEBUG stuff > +options CAMDEBUG > +options > CAM_DEBUG_FLAGS=3D(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DE= BUG_TRACE) + > +# pass(4) device > +device pass > +device mmccam > +options MMCCAM > + > +nodevice mmc > +nodevice mmcsd >=20 > Modified: head/sys/arm/ti/ti_sdhci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm/ti/ti_sdhci.c Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/arm/ti/ti_sdhci.c Sun Jul 9 16:57:24 2017 (r320844) > @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > =20 > #include > #include > @@ -60,6 +62,8 @@ __FBSDID("$FreeBSD$"); > #include > #include "gpio_if.h" > =20 > +#include "opt_mmccam.h" > + > struct ti_sdhci_softc { > device_t dev; > struct sdhci_fdt_gpio * gpio; > @@ -122,6 +126,11 @@ static struct ofw_compat_data compat_data[] =3D { > #define MMCHS_SD_CAPA_VS30 (1 << 25) > #define MMCHS_SD_CAPA_VS33 (1 << 24) > =20 > +/* Forward declarations, CAM-relataed */ > +// static void ti_sdhci_cam_poll(struct cam_sim *); > +// static void ti_sdhci_cam_action(struct cam_sim *, union ccb *); > +// static int ti_sdhci_cam_settran_settings(struct ti_sdhci_softc *sc, u= nion ccb *); > + > static inline uint32_t > ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) > { > @@ -241,6 +250,22 @@ ti_sdhci_write_1(device_t dev, struct sdhci_slot *sl= ot > struct ti_sdhci_softc *sc =3D device_get_softc(dev); > uint32_t val32; > =20 > +#ifdef MMCCAM > + uint32_t newval32; > + if (off =3D=3D SDHCI_HOST_CONTROL) { > + val32 =3D ti_mmchs_read_4(sc, MMCHS_CON); > + newval32 =3D val32; > + if (val & SDHCI_CTRL_8BITBUS) { > + device_printf(dev, "Custom-enabling 8-bit bus\n"); > + newval32 |=3D MMCHS_CON_DW8; > + } else { > + device_printf(dev, "Custom-disabling 8-bit bus\n"); > + newval32 &=3D ~MMCHS_CON_DW8; > + } > + if (newval32 !=3D val32) > + ti_mmchs_write_4(sc, MMCHS_CON, newval32); > + } > +#endif > val32 =3D RD4(sc, off & ~3); > val32 &=3D ~(0xff << (off & 3) * 8); > val32 |=3D (val << (off & 3) * 8); > @@ -658,8 +683,11 @@ ti_sdhci_attach(device_t dev) > bus_generic_probe(dev); > bus_generic_attach(dev); > =20 > +#ifdef MMCCAM > + sdhci_cam_start_slot(&sc->slot); > +#else > sdhci_start_slot(&sc->slot); > - > +#endif > return (0); > =20 > fail: > @@ -730,4 +758,7 @@ static driver_t ti_sdhci_driver =3D { > DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, N= ULL, > NULL); > MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); > + > +#ifndef MMCCAM > MMC_DECLARE_BRIDGE(sdhci_ti); > +#endif >=20 > Modified: head/sys/cam/cam_ccb.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cam/cam_ccb.h Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/cam/cam_ccb.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > =20 > /* General allocation length definitions for CCB structures */ > #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB bytes/pointer */ > @@ -208,10 +209,10 @@ typedef enum { > XPT_NVME_IO =3D 0x1c | XPT_FC_DEV_QUEUED, > /* Execiute the requestred NVMe I/O operation */ > =20 > - XPT_MMCSD_IO =3D 0x1d | XPT_FC_DEV_QUEUED, > + XPT_MMC_IO =3D 0x1d | XPT_FC_DEV_QUEUED, > /* Placeholder for MMC / SD / SDIO I/O stuff */ > =20 > - XPT_SCAN_TGT =3D 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB > + XPT_SCAN_TGT =3D 0x1e | XPT_FC_QUEUED | XPT_FC_USER_CCB > | XPT_FC_XPT_ONLY, > /* Scan Target */ > =20 > @@ -267,6 +268,7 @@ typedef enum { > PROTO_SATAPM, /* SATA Port Multiplier */ > PROTO_SEMB, /* SATA Enclosure Management Bridge */ > PROTO_NVME, /* NVME */ > + PROTO_MMCSD, /* MMC, SD, SDIO */ > } cam_proto; > =20 > typedef enum { > @@ -283,6 +285,7 @@ typedef enum { > XPORT_ISCSI, /* iSCSI */ > XPORT_SRP, /* SCSI RDMA Protocol */ > XPORT_NVME, /* NVMe over PCIe */ > + XPORT_MMCSD, /* MMC, SD, SDIO card */ > } cam_xport; > =20 > #define XPORT_IS_NVME(t) ((t) =3D=3D XPORT_NVME) > @@ -498,6 +501,7 @@ struct device_match_result { > cam_proto protocol; > struct scsi_inquiry_data inq_data; > struct ata_params ident_data; > + struct mmc_params mmc_ident_data; > dev_result_flags flags; > }; > =20 > @@ -773,6 +777,16 @@ struct ccb_ataio { > uint32_t unused; > }; > =20 > +/* > + * MMC I/O Request CCB used for the XPT_MMC_IO function code. > + */ > +struct ccb_mmcio { > + struct ccb_hdr ccb_h; > + union ccb *next_ccb; /* Ptr for next CCB for action */ > + struct mmc_command cmd; > + struct mmc_command stop; > +}; > + > struct ccb_accept_tio { > struct ccb_hdr ccb_h; > cdb_t cdb_io; /* Union for CDB bytes/pointer */ > @@ -1005,7 +1019,28 @@ struct ccb_trans_settings_nvme=20 > u_int max_xfer; /* Max transfer size (0 -> unlimited */ > u_int caps; > }; > -=09 > + > +#include > +struct ccb_trans_settings_mmc { > + struct mmc_ios ios; > +#define MMC_CLK (1 << 1) > +#define MMC_VDD (1 << 2) > +#define MMC_CS (1 << 3) > +#define MMC_BW (1 << 4) > +#define MMC_PM (1 << 5) > +#define MMC_BT (1 << 6) > +#define MMC_BM (1 << 7) > + uint32_t ios_valid; > +/* The folowing is used only for GET_TRAN_SETTINGS */ > + uint32_t host_ocr; > + int host_f_min; > + int host_f_max; > +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers */ > +#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ > +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ > + uint32_t host_caps; > +}; > + > /* Get/Set transfer rate/width/disconnection/tag queueing settings */ > struct ccb_trans_settings { > struct ccb_hdr ccb_h; > @@ -1019,6 +1054,7 @@ struct ccb_trans_settings { > struct ccb_trans_settings_ata ata; > struct ccb_trans_settings_scsi scsi; > struct ccb_trans_settings_nvme nvme; > + struct ccb_trans_settings_mmc mmc; > } proto_specific; > union { > u_int valid; /* Which fields to honor */ > @@ -1284,6 +1320,7 @@ union ccb { > struct ccb_dev_advinfo cdai; > struct ccb_async casync; > struct ccb_nvmeio nvmeio; > + struct ccb_mmcio mmcio; > }; > =20 > #define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ > @@ -1327,6 +1364,13 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t r= etri > uint32_t timeout); > =20 > static __inline void > +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, > + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, > + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, > + struct mmc_data *mmc_d, > + uint32_t timeout); > + > +static __inline void > cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, > void (*cbfcnp)(struct cam_periph *, union ccb *), > u_int32_t flags, u_int8_t tag_action, > @@ -1412,6 +1456,34 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t r= etri > smpio->smp_request_len =3D smp_request_len; > smpio->smp_response =3D smp_response; > smpio->smp_response_len =3D smp_response_len; > +} > + > +static __inline void > +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, > + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, > + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, > + struct mmc_data *mmc_d, > + uint32_t timeout) > +{ > + mmcio->ccb_h.func_code =3D XPT_MMC_IO; > + mmcio->ccb_h.flags =3D flags; > + mmcio->ccb_h.retry_count =3D retries; > + mmcio->ccb_h.cbfcnp =3D cbfcnp; > + mmcio->ccb_h.timeout =3D timeout; > + mmcio->cmd.opcode =3D mmc_opcode; > + mmcio->cmd.arg =3D mmc_arg; > + mmcio->cmd.flags =3D mmc_flags; > + mmcio->stop.opcode =3D 0; > + mmcio->stop.arg =3D 0; > + mmcio->stop.flags =3D 0; > + if (mmc_d !=3D NULL) { > + mmcio->cmd.data =3D mmc_d; > + } else > + mmcio->cmd.data =3D NULL; > + mmcio->cmd.resp[0] =3D 0; > + mmcio->cmd.resp[1] =3D 0; > + mmcio->cmd.resp[2] =3D 0; > + mmcio->cmd.resp[3] =3D 0; > } > =20 > static __inline void >=20 > Modified: head/sys/cam/cam_periph.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cam/cam_periph.c Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/cam/cam_periph.c Sun Jul 9 16:57:24 2017 (r320844) > @@ -827,6 +827,18 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_= ma > dirs[0] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > numbufs =3D 1; > break; > + case XPT_MMC_IO: > + if ((ccb->ccb_h.flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) > + return(0); > + /* Two mappings: one for cmd->data and one for cmd->data->data */ > + data_ptrs[0] =3D (unsigned char **)&ccb->mmcio.cmd.data; > + lengths[0] =3D sizeof(struct mmc_data *); > + dirs[0] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > + data_ptrs[1] =3D (unsigned char **)&ccb->mmcio.cmd.data->data; > + lengths[1] =3D ccb->mmcio.cmd.data->len; > + dirs[1] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > + numbufs =3D 2; > + break; > case XPT_SMP_IO: > data_ptrs[0] =3D &ccb->smpio.smp_request; > lengths[0] =3D ccb->smpio.smp_request_len; >=20 > Modified: head/sys/cam/cam_xpt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cam/cam_xpt.c Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/cam/cam_xpt.c Sun Jul 9 16:57:24 2017 (r320844) > @@ -329,7 +329,6 @@ static xpt_devicefunc_t xptsetasyncfunc; > static xpt_busfunc_t xptsetasyncbusfunc; > static cam_status xptregister(struct cam_periph *periph, > void *arg); > -static const char * xpt_action_name(uint32_t action); > static __inline int device_is_queued(struct cam_ed *device); > =20 > static __inline int > @@ -412,7 +411,7 @@ xptioctl(struct cdev *dev, u_long cmd, caddr_t addr, i > } > return (error); > } > -=09 > + > static int > xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct = thread *td) > { > @@ -820,6 +819,8 @@ xpt_scanner_thread(void *dummy) > TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, sim_links.tqe); > xpt_unlock_buses(); > =20 > + printf("xpt_scanner_thread is firing on path "); > + xpt_print_path(ccb->ccb_h.path);printf("\n"); > /* > * Since lock can be dropped inside and path freed > * by completion callback even before return here, > @@ -1503,7 +1504,7 @@ xptdevicematch(struct dev_match_pattern *patterns, = u_i > =20 > cur_pattern =3D &patterns[i].pattern.device_pattern; > =20 > - /* Error out if mutually exclusive options are specified. */=20 > + /* Error out if mutually exclusive options are specified. */ > if ((cur_pattern->flags & (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) > =3D=3D (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) > return(DM_RET_ERROR); > @@ -1905,6 +1906,9 @@ xptedtdevicefunc(struct cam_ed *device, void *arg) > bcopy(&device->ident_data, > &cdm->matches[j].result.device_result.ident_data, > sizeof(struct ata_params)); > + bcopy(&device->mmc_ident_data, > + &cdm->matches[j].result.device_result.mmc_ident_data, > + sizeof(struct mmc_params)); > =20 > /* Let the user know whether this device is unconfigured */ > if (device->flags & CAM_DEV_UNCONFIGURED) > @@ -2690,6 +2694,8 @@ xpt_action_default(union ccb *start_ccb) > if (start_ccb->ccb_h.func_code =3D=3D XPT_NVME_IO) > start_ccb->nvmeio.resid =3D 0; > /* FALLTHROUGH */ > + case XPT_MMC_IO: > + /* XXX just like nmve_io? */ > case XPT_RESET_DEV: > case XPT_ENG_EXEC: > case XPT_SMP_IO: > @@ -2801,11 +2807,12 @@ call_sim: > mtx_lock(mtx); > else > mtx =3D NULL; > + > CAM_DEBUG(path, CAM_DEBUG_TRACE, > - ("sim->sim_action: func=3D%#x\n", start_ccb->ccb_h.func_code)); > + ("Calling sim->sim_action(): func=3D%#x\n", > start_ccb->ccb_h.func_code)); (*(sim->sim_action))(sim, start_ccb); > CAM_DEBUG(path, CAM_DEBUG_TRACE, > - ("sim->sim_action: status=3D%#x\n", start_ccb->ccb_h.status)); > + ("sim->sim_action returned: status=3D%#x\n", > start_ccb->ccb_h.status)); if (mtx) > mtx_unlock(mtx); > break; > @@ -5540,7 +5547,7 @@ static struct kv map[] =3D { > { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, > { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, > { XPT_NVME_IO, "XPT_NVME_IO" }, > - { XPT_MMCSD_IO, "XPT_MMCSD_IO" }, > + { XPT_MMC_IO, "XPT_MMC_IO" }, > { XPT_SMP_IO, "XPT_SMP_IO" }, > { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, > { XPT_ENG_INQ, "XPT_ENG_INQ" }, > @@ -5556,7 +5563,7 @@ static struct kv map[] =3D { > { 0, 0 } > }; > =20 > -static const char * > +const char * > xpt_action_name(uint32_t action)=20 > { > static char buffer[32]; /* Only for unknown messages -- racy */ >=20 > Modified: head/sys/cam/cam_xpt.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cam/cam_xpt.h Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/cam/cam_xpt.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -141,6 +141,8 @@ void xpt_copy_path(struct cam_path *new_path, > =20 > void xpt_release_path(struct cam_path *path); > =20 > +const char * xpt_action_name(uint32_t action); > + > #endif /* _KERNEL */ > =20 > #endif /* _CAM_CAM_XPT_H */ >=20 > Modified: head/sys/cam/cam_xpt_internal.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cam/cam_xpt_internal.h Sun Jul 9 15:41:49 2017 (r320843) > +++ head/sys/cam/cam_xpt_internal.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -125,6 +125,7 @@ struct cam_ed { > uint32_t rcap_len; > uint8_t *rcap_buf; > struct ata_params ident_data; > + struct mmc_params mmc_ident_data; > u_int8_t inq_flags; /* > * Current settings for inquiry flags. > * This allows us to override settings >=20 > Copied and modified: head/sys/cam/mmc/mmc.h (from r320843, head/sys/dev/m= mc/mmcbrvar.h) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 (r320843, copy > source) +++ head/sys/cam/mmc/mmc.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -1,6 +1,5 @@ > /*- > - * Copyright (c) 2006 Bernd Walter. All rights reserved. > - * Copyright (c) 2006 M. Warner Losh. All rights reserved. > + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -49,77 +48,47 @@ > * or the SD Card Association to disclose or distribute any technical > * information, know-how or other confidential information to any third = party. > * > + * Inspired coded in sys/dev/mmc. Thanks to Warner Losh , > + * Bernd Walter , and other authors. > + * > * $FreeBSD$ > */ > =20 > -#ifndef DEV_MMC_MMCBRVAR_H > -#define DEV_MMC_MMCBRVAR_H > +#ifndef CAM_MMC_H > +#define CAM_MMC_H > =20 > #include > - > -#include "mmcbr_if.h" > - > -enum mmcbr_device_ivars { > - MMCBR_IVAR_BUS_MODE, > - MMCBR_IVAR_BUS_WIDTH, > - MMCBR_IVAR_CHIP_SELECT, > - MMCBR_IVAR_CLOCK, > - MMCBR_IVAR_F_MIN, > - MMCBR_IVAR_F_MAX, > - MMCBR_IVAR_HOST_OCR, > - MMCBR_IVAR_MODE, > - MMCBR_IVAR_OCR, > - MMCBR_IVAR_POWER_MODE, > - MMCBR_IVAR_VDD, > - MMCBR_IVAR_VCCQ, > - MMCBR_IVAR_CAPS, > - MMCBR_IVAR_TIMING, > - MMCBR_IVAR_MAX_DATA, > - MMCBR_IVAR_MAX_BUSY_TIMEOUT > -}; > - > /* > - * Simplified accessors for bridge devices > + * This structure describes an MMC/SD card > */ > -#define MMCBR_ACCESSOR(var, ivar, type) \ > - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) > +struct mmc_params { > + u_int8_t model[40]; /* Card model */ > =20 > -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) > -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) > -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) > -MMCBR_ACCESSOR(clock, CLOCK, int) > -MMCBR_ACCESSOR(f_max, F_MAX, int) > -MMCBR_ACCESSOR(f_min, F_MIN, int) > -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) > -MMCBR_ACCESSOR(mode, MODE, int) > -MMCBR_ACCESSOR(ocr, OCR, int) > -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) > -MMCBR_ACCESSOR(vdd, VDD, int) > -MMCBR_ACCESSOR(vccq, VCCQ, int) > -MMCBR_ACCESSOR(caps, CAPS, int) > -MMCBR_ACCESSOR(timing, TIMING, int) > -MMCBR_ACCESSOR(max_data, MAX_DATA, int) > -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) > + /* Card OCR */ > + uint32_t card_ocr; > =20 > -static int __inline > -mmcbr_update_ios(device_t dev) > -{ > + /* OCR of the IO portion of the card */ > + uint32_t io_ocr; > =20 > - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); > -} > + /* Card CID -- raw and parsed */ > + uint32_t card_cid[4]; > + struct mmc_cid cid; > =20 > -static int __inline > -mmcbr_switch_vccq(device_t dev) > -{ > + /* Card CSD -- raw */ > + uint32_t card_csd[4]; > =20 > - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); > -} > + /* Card RCA */ > + uint16_t card_rca; > =20 > -static int __inline > -mmcbr_get_ro(device_t dev) > -{ > + /* What kind of card is it */ > + uint32_t card_features; > +#define CARD_FEATURE_MEMORY 0x1 > +#define CARD_FEATURE_SDHC 0x1 << 1 > +#define CARD_FEATURE_SDIO 0x1 << 2 > +#define CARD_FEATURE_SD20 0x1 << 3 > +#define CARD_FEATURE_MMC 0x1 << 4 > =20 > - return (MMCBR_GET_RO(device_get_parent(dev), dev)); > -} > + uint8_t sdio_func_count; > +} __packed; > =20 > -#endif /* DEV_MMC_MMCBRVAR_H */ > +#endif >=20 > Copied and modified: head/sys/cam/mmc/mmc_all.h (from r320843, > head/sys/dev/mmc/mmcbrvar.h) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D --- > head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 (r320843, copy > source) +++ head/sys/cam/mmc/mmc_all.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -1,6 +1,5 @@ /*- > - * Copyright (c) 2006 Bernd Walter. All rights reserved. > - * Copyright (c) 2006 M. Warner Losh. All rights reserved. > + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -52,74 +51,20 @@ > * $FreeBSD$ > */ > =20 > -#ifndef DEV_MMC_MMCBRVAR_H > -#define DEV_MMC_MMCBRVAR_H > - > -#include > - > -#include "mmcbr_if.h" > - > -enum mmcbr_device_ivars { > - MMCBR_IVAR_BUS_MODE, > - MMCBR_IVAR_BUS_WIDTH, > - MMCBR_IVAR_CHIP_SELECT, > - MMCBR_IVAR_CLOCK, > - MMCBR_IVAR_F_MIN, > - MMCBR_IVAR_F_MAX, > - MMCBR_IVAR_HOST_OCR, > - MMCBR_IVAR_MODE, > - MMCBR_IVAR_OCR, > - MMCBR_IVAR_POWER_MODE, > - MMCBR_IVAR_VDD, > - MMCBR_IVAR_VCCQ, > - MMCBR_IVAR_CAPS, > - MMCBR_IVAR_TIMING, > - MMCBR_IVAR_MAX_DATA, > - MMCBR_IVAR_MAX_BUSY_TIMEOUT > -}; > - > /* > - * Simplified accessors for bridge devices > + * MMC function that should be visible to the CAM subsystem > + * and are somehow useful should be declared here > + * > + * Like in other *_all.h, it's also a nice place to include > + * some other transport-specific headers. > */ > -#define MMCBR_ACCESSOR(var, ivar, type) \ > - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) > =20 > -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) > -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) > -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) > -MMCBR_ACCESSOR(clock, CLOCK, int) > -MMCBR_ACCESSOR(f_max, F_MAX, int) > -MMCBR_ACCESSOR(f_min, F_MIN, int) > -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) > -MMCBR_ACCESSOR(mode, MODE, int) > -MMCBR_ACCESSOR(ocr, OCR, int) > -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) > -MMCBR_ACCESSOR(vdd, VDD, int) > -MMCBR_ACCESSOR(vccq, VCCQ, int) > -MMCBR_ACCESSOR(caps, CAPS, int) > -MMCBR_ACCESSOR(timing, TIMING, int) > -MMCBR_ACCESSOR(max_data, MAX_DATA, int) > -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) > +#ifndef CAM_MMC_ALL_H > +#define CAM_MMC_ALL_H > =20 > -static int __inline > -mmcbr_update_ios(device_t dev) > -{ > +#include > +#include > =20 > - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); > -} > +void mmc_print_ident(struct mmc_params *ident_data); > =20 > -static int __inline > -mmcbr_switch_vccq(device_t dev) > -{ > - > - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); > -} > - > -static int __inline > -mmcbr_get_ro(device_t dev) > -{ > - > - return (MMCBR_GET_RO(device_get_parent(dev), dev)); > -} > - > -#endif /* DEV_MMC_MMCBRVAR_H */ > +#endif >=20 > Added: head/sys/cam/mmc/mmc_bus.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/cam/mmc/mmc_bus.h Sun Jul 9 16:57:24 2017 (r320844) > @@ -0,0 +1,5 @@ > +/* > + * This file is in the public domain. > + * $FreeBSD$ > + */ > +#include >=20 > Added: head/sys/cam/mmc/mmc_da.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/cam/mmc/mmc_da.c Sun Jul 9 16:57:24 2017 (r320844) > @@ -0,0 +1,1432 @@ > +/*- > + * Copyright (c) 2006 Bernd Walter > + * Copyright (c) 2006 M. Warner Losh > + * Copyright (c) 2009 Alexander Motin > + * Copyright (c) 2015-2017 Ilya Bakulin > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer, > + * without modification, immediately at the beginning of the file. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, = BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * Some code derived from the sys/dev/mmc and sys/cam/ata > + * Thanks to Warner Losh , Alexander Motin > + * Bernd Walter , and other authors. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +//#include "opt_sdda.h" > + > +#include > + > +#ifdef _KERNEL > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include /* for PRIu64 */ > +#endif /* _KERNEL */ > + > +#ifndef _KERNEL > +#include > +#include > +#endif /* _KERNEL */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +#include > + > +#include /* geometry translation */ > + > +#ifdef _KERNEL > + > +typedef enum { > + SDDA_FLAG_OPEN =3D 0x0002, > + SDDA_FLAG_DIRTY =3D 0x0004 > +} sdda_flags; > + > +typedef enum { > + SDDA_STATE_INIT, > + SDDA_STATE_INVALID, > + SDDA_STATE_NORMAL > +} sdda_state; > + > +struct sdda_softc { > + struct bio_queue_head bio_queue; > + int outstanding_cmds; /* Number of active commands */ > + int refcount; /* Active xpt_action() calls */ > + sdda_state state; > + sdda_flags flags; > + struct mmc_data *mmcdata; > +// sdda_quirks quirks; > + struct task start_init_task; > + struct disk *disk; > + uint32_t raw_csd[4]; > + uint8_t raw_ext_csd[512]; /* MMC only? */ > + struct mmc_csd csd; > + struct mmc_cid cid; > + struct mmc_scr scr; > + /* Calculated from CSD */ > + uint64_t sector_count; > + uint64_t mediasize; > + > + /* Calculated from CID */ > + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ > + char card_sn_string[16];/* Formatted serial # for disk->d_ident */ > + /* Determined from CSD + is highspeed card*/ > + uint32_t card_f_max; > +}; > + > +#define ccb_bp ppriv_ptr1 > + > +static disk_strategy_t sddastrategy; > +static periph_init_t sddainit; > +static void sddaasync(void *callback_arg, u_int32_t code, > + struct cam_path *path, void *arg); > +static periph_ctor_t sddaregister; > +static periph_dtor_t sddacleanup; > +static periph_start_t sddastart; > +static periph_oninv_t sddaoninvalidate; > +static void sddadone(struct cam_periph *periph, > + union ccb *done_ccb); > +static int sddaerror(union ccb *ccb, u_int32_t cam_flags, > + u_int32_t sense_flags); > + > +static uint16_t get_rca(struct cam_periph *periph); > +static cam_status sdda_hook_into_geom(struct cam_periph *periph); > +static void sdda_start_init(void *context, union ccb *start_ccb); > +static void sdda_start_init_task(void *context, int pending); > + > +static struct periph_driver sddadriver =3D > +{ > + sddainit, "sdda", > + TAILQ_HEAD_INITIALIZER(sddadriver.units), /* generation */ 0 > +}; > + > +PERIPHDRIVER_DECLARE(sdda, sddadriver); > + > +static MALLOC_DEFINE(M_SDDA, "sd_da", "sd_da buffers"); > + > +static const int exp[8] =3D { > + 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 > +}; > + > +static const int mant[16] =3D { > + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 > +}; > + > +static const int cur_min[8] =3D { > + 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 > +}; > + > +static const int cur_max[8] =3D { > + 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 > +}; > + > +static uint16_t > +get_rca(struct cam_periph *periph) { > + return periph->path->device->mmc_ident_data.card_rca; > +} > + > +static uint32_t > +mmc_get_bits(uint32_t *bits, int bit_len, int start, int size) > +{ > + const int i =3D (bit_len / 32) - (start / 32) - 1; > + const int shift =3D start & 31; > + uint32_t retval =3D bits[i] >> shift; > + if (size + shift > 32) > + retval |=3D bits[i - 1] << (32 - shift); > + return (retval & ((1llu << size) - 1)); > +} > + > + > +static void > +mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) > +{ > + int v; > + int m; > + int e; > + > + memset(csd, 0, sizeof(*csd)); > + csd->csd_structure =3D v =3D mmc_get_bits(raw_csd, 128, 126, 2); > + if (v =3D=3D 0) { > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > + csd->tacc =3D (exp[e] * mant[m] + 9) / 10; > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, 4); > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1); > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78, 1); > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77, 1); > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > + csd->vdd_r_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; > + csd->vdd_r_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; > + csd->vdd_w_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; > + csd->vdd_w_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; > + m =3D mmc_get_bits(raw_csd, 128, 62, 12); > + e =3D mmc_get_bits(raw_csd, 128, 47, 3); > + csd->capacity =3D ((1 + m) << (e + 2)) * csd->read_bl_len; > + csd->erase_blk_en =3D mmc_get_bits(raw_csd, 128, 46, 1); > + csd->erase_sector =3D mmc_get_bits(raw_csd, 128, 39, 7) + 1; > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 7); > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3); > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22, 4); > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, 1); > + } else if (v =3D=3D 1) { > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > + csd->tacc =3D (exp[e] * mant[m] + 9) / 10; > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, 4); > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1); > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78, 1); > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77, 1); > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > + csd->capacity =3D ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + 1) * > + 512 * 1024; > + csd->erase_blk_en =3D mmc_get_bits(raw_csd, 128, 46, 1); > + csd->erase_sector =3D mmc_get_bits(raw_csd, 128, 39, 7) + 1; > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 7); > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3); > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22, 4); > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, 1); > + } else > + panic("unknown SD CSD version"); > +} > + > +static void > +mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd) > +{ > + int m; > + int e; > + > + memset(csd, 0, sizeof(*csd)); > + csd->csd_structure =3D mmc_get_bits(raw_csd, 128, 126, 2); > + csd->spec_vers =3D mmc_get_bits(raw_csd, 128, 122, 4); > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > + csd->tacc =3D exp[e] * mant[m] + 9 / 10; > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, 4); > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1); > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78, 1); > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77, 1); > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > + csd->vdd_r_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; > + csd->vdd_r_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; > + csd->vdd_w_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; > + csd->vdd_w_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 50, 3)]; > + m =3D mmc_get_bits(raw_csd, 128, 62, 12); > + e =3D mmc_get_bits(raw_csd, 128, 47, 3); > + csd->capacity =3D ((1 + m) << (e + 2)) * csd->read_bl_len; > + csd->erase_blk_en =3D 0; > + csd->erase_sector =3D (mmc_get_bits(raw_csd, 128, 42, 5) + 1) * > + (mmc_get_bits(raw_csd, 128, 37, 5) + 1); > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 5); > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3); > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22, 4); > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, 1); > +} > + > +static void > +mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid) > +{ > + int i; > + > + /* There's no version info, so we take it on faith */ > + memset(cid, 0, sizeof(*cid)); >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" r320847 doesn't boot. It cycles all over a kernel panic (looks like a trap1= 2), reboots. Then, sometimes if the boot process can proceed after an erratic number of = attempts, it gets stuck in the loader's mountroot, bad device 16 error. I can not say whether this is due to this commit (On the crashing box, I ha= ve no debugging enabled an I'm back with r320829 which seems to work). --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/bOUleh6WuhKllk7dnQOTs3R Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWWJuKwAKCRDS528fyFhY lN0DAf9dahMH57ag3QhQBI3DcqkwRwxqRVqwj+V2XX/fwqZMN22CJEfvJEwpqEGe lcTgPUbHp5nn+hA1N23LPKkjnEiRAfsGtFOFTwRuXcwvfFrgHG2SVV+bYgMuV5w+ eFTXeXzNC3fCiLVpdkib/pjcC8Ho58EIoLrkm90mvtHxTGUM9tHU =9zM0 -----END PGP SIGNATURE----- --Sig_/bOUleh6WuhKllk7dnQOTs3R-- From owner-svn-src-all@freebsd.org Sun Jul 9 17:56:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C1DD91B76; Sun, 9 Jul 2017 17:56:40 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB5167080; Sun, 9 Jul 2017 17:56:40 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69Hud83021336; Sun, 9 Jul 2017 17:56:39 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69HudGL021335; Sun, 9 Jul 2017 17:56:39 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201707091756.v69HudGL021335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 9 Jul 2017 17:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320848 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 320848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 17:56:40 -0000 Author: kp Date: Sun Jul 9 17:56:39 2017 New Revision: 320848 URL: https://svnweb.freebsd.org/changeset/base/320848 Log: pf: Fix vnet purging pf_purge_thread() breaks up the work of iterating all states (in pf_purge_expired_states()) and tracks progress in the idx variable. If multiple vnets exist this results in pf_purge_thread() only calling pf_purge_expired_states() for part of the states (the first part of the first vnet, second part of the second vnet and so on). Combined with the mark-and-sweep approach to cleaning up old rules (in V_pf_unlinked_rules) that resulted in pf freeing rules that were still referenced by states. This in turn caused panics when pf_state_expires() encounters that state and attempts to access the rule. We need to track the progress per vnet, not globally, so idx is moved into a per-vnet V_pf_purge_idx. PR: 219251 Sponsored by: Hackathon Essen 2017 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Jul 9 17:05:48 2017 (r320847) +++ head/sys/netpfil/pf/pf.c Sun Jul 9 17:56:39 2017 (r320848) @@ -132,6 +132,9 @@ VNET_DEFINE(int, pf_tcp_iss_off); VNET_DECLARE(int, pf_vnet_active); #define V_pf_vnet_active VNET(pf_vnet_active) +static VNET_DEFINE(uint32_t, pf_purge_idx); +#define V_pf_purge_idx VNET(pf_purge_idx) + /* * Queue for pf_intr() sends. */ @@ -1427,7 +1430,6 @@ void pf_purge_thread(void *unused __unused) { VNET_ITERATOR_DECL(vnet_iter); - u_int idx = 0; sx_xlock(&pf_end_lock); while (pf_end_threads == 0) { @@ -1448,14 +1450,15 @@ pf_purge_thread(void *unused __unused) * Process 1/interval fraction of the state * table every run. */ - idx = pf_purge_expired_states(idx, pf_hashmask / + V_pf_purge_idx = + pf_purge_expired_states(V_pf_purge_idx, pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* * Purge other expired types every * PFTM_INTERVAL seconds. */ - if (idx == 0) { + if (V_pf_purge_idx == 0) { /* * Order is important: * - states and src nodes reference rules From owner-svn-src-all@freebsd.org Sun Jul 9 18:26:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9391D926B6 for ; Sun, 9 Jul 2017 18:26:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 745F267DFB for ; Sun, 9 Jul 2017 18:26:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id v202so16329247itb.0 for ; Sun, 09 Jul 2017 11:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HZ3+GMc/kt3rW6mKvnIMt4+c0XXFw9Az+hTbBe8Tm8c=; b=PoD/dMKQ7TRbIxgx9xWJyVvGYyE7BgZ+UwtaM8bu/Cp5XuM9ZwA90q9IYcmT2nRpCo jkzme9NKlQvsGPt2OT5CSN2vqhkIK1kuH4fHmjI+GclBVKNmuUc1PqZm0BljxOuxS3mW 23Ie5Nu0KSCMCdzipzXWzJ7qezadmukMlEcrWBXN15HDCATjT0P54WLNKA1bWcIXAfFc 7e4jBL9vRcGeO3b7f7E2r+6bL7K4TIcAt5TUB8Uc8sueVr3/0BZ9c8KNz7uCp6W/6NR6 QAocOv6BPDwNT3/y3+B+Qch9GmhM05PeTT8QaIHBBKyeOp6OOy53SbmAT+i2LGWO9TjE I36A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HZ3+GMc/kt3rW6mKvnIMt4+c0XXFw9Az+hTbBe8Tm8c=; b=tNuycnMyw6474v2ZfGuVKlNfiTp1MGvvt0bZWAaJ67mbTNzl6n8TCP0feAtdzK2zRB K+eQZQBWGiss698Ltm4kmxXRgFx7aFhcxbh2BiaGIE2t9JeiErh3gjw3/UdNazow9zeY OpjNRrrlFjwY4aPlzWjUGRH+vBEG+6VAST1XTMNXdQh2xdSknXPoer9hs6tBgDo3DSKc 4n8Ch0Mh1U+gIOGAW97/O4hF/hYQdqq3PjMFLPjGcZ9FfIwJ6v3+jiuJvGzIwR1PAu4M FlWXWOR65x4gtpB/KCEJEFSAHAd+1PPnviTU1NMKb4TEfdQmSiDw2SPBhprkNaVnqPgR CbSg== X-Gm-Message-State: AIVw113nbwBq5CM7A4SxMnXzu5aY3Jh02/8oVZmq06zp7lU/Ir/CzJh4 /2RarIJjaFkwPHfpl5ZoYVa1vuqt83t7 X-Received: by 10.36.139.1 with SMTP id g1mr8542713ite.18.1499624763290; Sun, 09 Jul 2017 11:26:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Sun, 9 Jul 2017 11:26:02 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5d99:2cb7:7594:1100] In-Reply-To: <20170709195525.188d6fa8@thor.intern.walstatt.dynvpn.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709195525.188d6fa8@thor.intern.walstatt.dynvpn.de> From: Warner Losh Date: Sun, 9 Jul 2017 12:26:02 -0600 X-Google-Sender-Auth: tt9EAh7pJST275HXHNeTCftP0fM Message-ID: Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... To: "O. Hartmann" Cc: "svn-src-head@freebsd.org" , Warner Losh , src-committers , "svn-src-all@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 18:26:04 -0000 Unless you are booting a MMCCAM kernel, this should be a no-op. I'll rebuild in a clean tree to make sure something weird didn't happen during the final integration... Warner On Sun, Jul 9, 2017 at 11:55 AM, O. Hartmann wrote= : > Am Sun, 9 Jul 2017 16:57:24 +0000 (UTC) > Warner Losh schrieb: > > > Author: imp > > Date: Sun Jul 9 16:57:24 2017 > > New Revision: 320844 > > URL: https://svnweb.freebsd.org/changeset/base/320844 > > > > Log: > > An MMC/SD/SDIO stack using CAM > > > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > flexible queueing will make it easier to write non-storage drivers > > than the legacy stack. SDIO drivers from both the kernel and as > > userland daemons are possible, though much of that functionality will > > come later. > > > > Some of the CAM integration isn't complete (there are sleeps in the > > device probe state machine, for example), but those minor issues can > > be improved in-tree more easily than out of tree and shouldn't gate > > progress on other fronts. Appologies to reviews if specific items > > have been overlooked. > > > > Submitted by: Ilya Bakulin > > Reviewed by: emaste, imp, mav, adrian, ian > > Differential Review: https://reviews.freebsd.org/D4761 > > > > merge with first commit, various compile hacks. > > > > Added: > > head/sys/amd64/conf/MMCCAM (contents, props changed) > > head/sys/arm/conf/BEAGLEBONE-MMCCAM (contents, props changed) > > head/sys/cam/mmc/ > > head/sys/cam/mmc/mmc.h > > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > > head/sys/cam/mmc/mmc_all.h > > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > > head/sys/cam/mmc/mmc_bus.h (contents, props changed) > > head/sys/cam/mmc/mmc_da.c (contents, props changed) > > head/sys/cam/mmc/mmc_sdio.c (contents, props changed) > > head/sys/cam/mmc/mmc_sdio.h > > - copied, changed from r320843, head/sys/dev/mmc/mmcbrvar.h > > head/sys/cam/mmc/mmc_xpt.c (contents, props changed) > > Modified: > > head/etc/mtree/BSD.include.dist > > head/include/Makefile > > head/lib/libcam/Makefile > > head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > > head/sys/arm/ti/ti_sdhci.c > > head/sys/cam/cam_ccb.h > > head/sys/cam/cam_periph.c > > head/sys/cam/cam_xpt.c > > head/sys/cam/cam_xpt.h > > head/sys/cam/cam_xpt_internal.h > > head/sys/cam/scsi/scsi_pass.c > > head/sys/conf/files > > head/sys/conf/options > > head/sys/dev/mmc/bridge.h > > head/sys/dev/mmc/mmcbrvar.h > > head/sys/dev/mmc/mmcreg.h > > head/sys/dev/sdhci/fsl_sdhci.c > > head/sys/dev/sdhci/sdhci.c > > head/sys/dev/sdhci/sdhci.h > > head/sys/dev/sdhci/sdhci_acpi.c > > head/sys/dev/sdhci/sdhci_pci.c > > head/sys/modules/Makefile > > > > Modified: head/etc/mtree/BSD.include.dist > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/etc/mtree/BSD.include.dist Sun Jul 9 15:41:49 2017 > (r320843) > > +++ head/etc/mtree/BSD.include.dist Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -90,6 +90,8 @@ > > cam > > ata > > .. > > + mmc > > + .. > > nvme > > .. > > scsi > > > > Modified: head/include/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/include/Makefile Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/include/Makefile Sun Jul 9 16:57:24 2017 (r320844) > > @@ -42,7 +42,7 @@ LHDRS=3D aio.h errno.h fcntl.h linker_set.h poll= .h > stdat > > LDIRS=3D bsm cam geom net net80211 netgraph netinet netinet6 \ > > netipsec netsmb nfs nfsclient nfsserver sys vm > > > > -LSUBDIRS=3D cam/ata cam/nvme cam/scsi \ > > +LSUBDIRS=3D cam/ata cam/mmc cam/nvme cam/scsi \ > > dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon > dev/firewire \ > > dev/hwpmc dev/hyperv \ > > dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/mmc dev/nvme \ > > > > Modified: head/lib/libcam/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/lib/libcam/Makefile Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/lib/libcam/Makefile Sun Jul 9 16:57:24 2017 (r320844) > > @@ -38,6 +38,7 @@ MLINKS+=3D cam.3 cam_open_device.3 \ > > > > .PATH: ${SRCTOP}/sys/cam \ > > ${SRCTOP}/sys/cam/ata \ > > + ${SRCTOP}/sys/cam/mmc \ > > ${SRCTOP}/sys/cam/scsi > > > > CFLAGS+=3D -I${.CURDIR} -I${SRCTOP}/sys > > > > Added: head/sys/amd64/conf/MMCCAM > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/amd64/conf/MMCCAM Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -0,0 +1,36 @@ > > +# MMCCAM is the kernel config for doing MMC on CAM development > > +# and testing on bhyve > > +# $FreeBSD$ > > + > > +include MINIMAL > > + > > +ident MMCCAM > > + > > +# Access GPT-formatted and labeled root volume > > +options GEOM_PART_GPT > > +options GEOM_LABEL > > + > > +# UART -- for bhyve console > > +device uart > > + > > +# kgdb stub > > +device bvmdebug > > + > > +# VirtIO support, needed for bhyve > > +device virtio # Generic VirtIO bus > (required) > > +device virtio_pci # VirtIO PCI device > > +device vtnet # VirtIO Ethernet device > > +device virtio_blk # VirtIO Block device > > +device virtio_scsi # VirtIO SCSI device > > +device virtio_balloon # VirtIO Memory Balloon > device > > + > > +# CAM-specific stuff > > +device pass > > +device scbus > > +device da > > +device mmccam > > + > > +options MMCCAM > > +# Add CAMDEBUG stuff > > +options CAMDEBUG > > +options > > CAM_DEBUG_FLAGS=3D(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_ > DEBUG_PERIPH|CAM_DEBUG_TRACE) > > > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Jul 9 > 15:41:49 > > 2017 (r320843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > Sun Jul > > 9 16:57:24 2017 (r320844) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$")= ; > > #include "mmcbr_if.h" > > #include "sdhci_if.h" > > > > +#include "opt_mmccam.h" > > + > > #include "bcm2835_dma.h" > > #include > > #include "bcm2835_vcbus.h" > > @@ -253,7 +255,11 @@ bcm_sdhci_attach(device_t dev) > > bus_generic_probe(dev); > > bus_generic_attach(dev); > > > > +#ifdef MMCCAM > > + sdhci_cam_start_slot(&sc->sc_slot); > > +#else > > sdhci_start_slot(&sc->sc_slot); > > +#endif > > > > return (0); > > > > > > Added: head/sys/arm/conf/BEAGLEBONE-MMCCAM > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/arm/conf/BEAGLEBONE-MMCCAM Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -0,0 +1,21 @@ > > +# > > +# BEAGLEBONE-MMCCAM > > +# > > +# Custom kernel for Beaglebone plus MMCCAM as opposed to the prior MMC > stack. It is > > +# present to keep it building in tree since it wouldn't work in LINT. > > +# > > +# $FreeBSD$ > > + > > +include BEAGLEBONE > > + > > +# Add CAMDEBUG stuff > > +options CAMDEBUG > > +options > > CAM_DEBUG_FLAGS=3D(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_= DEBUG_TRACE) > + > > +# pass(4) device > > +device pass > > +device mmccam > > +options MMCCAM > > + > > +nodevice mmc > > +nodevice mmcsd > > > > Modified: head/sys/arm/ti/ti_sdhci.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/arm/ti/ti_sdhci.c Sun Jul 9 15:41:49 2017 > (r320843) > > +++ head/sys/arm/ti/ti_sdhci.c Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > +#include > > > > #include > > #include > > @@ -60,6 +62,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include "gpio_if.h" > > > > +#include "opt_mmccam.h" > > + > > struct ti_sdhci_softc { > > device_t dev; > > struct sdhci_fdt_gpio * gpio; > > @@ -122,6 +126,11 @@ static struct ofw_compat_data compat_data[] =3D { > > #define MMCHS_SD_CAPA_VS30 (1 << 25) > > #define MMCHS_SD_CAPA_VS33 (1 << 24) > > > > +/* Forward declarations, CAM-relataed */ > > +// static void ti_sdhci_cam_poll(struct cam_sim *); > > +// static void ti_sdhci_cam_action(struct cam_sim *, union ccb *); > > +// static int ti_sdhci_cam_settran_settings(struct ti_sdhci_softc *sc, > union ccb *); > > + > > static inline uint32_t > > ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) > > { > > @@ -241,6 +250,22 @@ ti_sdhci_write_1(device_t dev, struct sdhci_slot > *slot > > struct ti_sdhci_softc *sc =3D device_get_softc(dev); > > uint32_t val32; > > > > +#ifdef MMCCAM > > + uint32_t newval32; > > + if (off =3D=3D SDHCI_HOST_CONTROL) { > > + val32 =3D ti_mmchs_read_4(sc, MMCHS_CON); > > + newval32 =3D val32; > > + if (val & SDHCI_CTRL_8BITBUS) { > > + device_printf(dev, "Custom-enabling 8-bit bus\n")= ; > > + newval32 |=3D MMCHS_CON_DW8; > > + } else { > > + device_printf(dev, "Custom-disabling 8-bit bus\n"= ); > > + newval32 &=3D ~MMCHS_CON_DW8; > > + } > > + if (newval32 !=3D val32) > > + ti_mmchs_write_4(sc, MMCHS_CON, newval32); > > + } > > +#endif > > val32 =3D RD4(sc, off & ~3); > > val32 &=3D ~(0xff << (off & 3) * 8); > > val32 |=3D (val << (off & 3) * 8); > > @@ -658,8 +683,11 @@ ti_sdhci_attach(device_t dev) > > bus_generic_probe(dev); > > bus_generic_attach(dev); > > > > +#ifdef MMCCAM > > + sdhci_cam_start_slot(&sc->slot); > > +#else > > sdhci_start_slot(&sc->slot); > > - > > +#endif > > return (0); > > > > fail: > > @@ -730,4 +758,7 @@ static driver_t ti_sdhci_driver =3D { > > DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, > NULL, > > NULL); > > MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); > > + > > +#ifndef MMCCAM > > MMC_DECLARE_BRIDGE(sdhci_ti); > > +#endif > > > > Modified: head/sys/cam/cam_ccb.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/cam/cam_ccb.h Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/sys/cam/cam_ccb.h Sun Jul 9 16:57:24 2017 (r320844) > > @@ -42,6 +42,7 @@ > > #include > > #include > > #include > > +#include > > > > /* General allocation length definitions for CCB structures */ > > #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB > bytes/pointer */ > > @@ -208,10 +209,10 @@ typedef enum { > > XPT_NVME_IO =3D 0x1c | XPT_FC_DEV_QUEUED, > > /* Execiute the requestred NVMe I/O > operation */ > > > > - XPT_MMCSD_IO =3D 0x1d | XPT_FC_DEV_QUEUED, > > + XPT_MMC_IO =3D 0x1d | XPT_FC_DEV_QUEUED, > > /* Placeholder for MMC / SD / SDIO I/O > stuff */ > > > > - XPT_SCAN_TGT =3D 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CC= B > > + XPT_SCAN_TGT =3D 0x1e | XPT_FC_QUEUED | XPT_FC_USER_CC= B > > | XPT_FC_XPT_ONLY, > > /* Scan Target */ > > > > @@ -267,6 +268,7 @@ typedef enum { > > PROTO_SATAPM, /* SATA Port Multiplier */ > > PROTO_SEMB, /* SATA Enclosure Management Bridge */ > > PROTO_NVME, /* NVME */ > > + PROTO_MMCSD, /* MMC, SD, SDIO */ > > } cam_proto; > > > > typedef enum { > > @@ -283,6 +285,7 @@ typedef enum { > > XPORT_ISCSI, /* iSCSI */ > > XPORT_SRP, /* SCSI RDMA Protocol */ > > XPORT_NVME, /* NVMe over PCIe */ > > + XPORT_MMCSD, /* MMC, SD, SDIO card */ > > } cam_xport; > > > > #define XPORT_IS_NVME(t) ((t) =3D=3D XPORT_NVME) > > @@ -498,6 +501,7 @@ struct device_match_result { > > cam_proto protocol; > > struct scsi_inquiry_data inq_data; > > struct ata_params ident_data; > > + struct mmc_params mmc_ident_data; > > dev_result_flags flags; > > }; > > > > @@ -773,6 +777,16 @@ struct ccb_ataio { > > uint32_t unused; > > }; > > > > +/* > > + * MMC I/O Request CCB used for the XPT_MMC_IO function code. > > + */ > > +struct ccb_mmcio { > > + struct ccb_hdr ccb_h; > > + union ccb *next_ccb; /* Ptr for next CCB for action */ > > + struct mmc_command cmd; > > + struct mmc_command stop; > > +}; > > + > > struct ccb_accept_tio { > > struct ccb_hdr ccb_h; > > cdb_t cdb_io; /* Union for CDB bytes/pointer */ > > @@ -1005,7 +1019,28 @@ struct ccb_trans_settings_nvme > > u_int max_xfer; /* Max transfer size (0 -> > unlimited */ > > u_int caps; > > }; > > - > > + > > +#include > > +struct ccb_trans_settings_mmc { > > + struct mmc_ios ios; > > +#define MMC_CLK (1 << 1) > > +#define MMC_VDD (1 << 2) > > +#define MMC_CS (1 << 3) > > +#define MMC_BW (1 << 4) > > +#define MMC_PM (1 << 5) > > +#define MMC_BT (1 << 6) > > +#define MMC_BM (1 << 7) > > + uint32_t ios_valid; > > +/* The folowing is used only for GET_TRAN_SETTINGS */ > > + uint32_t host_ocr; > > + int host_f_min; > > + int host_f_max; > > +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can do 4-bit data transfers *= / > > +#define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers *= / > > +#define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed > transfers */ > > + uint32_t host_caps; > > +}; > > + > > /* Get/Set transfer rate/width/disconnection/tag queueing settings */ > > struct ccb_trans_settings { > > struct ccb_hdr ccb_h; > > @@ -1019,6 +1054,7 @@ struct ccb_trans_settings { > > struct ccb_trans_settings_ata ata; > > struct ccb_trans_settings_scsi scsi; > > struct ccb_trans_settings_nvme nvme; > > + struct ccb_trans_settings_mmc mmc; > > } proto_specific; > > union { > > u_int valid; /* Which fields to honor */ > > @@ -1284,6 +1320,7 @@ union ccb { > > struct ccb_dev_advinfo cdai; > > struct ccb_async casync; > > struct ccb_nvmeio nvmeio; > > + struct ccb_mmcio mmcio; > > }; > > > > #define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ > > @@ -1327,6 +1364,13 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t > retri > > uint32_t timeout); > > > > static __inline void > > +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, > > + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t > flags, > > + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t > mmc_flags, > > + struct mmc_data *mmc_d, > > + uint32_t timeout); > > + > > +static __inline void > > cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, > > void (*cbfcnp)(struct cam_periph *, union ccb *), > > u_int32_t flags, u_int8_t tag_action, > > @@ -1412,6 +1456,34 @@ cam_fill_smpio(struct ccb_smpio *smpio, uint32_t > retri > > smpio->smp_request_len =3D smp_request_len; > > smpio->smp_response =3D smp_response; > > smpio->smp_response_len =3D smp_response_len; > > +} > > + > > +static __inline void > > +cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, > > + void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t > flags, > > + uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, > > + struct mmc_data *mmc_d, > > + uint32_t timeout) > > +{ > > + mmcio->ccb_h.func_code =3D XPT_MMC_IO; > > + mmcio->ccb_h.flags =3D flags; > > + mmcio->ccb_h.retry_count =3D retries; > > + mmcio->ccb_h.cbfcnp =3D cbfcnp; > > + mmcio->ccb_h.timeout =3D timeout; > > + mmcio->cmd.opcode =3D mmc_opcode; > > + mmcio->cmd.arg =3D mmc_arg; > > + mmcio->cmd.flags =3D mmc_flags; > > + mmcio->stop.opcode =3D 0; > > + mmcio->stop.arg =3D 0; > > + mmcio->stop.flags =3D 0; > > + if (mmc_d !=3D NULL) { > > + mmcio->cmd.data =3D mmc_d; > > + } else > > + mmcio->cmd.data =3D NULL; > > + mmcio->cmd.resp[0] =3D 0; > > + mmcio->cmd.resp[1] =3D 0; > > + mmcio->cmd.resp[2] =3D 0; > > + mmcio->cmd.resp[3] =3D 0; > > } > > > > static __inline void > > > > Modified: head/sys/cam/cam_periph.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/cam/cam_periph.c Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/sys/cam/cam_periph.c Sun Jul 9 16:57:24 2017 (r320844) > > @@ -827,6 +827,18 @@ cam_periph_mapmem(union ccb *ccb, struct > cam_periph_ma > > dirs[0] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > > numbufs =3D 1; > > break; > > + case XPT_MMC_IO: > > + if ((ccb->ccb_h.flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE= ) > > + return(0); > > + /* Two mappings: one for cmd->data and one for > cmd->data->data */ > > + data_ptrs[0] =3D (unsigned char **)&ccb->mmcio.cmd.data; > > + lengths[0] =3D sizeof(struct mmc_data *); > > + dirs[0] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > > + data_ptrs[1] =3D (unsigned char > **)&ccb->mmcio.cmd.data->data; > > + lengths[1] =3D ccb->mmcio.cmd.data->len; > > + dirs[1] =3D ccb->ccb_h.flags & CAM_DIR_MASK; > > + numbufs =3D 2; > > + break; > > case XPT_SMP_IO: > > data_ptrs[0] =3D &ccb->smpio.smp_request; > > lengths[0] =3D ccb->smpio.smp_request_len; > > > > Modified: head/sys/cam/cam_xpt.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/cam/cam_xpt.c Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/sys/cam/cam_xpt.c Sun Jul 9 16:57:24 2017 (r320844) > > @@ -329,7 +329,6 @@ static xpt_devicefunc_t xptsetasyncfunc; > > static xpt_busfunc_t xptsetasyncbusfunc; > > static cam_status xptregister(struct cam_periph *periph, > > void *arg); > > -static const char * xpt_action_name(uint32_t action); > > static __inline int device_is_queued(struct cam_ed *device); > > > > static __inline int > > @@ -412,7 +411,7 @@ xptioctl(struct cdev *dev, u_long cmd, caddr_t addr= , > i > > } > > return (error); > > } > > - > > + > > static int > > xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struc= t > thread *td) > > { > > @@ -820,6 +819,8 @@ xpt_scanner_thread(void *dummy) > > TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, > sim_links.tqe); > > xpt_unlock_buses(); > > > > + printf("xpt_scanner_thread is firing on path "= ); > > + xpt_print_path(ccb->ccb_h.path);printf("\n"); > > /* > > * Since lock can be dropped inside and path free= d > > * by completion callback even before return here= , > > @@ -1503,7 +1504,7 @@ xptdevicematch(struct dev_match_pattern *patterns= , > u_i > > > > cur_pattern =3D &patterns[i].pattern.device_pattern; > > > > - /* Error out if mutually exclusive options are specified. > */ > > + /* Error out if mutually exclusive options are specified. > */ > > if ((cur_pattern->flags & (DEV_MATCH_INQUIRY|DEV_MATCH_ > DEVID)) > > =3D=3D (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) > > return(DM_RET_ERROR); > > @@ -1905,6 +1906,9 @@ xptedtdevicefunc(struct cam_ed *device, void *arg= ) > > bcopy(&device->ident_data, > > &cdm->matches[j].result.device_result.ident_data, > > sizeof(struct ata_params)); > > + bcopy(&device->mmc_ident_data, > > + &cdm->matches[j].result. > device_result.mmc_ident_data, > > + sizeof(struct mmc_params)); > > > > /* Let the user know whether this device is unconfigured = */ > > if (device->flags & CAM_DEV_UNCONFIGURED) > > @@ -2690,6 +2694,8 @@ xpt_action_default(union ccb *start_ccb) > > if (start_ccb->ccb_h.func_code =3D=3D XPT_NVME_IO) > > start_ccb->nvmeio.resid =3D 0; > > /* FALLTHROUGH */ > > + case XPT_MMC_IO: > > + /* XXX just like nmve_io? */ > > case XPT_RESET_DEV: > > case XPT_ENG_EXEC: > > case XPT_SMP_IO: > > @@ -2801,11 +2807,12 @@ call_sim: > > mtx_lock(mtx); > > else > > mtx =3D NULL; > > + > > CAM_DEBUG(path, CAM_DEBUG_TRACE, > > - ("sim->sim_action: func=3D%#x\n", > start_ccb->ccb_h.func_code)); > > + ("Calling sim->sim_action(): func=3D%#x\n", > > start_ccb->ccb_h.func_code)); (*(sim->sim_action))(sim, start_ccb); > > CAM_DEBUG(path, CAM_DEBUG_TRACE, > > - ("sim->sim_action: status=3D%#x\n", > start_ccb->ccb_h.status)); > > + ("sim->sim_action returned: status=3D%#x\n", > > start_ccb->ccb_h.status)); if (mtx) > > mtx_unlock(mtx); > > break; > > @@ -5540,7 +5547,7 @@ static struct kv map[] =3D { > > { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, > > { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, > > { XPT_NVME_IO, "XPT_NVME_IO" }, > > - { XPT_MMCSD_IO, "XPT_MMCSD_IO" }, > > + { XPT_MMC_IO, "XPT_MMC_IO" }, > > { XPT_SMP_IO, "XPT_SMP_IO" }, > > { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, > > { XPT_ENG_INQ, "XPT_ENG_INQ" }, > > @@ -5556,7 +5563,7 @@ static struct kv map[] =3D { > > { 0, 0 } > > }; > > > > -static const char * > > +const char * > > xpt_action_name(uint32_t action) > > { > > static char buffer[32]; /* Only for unknown messages -- racy */ > > > > Modified: head/sys/cam/cam_xpt.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/cam/cam_xpt.h Sun Jul 9 15:41:49 2017 (r320843) > > +++ head/sys/cam/cam_xpt.h Sun Jul 9 16:57:24 2017 (r320844) > > @@ -141,6 +141,8 @@ void xpt_copy_path(struct > cam_path *new_path, > > > > void xpt_release_path(struct cam_path *path); > > > > +const char * xpt_action_name(uint32_t action); > > + > > #endif /* _KERNEL */ > > > > #endif /* _CAM_CAM_XPT_H */ > > > > Modified: head/sys/cam/cam_xpt_internal.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/cam/cam_xpt_internal.h Sun Jul 9 15:41:49 2017 > (r320843) > > +++ head/sys/cam/cam_xpt_internal.h Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -125,6 +125,7 @@ struct cam_ed { > > uint32_t rcap_len; > > uint8_t *rcap_buf; > > struct ata_params ident_data; > > + struct mmc_params mmc_ident_data; > > u_int8_t inq_flags; /* > > * Current settings for inquiry > flags. > > * This allows us to override > settings > > > > Copied and modified: head/sys/cam/mmc/mmc.h (from r320843, > head/sys/dev/mmc/mmcbrvar.h) > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 > (r320843, copy > > source) +++ head/sys/cam/mmc/mmc.h Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -1,6 +1,5 @@ > > /*- > > - * Copyright (c) 2006 Bernd Walter. All rights reserved. > > - * Copyright (c) 2006 M. Warner Losh. All rights reserved. > > + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > * modification, are permitted provided that the following conditions > > @@ -49,77 +48,47 @@ > > * or the SD Card Association to disclose or distribute any technical > > * information, know-how or other confidential information to any thir= d > party. > > * > > + * Inspired coded in sys/dev/mmc. Thanks to Warner Losh >, > > + * Bernd Walter , and other authors. > > + * > > * $FreeBSD$ > > */ > > > > -#ifndef DEV_MMC_MMCBRVAR_H > > -#define DEV_MMC_MMCBRVAR_H > > +#ifndef CAM_MMC_H > > +#define CAM_MMC_H > > > > #include > > - > > -#include "mmcbr_if.h" > > - > > -enum mmcbr_device_ivars { > > - MMCBR_IVAR_BUS_MODE, > > - MMCBR_IVAR_BUS_WIDTH, > > - MMCBR_IVAR_CHIP_SELECT, > > - MMCBR_IVAR_CLOCK, > > - MMCBR_IVAR_F_MIN, > > - MMCBR_IVAR_F_MAX, > > - MMCBR_IVAR_HOST_OCR, > > - MMCBR_IVAR_MODE, > > - MMCBR_IVAR_OCR, > > - MMCBR_IVAR_POWER_MODE, > > - MMCBR_IVAR_VDD, > > - MMCBR_IVAR_VCCQ, > > - MMCBR_IVAR_CAPS, > > - MMCBR_IVAR_TIMING, > > - MMCBR_IVAR_MAX_DATA, > > - MMCBR_IVAR_MAX_BUSY_TIMEOUT > > -}; > > - > > /* > > - * Simplified accessors for bridge devices > > + * This structure describes an MMC/SD card > > */ > > -#define MMCBR_ACCESSOR(var, ivar, type) > \ > > - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) > > +struct mmc_params { > > + u_int8_t model[40]; /* Card model */ > > > > -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) > > -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) > > -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) > > -MMCBR_ACCESSOR(clock, CLOCK, int) > > -MMCBR_ACCESSOR(f_max, F_MAX, int) > > -MMCBR_ACCESSOR(f_min, F_MIN, int) > > -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) > > -MMCBR_ACCESSOR(mode, MODE, int) > > -MMCBR_ACCESSOR(ocr, OCR, int) > > -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) > > -MMCBR_ACCESSOR(vdd, VDD, int) > > -MMCBR_ACCESSOR(vccq, VCCQ, int) > > -MMCBR_ACCESSOR(caps, CAPS, int) > > -MMCBR_ACCESSOR(timing, TIMING, int) > > -MMCBR_ACCESSOR(max_data, MAX_DATA, int) > > -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) > > + /* Card OCR */ > > + uint32_t card_ocr; > > > > -static int __inline > > -mmcbr_update_ios(device_t dev) > > -{ > > + /* OCR of the IO portion of the card */ > > + uint32_t io_ocr; > > > > - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); > > -} > > + /* Card CID -- raw and parsed */ > > + uint32_t card_cid[4]; > > + struct mmc_cid cid; > > > > -static int __inline > > -mmcbr_switch_vccq(device_t dev) > > -{ > > + /* Card CSD -- raw */ > > + uint32_t card_csd[4]; > > > > - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); > > -} > > + /* Card RCA */ > > + uint16_t card_rca; > > > > -static int __inline > > -mmcbr_get_ro(device_t dev) > > -{ > > + /* What kind of card is it */ > > + uint32_t card_features; > > +#define CARD_FEATURE_MEMORY 0x1 > > +#define CARD_FEATURE_SDHC 0x1 << 1 > > +#define CARD_FEATURE_SDIO 0x1 << 2 > > +#define CARD_FEATURE_SD20 0x1 << 3 > > +#define CARD_FEATURE_MMC 0x1 << 4 > > > > - return (MMCBR_GET_RO(device_get_parent(dev), dev)); > > -} > > + uint8_t sdio_func_count; > > +} __packed; > > > > -#endif /* DEV_MMC_MMCBRVAR_H */ > > +#endif > > > > Copied and modified: head/sys/cam/mmc/mmc_all.h (from r320843, > > head/sys/dev/mmc/mmcbrvar.h) > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- > > head/sys/dev/mmc/mmcbrvar.h Sun Jul 9 15:41:49 2017 (r320843, > copy > > source) +++ head/sys/cam/mmc/mmc_all.h Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -1,6 +1,5 @@ /*- > > - * Copyright (c) 2006 Bernd Walter. All rights reserved. > > - * Copyright (c) 2006 M. Warner Losh. All rights reserved. > > + * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > * modification, are permitted provided that the following conditions > > @@ -52,74 +51,20 @@ > > * $FreeBSD$ > > */ > > > > -#ifndef DEV_MMC_MMCBRVAR_H > > -#define DEV_MMC_MMCBRVAR_H > > - > > -#include > > - > > -#include "mmcbr_if.h" > > - > > -enum mmcbr_device_ivars { > > - MMCBR_IVAR_BUS_MODE, > > - MMCBR_IVAR_BUS_WIDTH, > > - MMCBR_IVAR_CHIP_SELECT, > > - MMCBR_IVAR_CLOCK, > > - MMCBR_IVAR_F_MIN, > > - MMCBR_IVAR_F_MAX, > > - MMCBR_IVAR_HOST_OCR, > > - MMCBR_IVAR_MODE, > > - MMCBR_IVAR_OCR, > > - MMCBR_IVAR_POWER_MODE, > > - MMCBR_IVAR_VDD, > > - MMCBR_IVAR_VCCQ, > > - MMCBR_IVAR_CAPS, > > - MMCBR_IVAR_TIMING, > > - MMCBR_IVAR_MAX_DATA, > > - MMCBR_IVAR_MAX_BUSY_TIMEOUT > > -}; > > - > > /* > > - * Simplified accessors for bridge devices > > + * MMC function that should be visible to the CAM subsystem > > + * and are somehow useful should be declared here > > + * > > + * Like in other *_all.h, it's also a nice place to include > > + * some other transport-specific headers. > > */ > > -#define MMCBR_ACCESSOR(var, ivar, type) > \ > > - __BUS_ACCESSOR(mmcbr, var, MMCBR, ivar, type) > > > > -MMCBR_ACCESSOR(bus_mode, BUS_MODE, int) > > -MMCBR_ACCESSOR(bus_width, BUS_WIDTH, int) > > -MMCBR_ACCESSOR(chip_select, CHIP_SELECT, int) > > -MMCBR_ACCESSOR(clock, CLOCK, int) > > -MMCBR_ACCESSOR(f_max, F_MAX, int) > > -MMCBR_ACCESSOR(f_min, F_MIN, int) > > -MMCBR_ACCESSOR(host_ocr, HOST_OCR, int) > > -MMCBR_ACCESSOR(mode, MODE, int) > > -MMCBR_ACCESSOR(ocr, OCR, int) > > -MMCBR_ACCESSOR(power_mode, POWER_MODE, int) > > -MMCBR_ACCESSOR(vdd, VDD, int) > > -MMCBR_ACCESSOR(vccq, VCCQ, int) > > -MMCBR_ACCESSOR(caps, CAPS, int) > > -MMCBR_ACCESSOR(timing, TIMING, int) > > -MMCBR_ACCESSOR(max_data, MAX_DATA, int) > > -MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int) > > +#ifndef CAM_MMC_ALL_H > > +#define CAM_MMC_ALL_H > > > > -static int __inline > > -mmcbr_update_ios(device_t dev) > > -{ > > +#include > > +#include > > > > - return (MMCBR_UPDATE_IOS(device_get_parent(dev), dev)); > > -} > > +void mmc_print_ident(struct mmc_params *ident_data); > > > > -static int __inline > > -mmcbr_switch_vccq(device_t dev) > > -{ > > - > > - return (MMCBR_SWITCH_VCCQ(device_get_parent(dev), dev)); > > -} > > - > > -static int __inline > > -mmcbr_get_ro(device_t dev) > > -{ > > - > > - return (MMCBR_GET_RO(device_get_parent(dev), dev)); > > -} > > - > > -#endif /* DEV_MMC_MMCBRVAR_H */ > > +#endif > > > > Added: head/sys/cam/mmc/mmc_bus.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/cam/mmc/mmc_bus.h Sun Jul 9 16:57:24 2017 > (r320844) > > @@ -0,0 +1,5 @@ > > +/* > > + * This file is in the public domain. > > + * $FreeBSD$ > > + */ > > +#include > > > > Added: head/sys/cam/mmc/mmc_da.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/cam/mmc/mmc_da.c Sun Jul 9 16:57:24 2017 (r320844) > > @@ -0,0 +1,1432 @@ > > +/*- > > + * Copyright (c) 2006 Bernd Walter > > + * Copyright (c) 2006 M. Warner Losh > > + * Copyright (c) 2009 Alexander Motin > > + * Copyright (c) 2015-2017 Ilya Bakulin > > + * All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + * notice, this list of conditions and the following disclaimer, > > + * without modification, immediately at the beginning of the file. > > + * 2. Redistributions in binary form must reproduce the above copyrigh= t > > + * notice, this list of conditions and the following disclaimer in > the > > + * documentation and/or other materials provided with the > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS O= R > > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > DISCLAIMED. > > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING= , > BUT > > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS O= F > USE, > > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A= NY > > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE > USE OF > > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > + * > > + * Some code derived from the sys/dev/mmc and sys/cam/ata > > + * Thanks to Warner Losh , Alexander Motin > > > + * Bernd Walter , and other authors. > > + */ > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +//#include "opt_sdda.h" > > + > > +#include > > + > > +#ifdef _KERNEL > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include /* for PRIu64 */ > > +#endif /* _KERNEL */ > > + > > +#ifndef _KERNEL > > +#include > > +#include > > +#endif /* _KERNEL */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > + > > +#include > > + > > +#include /* geometry translation */ > > + > > +#ifdef _KERNEL > > + > > +typedef enum { > > + SDDA_FLAG_OPEN =3D 0x0002, > > + SDDA_FLAG_DIRTY =3D 0x0004 > > +} sdda_flags; > > + > > +typedef enum { > > + SDDA_STATE_INIT, > > + SDDA_STATE_INVALID, > > + SDDA_STATE_NORMAL > > +} sdda_state; > > + > > +struct sdda_softc { > > + struct bio_queue_head bio_queue; > > + int outstanding_cmds; /* Number of active commands */ > > + int refcount; /* Active xpt_action() calls */ > > + sdda_state state; > > + sdda_flags flags; > > + struct mmc_data *mmcdata; > > +// sdda_quirks quirks; > > + struct task start_init_task; > > + struct disk *disk; > > + uint32_t raw_csd[4]; > > + uint8_t raw_ext_csd[512]; /* MMC only? */ > > + struct mmc_csd csd; > > + struct mmc_cid cid; > > + struct mmc_scr scr; > > + /* Calculated from CSD */ > > + uint64_t sector_count; > > + uint64_t mediasize; > > + > > + /* Calculated from CID */ > > + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) = */ > > + char card_sn_string[16];/* Formatted serial # for disk->d_ident *= / > > + /* Determined from CSD + is highspeed card*/ > > + uint32_t card_f_max; > > +}; > > + > > +#define ccb_bp ppriv_ptr1 > > + > > +static disk_strategy_t sddastrategy; > > +static periph_init_t sddainit; > > +static void sddaasync(void *callback_arg, u_int32_t > code, > > + struct cam_path *path, void *arg); > > +static periph_ctor_t sddaregister; > > +static periph_dtor_t sddacleanup; > > +static periph_start_t sddastart; > > +static periph_oninv_t sddaoninvalidate; > > +static void sddadone(struct cam_periph *periph, > > + union ccb *done_ccb); > > +static int sddaerror(union ccb *ccb, u_int32_t cam_flags, > > + u_int32_t sense_flags); > > + > > +static uint16_t get_rca(struct cam_periph *periph); > > +static cam_status sdda_hook_into_geom(struct cam_periph *periph); > > +static void sdda_start_init(void *context, union ccb *start_ccb); > > +static void sdda_start_init_task(void *context, int pending); > > + > > +static struct periph_driver sddadriver =3D > > +{ > > + sddainit, "sdda", > > + TAILQ_HEAD_INITIALIZER(sddadriver.units), /* generation */ 0 > > +}; > > + > > +PERIPHDRIVER_DECLARE(sdda, sddadriver); > > + > > +static MALLOC_DEFINE(M_SDDA, "sd_da", "sd_da buffers"); > > + > > +static const int exp[8] =3D { > > + 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 > > +}; > > + > > +static const int mant[16] =3D { > > + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 > > +}; > > + > > +static const int cur_min[8] =3D { > > + 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 > > +}; > > + > > +static const int cur_max[8] =3D { > > + 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 > > +}; > > + > > +static uint16_t > > +get_rca(struct cam_periph *periph) { > > + return periph->path->device->mmc_ident_data.card_rca; > > +} > > + > > +static uint32_t > > +mmc_get_bits(uint32_t *bits, int bit_len, int start, int size) > > +{ > > + const int i =3D (bit_len / 32) - (start / 32) - 1; > > + const int shift =3D start & 31; > > + uint32_t retval =3D bits[i] >> shift; > > + if (size + shift > 32) > > + retval |=3D bits[i - 1] << (32 - shift); > > + return (retval & ((1llu << size) - 1)); > > +} > > + > > + > > +static void > > +mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) > > +{ > > + int v; > > + int m; > > + int e; > > + > > + memset(csd, 0, sizeof(*csd)); > > + csd->csd_structure =3D v =3D mmc_get_bits(raw_csd, 128, 126, 2); > > + if (v =3D=3D 0) { > > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > > + csd->tacc =3D (exp[e] * mant[m] + 9) / 10; > > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, = 4); > > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1= ); > > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78= , > 1); > > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77,= 1); > > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > > + csd->vdd_r_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128= , > 59, 3)]; > > + csd->vdd_r_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128= , > 56, 3)]; > > + csd->vdd_w_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128= , > 53, 3)]; > > + csd->vdd_w_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128= , > 50, 3)]; > > + m =3D mmc_get_bits(raw_csd, 128, 62, 12); > > + e =3D mmc_get_bits(raw_csd, 128, 47, 3); > > + csd->capacity =3D ((1 + m) << (e + 2)) * csd->read_bl_len= ; > > + csd->erase_blk_en =3D mmc_get_bits(raw_csd, 128, 46, 1); > > + csd->erase_sector =3D mmc_get_bits(raw_csd, 128, 39, 7) += 1; > > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 7); > > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3= ); > > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22,= 4); > > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, = 1); > > + } else if (v =3D=3D 1) { > > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > > + csd->tacc =3D (exp[e] * mant[m] + 9) / 10; > > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, = 4); > > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1= ); > > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78= , > 1); > > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77,= 1); > > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > > + csd->capacity =3D ((uint64_t)mmc_get_bits(raw_csd, 128, 4= 8, > 22) + 1) * > > + 512 * 1024; > > + csd->erase_blk_en =3D mmc_get_bits(raw_csd, 128, 46, 1); > > + csd->erase_sector =3D mmc_get_bits(raw_csd, 128, 39, 7) += 1; > > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 7); > > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3= ); > > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22,= 4); > > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, = 1); > > + } else > > + panic("unknown SD CSD version"); > > +} > > + > > +static void > > +mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd) > > +{ > > + int m; > > + int e; > > + > > + memset(csd, 0, sizeof(*csd)); > > + csd->csd_structure =3D mmc_get_bits(raw_csd, 128, 126, 2); > > + csd->spec_vers =3D mmc_get_bits(raw_csd, 128, 122, 4); > > + m =3D mmc_get_bits(raw_csd, 128, 115, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 112, 3); > > + csd->tacc =3D exp[e] * mant[m] + 9 / 10; > > + csd->nsac =3D mmc_get_bits(raw_csd, 128, 104, 8) * 100; > > + m =3D mmc_get_bits(raw_csd, 128, 99, 4); > > + e =3D mmc_get_bits(raw_csd, 128, 96, 3); > > + csd->tran_speed =3D exp[e] * 10000 * mant[m]; > > + csd->ccc =3D mmc_get_bits(raw_csd, 128, 84, 12); > > + csd->read_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 80, 4); > > + csd->read_bl_partial =3D mmc_get_bits(raw_csd, 128, 79, 1); > > + csd->write_blk_misalign =3D mmc_get_bits(raw_csd, 128, 78, 1); > > + csd->read_blk_misalign =3D mmc_get_bits(raw_csd, 128, 77, 1); > > + csd->dsr_imp =3D mmc_get_bits(raw_csd, 128, 76, 1); > > + csd->vdd_r_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 59, 3)= ]; > > + csd->vdd_r_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 56, 3)= ]; > > + csd->vdd_w_curr_min =3D cur_min[mmc_get_bits(raw_csd, 128, 53, 3)= ]; > > + csd->vdd_w_curr_max =3D cur_max[mmc_get_bits(raw_csd, 128, 50, 3)= ]; > > + m =3D mmc_get_bits(raw_csd, 128, 62, 12); > > + e =3D mmc_get_bits(raw_csd, 128, 47, 3); > > + csd->capacity =3D ((1 + m) << (e + 2)) * csd->read_bl_len; > > + csd->erase_blk_en =3D 0; > > + csd->erase_sector =3D (mmc_get_bits(raw_csd, 128, 42, 5) + 1) * > > + (mmc_get_bits(raw_csd, 128, 37, 5) + 1); > > + csd->wp_grp_size =3D mmc_get_bits(raw_csd, 128, 32, 5); > > + csd->wp_grp_enable =3D mmc_get_bits(raw_csd, 128, 31, 1); > > + csd->r2w_factor =3D 1 << mmc_get_bits(raw_csd, 128, 26, 3); > > + csd->write_bl_len =3D 1 << mmc_get_bits(raw_csd, 128, 22, 4); > > + csd->write_bl_partial =3D mmc_get_bits(raw_csd, 128, 21, 1); > > +} > > + > > +static void > > +mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid) > > +{ > > + int i; > > + > > + /* There's no version info, so we take it on faith */ > > + memset(cid, 0, sizeof(*cid)); > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > r320847 doesn't boot. It cycles all over a kernel panic (looks like a > trap12), reboots. > Then, sometimes if the boot process can proceed after an erratic number o= f > attempts, it > gets stuck in the loader's mountroot, bad device 16 error. > > I can not say whether this is due to this commit (On the crashing box, I > have no > debugging enabled an I'm back with r320829 which seems to work). > > -- > O. Hartmann > > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Ab= s. 4 BDSG). > From owner-svn-src-all@freebsd.org Sun Jul 9 18:42:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E6AD92C33; Sun, 9 Jul 2017 18:42:30 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 29F2268763; Sun, 9 Jul 2017 18:42:29 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id v69IgL8a060002 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 9 Jul 2017 20:42:21 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id v69IgLMX060001; Sun, 9 Jul 2017 20:42:21 +0200 (CEST) (envelope-from marius) Date: Sun, 9 Jul 2017 20:42:21 +0200 From: Marius Strobl To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... Message-ID: <20170709184221.GB38352@alchemy.franken.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707091657.v69GvOar096942@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 18:42:30 -0000 On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > Author: imp > Date: Sun Jul 9 16:57:24 2017 > New Revision: 320844 > URL: https://svnweb.freebsd.org/changeset/base/320844 > > Log: > An MMC/SD/SDIO stack using CAM > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > flexible queueing will make it easier to write non-storage drivers > than the legacy stack. SDIO drivers from both the kernel and as > userland daemons are possible, though much of that functionality will > come later. At least with a non-MMCCAM kernel, with this revision in place I get an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during boot. Apparently this is due to the fact that sdhci(4) now enables these interrupts, but sdhci_generic_intr() neither actually handles them nor clears them from intmask. Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this commit? Marius From owner-svn-src-all@freebsd.org Sun Jul 9 20:40:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 571E1D94BFE for ; Sun, 9 Jul 2017 20:40:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3A16F130 for ; Sun, 9 Jul 2017 20:40:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id v202so17590296itb.0 for ; Sun, 09 Jul 2017 13:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=r/d3TnpUxXeoTj9JOWtnJk6V0sTCC0m43dbQdYHr68k=; b=KmgBue0s4u5O8CJeR8Viz7bAImx0LnsdWinHRswLSKMIiBCenOKX9LKiiDw4Clx9Ay EosELk/fk52Io0My7H5/+PxSJy52y+SY33zDm3QCnyY2z7iKW+5s7jL2zVfLWV7ik2vl 5LNZFOitTGGAs8d4Riku5IRAlpGwtARCUmlhUgP993aMwKlX9m5uiTdYUvQgqySnlatq eD1wy9Ym4BM7+axN05I8DT4dE51UB74j7I6I5O0nbgIHtn7LxGbpnQFirtH1CMaAGeXp J9KoJgGq0tcG73FuEP7ljRgSczXqYw9QMTqCM0r689UyrUriMhXcfQl9q0vxuSZ0T87Z JIgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=r/d3TnpUxXeoTj9JOWtnJk6V0sTCC0m43dbQdYHr68k=; b=NixvO5IUJ9ieJh/izgj0p7Y1aVxI7+5n5vWWqcFOT6zqzjgpk6OlF/Z1+b+vnUa+z+ OpVYk9nTtwQVWWl8J31QAPKGigBAqtEq4300IPZIXdZ0W6M1dtT7ppMF5Z/J2HYIeWFJ 86g2n9ToMsXkGRujtpuxneXqAvBVpaLU1/LRmVDh6fefWz4q3mWaIOPT42E1cs71m4nd SAKZ42yhk6bJJ8YhqO+RnnjyxAMcB7z2npmDU8DQ35atiIDiqycN8HartKYw98IiqIzd C3JjqCryYE+KSpK/sr5Kf++u8pGnPhVmYsZtosLIsrWq+q6KQB0h8Y/aAIgcsQq3IMp1 y43g== X-Gm-Message-State: AIVw11309TctjQAgCRan0XYkqcyK2H/mYI/K+aIoHTuet+VXdFUwTL0R zquXEgeYaXO5zJt5aFCX1H0meIIEJjjj X-Received: by 10.107.142.130 with SMTP id q124mr484761iod.173.1499632817516; Sun, 09 Jul 2017 13:40:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Sun, 9 Jul 2017 13:40:16 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5d99:2cb7:7594:1100] In-Reply-To: <20170709184221.GB38352@alchemy.franken.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> From: Warner Losh Date: Sun, 9 Jul 2017 14:40:16 -0600 X-Google-Sender-Auth: e0yuve5-mzrOPO7lLtu667B2M7g Message-ID: Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... To: Marius Strobl Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 20:40:18 -0000 On Sun, Jul 9, 2017 at 12:42 PM, Marius Strobl wrote: > On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > > Author: imp > > Date: Sun Jul 9 16:57:24 2017 > > New Revision: 320844 > > URL: https://svnweb.freebsd.org/changeset/base/320844 > > > > Log: > > An MMC/SD/SDIO stack using CAM > > > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > flexible queueing will make it easier to write non-storage drivers > > than the legacy stack. SDIO drivers from both the kernel and as > > userland daemons are possible, though much of that functionality will > > come later. > > At least with a non-MMCCAM kernel, with this revision in place I get > an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > boot. Apparently this is due to the fact that sdhci(4) now enables > these interrupts, but sdhci_generic_intr() neither actually handles > them nor clears them from intmask. > OK. I'll look into it. Since I don't have an SDHCI card in the system I tested it in, I never saw these... > Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this commit? No, I'll reconnect. Warner From owner-svn-src-all@freebsd.org Sun Jul 9 20:42:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9335D94DB1; Sun, 9 Jul 2017 20:42:12 +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 mx1.freebsd.org (Postfix) with ESMTPS id A8C686F471; Sun, 9 Jul 2017 20:42:12 +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 v69KgBmf087553; Sun, 9 Jul 2017 20:42:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69KgBQ7087552; Sun, 9 Jul 2017 20:42:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707092042.v69KgBQ7087552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 20:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320849 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 320849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 20:42:13 -0000 Author: imp Date: Sun Jul 9 20:42:11 2017 New Revision: 320849 URL: https://svnweb.freebsd.org/changeset/base/320849 Log: Reconnect mmc and mmcsd disconnected unintentioanlly in mmccam commit. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jul 9 17:56:39 2017 (r320848) +++ head/sys/modules/Makefile Sun Jul 9 20:42:11 2017 (r320849) @@ -251,6 +251,8 @@ SUBDIR= \ ${_mlx5} \ ${_mlx5en} \ ${_mly} \ + mmc \ + mmcsd \ mpr \ mps \ mpt \ From owner-svn-src-all@freebsd.org Sun Jul 9 20:49:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEED6D94E94; Sun, 9 Jul 2017 20:49:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCDA6F62C; Sun, 9 Jul 2017 20:49:03 +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 v69Kn2oI090135; Sun, 9 Jul 2017 20:49:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69Kn2ve090134; Sun, 9 Jul 2017 20:49:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707092049.v69Kn2ve090134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 9 Jul 2017 20:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320850 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 320850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 20:49:03 -0000 Author: imp Date: Sun Jul 9 20:49:02 2017 New Revision: 320850 URL: https://svnweb.freebsd.org/changeset/base/320850 Log: Back out enabling the card interrupt detection bit. It is not ready to commit. Noticed by: marius@ Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Jul 9 20:42:11 2017 (r320849) +++ head/sys/dev/sdhci/sdhci.c Sun Jul 9 20:49:02 2017 (r320850) @@ -268,7 +268,7 @@ sdhci_init(struct sdhci_slot *slot) SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | - SDHCI_INT_ACMD12ERR | SDHCI_INT_CARD_INT; + SDHCI_INT_ACMD12ERR; if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && !(slot->opt & SDHCI_NON_REMOVABLE)) { @@ -1826,10 +1826,7 @@ sdhci_generic_intr(struct sdhci_slot *slot) "Card is consuming too much power!\n"); intmask &= ~SDHCI_INT_BUS_POWER; } - /* Handle card interrupt. */ - if (intmask & SDHCI_INT_CARD_INT) { - - } + /* The rest is unknown. */ if (intmask) { WR4(slot, SDHCI_INT_STATUS, intmask); From owner-svn-src-all@freebsd.org Sun Jul 9 20:49:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7419D94F06 for ; Sun, 9 Jul 2017 20:49:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8CB66F76B for ; Sun, 9 Jul 2017 20:49:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id v202so7368073itb.1 for ; Sun, 09 Jul 2017 13:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YxuVMm3Kh6FLb5vQZNAdzzja1xUZhCnxRLwcj5MaMCQ=; b=GO/S3WrX2kYfmrs4BktYvaPSAZP59piV8dw3zNKgrUkUvLBVsNdk7P+sfj7IwLv10+ QQ2tJR1PswInzwimH2W1IZ/23QwMu5BejLS3uWzz7OPRsW/ByxvfSgnbH8d2Kz+oepv/ YtvQDHBlVR6HZphHzy5+tcNjNeTB+S4e35ONVVMyAWnbINEFgYOYBUZexKtCm0X7e74q arZ/VlRdoRK6nd0hgskRR05zPzaQ70odDCMYYjZHPwb+/tb31PIADCwa48sFyTB1WaP6 yVBjiaxGnSJEDLmuKUk/cUZgRW77Fb4ipbgp+Me73sM15A/So16IOeElBs4U6rQCozXU CQzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YxuVMm3Kh6FLb5vQZNAdzzja1xUZhCnxRLwcj5MaMCQ=; b=P4tRW07eVTpnqsvsDLPz1qkmo4/Mwh9CzMp3pl1j+DZqur9qj7nuDVwYI20DZERr6O 8RHAEaBsrUlv3GGySbxmrlh9G+QJkxBFgBOpKpbGuZrvzm6fDo+nGAoX8jV1Qax+TAQf AGJMqYaSz3ymCVP6yirLfFUilfE+3qJsQbWOgNyaEhaS8mR+bzxd1FRFOOBTgL3JSIRr bq4NStkfzqpGo9GXirqI8Q9fLTxhiMPtw/2scpC0p6NemxY2gjLkF2oed2ZGDrF2lIY7 wrL2ZEZwUSKrOBQBn4sp/fFmUtlqiQudHZ5ppykiJEyw9yiB+oYHAHokWkrGo6JLdUUJ 0Rkw== X-Gm-Message-State: AIVw112hJQ7C0gZ+i1wDdvtY+eqT+0HFcx8BY7AQQLAHxZTsa7TVnTNT iqjbumvjKy8b74yL4lTb9w9oqd6mI7F6 X-Received: by 10.36.25.200 with SMTP id b191mr8978372itb.20.1499633397071; Sun, 09 Jul 2017 13:49:57 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Sun, 9 Jul 2017 13:49:56 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5d99:2cb7:7594:1100] In-Reply-To: References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> From: Warner Losh Date: Sun, 9 Jul 2017 14:49:56 -0600 X-Google-Sender-Auth: -CnpkUN2IjSECpiTCBp31-Pm6O8 Message-ID: Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... To: Marius Strobl Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 20:49:58 -0000 On Sun, Jul 9, 2017 at 2:40 PM, Warner Losh wrote: > > > On Sun, Jul 9, 2017 at 12:42 PM, Marius Strobl wrote: > >> On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: >> > Author: imp >> > Date: Sun Jul 9 16:57:24 2017 >> > New Revision: 320844 >> > URL: https://svnweb.freebsd.org/changeset/base/320844 >> > >> > Log: >> > An MMC/SD/SDIO stack using CAM >> > >> > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's >> > flexible queueing will make it easier to write non-storage drivers >> > than the legacy stack. SDIO drivers from both the kernel and as >> > userland daemons are possible, though much of that functionality will >> > come later. >> >> At least with a non-MMCCAM kernel, with this revision in place I get >> an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during >> boot. Apparently this is due to the fact that sdhci(4) now enables >> these interrupts, but sdhci_generic_intr() neither actually handles >> them nor clears them from intmask. >> > > OK. I'll look into it. Since I don't have an SDHCI card in the system I > tested it in, I never saw these... > Looking at the code, the problem is obvious. It looks like it came in on a late commit to the mmccam integration branch. I'll revert which should solve your problem. Looking at my notes and test systems, I did test this on a NUC, but it was an older version w/o the patch I just reverted. Sorry for the hassle. r320850 > Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this commit? > > > No, I'll reconnect. > This has been done. r320849 Warner From owner-svn-src-all@freebsd.org Sun Jul 9 22:37:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE209D97787; Sun, 9 Jul 2017 22:37:51 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 505CB72DD7; Sun, 9 Jul 2017 22:37:50 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id v69MblkB061656 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Jul 2017 00:37:47 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id v69MblG0061655; Mon, 10 Jul 2017 00:37:47 +0200 (CEST) (envelope-from marius) Date: Mon, 10 Jul 2017 00:37:47 +0200 From: Marius Strobl To: Warner Losh Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... Message-ID: <20170709223747.GC38352@alchemy.franken.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 22:37:51 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jul 09, 2017 at 02:49:56PM -0600, Warner Losh wrote: > On Sun, Jul 9, 2017 at 2:40 PM, Warner Losh wrote: > > > > > > > On Sun, Jul 9, 2017 at 12:42 PM, Marius Strobl wrote: > > > >> On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > >> > Author: imp > >> > Date: Sun Jul 9 16:57:24 2017 > >> > New Revision: 320844 > >> > URL: https://svnweb.freebsd.org/changeset/base/320844 > >> > > >> > Log: > >> > An MMC/SD/SDIO stack using CAM > >> > > >> > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > >> > flexible queueing will make it easier to write non-storage drivers > >> > than the legacy stack. SDIO drivers from both the kernel and as > >> > userland daemons are possible, though much of that functionality will > >> > come later. > >> > >> At least with a non-MMCCAM kernel, with this revision in place I get > >> an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > >> boot. Apparently this is due to the fact that sdhci(4) now enables > >> these interrupts, but sdhci_generic_intr() neither actually handles > >> them nor clears them from intmask. > >> > > > > OK. I'll look into it. Since I don't have an SDHCI card in the system I > > tested it in, I never saw these... > > > > Looking at the code, the problem is obvious. It looks like it came in on a > late commit to the mmccam integration branch. I'll revert which should > solve your problem. Thanks, I can confirm that r320850 allows booting again. Compared to pre-r320844, sdhci(4) now still is incredibly noisy in the non-MMCCAM path, though. Can we get this removed again or at least put under sdhci_debug, along with removing the memory overhead for the non-MMCCAM case and some of the style(9) violations/inconsistencies (re-)introduced, using something like the attached patch? > Looking at my notes and test systems, I did test this > on a NUC, but it was an older version w/o the patch I just reverted. Sorry > for the hassle. r320850 Well, I might have given a different impression, but I don't actually care about NUCs as such; they are just a relatively cheap way of obtaining various combinations of Intel MMC/SDXC controllers and eMMC chips and are an acceptable loss should I ever manage to kill an eMMC chip during development. Marius --cWoXeonUoKmBZSoM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sdhci.diff" Index: sdhci.c =================================================================== --- sdhci.c (revision 320850) +++ sdhci.c (working copy) @@ -91,7 +91,7 @@ static void sdhci_start_data(struct sdhci_slot *sl static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); -/* CAM-related */ +#ifdef MMCCAM int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, int proposed_clock); static int sdhci_cam_update_ios(struct sdhci_slot *slot); static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb); @@ -98,6 +98,7 @@ static int sdhci_cam_request(struct sdhci_slot *sl static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb); static void sdhci_cam_poll(struct cam_sim *sim); static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb); +#endif /* helper routines */ static void sdhci_dumpregs(struct sdhci_slot *slot); @@ -1021,10 +1022,6 @@ sdhci_generic_update_ios(device_t brdev, device_t struct sdhci_slot *slot = device_get_ivars(reqdev); struct mmc_ios *ios = &slot->host.ios; - device_printf(brdev, "This is a bridge device\n"); - device_printf(reqdev, "This is a request device\n"); - - slot_printf(slot, " <--- The locking slot is this\n"); SDHCI_LOCK(slot); /* Do full reset on bus power down to clear from any state. */ if (ios->power_mode == power_off) { @@ -1121,8 +1118,9 @@ static void sdhci_req_done(struct sdhci_slot *slot) { union ccb *ccb; + if (sdhci_debug > 1) - slot_printf(slot, "sdhci_req_done()\n"); + slot_printf(slot, "%s\n", __func_); if (slot->ccb != NULL && slot->curcmd != NULL) { callout_stop(&slot->timeout_callout); ccb = slot->ccb; @@ -1139,7 +1137,7 @@ sdhci_req_done(struct sdhci_slot *slot) } } #else -static void +static void sdhci_req_done(struct sdhci_slot *slot) { struct mmc_request *req; @@ -1320,7 +1318,7 @@ sdhci_finish_command(struct sdhci_slot *slot) if (sdhci_debug > 1) slot_printf(slot, "%s: called, err %d flags %d\n", - __func__, slot->curcmd->error, slot->curcmd->flags); + __func__, slot->curcmd->error, slot->curcmd->flags); slot->cmd_done = 1; /* * Interrupt aggregation: Restore command interrupt. @@ -1356,8 +1354,8 @@ sdhci_finish_command(struct sdhci_slot *slot) } if (sdhci_debug > 1) printf("Resp: %02x %02x %02x %02x\n", - slot->curcmd->resp[0], slot->curcmd->resp[1], - slot->curcmd->resp[2], slot->curcmd->resp[3]); + slot->curcmd->resp[0], slot->curcmd->resp[1], + slot->curcmd->resp[2], slot->curcmd->resp[3]); /* If data ready - finish. */ if (slot->data_done) @@ -1441,9 +1439,10 @@ sdhci_start_data(struct sdhci_slot *slot, struct m WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512); if (sdhci_debug > 1) - slot_printf(slot, "Block size: %02x, count %lu\n", (unsigned int) - SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512)?data->len:512), - (unsigned long)(data->len + 511) / 512); + slot_printf(slot, "Block size: %02x, count %lu\n", + (unsigned int)SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < + 512) ? data->len : 512), (unsigned long)(data->len + 511) / + 512); } void @@ -1657,6 +1656,7 @@ static void sdhci_data_irq(struct sdhci_slot *slot, uint32_t intmask) { struct mmc_data *data; + size_t left; if (!slot->curcmd) { slot_printf(slot, "Got data interrupt 0x%08x, but " @@ -1702,7 +1702,6 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t i /* Handle DMA border. */ if (intmask & SDHCI_INT_DMA_END) { data = slot->curcmd->data; - size_t left; /* Unload DMA buffer ... */ left = data->len - slot->offset; @@ -1910,7 +1909,8 @@ sdhci_generic_write_ivar(device_t bus, device_t ch uint32_t clock, max_clock; int i; - slot_printf(slot, "sdhci_generic_write_ivar, var=%d\n", which); + if (sdhci_debug > 1) + slot_printf(slot, "%s: var=%d\n", __func__, which); switch (which) { default: return (EINVAL); @@ -1976,6 +1976,7 @@ sdhci_generic_write_ivar(device_t bus, device_t ch return (0); } +#ifdef MMCCAM /* CAM-related functions */ #include #include @@ -2294,5 +2295,6 @@ sdhci_cam_request(struct sdhci_slot *slot, union c } return (0); } +#endif /* MMCCAM */ MODULE_VERSION(sdhci, 1); Index: sdhci.h =================================================================== --- sdhci.h (revision 320850) +++ sdhci.h (working copy) @@ -28,6 +28,8 @@ #ifndef __SDHCI_H__ #define __SDHCI_H__ +#include "opt_mmccam.h" + #define DMA_BLOCK_SIZE 4096 #define DMA_BOUNDARY 0 /* DMA reload every 4K */ @@ -368,12 +370,13 @@ struct sdhci_slot { #define PLATFORM_DATA_STARTED 8 /* Data xfer is handled by platform */ struct mtx mtx; /* Slot mutex */ - /* CAM stuff */ +#ifdef MMCCAM union ccb *ccb; struct cam_devq *devq; struct cam_sim *sim; struct mtx sim_mtx; u_char card_present; /* XXX Maybe derive this from elsewhere? */ +#endif }; int sdhci_generic_read_ivar(device_t bus, device_t child, int which, @@ -400,6 +403,8 @@ bool sdhci_generic_get_card_present(device_t brdev void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); -/* CAM-related */ +#ifdef MMCCAM void sdhci_cam_start_slot(struct sdhci_slot *slot); +#endif + #endif /* __SDHCI_H__ */ --cWoXeonUoKmBZSoM-- From owner-svn-src-all@freebsd.org Sun Jul 9 22:53:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29C48D97BE5; Sun, 9 Jul 2017 22:53:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB18773409; Sun, 9 Jul 2017 22:53:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69MrPBu042870; Sun, 9 Jul 2017 22:53:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69MrO5v042866; Sun, 9 Jul 2017 22:53:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707092253.v69MrO5v042866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 9 Jul 2017 22:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320851 - in head/sys: dev/agp modules/agp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: dev/agp modules/agp X-SVN-Commit-Revision: 320851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 22:53:26 -0000 Author: markj Date: Sun Jul 9 22:53:24 2017 New Revision: 320851 URL: https://svnweb.freebsd.org/changeset/base/320851 Log: Add a helper function to agp(4) which installs a single GTT entry. Submitted by: dumbbell MFC after: 1 week Modified: head/sys/dev/agp/agp_i810.c head/sys/dev/agp/agp_i810.h head/sys/modules/agp/Makefile Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Sun Jul 9 20:49:02 2017 (r320850) +++ head/sys/dev/agp/agp_i810.c Sun Jul 9 22:53:24 2017 (r320851) @@ -2242,6 +2242,16 @@ agp_intel_gtt_map_memory(device_t dev, vm_page_t *page return (0); } +static void +agp_intel_gtt_install_pte(device_t dev, u_int index, vm_paddr_t addr, + u_int flags) +{ + struct agp_i810_softc *sc; + + sc = device_get_softc(dev); + sc->match->driver->install_gtt_pte(dev, index, addr, flags); +} + void agp_intel_gtt_insert_sg_entries(device_t dev, struct sglist *sg_list, u_int first_entry, u_int flags) @@ -2318,6 +2328,13 @@ intel_gtt_insert_sg_entries(struct sglist *sg_list, u_ { agp_intel_gtt_insert_sg_entries(intel_agp, sg_list, first_entry, flags); +} + +void +intel_gtt_install_pte(u_int index, vm_paddr_t addr, u_int flags) +{ + + agp_intel_gtt_install_pte(intel_agp, index, addr, flags); } device_t Modified: head/sys/dev/agp/agp_i810.h ============================================================================== --- head/sys/dev/agp/agp_i810.h Sun Jul 9 20:49:02 2017 (r320850) +++ head/sys/dev/agp/agp_i810.h Sun Jul 9 22:53:24 2017 (r320851) @@ -87,6 +87,7 @@ struct intel_gtt *intel_gtt_get(void); int intel_gtt_chipset_flush(void); void intel_gtt_unmap_memory(struct sglist *sg_list); void intel_gtt_clear_range(u_int first_entry, u_int num_entries); +void intel_gtt_install_pte(u_int index, vm_paddr_t addr, u_int flags); int intel_gtt_map_memory(vm_page_t *pages, u_int num_entries, struct sglist **sg_list); void intel_gtt_insert_sg_entries(struct sglist *sg_list, u_int pg_start, Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Sun Jul 9 20:49:02 2017 (r320850) +++ head/sys/modules/agp/Makefile Sun Jul 9 22:53:24 2017 (r320851) @@ -35,6 +35,7 @@ EXPORT_SYMS= agp_find_device \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" EXPORT_SYMS+= intel_gtt_clear_range \ intel_gtt_insert_pages \ + intel_gtt_install_pte \ intel_gtt_get \ intel_gtt_chipset_flush \ intel_gtt_unmap_memory \ From owner-svn-src-all@freebsd.org Sun Jul 9 22:57:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E8BAD97D2C; Sun, 9 Jul 2017 22:57:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFD8273594; Sun, 9 Jul 2017 22:57:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v69Mv0kM043048; Sun, 9 Jul 2017 22:57:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69Mv0ZS043047; Sun, 9 Jul 2017 22:57:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707092257.v69Mv0ZS043047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 9 Jul 2017 22:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320852 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 320852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 22:57:01 -0000 Author: markj Date: Sun Jul 9 22:57:00 2017 New Revision: 320852 URL: https://svnweb.freebsd.org/changeset/base/320852 Log: Free existing per-thread task structs when unloading linuxkpi.ko. They are otherwise leaked. Reported and tested by: ae MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/src/linux_current.c Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Sun Jul 9 22:53:24 2017 (r320851) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Sun Jul 9 22:57:00 2017 (r320852) @@ -226,6 +226,23 @@ SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_S static void linux_current_uninit(void *arg __unused) { + struct proc *p; + struct task_struct *ts; + struct thread *td; + + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + FOREACH_THREAD_IN_PROC(p, td) { + if ((ts = td->td_lkpi_task) != NULL) { + td->td_lkpi_task = NULL; + put_task_struct(ts); + } + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); } SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); From owner-svn-src-all@freebsd.org Sun Jul 9 23:13:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBB2D98137; Sun, 9 Jul 2017 23:13:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEAC473C16; Sun, 9 Jul 2017 23:13:09 +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 v69ND8WB050951; Sun, 9 Jul 2017 23:13:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69ND8WA050950; Sun, 9 Jul 2017 23:13:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707092313.v69ND8WA050950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 9 Jul 2017 23:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320853 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 320853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 23:13:10 -0000 Author: markj Date: Sun Jul 9 23:13:08 2017 New Revision: 320853 URL: https://svnweb.freebsd.org/changeset/base/320853 Log: Add a few functions to ktime.h in the LinuxKPI, and fix nearby style. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11534 Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Jul 9 22:57:00 2017 (r320852) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Jul 9 23:13:08 2017 (r320853) @@ -26,8 +26,9 @@ * * $FreeBSD$ */ + #ifndef _LINUX_KTIME_H -#define _LINUX_KTIME_H +#define _LINUX_KTIME_H #include #include @@ -153,7 +154,7 @@ timeval_to_ktime(struct timeval tv) #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) #define ktime_to_ns(kt) ((kt).tv64) -static inline s64 +static inline int64_t ktime_get_ns(void) { struct timespec ts; @@ -164,6 +165,8 @@ ktime_get_ns(void) return (ktime_to_ns(kt)); } +#define ktime_get_raw_ns() ktime_get_ns() + static inline ktime_t ktime_get(void) { @@ -173,4 +176,22 @@ ktime_get(void) return (timespec_to_ktime(ts)); } -#endif /* _LINUX_KTIME_H */ +static inline ktime_t +ktime_get_boottime(void) +{ + struct timespec ts; + + nanouptime(&ts); + return (timespec_to_ktime(ts)); +} + +static inline ktime_t +ktime_get_real(void) +{ + struct timespec ts; + + nanotime(&ts); + return (timespec_to_ktime(ts)); +} + +#endif /* _LINUX_KTIME_H */ From owner-svn-src-all@freebsd.org Sun Jul 9 23:14:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D59DD981D8; Sun, 9 Jul 2017 23:14:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id EE40073D7F; Sun, 9 Jul 2017 23:14:52 +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 v69NEqgp051062; Sun, 9 Jul 2017 23:14:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v69NEqn9051061; Sun, 9 Jul 2017 23:14:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707092314.v69NEqn9051061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 9 Jul 2017 23:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320854 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 320854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2017 23:14:53 -0000 Author: markj Date: Sun Jul 9 23:14:51 2017 New Revision: 320854 URL: https://svnweb.freebsd.org/changeset/base/320854 Log: Add some functions to math64.h in the LinuxKPI, and fix nearby style. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11535 Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/math64.h Sun Jul 9 23:13:08 2017 (r320853) +++ head/sys/compat/linuxkpi/common/include/linux/math64.h Sun Jul 9 23:14:51 2017 (r320854) @@ -26,6 +26,7 @@ * * $FreeBSD$ */ + #ifndef _LINUX_MATH64_H #define _LINUX_MATH64_H @@ -40,16 +41,47 @@ }) static inline uint64_t +div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder) +{ + + *remainder = dividend % divisor; + return (dividend / divisor); +} + +static inline int64_t +div64_s64(int64_t dividend, int64_t divisor) +{ + + return (dividend / divisor); +} + +static inline uint64_t +div64_u64(uint64_t dividend, uint64_t divisor) +{ + + return (dividend / divisor); +} + +static inline uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder) { + *remainder = dividend % divisor; return (dividend / divisor); } +static inline int64_t +div_s64(int64_t dividend, int32_t divisor) +{ + + return (dividend / divisor); +} + static inline uint64_t div_u64(uint64_t dividend, uint32_t divisor) { + return (dividend / divisor); } -#endif /* _LINUX_MATH64_H */ +#endif /* _LINUX_MATH64_H */ From owner-svn-src-all@freebsd.org Mon Jul 10 01:37:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4BF2D9A7CF for ; Mon, 10 Jul 2017 01:37:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4D076F1B for ; Mon, 10 Jul 2017 01:37:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id m68so20582044ith.1 for ; Sun, 09 Jul 2017 18:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=W9jfee5RIxwido0nnM8QqOwQn3Y60jUivIMdUN+VZaI=; b=l+eEgPDyc9OSyjqfO6WK9wr68+UUjwI2MqJDGJKNLh1P+gRWQCYYXh5BzWAjjROThO SUYqWtnyJvGlNsYx0IQ9EoLQNv/ugPhd5ByXNSnMQNbKv2aSf/KSGypkZrzvBKXZHGoz dVwMIsRT9P4jhy5rFZl/asZL/NnEGxGwem1uurepcz5O+nfQBhf86WgJJV4x6RiAW6PK I78Rposfj52H1SX5OYDIs2Ew0ZbMi0EGyw255zQpnTLgcTTn64vw/iA9QeLg5HLe0OFo YKdmORYRrWQOS8+ZKbQNxN7U9sPvkoy8O9Kdbec9toG8cVdeRH53I2xFnYbzP+GUwzqZ LOUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=W9jfee5RIxwido0nnM8QqOwQn3Y60jUivIMdUN+VZaI=; b=pCwjmLzk2dAGFrPBaJUze3khvyyvREljpN8nAW/DDTt5NadKB8nzEpytJ/YBFc08fb 3cjTnv2uhqbQYbEcHQUDMZvnNEtjSxRO19orMnhD7wzvCeikcH2zBoVXvpSDgmAgB0PF ObQ3u9dKBljnnx15v+Fp38ewTHuOTQCan7So5M7L5iWiJSNnsBXWq29n9ergU2MLBB6g QEBfQtaC+MrWq72goCBVie779ote664+RkmsA9BO8WnMnHUyAf+PdyXclP5Mxl+jUCqV hzWoDDyYWAXJ6Lm6LDPWRBD0A/kakXzG1FIk1/ONEeBesBkAToJxI6eH/ICY/cyZpsRY K6Kw== X-Gm-Message-State: AIVw111yH8aTQHupbFuegA7TrlppL+T73U8qeiLaKgRNOg3rk0aP7pzq vmol4Xy8jfMqyoWx9PijoFLbx4VpqyVu X-Received: by 10.36.90.203 with SMTP id v194mr9443367ita.48.1499650650867; Sun, 09 Jul 2017 18:37:30 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Sun, 9 Jul 2017 18:37:30 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5d99:2cb7:7594:1100] In-Reply-To: <20170709223747.GC38352@alchemy.franken.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> <20170709223747.GC38352@alchemy.franken.de> From: Warner Losh Date: Sun, 9 Jul 2017 19:37:30 -0600 X-Google-Sender-Auth: Ycc0VbIvDXL9gSsAWdt8n51jMm4 Message-ID: Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... To: Marius Strobl Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 01:37:32 -0000 On Sun, Jul 9, 2017 at 4:37 PM, Marius Strobl wrote: > On Sun, Jul 09, 2017 at 02:49:56PM -0600, Warner Losh wrote: > > On Sun, Jul 9, 2017 at 2:40 PM, Warner Losh wrote: > > > > > > > > > > > On Sun, Jul 9, 2017 at 12:42 PM, Marius Strobl > wrote: > > > > > >> On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > > >> > Author: imp > > >> > Date: Sun Jul 9 16:57:24 2017 > > >> > New Revision: 320844 > > >> > URL: https://svnweb.freebsd.org/changeset/base/320844 > > >> > > > >> > Log: > > >> > An MMC/SD/SDIO stack using CAM > > >> > > > >> > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > >> > flexible queueing will make it easier to write non-storage drivers > > >> > than the legacy stack. SDIO drivers from both the kernel and as > > >> > userland daemons are possible, though much of that functionality > will > > >> > come later. > > >> > > >> At least with a non-MMCCAM kernel, with this revision in place I get > > >> an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > > >> boot. Apparently this is due to the fact that sdhci(4) now enables > > >> these interrupts, but sdhci_generic_intr() neither actually handles > > >> them nor clears them from intmask. > > >> > > > > > > OK. I'll look into it. Since I don't have an SDHCI card in the system I > > > tested it in, I never saw these... > > > > > > > Looking at the code, the problem is obvious. It looks like it came in on > a > > late commit to the mmccam integration branch. I'll revert which should > > solve your problem. > > Thanks, I can confirm that r320850 allows booting again. Compared to > pre-r320844, sdhci(4) now still is incredibly noisy in the non-MMCCAM > path, though. Can we get this removed again or at least put under > sdhci_debug, along with removing the memory overhead for the non-MMCCAM > case and some of the style(9) violations/inconsistencies (re-)introduced, > using something like the attached patch? Sure. The patch failed 100% to apply, so I applied it by hand (there's on > 80 character line that I left that way on purpose because (a) the way you chunked it up was worse than before and (b) most of it should be changed to use other macros so it isn't so ugly and I left the CAM related comments in for easiler grepping). That should get rid of the worst of the re-introduced offenders. That's what happens when work collides... I'll commit in a few, after I fix the module compilation errors... > Looking at my notes and test systems, I did test this > > on a NUC, but it was an older version w/o the patch I just reverted. > Sorry > > for the hassle. r320850 > > Well, I might have given a different impression, but I don't actually > care about NUCs as such; they are just a relatively cheap way of > obtaining various combinations of Intel MMC/SDXC controllers and eMMC > chips and are an acceptable loss should I ever manage to kill an eMMC > chip during development. > Yea, I have one laying around for other reasons as well... Mine don't have eMMC in them, but do have a SD slot... Warner From owner-svn-src-all@freebsd.org Mon Jul 10 03:11:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB1D1D9BEDB; Mon, 10 Jul 2017 03:11:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1CB6790E5; Mon, 10 Jul 2017 03:11:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A3BmEe048989; Mon, 10 Jul 2017 03:11:48 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A3BmgL048988; Mon, 10 Jul 2017 03:11:48 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707100311.v6A3BmgL048988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 10 Jul 2017 03:11:48 +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: r320855 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 320855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 03:11:50 -0000 Author: grehan Date: Mon Jul 10 03:11:48 2017 New Revision: 320855 URL: https://svnweb.freebsd.org/changeset/base/320855 Log: MFC r311699 ps2 mouse fixes, found by plan9/9front. Reminded by: sevan Modified: stable/11/usr.sbin/bhyve/ps2mouse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/ps2mouse.c ============================================================================== --- stable/11/usr.sbin/bhyve/ps2mouse.c Sun Jul 9 23:14:51 2017 (r320854) +++ stable/11/usr.sbin/bhyve/ps2mouse.c Mon Jul 10 03:11:48 2017 (r320855) @@ -62,6 +62,16 @@ __FBSDID("$FreeBSD$"); /* mouse device id */ #define PS2MOUSE_DEV_ID 0x0 +/* mouse data bits */ +#define PS2M_DATA_Y_OFLOW 0x80 +#define PS2M_DATA_X_OFLOW 0x40 +#define PS2M_DATA_Y_SIGN 0x20 +#define PS2M_DATA_X_SIGN 0x10 +#define PS2M_DATA_AONE 0x08 +#define PS2M_DATA_MID_BUTTON 0x04 +#define PS2M_DATA_RIGHT_BUTTON 0x02 +#define PS2M_DATA_LEFT_BUTTON 0x01 + /* mouse status bits */ #define PS2M_STS_REMOTE_MODE 0x40 #define PS2M_STS_ENABLE_DEV 0x20 @@ -169,19 +179,20 @@ movement_get(struct ps2mouse_softc *sc) assert(pthread_mutex_isowned_np(&sc->mtx)); - val0 = sc->status & (PS2M_STS_LEFT_BUTTON | - PS2M_STS_RIGHT_BUTTON | PS2M_STS_MID_BUTTON); + val0 = PS2M_DATA_AONE; + val0 |= sc->status & (PS2M_DATA_LEFT_BUTTON | + PS2M_DATA_RIGHT_BUTTON | PS2M_DATA_MID_BUTTON); if (sc->delta_x >= 0) { if (sc->delta_x > 255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; } else { - val0 |= (1 << 4); + val0 |= PS2M_DATA_X_SIGN; if (sc->delta_x < -255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; @@ -190,14 +201,14 @@ movement_get(struct ps2mouse_softc *sc) if (sc->delta_y >= 0) { if (sc->delta_y > 255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; } else { - val0 |= (1 << 5); + val0 |= PS2M_DATA_Y_SIGN; if (sc->delta_y < -255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; From owner-svn-src-all@freebsd.org Mon Jul 10 03:38:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1BA7D9C3F8; Mon, 10 Jul 2017 03:38:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id BA02F799EA; Mon, 10 Jul 2017 03:38:08 +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 v6A3c735058723; Mon, 10 Jul 2017 03:38:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A3c7ML058722; Mon, 10 Jul 2017 03:38:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707100338.v6A3c7ML058722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 03:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320856 - head/sys/modules/sdhci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/sdhci X-SVN-Commit-Revision: 320856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 03:38:09 -0000 Author: imp Date: Mon Jul 10 03:38:07 2017 New Revision: 320856 URL: https://svnweb.freebsd.org/changeset/base/320856 Log: Add dependency on opt_cam.h and opt_mmccam.h Modified: head/sys/modules/sdhci/Makefile Modified: head/sys/modules/sdhci/Makefile ============================================================================== --- head/sys/modules/sdhci/Makefile Mon Jul 10 03:11:48 2017 (r320855) +++ head/sys/modules/sdhci/Makefile Mon Jul 10 03:38:07 2017 (r320856) @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/dev/sdhci KMOD= sdhci -SRCS= sdhci.c sdhci.h sdhci_if.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h +SRCS= sdhci.c sdhci.h sdhci_if.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h .include From owner-svn-src-all@freebsd.org Mon Jul 10 03:38:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B87B6D9C41B; Mon, 10 Jul 2017 03:38:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8867079A00; Mon, 10 Jul 2017 03:38:13 +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 v6A3cCPv058779; Mon, 10 Jul 2017 03:38:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A3cCR4058778; Mon, 10 Jul 2017 03:38:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707100338.v6A3cCR4058778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 03:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320857 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 320857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 03:38:13 -0000 Author: imp Date: Mon Jul 10 03:38:12 2017 New Revision: 320857 URL: https://svnweb.freebsd.org/changeset/base/320857 Log: Opt files are included with single quotes. Modified: head/sys/cam/cam.h Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Mon Jul 10 03:38:07 2017 (r320856) +++ head/sys/cam/cam.h Mon Jul 10 03:38:12 2017 (r320857) @@ -32,7 +32,7 @@ #define _CAM_CAM_H 1 #ifdef _KERNEL -#include +#include "opt_cam.h" #endif #include From owner-svn-src-all@freebsd.org Mon Jul 10 03:38:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE89D9C44E; Mon, 10 Jul 2017 03:38:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0843D79A89; Mon, 10 Jul 2017 03:38:18 +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 v6A3cIh4058834; Mon, 10 Jul 2017 03:38:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A3cIbn058831; Mon, 10 Jul 2017 03:38:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707100338.v6A3cIbn058831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 03:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320858 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 320858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 03:38:19 -0000 Author: imp Date: Mon Jul 10 03:38:17 2017 New Revision: 320858 URL: https://svnweb.freebsd.org/changeset/base/320858 Log: Better contain MMCCAM parts of this file Remove some useless to the general user debugs Put debugs under sdhci_debug. Fix some style(9) regressions Submitted by: marius@ Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jul 10 03:38:12 2017 (r320857) +++ head/sys/dev/sdhci/sdhci.c Mon Jul 10 03:38:17 2017 (r320858) @@ -91,6 +91,7 @@ static void sdhci_start_data(struct sdhci_slot *slot, static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); +#ifdef MMCCAM /* CAM-related */ int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, int proposed_clock); static int sdhci_cam_update_ios(struct sdhci_slot *slot); @@ -98,6 +99,7 @@ static int sdhci_cam_request(struct sdhci_slot *slot, static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb); static void sdhci_cam_poll(struct cam_sim *sim); static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb); +#endif /* helper routines */ static void sdhci_dumpregs(struct sdhci_slot *slot); @@ -1021,10 +1023,6 @@ sdhci_generic_update_ios(device_t brdev, device_t reqd struct sdhci_slot *slot = device_get_ivars(reqdev); struct mmc_ios *ios = &slot->host.ios; - device_printf(brdev, "This is a bridge device\n"); - device_printf(reqdev, "This is a request device\n"); - - slot_printf(slot, " <--- The locking slot is this\n"); SDHCI_LOCK(slot); /* Do full reset on bus power down to clear from any state. */ if (ios->power_mode == power_off) { @@ -1121,8 +1119,9 @@ static void sdhci_req_done(struct sdhci_slot *slot) { union ccb *ccb; + if (sdhci_debug > 1) - slot_printf(slot, "sdhci_req_done()\n"); + slot_printf(slot, "%s\n", __func__); if (slot->ccb != NULL && slot->curcmd != NULL) { callout_stop(&slot->timeout_callout); ccb = slot->ccb; @@ -1139,7 +1138,7 @@ sdhci_req_done(struct sdhci_slot *slot) } } #else -static void +static void sdhci_req_done(struct sdhci_slot *slot) { struct mmc_request *req; @@ -1320,7 +1319,7 @@ sdhci_finish_command(struct sdhci_slot *slot) if (sdhci_debug > 1) slot_printf(slot, "%s: called, err %d flags %d\n", - __func__, slot->curcmd->error, slot->curcmd->flags); + __func__, slot->curcmd->error, slot->curcmd->flags); slot->cmd_done = 1; /* * Interrupt aggregation: Restore command interrupt. @@ -1356,8 +1355,8 @@ sdhci_finish_command(struct sdhci_slot *slot) } if (sdhci_debug > 1) printf("Resp: %02x %02x %02x %02x\n", - slot->curcmd->resp[0], slot->curcmd->resp[1], - slot->curcmd->resp[2], slot->curcmd->resp[3]); + slot->curcmd->resp[0], slot->curcmd->resp[1], + slot->curcmd->resp[2], slot->curcmd->resp[3]); /* If data ready - finish. */ if (slot->data_done) @@ -1441,8 +1440,8 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512); if (sdhci_debug > 1) - slot_printf(slot, "Block size: %02x, count %lu\n", (unsigned int) - SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512)?data->len:512), + slot_printf(slot, "Block size: %02x, count %lu\n", + (unsigned int)SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512) ? data->len : 512), (unsigned long)(data->len + 511) / 512); } @@ -1657,6 +1656,7 @@ static void sdhci_data_irq(struct sdhci_slot *slot, uint32_t intmask) { struct mmc_data *data; + size_t left; if (!slot->curcmd) { slot_printf(slot, "Got data interrupt 0x%08x, but " @@ -1702,7 +1702,6 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma /* Handle DMA border. */ if (intmask & SDHCI_INT_DMA_END) { data = slot->curcmd->data; - size_t left; /* Unload DMA buffer ... */ left = data->len - slot->offset; @@ -1910,7 +1909,8 @@ sdhci_generic_write_ivar(device_t bus, device_t child, uint32_t clock, max_clock; int i; - slot_printf(slot, "sdhci_generic_write_ivar, var=%d\n", which); + if (sdhci_debug > 1) + slot_printf(slot, "%s: var=%d\n", __func__, which); switch (which) { default: return (EINVAL); @@ -1976,6 +1976,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, return (0); } +#ifdef MMCCAM /* CAM-related functions */ #include #include @@ -2294,5 +2295,6 @@ sdhci_cam_request(struct sdhci_slot *slot, union ccb * } return (0); } +#endif /* MMCCAM */ MODULE_VERSION(sdhci, 1); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Mon Jul 10 03:38:12 2017 (r320857) +++ head/sys/dev/sdhci/sdhci.h Mon Jul 10 03:38:17 2017 (r320858) @@ -28,6 +28,8 @@ #ifndef __SDHCI_H__ #define __SDHCI_H__ +#include "opt_mmccam.h" + #define DMA_BLOCK_SIZE 4096 #define DMA_BOUNDARY 0 /* DMA reload every 4K */ @@ -368,12 +370,14 @@ struct sdhci_slot { #define PLATFORM_DATA_STARTED 8 /* Data xfer is handled by platform */ struct mtx mtx; /* Slot mutex */ +#ifdef MMCCAM /* CAM stuff */ union ccb *ccb; struct cam_devq *devq; struct cam_sim *sim; struct mtx sim_mtx; u_char card_present; /* XXX Maybe derive this from elsewhere? */ +#endif }; int sdhci_generic_read_ivar(device_t bus, device_t child, int which, @@ -400,6 +404,9 @@ bool sdhci_generic_get_card_present(device_t brdev, st void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); +#ifdef MMCCAM /* CAM-related */ void sdhci_cam_start_slot(struct sdhci_slot *slot); +#endif + #endif /* __SDHCI_H__ */ From owner-svn-src-all@freebsd.org Mon Jul 10 04:28:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701CBD9CE8C; Mon, 10 Jul 2017 04:28:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 350047AC50; Mon, 10 Jul 2017 04:28:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A4SS5j080069; Mon, 10 Jul 2017 04:28:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A4SSSI080068; Mon, 10 Jul 2017 04:28:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707100428.v6A4SSSI080068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 10 Jul 2017 04:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320859 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 320859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 04:28:29 -0000 Author: ngie Date: Mon Jul 10 04:28:28 2017 New Revision: 320859 URL: https://svnweb.freebsd.org/changeset/base/320859 Log: Fix -Wuninitialized warning with gcc Initialize mmc_data_byte to 0, as it could be used uninitialized later on. MFC with: r320846 Reported by: Jenkins (powerpc jobs) Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 10 03:38:17 2017 (r320858) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 10 04:28:28 2017 (r320859) @@ -7360,7 +7360,7 @@ mmcsdcmd(struct cam_device *device, int argc, char **a int is_highspeed = 0, is_stdspeed = 0; int is_info_request = 0; int flags = 0; - uint8_t mmc_data_byte; + uint8_t mmc_data_byte = 0; /* For IO_RW_EXTENDED command */ uint8_t *mmc_data = NULL; From owner-svn-src-all@freebsd.org Mon Jul 10 05:08:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF11D9D698; Mon, 10 Jul 2017 05:08:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B13F7B841; Mon, 10 Jul 2017 05:08:03 +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 v6A582sI096517; Mon, 10 Jul 2017 05:08:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A581rQ096507; Mon, 10 Jul 2017 05:08:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707100508.v6A581rQ096507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 05:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320860 - in head/sys: cam/ata cam/scsi ddb dev/aic7xxx dev/drm dev/isci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam/ata cam/scsi ddb dev/aic7xxx dev/drm dev/isci X-SVN-Commit-Revision: 320860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 05:08:03 -0000 Author: imp Date: Mon Jul 10 05:08:01 2017 New Revision: 320860 URL: https://svnweb.freebsd.org/changeset/base/320860 Log: Include opt files in the kernel with "" instead of <>. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_sa.c head/sys/ddb/db_sym.c head/sys/dev/aic7xxx/aic79xx_osm.h head/sys/dev/aic7xxx/aic7xxx_osm.h head/sys/dev/drm/drmP.h head/sys/dev/isci/environment.h Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/cam/ata/ata_all.c Mon Jul 10 05:08:01 2017 (r320860) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef _KERNEL -#include +#include "opt_scsi.h" #include #include Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/cam/scsi/scsi_all.c Mon Jul 10 05:08:01 2017 (r320860) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef _KERNEL -#include +#include "opt_scsi.h" #include #include Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/cam/scsi/scsi_enc.c Mon Jul 10 05:08:01 2017 (r320860) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "opt_ses.h" MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers"); Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/cam/scsi/scsi_sa.c Mon Jul 10 05:08:01 2017 (r320860) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL -#include +#include "opt_sa.h" #ifndef SA_IO_TIMEOUT #define SA_IO_TIMEOUT 32 Modified: head/sys/ddb/db_sym.c ============================================================================== --- head/sys/ddb/db_sym.c Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/ddb/db_sym.c Mon Jul 10 05:08:01 2017 (r320860) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "opt_ddb.h" /* * Multiple symbol tables Modified: head/sys/dev/aic7xxx/aic79xx_osm.h ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_osm.h Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/dev/aic7xxx/aic79xx_osm.h Mon Jul 10 05:08:01 2017 (r320860) @@ -38,7 +38,7 @@ #ifndef _AIC79XX_FREEBSD_H_ #define _AIC79XX_FREEBSD_H_ -#include /* for config options */ +#include "opt_aic79xx.h" /* for config options */ #include #include Modified: head/sys/dev/aic7xxx/aic7xxx_osm.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_osm.h Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/dev/aic7xxx/aic7xxx_osm.h Mon Jul 10 05:08:01 2017 (r320860) @@ -37,7 +37,7 @@ #ifndef _AIC7XXX_FREEBSD_H_ #define _AIC7XXX_FREEBSD_H_ -#include /* for config options */ +#include "opt_aic7xxx.h" /* for config options */ #include #include Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/dev/drm/drmP.h Mon Jul 10 05:08:01 2017 (r320860) @@ -104,7 +104,7 @@ struct drm_file; #include "dev/drm/drm_internal.h" #include "dev/drm/drm_linux_list.h" -#include +#include "opt_drm.h" #ifdef DRM_DEBUG #undef DRM_DEBUG #define DRM_DEBUG_DEFAULT_ON 1 Modified: head/sys/dev/isci/environment.h ============================================================================== --- head/sys/dev/isci/environment.h Mon Jul 10 04:28:28 2017 (r320859) +++ head/sys/dev/isci/environment.h Mon Jul 10 05:08:01 2017 (r320860) @@ -42,7 +42,7 @@ #include #include #include -#include +#include "opt_isci.h" typedef int8_t S8; typedef uint8_t U8; From owner-svn-src-all@freebsd.org Mon Jul 10 05:16:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E311D9D8BA; Mon, 10 Jul 2017 05:16:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 066977BBFA; Mon, 10 Jul 2017 05:16:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A5G7I1000709; Mon, 10 Jul 2017 05:16:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A5G74p000708; Mon, 10 Jul 2017 05:16:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707100516.v6A5G74p000708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 10 Jul 2017 05:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320861 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 320861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 05:16:09 -0000 Author: ngie Date: Mon Jul 10 05:16:07 2017 New Revision: 320861 URL: https://svnweb.freebsd.org/changeset/base/320861 Log: Fix whitespace bugs - Delete trailing whitespace. - Replace 8 single column spaces with hard tabs. - Delete lines with consisting purely of blank space. - Add space between `return` and `(`, per style(9). Special care was taken to not blindly replace 8 single column spaces with tabs; doing so could break tools that do strict string comparisons with camcontrol output. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 10 05:08:01 2017 (r320860) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 10 05:16:07 2017 (r320861) @@ -380,14 +380,14 @@ getoption(struct camcontrol_opts *table, char *arg, ui *argnum = opts->argnum; *subopt = opts->subopt; if (++num_matches > 1) - return(CC_OR_AMBIGUOUS); + return (CC_OR_AMBIGUOUS); } } if (num_matches > 0) - return(CC_OR_FOUND); + return (CC_OR_FOUND); else - return(CC_OR_NOT_FOUND); + return (CC_OR_NOT_FOUND); } #ifndef MINIMALISTIC @@ -409,7 +409,7 @@ getdevlist(struct cam_device *device) if (cam_send_ccb(device, ccb) < 0) { perror("error getting device list"); cam_freeccb(ccb); - return(1); + return (1); } status[0] = '\0'; @@ -447,7 +447,7 @@ getdevlist(struct cam_device *device) cam_freeccb(ccb); - return(error); + return (error); } #endif /* MINIMALISTIC */ @@ -476,7 +476,7 @@ getdevtree(int argc, char **argv, char *combinedopt) if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { warn("couldn't open %s", XPT_DEVICE); - return(1); + return (1); } bzero(&ccb, sizeof(union ccb)); @@ -492,7 +492,7 @@ getdevtree(int argc, char **argv, char *combinedopt) if (ccb.cdm.matches == NULL) { warnx("can't malloc memory for matches"); close(fd); - return(1); + return (1); } ccb.cdm.num_matches = 0; @@ -598,12 +598,12 @@ getdevtree(int argc, char **argv, char *combinedopt) sprintf(tmpstr, "<%s %s>", product, revision); } else if (dev_result->protocol == PROTO_MMCSD) { - if (strlen(dev_result->mmc_ident_data.model) > 0) { - sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); - } else { - sprintf(tmpstr, "<%s card>", - dev_result->mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown"); - } + if (strlen(dev_result->mmc_ident_data.model) > 0) { + sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); + } else { + sprintf(tmpstr, "<%s card>", + dev_result->mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown"); + } } else if (dev_result->protocol == PROTO_SEMB) { struct sep_identify_data *sid; @@ -675,7 +675,7 @@ getdevtree(int argc, char **argv, char *combinedopt) close(fd); - return(error); + return (error); } #ifndef MINIMALISTIC @@ -711,7 +711,7 @@ testunitready(struct cam_device *device, int task_attr } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { @@ -730,7 +730,7 @@ testunitready(struct cam_device *device, int task_attr cam_freeccb(ccb); - return(error); + return (error); } static int @@ -780,7 +780,7 @@ scsistart(struct cam_device *device, int startstop, in } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) @@ -814,7 +814,7 @@ scsistart(struct cam_device *device, int startstop, in cam_freeccb(ccb); - return(error); + return (error); } int @@ -851,7 +851,7 @@ scsidoinquiry(struct cam_device *device, int argc, cha error = scsiinquiry(device, task_attr, retry_count, timeout); if (error != 0) - return(error); + return (error); if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, task_attr, retry_count, timeout); @@ -859,7 +859,7 @@ scsidoinquiry(struct cam_device *device, int argc, cha if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); - return(error); + return (error); } static int @@ -874,7 +874,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } /* cam_getccb cleans up the header, caller has to zero the payload */ @@ -886,7 +886,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (inq_buf == NULL) { cam_freeccb(ccb); warnx("can't malloc memory for inquiry\n"); - return(1); + return (1); } bzero(inq_buf, sizeof(*inq_buf)); @@ -949,7 +949,7 @@ scsiinquiry(struct cam_device *device, int task_attr, } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -965,7 +965,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (error != 0) { free(inq_buf); - return(error); + return (error); } fprintf(stdout, "%s%d: ", device->device_name, @@ -974,7 +974,7 @@ scsiinquiry(struct cam_device *device, int task_attr, free(inq_buf); - return(0); + return (0); } static int @@ -990,7 +990,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } /* cam_getccb cleans up the header, caller has to zero the payload */ @@ -1002,7 +1002,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (serial_buf == NULL) { cam_freeccb(ccb); warnx("can't malloc memory for serial number"); - return(1); + return (1); } scsi_inquiry(&ccb->csio, @@ -1032,7 +1032,7 @@ scsiserial(struct cam_device *device, int task_attr, i cam_freeccb(ccb); free(serial_buf); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1048,7 +1048,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (error != 0) { free(serial_buf); - return(error); + return (error); } bcopy(serial_buf->serial_num, serial_num, serial_buf->length); @@ -1063,7 +1063,7 @@ scsiserial(struct cam_device *device, int task_attr, i free(serial_buf); - return(0); + return (0); } int @@ -1083,7 +1083,7 @@ camxferrate(struct cam_device *device) if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); @@ -1222,13 +1222,13 @@ camxferrate(struct cam_device *device) } } - fprintf(stdout, "\n"); + fprintf(stdout, "\n"); xferrate_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static void @@ -1251,7 +1251,7 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz if (parm->support.command1 & ATA_SUPPORT_PROTECTED) { u_int64_t lba = lbasize48 ? lbasize48 : lbasize; printf("yes %s %ju/%ju\n", (hpasize > lba) ? "yes" : "no ", - lba, hpasize); + lba, hpasize); printf("HPA - Security "); if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) @@ -3041,8 +3041,7 @@ atasecurity(struct cam_device *device, int retry_count } error = atasecurity_erase(device, ccb, retry_count, - timeout, erase_timeout, &pwd, - quiet); + timeout, erase_timeout, &pwd, quiet); } else { warnx("Can't secure erase (security is disabled)"); error = 1; @@ -3135,7 +3134,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) if (argc < 3) { warnx(must, rescan? "rescan" : "reset"); - return(1); + return (1); } tstr = argv[optind]; @@ -3147,7 +3146,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist); if (rv != 1 && rv != 3) { warnx(must, rescan? "rescan" : "reset"); - return(1); + return (1); } } else { char name[30]; @@ -3255,7 +3254,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) bailout: - return(error); + return (error); } static int @@ -3270,7 +3269,7 @@ rescan_or_reset_bus(path_id_t bus, int rescan) if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { warnx("error opening transport layer device %s", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } ccb = malloc(sizeof(*ccb)); @@ -3435,7 +3434,7 @@ bailout: } free(ccb); - return(retval); + return (retval); } static int @@ -3449,17 +3448,17 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target if (bus == CAM_BUS_WILDCARD) { warnx("invalid bus number %d", bus); - return(1); + return (1); } if (target == CAM_TARGET_WILDCARD) { warnx("invalid target number %d", target); - return(1); + return (1); } if (lun == CAM_LUN_WILDCARD) { warnx("invalid lun number %jx", (uintmax_t)lun); - return(1); + return (1); } fd = -1; @@ -3471,13 +3470,13 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target warnx("error opening transport layer device %s\n", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } } else { device = cam_open_btl(bus, target, lun, O_RDWR, NULL); if (device == NULL) { warnx("%s", cam_errbuf); - return(1); + return (1); } } @@ -3495,13 +3494,13 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target if (ioctl(fd, CAMIOCOMMAND, &ccb) < 0) { warn("CAMIOCOMMAND ioctl failed"); close(fd); - return(1); + return (1); } } else { if (cam_send_ccb(device, &ccb) < 0) { warn("error sending XPT_RESET_DEV CCB"); cam_close_device(device); - return(1); + return (1); } } @@ -3518,12 +3517,12 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target && ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_BDR_SENT))) { fprintf(stdout, "%s of %d:%d:%jx was successful\n", scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun); - return(0); + return (0); } else { fprintf(stdout, "%s of %d:%d:%jx returned error %#x\n", scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun, ccb.ccb_h.status & CAM_STATUS_MASK); - return(1); + return (1); } } @@ -3755,7 +3754,7 @@ next_batch: error = 1; goto defect_bailout; break; - } + } max_possible_size = (hdr_max / entry_size) * entry_size; num_returned = returned_length / entry_size; @@ -4101,7 +4100,7 @@ defect_bailout: if (ccb != NULL) cam_freeccb(ccb); - return(error); + return (error); } #endif /* MINIMALISTIC */ @@ -4302,7 +4301,7 @@ scsicmd(struct cam_device *device, int argc, char **ar if (ccb == NULL) { warnx("scsicmd: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(ccb); @@ -4502,7 +4501,7 @@ scsicmd(struct cam_device *device, int argc, char **ar case 3: case 6: case 7: - /* computed by buff_encode_visit */ + /* computed by buff_encode_visit */ break; case 4: cdb_len = 16; @@ -4631,7 +4630,7 @@ scsicmd_bailout: cam_freeccb(ccb); - return(error); + return (error); } static int @@ -4685,7 +4684,7 @@ camdebug(int argc, char **argv, char *combinedopt) if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { warnx("error opening transport layer device %s", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } argc -= optind; argv += optind; @@ -4694,7 +4693,7 @@ camdebug(int argc, char **argv, char *combinedopt) warnx("you must specify \"off\", \"all\" or a bus,"); warnx("bus:target, or bus:target:lun"); close(fd); - return(1); + return (1); } tstr = *argv; @@ -4768,7 +4767,7 @@ camdebug(int argc, char **argv, char *combinedopt) close(fd); } - return(error); + return (error); } static int @@ -4786,7 +4785,7 @@ tagcontrol(struct cam_device *device, int argc, char * if (ccb == NULL) { warnx("tagcontrol: error allocating ccb"); - return(1); + return (1); } while ((c = getopt(argc, argv, combinedopt)) != -1) { @@ -4882,7 +4881,7 @@ tagcontrol(struct cam_device *device, int argc, char * tagcontrol_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static void @@ -5035,7 +5034,7 @@ get_cpi(struct cam_device *device, struct ccb_pathinq ccb = cam_getccb(device); if (ccb == NULL) { warnx("get_cpi: couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; @@ -5058,7 +5057,7 @@ get_cpi(struct cam_device *device, struct ccb_pathinq get_cpi_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } /* @@ -5073,7 +5072,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * ccb = cam_getccb(device); if (ccb == NULL) { warnx("get_cgd: couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; @@ -5096,7 +5095,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * get_cgd_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } /* @@ -5118,7 +5117,7 @@ dev_has_vpd_page(struct cam_device *dev, uint8_t page_ retval = -1; goto bailout; } - + /* cam_getccb cleans up the header, caller has to zero the payload */ CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -5165,7 +5164,7 @@ dev_has_vpd_page(struct cam_device *dev, uint8_t page_ bailout: if (ccb != NULL) cam_freeccb(ccb); - + return (retval); } @@ -5195,7 +5194,7 @@ get_device_type(struct cam_device *dev, int retry_coun break; /*NOTREACHED*/ default: *devtype = CC_DT_UNKNOWN; - goto bailout; + goto bailout; break; /*NOTREACHED*/ } @@ -5270,7 +5269,7 @@ build_ata_cmd(union ccb *ccb, uint32_t retry_count, ui /*protocol*/ protocol, /*ata_flags*/ ata_flags, /*features*/ features, - /*sector_count*/ sector_count, + /*sector_count*/ sector_count, /*lba*/ lba, /*command*/ command, /*device*/ 0, @@ -5302,7 +5301,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, /* * In this case, we have SCSI ATA PASS-THROUGH command, 12 - * or 16 byte, and need to see what + * or 16 byte, and need to see what */ if (ccb->ccb_h.flags & CAM_CDB_POINTER) opcode = ccb->csio.cdb_io.cdb_ptr[0]; @@ -5352,7 +5351,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, ((uint64_t)desc->lba_31_24 << 24) | (desc->lba_23_16 << 16) | (desc->lba_15_8 << 8) | - desc->lba_7_0; + desc->lba_7_0; *device = desc->device; *status = desc->status; @@ -5403,7 +5402,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, res = &ccb->ataio.res; *error = res->error; *status = res->status; - *device = res->device; + *device = res->device; *count = res->sector_count; *lba = (res->lba_high << 16) | (res->lba_mid << 8) | @@ -5603,7 +5602,7 @@ get_print_cts(struct cam_device *device, int user_sett if (ccb == NULL) { warnx("get_print_cts: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); @@ -5643,7 +5642,7 @@ get_print_cts_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static int @@ -5666,7 +5665,7 @@ ratecontrol(struct cam_device *device, int task_attr, ccb = cam_getccb(device); if (ccb == NULL) { warnx("ratecontrol: error allocating ccb"); - return(1); + return (1); } while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c){ @@ -5998,7 +5997,7 @@ ratecontrol(struct cam_device *device, int task_attr, ratecontrol_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static int @@ -6022,7 +6021,7 @@ scsiformat(struct cam_device *device, int argc, char * if (ccb == NULL) { warnx("scsiformat: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -6288,7 +6287,7 @@ scsiformat_bailout: cam_freeccb(ccb); - return(error); + return (error); } static int @@ -6317,7 +6316,7 @@ scsisanitize(struct cam_device *device, int argc, char if (ccb == NULL) { warnx("scsisanitize: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -6698,7 +6697,7 @@ scsisanitize_bailout: free(data_ptr); cam_freeccb(ccb); - return(error); + return (error); } static int @@ -7328,7 +7327,7 @@ smpcmd(struct cam_device *device, int argc, char **arg } else if ((amt_written == 0) && (amt_to_write > 0)) { warnx("only wrote %u bytes out of %u", - response_size - amt_to_write, + response_size - amt_to_write, response_size); } } @@ -7352,19 +7351,19 @@ mmcsdcmd(struct cam_device *device, int argc, char **a { int c, error = 0; union ccb *ccb; - int32_t mmc_opcode = 0, mmc_arg = 0; - int32_t mmc_flags = -1; + int32_t mmc_opcode = 0, mmc_arg = 0; + int32_t mmc_flags = -1; int retval; - int is_write = 0; - int is_bw_4 = 0, is_bw_1 = 0; - int is_highspeed = 0, is_stdspeed = 0; + int is_write = 0; + int is_bw_4 = 0, is_bw_1 = 0; + int is_highspeed = 0, is_stdspeed = 0; int is_info_request = 0; int flags = 0; - uint8_t mmc_data_byte = 0; + uint8_t mmc_data_byte = 0; - /* For IO_RW_EXTENDED command */ + /* For IO_RW_EXTENDED command */ uint8_t *mmc_data = NULL; - struct mmc_data mmc_d; + struct mmc_data mmc_d; int mmc_data_len = 0; /* @@ -7382,143 +7381,143 @@ mmcsdcmd(struct cam_device *device, int argc, char **a while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { - case '4': - is_bw_4 = 1; - break; - case '1': - is_bw_1 = 1; - break; - case 'S': - if (!strcmp(optarg, "high")) - is_highspeed = 1; - else - is_stdspeed = 1; - break; + case '4': + is_bw_4 = 1; + break; + case '1': + is_bw_1 = 1; + break; + case 'S': + if (!strcmp(optarg, "high")) + is_highspeed = 1; + else + is_stdspeed = 1; + break; case 'I': is_info_request = 1; break; - case 'c': - mmc_opcode = strtol(optarg, NULL, 0); + case 'c': + mmc_opcode = strtol(optarg, NULL, 0); if (mmc_opcode < 0) { warnx("invalid MMC opcode %d", mmc_opcode); error = 1; goto mmccmd_bailout; } - break; - case 'a': - mmc_arg = strtol(optarg, NULL, 0); + break; + case 'a': + mmc_arg = strtol(optarg, NULL, 0); if (mmc_arg < 0) { warnx("invalid MMC arg %d", mmc_arg); error = 1; goto mmccmd_bailout; } - break; - case 'f': - mmc_flags = strtol(optarg, NULL, 0); + break; + case 'f': + mmc_flags = strtol(optarg, NULL, 0); if (mmc_flags < 0) { warnx("invalid MMC flags %d", mmc_flags); error = 1; goto mmccmd_bailout; } - break; - case 'l': - mmc_data_len = strtol(optarg, NULL, 0); + break; + case 'l': + mmc_data_len = strtol(optarg, NULL, 0); if (mmc_data_len <= 0) { warnx("invalid MMC data len %d", mmc_data_len); error = 1; goto mmccmd_bailout; } - break; - case 'W': - is_write = 1; - break; - case 'b': - mmc_data_byte = strtol(optarg, NULL, 0); - break; + break; + case 'W': + is_write = 1; + break; + case 'b': + mmc_data_byte = strtol(optarg, NULL, 0); + break; default: break; } } flags |= CAM_DEV_QFRZDIS; /* masks are broken?! */ - /* If flags are left default, supply the right flags */ - if (mmc_flags < 0) - switch (mmc_opcode) { - case MMC_GO_IDLE_STATE: - mmc_flags = MMC_RSP_NONE | MMC_CMD_BC; - break; - case IO_SEND_OP_COND: - mmc_flags = MMC_RSP_R4; - break; - case SD_SEND_RELATIVE_ADDR: - mmc_flags = MMC_RSP_R6 | MMC_CMD_BCR; - break; - case MMC_SELECT_CARD: - mmc_flags = MMC_RSP_R1B | MMC_CMD_AC; - mmc_arg = mmc_arg << 16; - break; - case SD_IO_RW_DIRECT: - mmc_flags = MMC_RSP_R5 | MMC_CMD_AC; - mmc_arg = SD_IO_RW_ADR(mmc_arg); - if (is_write) - mmc_arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(mmc_data_byte); - break; - case SD_IO_RW_EXTENDED: - mmc_flags = MMC_RSP_R5 | MMC_CMD_ADTC; - mmc_arg = SD_IO_RW_ADR(mmc_arg); - int len_arg = mmc_data_len; - if (mmc_data_len == 512) - len_arg = 0; + /* If flags are left default, supply the right flags */ + if (mmc_flags < 0) + switch (mmc_opcode) { + case MMC_GO_IDLE_STATE: + mmc_flags = MMC_RSP_NONE | MMC_CMD_BC; + break; + case IO_SEND_OP_COND: + mmc_flags = MMC_RSP_R4; + break; + case SD_SEND_RELATIVE_ADDR: + mmc_flags = MMC_RSP_R6 | MMC_CMD_BCR; + break; + case MMC_SELECT_CARD: + mmc_flags = MMC_RSP_R1B | MMC_CMD_AC; + mmc_arg = mmc_arg << 16; + break; + case SD_IO_RW_DIRECT: + mmc_flags = MMC_RSP_R5 | MMC_CMD_AC; + mmc_arg = SD_IO_RW_ADR(mmc_arg); + if (is_write) + mmc_arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(mmc_data_byte); + break; + case SD_IO_RW_EXTENDED: + mmc_flags = MMC_RSP_R5 | MMC_CMD_ADTC; + mmc_arg = SD_IO_RW_ADR(mmc_arg); + int len_arg = mmc_data_len; + if (mmc_data_len == 512) + len_arg = 0; - // Byte mode - mmc_arg |= SD_IOE_RW_LEN(len_arg) | SD_IO_RW_INCR; - // Block mode + // Byte mode + mmc_arg |= SD_IOE_RW_LEN(len_arg) | SD_IO_RW_INCR; + // Block mode // mmc_arg |= SD_IOE_RW_BLK | SD_IOE_RW_LEN(len_arg) | SD_IO_RW_INCR; - break; - default: - mmc_flags = MMC_RSP_R1; - break; - } + break; + default: + mmc_flags = MMC_RSP_R1; + break; + } - // Switch bus width instead of sending IO command - if (is_bw_4 || is_bw_1) { - struct ccb_trans_settings_mmc *cts; - ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - ccb->ccb_h.flags = 0; - cts = &ccb->cts.proto_specific.mmc; - cts->ios.bus_width = is_bw_4 == 1 ? bus_width_4 : bus_width_1; - cts->ios_valid = MMC_BW; - if (((retval = cam_send_ccb(device, ccb)) < 0) - || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { - warn("Error sending command"); - } else { - printf("Parameters set OK\n"); - } - cam_freeccb(ccb); - return (retval); - } + // Switch bus width instead of sending IO command + if (is_bw_4 || is_bw_1) { + struct ccb_trans_settings_mmc *cts; + ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + cts = &ccb->cts.proto_specific.mmc; + cts->ios.bus_width = is_bw_4 == 1 ? bus_width_4 : bus_width_1; + cts->ios_valid = MMC_BW; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + } else { + printf("Parameters set OK\n"); + } + cam_freeccb(ccb); + return (retval); + } - // Switch bus speed instead of sending IO command - if (is_stdspeed || is_highspeed) { - struct ccb_trans_settings_mmc *cts; - ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - ccb->ccb_h.flags = 0; - cts = &ccb->cts.proto_specific.mmc; - cts->ios.timing = is_highspeed == 1 ? bus_timing_hs : bus_timing_normal; - cts->ios_valid = MMC_BT; - if (((retval = cam_send_ccb(device, ccb)) < 0) - || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { - warn("Error sending command"); - } else { - printf("Speed set OK (HS: %d)\n", is_highspeed); - } - cam_freeccb(ccb); - return (retval); - } + // Switch bus speed instead of sending IO command + if (is_stdspeed || is_highspeed) { + struct ccb_trans_settings_mmc *cts; + ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + ccb->ccb_h.flags = 0; + cts = &ccb->cts.proto_specific.mmc; + cts->ios.timing = is_highspeed == 1 ? bus_timing_hs : bus_timing_normal; + cts->ios_valid = MMC_BT; + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + warn("Error sending command"); + } else { + printf("Speed set OK (HS: %d)\n", is_highspeed); + } + cam_freeccb(ccb); + return (retval); + } // Get information about controller and its settings if (is_info_request) { @@ -7560,16 +7559,16 @@ mmcsdcmd(struct cam_device *device, int argc, char **a return (0); } - printf("CMD %d arg %d flags %02x\n", mmc_opcode, mmc_arg, mmc_flags); + printf("CMD %d arg %d flags %02x\n", mmc_opcode, mmc_arg, mmc_flags); - if (mmc_data_len > 0) { - flags |= CAM_DIR_IN; - mmc_data = malloc(mmc_data_len); - memset(mmc_data, 0, mmc_data_len); - mmc_d.len = mmc_data_len; - mmc_d.data = mmc_data; - mmc_d.flags = MMC_DATA_READ; - } else flags |= CAM_DIR_NONE; + if (mmc_data_len > 0) { + flags |= CAM_DIR_IN; + mmc_data = malloc(mmc_data_len); + memset(mmc_data, 0, mmc_data_len); + mmc_d.len = mmc_data_len; + mmc_d.data = mmc_data; + mmc_d.flags = MMC_DATA_READ; + } else flags |= CAM_DIR_NONE; cam_fill_mmcio(&ccb->mmcio, /*retries*/ retry_count, @@ -7597,36 +7596,35 @@ mmcsdcmd(struct cam_device *device, int argc, char **a } if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { - printf("MMCIO: error %d, %08x %08x %08x %08x\n", - ccb->mmcio.cmd.error, ccb->mmcio.cmd.resp[0], - ccb->mmcio.cmd.resp[1], - ccb->mmcio.cmd.resp[2], - ccb->mmcio.cmd.resp[3]); + printf("MMCIO: error %d, %08x %08x %08x %08x\n", + ccb->mmcio.cmd.error, ccb->mmcio.cmd.resp[0], + ccb->mmcio.cmd.resp[1], + ccb->mmcio.cmd.resp[2], + ccb->mmcio.cmd.resp[3]); - switch (mmc_opcode) { - case SD_IO_RW_DIRECT: - printf("IO_RW_DIRECT: resp byte %02x, cur state %d\n", - SD_R5_DATA(ccb->mmcio.cmd.resp), - (ccb->mmcio.cmd.resp[0] >> 12) & 0x3 - ); - break; - case SD_IO_RW_EXTENDED: - printf("IO_RW_EXTENDED: read %d bytes w/o error:\n", mmc_data_len); - hexdump(mmc_data, mmc_data_len, NULL, 0); - break; - case SD_SEND_RELATIVE_ADDR: - printf("SEND_RELATIVE_ADDR: published RCA %02x\n", ccb->mmcio.cmd.resp[0] >> 16); - break; - default: - printf("No command-specific decoder for CMD %d\n", mmc_opcode); - } + switch (mmc_opcode) { + case SD_IO_RW_DIRECT: + printf("IO_RW_DIRECT: resp byte %02x, cur state %d\n", + SD_R5_DATA(ccb->mmcio.cmd.resp), + (ccb->mmcio.cmd.resp[0] >> 12) & 0x3); + break; + case SD_IO_RW_EXTENDED: + printf("IO_RW_EXTENDED: read %d bytes w/o error:\n", mmc_data_len); + hexdump(mmc_data, mmc_data_len, NULL, 0); + break; + case SD_SEND_RELATIVE_ADDR: + printf("SEND_RELATIVE_ADDR: published RCA %02x\n", ccb->mmcio.cmd.resp[0] >> 16); + break; + default: + printf("No command-specific decoder for CMD %d\n", mmc_opcode); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 10 05:34:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94022D9DFB3; Mon, 10 Jul 2017 05:34:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9A67C598; Mon, 10 Jul 2017 05:34:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A5Yb22008988; Mon, 10 Jul 2017 05:34:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A5Yb6h008986; Mon, 10 Jul 2017 05:34:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707100534.v6A5Yb6h008986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 10 Jul 2017 05:34:37 +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: r320862 - stable/11/tests/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/tests/sys/opencrypto X-SVN-Commit-Revision: 320862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 05:34:38 -0000 Author: ngie Date: Mon Jul 10 05:34:37 2017 New Revision: 320862 URL: https://svnweb.freebsd.org/changeset/base/320862 Log: MFC r319455,r319456: r319455: Fix up `TEST_METADATA` - `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak trying to run the tests on a system without python installed in $PATH. - The tests require root because they load aesni(4) and/or cryptodev(4) if not already loaded. r319456: tests/sys/opencrypto/runtests: apply minor polish to test script - Refactor kld loading/unloading logic: -- Use a loop instead of an unrolled one. -- Check for the module being loaded before trying to load it, to reduce noise when loading modules that are already loaded. -- Don't mute stderr from kldload -- it could be potentially useful to the tester. -- In the event that the test script was terminated early, it would leave the modules still attached to the system (which is undesirable). Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the system is returned to its former operating state as best possible. Unload the modules in reverse order, in part for consistency and/or dependency reasons. Modified: stable/11/tests/sys/opencrypto/Makefile stable/11/tests/sys/opencrypto/runtests.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/opencrypto/Makefile ============================================================================== --- stable/11/tests/sys/opencrypto/Makefile Mon Jul 10 05:16:07 2017 (r320861) +++ stable/11/tests/sys/opencrypto/Makefile Mon Jul 10 05:34:37 2017 (r320862) @@ -7,7 +7,9 @@ BINDIR= ${TESTSDIR} PLAIN_TESTS_SH= runtests -TEST_METADATA.foo+=required_programs="python" +TEST_METADATA.runtests+= required_programs="python" +TEST_METADATA.runtests+= required_user="root" + PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py ${PACKAGE}FILES+= ${PYMODULES} Modified: stable/11/tests/sys/opencrypto/runtests.sh ============================================================================== --- stable/11/tests/sys/opencrypto/runtests.sh Mon Jul 10 05:16:07 2017 (r320861) +++ stable/11/tests/sys/opencrypto/runtests.sh Mon Jul 10 05:34:37 2017 (r320862) @@ -29,21 +29,34 @@ # $FreeBSD$ # -set -e +set -ex if [ ! -d /usr/local/share/nist-kat ]; then echo 'Skipping, nist-kat package not installed for test vectors.' exit 0 fi -if kldload aesni 2>/dev/null; then - unloadaesni=1 -fi +loaded_modules= +cleanup_tests() +{ + trap - EXIT INT TERM -if kldload cryptodev 2>/dev/null; then - unloadcdev=1 -fi + set +e + # Unload modules in reverse order + for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do + kldunload $loaded_module + done +} +trap cleanup_tests EXIT INT TERM + +for required_module in aesni cryptodev; do + if ! kldstat -q -m $required_module; then + kldload $required_module + loaded_modules="$loaded_modules $required_module" + fi +done + # Run software crypto test oldcdas=$(sysctl -e kern.cryptodevallowsoft) sysctl kern.cryptodevallowsoft=1 @@ -51,10 +64,3 @@ sysctl kern.cryptodevallowsoft=1 python $(dirname $0)/cryptotest.py sysctl "$oldcdas" - -if [ x"$unloadcdev" = x"1" ]; then - kldunload cryptodev -fi -if [ x"$unloadaesni" = x"1" ]; then - kldunload aesni -fi From owner-svn-src-all@freebsd.org Mon Jul 10 05:59:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 941C1D9E909; Mon, 10 Jul 2017 05:59:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5E1027D068; Mon, 10 Jul 2017 05:59:07 +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 v6A5x6CG017270; Mon, 10 Jul 2017 05:59:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A5x61t017269; Mon, 10 Jul 2017 05:59:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707100559.v6A5x61t017269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Jul 2017 05:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320863 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 320863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 05:59:07 -0000 Author: kib Date: Mon Jul 10 05:59:06 2017 New Revision: 320863 URL: https://svnweb.freebsd.org/changeset/base/320863 Log: MFC r320619: Resolve confusion between different error code spaces. Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Mon Jul 10 05:34:37 2017 (r320862) +++ stable/11/sys/kern/kern_exec.c Mon Jul 10 05:59:06 2017 (r320863) @@ -1057,9 +1057,9 @@ exec_unmap_first_page(imgp) } /* - * Destroy old address space, and allocate a new stack - * The new stack is only SGROWSIZ large because it is grown - * automatically in trap.c. + * Destroy old address space, and allocate a new stack. + * The new stack is only sgrowsiz large because it is grown + * automatically on a page fault. */ int exec_new_vmspace(imgp, sv) @@ -1113,9 +1113,9 @@ exec_new_vmspace(imgp, sv) VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_READ | VM_PROT_EXECUTE, MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(obj); - return (error); + return (vm_mmap_to_errno(error)); } } @@ -1139,10 +1139,9 @@ exec_new_vmspace(imgp, sv) stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : - sv->sv_stackprot, - VM_PROT_ALL, MAP_STACK_GROWS_DOWN); - if (error) - return (error); + sv->sv_stackprot, VM_PROT_ALL, MAP_STACK_GROWS_DOWN); + if (error != KERN_SUCCESS) + return (vm_mmap_to_errno(error)); /* * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they From owner-svn-src-all@freebsd.org Mon Jul 10 06:08:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D9FD9EBC5; Mon, 10 Jul 2017 06:08:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B54797D458; Mon, 10 Jul 2017 06:08:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A68iMM021527; Mon, 10 Jul 2017 06:08:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A68i8L021526; Mon, 10 Jul 2017 06:08:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707100608.v6A68i8L021526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Jul 2017 06:08:44 +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: r320864 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 320864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 06:08:46 -0000 Author: kib Date: Mon Jul 10 06:08:44 2017 New Revision: 320864 URL: https://svnweb.freebsd.org/changeset/base/320864 Log: MFC r320619: Resolve confusion between different error code spaces. Modified: stable/10/sys/kern/kern_exec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Mon Jul 10 05:59:06 2017 (r320863) +++ stable/10/sys/kern/kern_exec.c Mon Jul 10 06:08:44 2017 (r320864) @@ -1043,9 +1043,9 @@ exec_unmap_first_page(imgp) } /* - * Destroy old address space, and allocate a new stack - * The new stack is only SGROWSIZ large because it is grown - * automatically in trap.c. + * Destroy old address space, and allocate a new stack. + * The new stack is only sgrowsiz large because it is grown + * automatically on a page fault. */ int exec_new_vmspace(imgp, sv) @@ -1099,9 +1099,9 @@ exec_new_vmspace(imgp, sv) VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_READ | VM_PROT_EXECUTE, MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(obj); - return (error); + return (vm_mmap_to_errno(error)); } } @@ -1125,10 +1125,9 @@ exec_new_vmspace(imgp, sv) stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : - sv->sv_stackprot, - VM_PROT_ALL, MAP_STACK_GROWS_DOWN); - if (error) - return (error); + sv->sv_stackprot, VM_PROT_ALL, MAP_STACK_GROWS_DOWN); + if (error != KERN_SUCCESS) + return (vm_mmap_to_errno(error)); #ifdef __ia64__ /* Allocate a new register stack */ From owner-svn-src-all@freebsd.org Mon Jul 10 06:25:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1A1D9EFE2; Mon, 10 Jul 2017 06:25:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B3EE7DB36; Mon, 10 Jul 2017 06:25:31 +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 v6A6PUVB029555; Mon, 10 Jul 2017 06:25:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A6PU4T029554; Mon, 10 Jul 2017 06:25:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707100625.v6A6PU4T029554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 10 Jul 2017 06:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320865 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 320865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 06:25:32 -0000 Author: mav Date: Mon Jul 10 06:25:30 2017 New Revision: 320865 URL: https://svnweb.freebsd.org/changeset/base/320865 Log: "Port Type not registered" is not a real error for GIT_PT. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Jul 10 06:08:44 2017 (r320864) +++ head/sys/dev/isp/isp.c Mon Jul 10 06:25:30 2017 (r320865) @@ -3783,7 +3783,10 @@ fail: goto abort; if (rs->snscb_cthdr.ct_cmd_resp != LS_ACC) { int level; - if (rs->snscb_cthdr.ct_reason == 9 && rs->snscb_cthdr.ct_explanation == 7) { + /* FC-4 Type and Port Type not registered are not errors. */ + if (rs->snscb_cthdr.ct_reason == 9 && + (rs->snscb_cthdr.ct_explanation == 0x07 || + rs->snscb_cthdr.ct_explanation == 0x0a)) { level = ISP_LOG_SANCFG; } else { level = ISP_LOGWARN; From owner-svn-src-all@freebsd.org Mon Jul 10 06:28:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC39BD9F07A; Mon, 10 Jul 2017 06:28:52 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4487DC8B; Mon, 10 Jul 2017 06:28:52 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A6Sp9P029724; Mon, 10 Jul 2017 06:28:51 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A6So8e029710; Mon, 10 Jul 2017 06:28:50 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707100628.v6A6So8e029710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 10 Jul 2017 06:28: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: r320866 - in stable/11: lib/libvmmapi usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in stable/11: lib/libvmmapi usr.sbin/bhyve X-SVN-Commit-Revision: 320866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 06:28:53 -0000 Author: grehan Date: Mon Jul 10 06:28:50 2017 New Revision: 320866 URL: https://svnweb.freebsd.org/changeset/base/320866 Log: MFC 313727, 317483 In addition, replace the missing caph routines with small helper functions (bhyverun.c) or an open-coded replacement (uart_emul.c) 313727 Capsicumize bhyve 317483 Allow CAP_MMAP_RW on memfd for PCI passthru Modified: stable/11/lib/libvmmapi/vmmapi.c stable/11/lib/libvmmapi/vmmapi.h stable/11/usr.sbin/bhyve/bhyverun.c stable/11/usr.sbin/bhyve/block_if.c stable/11/usr.sbin/bhyve/consport.c stable/11/usr.sbin/bhyve/dbgport.c stable/11/usr.sbin/bhyve/mevent.c stable/11/usr.sbin/bhyve/pci_e82545.c stable/11/usr.sbin/bhyve/pci_passthru.c stable/11/usr.sbin/bhyve/pci_virtio_net.c stable/11/usr.sbin/bhyve/pci_virtio_rnd.c stable/11/usr.sbin/bhyve/rfb.c stable/11/usr.sbin/bhyve/uart_emul.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/11/lib/libvmmapi/vmmapi.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/lib/libvmmapi/vmmapi.c Mon Jul 10 06:28:50 2017 (r320866) @@ -1416,3 +1416,45 @@ vm_restart_instruction(void *arg, int vcpu) return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); } + +int +vm_get_device_fd(struct vmctx *ctx) +{ + + return (ctx->fd); +} + +const cap_ioctl_t * +vm_get_ioctls(size_t *len) +{ + cap_ioctl_t *cmds; + /* keep in sync with machine/vmm_dev.h */ + static const cap_ioctl_t vm_ioctl_cmds[] = { VM_RUN, VM_SUSPEND, VM_REINIT, + VM_ALLOC_MEMSEG, VM_GET_MEMSEG, VM_MMAP_MEMSEG, VM_MMAP_MEMSEG, + VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, + VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, + VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, + VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, + VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, + VM_ISA_DEASSERT_IRQ, VM_ISA_PULSE_IRQ, VM_ISA_SET_IRQ_TRIGGER, + VM_SET_CAPABILITY, VM_GET_CAPABILITY, VM_BIND_PPTDEV, + VM_UNBIND_PPTDEV, VM_MAP_PPTDEV_MMIO, VM_PPTDEV_MSI, + VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, + VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, + VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, + VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, + VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, + VM_RESTART_INSTRUCTION }; + + if (len == NULL) { + cmds = malloc(sizeof(vm_ioctl_cmds)); + if (cmds == NULL) + return (NULL); + bcopy(vm_ioctl_cmds, cmds, sizeof(vm_ioctl_cmds)); + return (cmds); + } + + *len = nitems(vm_ioctl_cmds); + return (NULL); +} + Modified: stable/11/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/11/lib/libvmmapi/vmmapi.h Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/lib/libvmmapi/vmmapi.h Mon Jul 10 06:28:50 2017 (r320866) @@ -36,7 +36,7 @@ * API version for out-of-tree consumers like grub-bhyve for making compile * time decisions. */ -#define VMMAPI_VERSION 0102 /* 2 digit major followed by 2 digit minor */ +#define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ struct iovec; struct vmctx; @@ -102,6 +102,7 @@ int vm_mmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, vm_ooffset_t segoff, size_t len, int prot); int vm_create(const char *name); +int vm_get_device_fd(struct vmctx *ctx); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); int vm_parse_memsize(const char *optarg, size_t *memsize); @@ -161,6 +162,8 @@ int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); + +const cap_ioctl_t *vm_get_ioctls(size_t *len); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: stable/11/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/11/usr.sbin/bhyve/bhyverun.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/bhyverun.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include @@ -40,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -48,8 +52,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#include +#endif #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include "bhyverun.h" @@ -152,7 +163,44 @@ usage(int code) exit(code); } +#ifndef WITHOUT_CAPSICUM +/* + * 11-stable capsicum helpers + */ +static void +bhyve_caph_cache_catpages(void) +{ + + (void)catopen("libc", NL_CAT_LOCALE); +} + static int +bhyve_caph_limit_stdoe(void) +{ + cap_rights_t rights; + unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ }; + int i, fds[] = { STDOUT_FILENO, STDERR_FILENO }; + + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL); + cap_rights_set(&rights, CAP_WRITE); + + for (i = 0; i < nitems(fds); i++) { + if (cap_rights_limit(fds[i], &rights) < 0 && errno != ENOSYS) + return (-1); + + if (cap_ioctls_limit(fds[i], cmds, nitems(cmds)) < 0 && errno != ENOSYS) + return (-1); + + if (cap_fcntls_limit(fds[i], CAP_FCNTL_GETFL) < 0 && errno != ENOSYS) + return (-1); + } + + return (0); +} + +#endif + +static int pincpu_parse(const char *opt) { int vcpu, pcpu; @@ -706,6 +754,11 @@ do_open(const char *vmname) struct vmctx *ctx; int error; bool reinit, romboot; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + const cap_ioctl_t *cmds; + size_t ncmds; +#endif reinit = romboot = false; @@ -744,6 +797,21 @@ do_open(const char *vmname) exit(1); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); + if (cap_rights_limit(vm_get_device_fd(ctx), &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + vm_get_ioctls(&ncmds); + cmds = vm_get_ioctls(NULL); + if (cmds == NULL) + errx(EX_OSERR, "out of memory"); + if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + free((cap_ioctl_t *)cmds); +#endif + if (reinit) { error = vm_reinit(ctx); if (error) { @@ -951,6 +1019,16 @@ main(int argc, char *argv[]) if (lpc_bootrom()) fwctl_init(); + +#ifndef WITHOUT_CAPSICUM + + + if (bhyve_caph_limit_stdoe() == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + + if (cap_enter() == -1 && errno != ENOSYS) + errx(EX_OSERR, "cap_enter() failed"); +#endif /* * Change the proc title to include the VM name. Modified: stable/11/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/11/usr.sbin/bhyve/block_if.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/block_if.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -45,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -400,6 +404,10 @@ blockif_open(const char *optstr, const char *ident) off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; +#endif pthread_once(&blockif_once, blockif_init); @@ -457,6 +465,16 @@ blockif_open(const char *optstr, const char *ident) goto err; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_FSYNC, CAP_IOCTL, CAP_READ, CAP_SEEK, + CAP_WRITE); + if (ro) + cap_rights_clear(&rights, CAP_FSYNC, CAP_WRITE); + + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Deal with raw devices */ @@ -482,6 +500,11 @@ blockif_open(const char *optstr, const char *ident) geom = 1; } else psectsz = sbuf.st_blksize; + +#ifndef WITHOUT_CAPSICUM + if (cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif if (ssopt != 0) { if (!powerof2(ssopt) || !powerof2(pssopt) || ssopt < 512 || Modified: stable/11/usr.sbin/bhyve/consport.c ============================================================================== --- stable/11/usr.sbin/bhyve/consport.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/consport.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,13 +30,19 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include +#include +#include #include #include #include #include #include +#include #include "inout.h" #include "pci_lpc.h" @@ -104,6 +110,10 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i uint32_t *eax, void *arg) { static int opened; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif if (bytes == 2 && in) { *eax = BVM_CONS_SIG; @@ -123,6 +133,13 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i return (-1); if (!opened) { +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif ttyopen(); opened = 1; } Modified: stable/11/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/11/usr.sbin/bhyve/dbgport.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/dbgport.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,13 +30,18 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include +#include #include #include +#include #include #include #include @@ -125,6 +130,9 @@ void init_dbgport(int sport) { int reuse; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif conn_fd = -1; @@ -154,6 +162,12 @@ init_dbgport(int sport) perror("listen"); exit(1); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(listen_fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif register_inout(&dbgport); } Modified: stable/11/usr.sbin/bhyve/mevent.c ============================================================================== --- stable/11/usr.sbin/bhyve/mevent.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/mevent.c Mon Jul 10 06:28:50 2017 (r320866) @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include +#include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include @@ -401,6 +406,9 @@ mevent_dispatch(void) int mfd; int numev; int ret; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif mevent_tid = pthread_self(); mevent_set_name(); @@ -408,6 +416,12 @@ mevent_dispatch(void) mfd = kqueue(); assert(mfd > 0); +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_KQUEUE); + if (cap_rights_limit(mfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Open the pipe that will be used for other threads to force * the blocking kqueue call to exit by writing to it. Set the @@ -418,6 +432,14 @@ mevent_dispatch(void) perror("pipe"); exit(0); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(mevent_pipefd[0], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_rights_limit(mevent_pipefd[1], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif /* * Add internal event handler for the pipe write fd Modified: stable/11/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_e82545.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/pci_e82545.c Mon Jul 10 06:28:50 2017 (r320866) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -38,12 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -2202,6 +2207,9 @@ static void e82545_open_tap(struct e82545_softc *sc, char *opts) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif if (opts == NULL) { sc->esc_tapfd = -1; @@ -2228,6 +2236,12 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) sc->esc_tapfd = -1; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->esc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + sc->esc_mevp = mevent_add(sc->esc_tapfd, EVF_READ, e82545_tap_callback, Modified: stable/11/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_passthru.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/pci_passthru.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -44,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -639,10 +644,19 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p { int bus, slot, func, error, memflags; struct passthru_softc *sc; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t pci_ioctls[] = { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR }; + cap_ioctl_t io_ioctls[] = { IODEV_PIO }; +#endif sc = NULL; error = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_WRITE); +#endif + memflags = vm_get_memflags(ctx); if (!(memflags & VM_MEM_F_WIRED)) { warnx("passthru requires guest memory to be wired"); @@ -657,6 +671,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(pcifd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(pcifd, pci_ioctls, nitems(pci_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (iofd < 0) { iofd = open(_PATH_DEVIO, O_RDWR, 0); if (iofd < 0) { @@ -665,6 +686,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(iofd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(iofd, io_ioctls, nitems(io_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (memfd < 0) { memfd = open(_PATH_MEM, O_RDWR, 0); if (memfd < 0) { @@ -672,6 +700,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p goto done; } } + +#ifndef WITHOUT_CAPSICUM + cap_rights_clear(&rights, CAP_IOCTL); + cap_rights_set(&rights, CAP_MMAP_RW); + if (cap_rights_limit(memfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif if (opts == NULL || sscanf(opts, "%d/%d/%d", &bus, &slot, &func) != 3) { Modified: stable/11/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_virtio_net.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/pci_virtio_net.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -41,6 +44,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include #include @@ -53,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -743,6 +748,9 @@ static void pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif strcpy(tbuf, "/dev/"); strlcat(tbuf, devname, sizeof(tbuf)); @@ -766,6 +774,12 @@ pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char * close(sc->vsc_tapfd); sc->vsc_tapfd = -1; } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->vsc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif sc->vsc_mevp = mevent_add(sc->vsc_tapfd, EVF_READ, Modified: stable/11/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_virtio_rnd.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/pci_virtio_rnd.c Mon Jul 10 06:28:50 2017 (r320866) @@ -35,9 +35,13 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include +#include #include #include #include @@ -46,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -138,6 +143,9 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * int fd; int len; uint8_t v; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif /* * Should always be able to open /dev/random. @@ -145,6 +153,12 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * fd = open("/dev/random", O_RDONLY | O_NONBLOCK); assert(fd >= 0); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_READ); + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif /* * Check that device is seeded and non-blocking. Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/rfb.c Mon Jul 10 06:28:50 2017 (r320866) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -39,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -46,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -972,6 +978,9 @@ rfb_init(char *hostname, int port, int wait, char *pas struct rfb_softc *rc; struct sockaddr_in sin; int on = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif rc = calloc(1, sizeof(struct rfb_softc)); @@ -1009,6 +1018,12 @@ rfb_init(char *hostname, int port, int wait, char *pas perror("listen"); return (-1); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(rc->sfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif rc->hw_crc = sse42_supported(); Modified: stable/11/usr.sbin/bhyve/uart_emul.c ============================================================================== --- stable/11/usr.sbin/bhyve/uart_emul.c Mon Jul 10 06:25:30 2017 (r320865) +++ stable/11/usr.sbin/bhyve/uart_emul.c Mon Jul 10 06:28:50 2017 (r320866) @@ -32,16 +32,22 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include +#include +#include #include #include #include #include #include #include +#include #include "mevent.h" #include "uart_emul.h" @@ -638,7 +644,7 @@ uart_tty_backend(struct uart_softc *sc, const char *op sc->tty.opened = true; retval = 0; } - + return (retval); } @@ -646,6 +652,11 @@ int uart_set_backend(struct uart_softc *sc, const char *opts) { int retval; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; + cap_ioctl_t sicmds[] = { TIOCGETA, TIOCGWINSZ }; +#endif retval = -1; @@ -666,6 +677,23 @@ uart_set_backend(struct uart_softc *sc, const char *op /* Make the backend file descriptor non-blocking */ if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (!uart_stdio) { + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_READ); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, sicmds, nitems(sicmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_fcntls_limit(STDIN_FILENO, CAP_FCNTL_GETFL) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + } +#endif if (retval == 0) uart_opentty(sc); From owner-svn-src-all@freebsd.org Mon Jul 10 07:13:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7769ED9FA57; Mon, 10 Jul 2017 07:13: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 mx1.freebsd.org (Postfix) with ESMTPS id 4498D7ECA5; Mon, 10 Jul 2017 07:13: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 v6A7CxEQ049960; Mon, 10 Jul 2017 07:12:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A7CxVc049959; Mon, 10 Jul 2017 07:12:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707100712.v6A7CxVc049959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Jul 2017 07:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320867 - releng/11.1/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.1/sys/kern X-SVN-Commit-Revision: 320867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 07:13:00 -0000 Author: kib Date: Mon Jul 10 07:12:59 2017 New Revision: 320867 URL: https://svnweb.freebsd.org/changeset/base/320867 Log: MFC r320619 MFS r320863: Resolve confusion between different error code spaces. Approved by: re (delphij) Modified: releng/11.1/sys/kern/kern_exec.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/sys/kern/kern_exec.c ============================================================================== --- releng/11.1/sys/kern/kern_exec.c Mon Jul 10 06:28:50 2017 (r320866) +++ releng/11.1/sys/kern/kern_exec.c Mon Jul 10 07:12:59 2017 (r320867) @@ -1055,9 +1055,9 @@ exec_unmap_first_page(imgp) } /* - * Destroy old address space, and allocate a new stack - * The new stack is only SGROWSIZ large because it is grown - * automatically in trap.c. + * Destroy old address space, and allocate a new stack. + * The new stack is only sgrowsiz large because it is grown + * automatically on a page fault. */ int exec_new_vmspace(imgp, sv) @@ -1111,9 +1111,9 @@ exec_new_vmspace(imgp, sv) VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_READ | VM_PROT_EXECUTE, MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(obj); - return (error); + return (vm_mmap_to_errno(error)); } } @@ -1137,10 +1137,9 @@ exec_new_vmspace(imgp, sv) stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : - sv->sv_stackprot, - VM_PROT_ALL, MAP_STACK_GROWS_DOWN); - if (error) - return (error); + sv->sv_stackprot, VM_PROT_ALL, MAP_STACK_GROWS_DOWN); + if (error != KERN_SUCCESS) + return (vm_mmap_to_errno(error)); /* * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they From owner-svn-src-all@freebsd.org Mon Jul 10 08:10:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B49D7DA07BA; Mon, 10 Jul 2017 08:10:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 847C27FFC1; Mon, 10 Jul 2017 08:10:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A8AjS8070662; Mon, 10 Jul 2017 08:10:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A8Aj6b070661; Mon, 10 Jul 2017 08:10:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707100810.v6A8Aj6b070661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Jul 2017 08:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320868 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 320868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 08:10:46 -0000 Author: kib Date: Mon Jul 10 08:10:45 2017 New Revision: 320868 URL: https://svnweb.freebsd.org/changeset/base/320868 Log: Fix warnings, adjust style. Reviewed by: bdrewery, dim, emaste (as part of D11504) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/dlfcn.c Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Mon Jul 10 07:12:59 2017 (r320867) +++ head/lib/libc/gen/dlfcn.c Mon Jul 10 08:10:45 2017 (r320868) @@ -57,92 +57,103 @@ void _rtld_atfork_post(int *); #pragma weak _rtld_error void -_rtld_error(const char *fmt, ...) +_rtld_error(const char *fmt __unused, ...) { } #pragma weak dladdr int -dladdr(const void *addr, Dl_info *dlip) +dladdr(const void *addr __unused, Dl_info *dlip __unused) { + _rtld_error(sorry); - return 0; + return (0); } #pragma weak dlclose int -dlclose(void *handle) +dlclose(void *handle __unused) { + _rtld_error(sorry); - return -1; + return (-1); } #pragma weak dlerror char * dlerror(void) { - return sorry; + + return (sorry); } #pragma weak dllockinit void dllockinit(void *context, - void *(*lock_create)(void *context), - void (*rlock_acquire)(void *lock), - void (*wlock_acquire)(void *lock), - void (*lock_release)(void *lock), - void (*lock_destroy)(void *lock), - void (*context_destroy)(void *context)) + void *(*lock_create)(void *context) __unused, + void (*rlock_acquire)(void *lock) __unused, + void (*wlock_acquire)(void *lock) __unused, + void (*lock_release)(void *lock) __unused, + void (*lock_destroy)(void *lock) __unused, + void (*context_destroy)(void *context) __unused) { + if (context_destroy != NULL) context_destroy(context); } #pragma weak dlopen void * -dlopen(const char *name, int mode) +dlopen(const char *name __unused, int mode __unused) { + _rtld_error(sorry); - return NULL; + return (NULL); } #pragma weak dlsym void * -dlsym(void * __restrict handle, const char * __restrict name) +dlsym(void * __restrict handle __unused, const char * __restrict name __unused) { + _rtld_error(sorry); - return NULL; + return (NULL); } #pragma weak dlfunc dlfunc_t -dlfunc(void * __restrict handle, const char * __restrict name) +dlfunc(void * __restrict handle __unused, const char * __restrict name __unused) { + _rtld_error(sorry); - return NULL; + return (NULL); } #pragma weak dlvsym void * -dlvsym(void * __restrict handle, const char * __restrict name, - const char * __restrict version) +dlvsym(void * __restrict handle __unused, const char * __restrict name __unused, + const char * __restrict version __unused) { + _rtld_error(sorry); - return NULL; + return (NULL); } #pragma weak dlinfo int -dlinfo(void * __restrict handle, int request, void * __restrict p) +dlinfo(void * __restrict handle __unused, int request __unused, + void * __restrict p __unused) { + _rtld_error(sorry); - return 0; + return (0); } #pragma weak _rtld_thread_init void -_rtld_thread_init(void * li) +_rtld_thread_init(void *li __unused) { + _rtld_error(sorry); } @@ -184,8 +195,8 @@ dl_init_phdr_info(void) #pragma weak dl_iterate_phdr int -dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *), - void *data) +dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused, + void *data __unused) { __init_elf_aux_vector(); @@ -197,28 +208,29 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, #pragma weak fdlopen void * -fdlopen(int fd, int mode) +fdlopen(int fd __unused, int mode __unused) { _rtld_error(sorry); - return NULL; + return (NULL); } #pragma weak _rtld_atfork_pre void -_rtld_atfork_pre(int *locks) +_rtld_atfork_pre(int *locks __unused) { } #pragma weak _rtld_atfork_post void -_rtld_atfork_post(int *locks) +_rtld_atfork_post(int *locks __unused) { } #pragma weak _rtld_addr_phdr int -_rtld_addr_phdr(const void *addr, struct dl_phdr_info *phdr_info) +_rtld_addr_phdr(const void *addr __unused, + struct dl_phdr_info *phdr_info_a __unused) { return (0); @@ -234,7 +246,7 @@ _rtld_get_stack_prot(void) #pragma weak _rtld_is_dlopened int -_rtld_is_dlopened(void *arg) +_rtld_is_dlopened(void *arg __unused) { return (0); From owner-svn-src-all@freebsd.org Mon Jul 10 09:00:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71855DA1856; Mon, 10 Jul 2017 09:00:36 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 398F081588; Mon, 10 Jul 2017 09:00:36 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6A90Z2o091652; Mon, 10 Jul 2017 09:00:35 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6A90ZPe091651; Mon, 10 Jul 2017 09:00:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201707100900.v6A90ZPe091651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 10 Jul 2017 09:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320869 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 320869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 09:00:36 -0000 Author: bde Date: Mon Jul 10 09:00:35 2017 New Revision: 320869 URL: https://svnweb.freebsd.org/changeset/base/320869 Log: Fix attribute flipping for cut marking in pixel mode. The text-mode code was used, so the lightness bit was not flipped, so the flipping was unnecessarily null in some cases. E.g., the unusal color scheme of lightwhite on white (white = lightgrey in kernelspeak) is not completely unusable, except null flipping of it gave no visible marks for cut marking. Now flipping it works in pixel mode only. Fix text cursor attribute adjustment over cut marking in text mode for the usual cursor type (non-blinking full block). Apply the flipping for cut marking first and adjust that instead of vice versa. This gives a uniform color scheme for the usual text cursor type in text mode: a white block background with no change to the character foreground except for variations to avoid collisions. The old order gave a white character fg with no change in the bg in non-colliding cases. Versions before r316636 changed the bg to the non-cut-marked one about half the time using a saveunder bug; this accidentally gave something resembling a block cursor half the time. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Mon Jul 10 08:10:45 2017 (r320868) +++ head/sys/dev/syscons/scvgarndr.c Mon Jul 10 09:00:35 2017 (r320869) @@ -534,9 +534,9 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u } else #endif /* SC_NO_FONT_LOADING */ { - a = vga_cursorattr_adj(a, TRUE); if (flip) a = vga_flipattr(a, TRUE); + a = vga_cursorattr_adj(a, TRUE); sc_vtb_putc(&scp->scr, at, c, a); } } @@ -903,7 +903,7 @@ vga_vgadraw_direct(scr_stat *scp, int from, int count, a = sc_vtb_geta(&scp->vtb, i); if (flip) - a = vga_flipattr(a, TRUE); /* XXX */ + a = vga_flipattr(a, FALSE); col1 = (a & 0x0f00) >> 8; col2 = (a & 0xf000) >> 12; @@ -957,7 +957,7 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count, for (i = from; count-- > 0; ++i) { a = sc_vtb_geta(&scp->vtb, i); if (flip) - a = vga_flipattr(a, TRUE); /* XXX */ + a = vga_flipattr(a, FALSE); col1 = a & 0x0f00; col2 = (a & 0xf000) >> 4; /* set background color in EGA/VGA latch */ From owner-svn-src-all@freebsd.org Mon Jul 10 12:24:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6855FDA6C7D; Mon, 10 Jul 2017 12:24:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3238B29FA; Mon, 10 Jul 2017 12:24:57 +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 v6ACOudC077694; Mon, 10 Jul 2017 12:24:56 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ACOuBQ077693; Mon, 10 Jul 2017 12:24:56 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707101224.v6ACOuBQ077693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 10 Jul 2017 12:24: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: r320870 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 320870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 12:24:57 -0000 Author: gjb Date: Mon Jul 10 12:24:56 2017 New Revision: 320870 URL: https://svnweb.freebsd.org/changeset/base/320870 Log: MFC r320785: Connect ena(4) to the build. Sponsored by: The FreeBSD Foundation Modified: stable/11/share/man/man4/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Mon Jul 10 09:00:35 2017 (r320869) +++ stable/11/share/man/man4/Makefile Mon Jul 10 12:24:56 2017 (r320870) @@ -146,6 +146,7 @@ MAN= aac.4 \ ehci.4 \ em.4 \ en.4 \ + ena.4 \ enc.4 \ epair.4 \ esp.4 \ From owner-svn-src-all@freebsd.org Mon Jul 10 12:52:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B0F4DA7663; Mon, 10 Jul 2017 12:52:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 290213BF9; Mon, 10 Jul 2017 12:52:20 +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 v6ACqJai090240; Mon, 10 Jul 2017 12:52:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ACqJiZ090239; Mon, 10 Jul 2017 12:52:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707101252.v6ACqJiZ090239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 10 Jul 2017 12:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320871 - releng/11.1/share/man/man4 X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.1/share/man/man4 X-SVN-Commit-Revision: 320871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 12:52:20 -0000 Author: gjb Date: Mon Jul 10 12:52:18 2017 New Revision: 320871 URL: https://svnweb.freebsd.org/changeset/base/320871 Log: MFS11 r320870: MFC r320785: Connect ena(4) to the build. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/share/man/man4/Makefile Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/share/man/man4/Makefile ============================================================================== --- releng/11.1/share/man/man4/Makefile Mon Jul 10 12:24:56 2017 (r320870) +++ releng/11.1/share/man/man4/Makefile Mon Jul 10 12:52:18 2017 (r320871) @@ -146,6 +146,7 @@ MAN= aac.4 \ ehci.4 \ em.4 \ en.4 \ + ena.4 \ enc.4 \ epair.4 \ esp.4 \ From owner-svn-src-all@freebsd.org Mon Jul 10 14:59:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAA5DAA1CB; Mon, 10 Jul 2017 14:59:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id DFFD96770D; Mon, 10 Jul 2017 14:59:22 +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 v6AExMgN039222; Mon, 10 Jul 2017 14:59:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AExL7N039212; Mon, 10 Jul 2017 14:59:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707101459.v6AExL7N039212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Jul 2017 14:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320872 - in head: contrib/mdocml lib lib/libc/gen lib/libdl share/mk X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: contrib/mdocml lib lib/libc/gen lib/libdl share/mk X-SVN-Commit-Revision: 320872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 14:59:23 -0000 Author: kib Date: Mon Jul 10 14:59:21 2017 New Revision: 320872 URL: https://svnweb.freebsd.org/changeset/base/320872 Log: Provide libdl. Create libdl.so.1 as a filter for libc.so.7 which exports public dl* functions. The functions are resolved from the rtld instead, the goal of creating library is to avoid errors from the static linker due to missed libdl. For static binaries, an empty .o is compiled into libdl.a so that static binaries still get dl stubs from libc.a. Right now lld cannot create filter objects, disable libdl on arm64 when binutils are not used. Reviewed by: bdrewery, dim (previos version); emaste Exp run: PR 220525, done by antoine Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D11504 Added: head/lib/libdl/ head/lib/libdl/Makefile (contents, props changed) head/lib/libdl/Symbol.map (contents, props changed) Modified: head/contrib/mdocml/lib.in head/lib/Makefile head/lib/libc/gen/dlfcn.c head/lib/libc/gen/dlopen.3 head/share/mk/bsd.libnames.mk head/share/mk/bsd.linker.mk head/share/mk/src.libnames.mk Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Mon Jul 10 12:52:18 2017 (r320871) +++ head/contrib/mdocml/lib.in Mon Jul 10 14:59:21 2017 (r320872) @@ -46,6 +46,7 @@ LINE("libdevctl", "Device Control Library (libdevctl, LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") +LINE("libdl", "Dynamic Linker Services Filter (libdl, \\-ldl)") LINE("libdm", "Device Mapper Library (libdm, \\-ldm)") LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Jul 10 12:52:18 2017 (r320871) +++ head/lib/Makefile Mon Jul 10 14:59:21 2017 (r320872) @@ -40,6 +40,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libdevctl \ libdevinfo \ libdevstat \ + ${_libdl} \ libdwarf \ libedit \ libevent \ @@ -181,6 +182,10 @@ SUBDIR.${MK_BHYVE}+= libvmmapi .if ${MACHINE_CPUARCH} != "sparc64" _libproc= libproc _librtld_db= librtld_db +.endif + +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} +_libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Mon Jul 10 12:52:18 2017 (r320871) +++ head/lib/libc/gen/dlfcn.c Mon Jul 10 14:59:21 2017 (r320872) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#if !defined(IN_LIBDL) || defined(PIC) + /* * Linkage to services provided by the dynamic linker. */ @@ -157,6 +159,7 @@ _rtld_thread_init(void *li __unused) _rtld_error(sorry); } +#ifndef IN_LIBDL static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT; static struct dl_phdr_info phdr_info; @@ -192,6 +195,7 @@ dl_init_phdr_info(void) } phdr_info.dlpi_adds = 1; } +#endif #pragma weak dl_iterate_phdr int @@ -199,11 +203,15 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, void *data __unused) { +#ifndef IN_LIBDL __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (1); _once(&dl_phdr_info_once, dl_init_phdr_info); return (callback(&phdr_info, sizeof(phdr_info), data)); +#else + return (0); +#endif } #pragma weak fdlopen @@ -251,3 +259,5 @@ _rtld_is_dlopened(void *arg __unused) return (0); } + +#endif /* !defined(IN_LIBDL) || defined(PIC) */ Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Mon Jul 10 12:52:18 2017 (r320871) +++ head/lib/libc/gen/dlopen.3 Mon Jul 10 14:59:21 2017 (r320872) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd February 14, 2015 +.Dd July 7, 2017 .Dt DLOPEN 3 .Os .Sh NAME @@ -376,6 +376,14 @@ option to .Xr ld 1 for symbols defined in the executable to become visible to .Fn dlsym . +.Pp +Other ELF platforms require linking with +.Lb libdl +to provide +.Fn dlopen +and other functions. +.Fx +does not require linking with the library, but supports it for compatibility. .Pp In previous implementations, it was necessary to prepend an underscore to all external symbols in order to gain symbol Added: head/lib/libdl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdl/Makefile Mon Jul 10 14:59:21 2017 (r320872) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +LIB=dl +SHLIB_MAJOR=1 + +.PATH: ${SRCTOP}/lib/libc/gen +CFLAGS+=-I${SRCTOP}/lib/libc/include +CFLAGS+=-DIN_LIBDL +LDFLAGS+=-Wl,-F,libc.so.7 +VERSION_DEF=${SRCTOP}/lib/libc/Versions.def +SYMBOL_MAPS=${.CURDIR}/Symbol.map + +SRCS = dlfcn.c + +.include Added: head/lib/libdl/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdl/Symbol.map Mon Jul 10 14:59:21 2017 (r320872) @@ -0,0 +1,20 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.0 { + dladdr; + dlclose; + dlerror; + dlfunc; + dlopen; + dlsym; + dlvsym; + dlinfo; + dl_iterate_phdr; +}; + + +FBSD_1.3 { + fdlopen; +}; Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Jul 10 12:52:18 2017 (r320871) +++ head/share/mk/bsd.libnames.mk Mon Jul 10 14:59:21 2017 (r320872) @@ -56,6 +56,7 @@ LIBDEVDCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevdctl.a LIBDEVINFO?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevinfo.a LIBDEVSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libdevstat.a LIBDIALOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libdialog.a +LIBDL?= ${LIBDESTDIR}${LIBDIR_BASE}/libdl.a LIBDNS?= ${LIBDESTDIR}${LIBDIR_BASE}/libdns.a LIBDPV?= ${LIBDESTDIR}${LIBDIR_BASE}/libdpv.a LIBDTRACE?= ${LIBDESTDIR}${LIBDIR_BASE}/libdtrace.a Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Mon Jul 10 12:52:18 2017 (r320871) +++ head/share/mk/bsd.linker.mk Mon Jul 10 14:59:21 2017 (r320872) @@ -70,6 +70,9 @@ ${X_}LINKER_FEATURES= .if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750 ${X_}LINKER_FEATURES+= build-id .endif +.if ${${X_}LINKER_TYPE} == "bfd" +${X_}LINKER_FEATURES+= filter +.endif .endif .else # Use LD's values Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Jul 10 12:52:18 2017 (r320871) +++ head/share/mk/src.libnames.mk Mon Jul 10 14:59:21 2017 (r320872) @@ -88,6 +88,7 @@ _LIBRARIES= \ devinfo \ devstat \ dialog \ + dl \ dpv \ dtrace \ dwarf \ From owner-svn-src-all@freebsd.org Mon Jul 10 15:27:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DCD5DAABEE; Mon, 10 Jul 2017 15:27:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07DED68534; Mon, 10 Jul 2017 15:27:55 +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 v6AFRsbm051220; Mon, 10 Jul 2017 15:27:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AFRs2B051210; Mon, 10 Jul 2017 15:27:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707101527.v6AFRs2B051210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 10 Jul 2017 15:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320873 - in head/sys/arm: freescale/imx ti ti/omap4 xilinx X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: freescale/imx ti ti/omap4 xilinx X-SVN-Commit-Revision: 320873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 15:27:56 -0000 Author: andrew Date: Mon Jul 10 15:27:53 2017 New Revision: 320873 URL: https://svnweb.freebsd.org/changeset/base/320873 Log: Start to move the arm *_mp.h to be names *_machdep.h. These will be used by the reworked pl310 driver interface in https://reviews.freebsd.org/D11546 Added: head/sys/arm/freescale/imx/imx6_machdep.h - copied, changed from r320872, head/sys/arm/freescale/imx/imx6_mp.h head/sys/arm/ti/omap4/omap4_machdep.h - copied, changed from r320872, head/sys/arm/ti/omap4/omap4_mp.h head/sys/arm/xilinx/zy7_machdep.h - copied, changed from r320872, head/sys/arm/xilinx/zy7_mp.h Deleted: head/sys/arm/freescale/imx/imx6_mp.h head/sys/arm/ti/omap4/omap4_mp.h head/sys/arm/xilinx/zy7_mp.h Modified: head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx6_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/ti/ti_machdep.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/freescale/imx/imx6_machdep.c Mon Jul 10 15:27:53 2017 (r320873) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "platform_if.h" Copied and modified: head/sys/arm/freescale/imx/imx6_machdep.h (from r320872, head/sys/arm/freescale/imx/imx6_mp.h) ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.h Mon Jul 10 14:59:21 2017 (r320872, copy source) +++ head/sys/arm/freescale/imx/imx6_machdep.h Mon Jul 10 15:27:53 2017 (r320873) @@ -26,10 +26,10 @@ * $FreeBSD$ */ -#ifndef IMX6_MP_H -#define IMX6_MP_H +#ifndef IMX6_MACHDEP_H +#define IMX6_MACHDEP_H void imx6_mp_start_ap(platform_t); void imx6_mp_setmaxid(platform_t); -#endif /* IMX6_MP_H */ +#endif /* IMX6_MACHDEP_H */ Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/freescale/imx/imx6_mp.c Mon Jul 10 15:27:53 2017 (r320873) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #define SCU_PHYSBASE 0x00a00000 #define SCU_SIZE 0x00001000 Copied and modified: head/sys/arm/ti/omap4/omap4_machdep.h (from r320872, head/sys/arm/ti/omap4/omap4_mp.h) ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.h Mon Jul 10 14:59:21 2017 (r320872, copy source) +++ head/sys/arm/ti/omap4/omap4_machdep.h Mon Jul 10 15:27:53 2017 (r320873) @@ -25,9 +25,10 @@ * $FreeBSD$ */ -#ifndef _OMAP4_MP_H_ -#define _OMAP4_MP_H_ +#ifndef _OMAP4_MACHDEP_H_ +#define _OMAP4_MACHDEP_H_ + void omap4_mp_setmaxid(platform_t plat); void omap4_mp_start_ap(platform_t plat); -#endif /* _OMAP4_MP_H_ */ +#endif /* _OMAP4_MACHDEP_H_ */ Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/ti/omap4/omap4_mp.c Mon Jul 10 15:27:53 2017 (r320873) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include void omap4_mp_setmaxid(platform_t plat) Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/ti/ti_machdep.c Mon Jul 10 15:27:53 2017 (r320873) @@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include #include #include "platform_if.h" Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/xilinx/zy7_machdep.c Mon Jul 10 15:27:53 2017 (r320873) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include "platform_if.h" Copied and modified: head/sys/arm/xilinx/zy7_machdep.h (from r320872, head/sys/arm/xilinx/zy7_mp.h) ============================================================================== --- head/sys/arm/xilinx/zy7_mp.h Mon Jul 10 14:59:21 2017 (r320872, copy source) +++ head/sys/arm/xilinx/zy7_machdep.h Mon Jul 10 15:27:53 2017 (r320873) @@ -25,10 +25,10 @@ * $FreeBSD$ */ -#ifndef _ZY7_MP_H_ -#define _ZY7_MP_H_ +#ifndef _ZY7_MACHDEP_H_ +#define _ZY7_MACHDEP_H_ void zynq7_mp_setmaxid(platform_t); void zynq7_mp_start_ap(platform_t); -#endif /* _ZY7_MP_H_ */ +#endif /* _ZY7_MACHDEP_H_ */ Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Mon Jul 10 14:59:21 2017 (r320872) +++ head/sys/arm/xilinx/zy7_mp.c Mon Jul 10 15:27:53 2017 (r320873) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #define ZYNQ7_CPU1_ENTRY 0xfffffff0 From owner-svn-src-all@freebsd.org Mon Jul 10 16:21:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55171DABB69; Mon, 10 Jul 2017 16:21:33 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C73EF6E0D2; Mon, 10 Jul 2017 16:21:32 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.37.89]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MYtId-1d7pfd0EoV-00Vhin; Mon, 10 Jul 2017 18:21:30 +0200 Date: Mon, 10 Jul 2017 18:21:22 +0200 From: "O. Hartmann" To: Marius Strobl Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... Message-ID: <20170710182048.3809fa38@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20170709184221.GB38352@alchemy.franken.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/b60ZKj7uljvEjqLtLdGX4N8"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:q6VNe8jezYFpXlKK82bl0D4eXOtt9MVROhwXYUhAMbaweL4kZ/7 YWUDmXP6Ld4a4pPo6hXeyyfBm3kUxsuQSnpNlG5SndqQOBT8Gj3mQO+Bv5mn9G6EuH8KqIW Doc2Z92VLQhG630gnQ/w8zT5lEVZh/XdVo9bwHwpNJryGLR80IVtZBzlwHZ2kPCipIi2/3f g4xYDp1zpgc8o1WNtx82g== X-UI-Out-Filterresults: notjunk:1;V01:K0:qioM958BrDM=:o8T2/fm0C1Kc6W4wJKAfYW KA/jBsffJFHKgOLrx3TEZHxuQ0dSHZgSJ7OEDkP6RH39uOp1NBGCyS8vmlZXuCHrUX8yUPf2h 33dun4hP9OFU/08KKauKeTUcBtS7mNSAjqdfiurcZcHc6OXE63AEwxmkbebdTIg85WBihUDsE 7ZuNSWAzVtzkLQf/s7NSbjSrEBCoeqotX2shxkp7j5oSxpfDLWsmSUr70cnJhLt4EqUAduexK 8AcafH3mDYAdoCAbULCHuF5PFvpPqbx12ZTWJprZaOHv+thlU2jq17giD7YJI5u5i+y49Wx/4 gw6nfFTL8aUwyr1IycwjoMJwWk6YsRF4pKFbRHG+kgfwPOir1djcrMJQQt6Dz3ETvU4AVjMR3 N8zPQhAnd/KTRHvFwyUIj8KoSiAFveajusk8zUvrJjyy0ZBZezWHD7Y7nKTX3OMZ6oJJTfwx/ 7YaDZgF4LDp3cojF22jlRtr4DbbPJjNusFLQVE7mLUJh6DzP5OcuvTTFxSsP9OCMJAlbDQ/IL 8S7q1Bo6H2lRGRzeJdlcd12EYPRDVkR1PJkXsyhatiixJVMhHjNXQ5/sS1Zv0qW2T2hN83Qlv uUjoVbsGHJDCzU/wdkTiP2GiCIlBfqiXyrz9tVO8tplaF1P/pdqZZetvQYqfJTStCVp1fzsbV i4MvqGhW89j4/fjWnfZ3DAtgLjR/Ud00Zy+QkX5idh3WUVbDrveykGWE1yeOMBdtgmjJ6lcs7 eHJmBnCZn8xJ83xIe5v9eqp8rE16o7icqrUBFv2ig6YVWJexMKNiKOOk9s8= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 16:21:33 -0000 --Sig_/b60ZKj7uljvEjqLtLdGX4N8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sun, 9 Jul 2017 20:42:21 +0200 Marius Strobl schrieb: > On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > > Author: imp > > Date: Sun Jul 9 16:57:24 2017 > > New Revision: 320844 > > URL: https://svnweb.freebsd.org/changeset/base/320844 > >=20 > > Log: > > An MMC/SD/SDIO stack using CAM > > =20 > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > flexible queueing will make it easier to write non-storage drivers > > than the legacy stack. SDIO drivers from both the kernel and as > > userland daemons are possible, though much of that functionality will > > come later. =20 >=20 > At least with a non-MMCCAM kernel, with this revision in place I get > an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > boot. Apparently this is due to the fact that sdhci(4) now enables > these interrupts, but sdhci_generic_intr() neither actually handles > them nor clears them from intmask. >=20 > Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this commit? >=20 > Marius I updated just to r320873. My box is booting off a Samsung SSD 830/UFS2 (GPT) and worked fine with r32= 0829 and hangs now again at: mountroot: Waiting for device /dev/gpt/root ... Mounting from ufs:/dev/gpt/root failed with error 19 mountroot >: ? List of GEOM managed disk devices mountroot >: What happened here? I run a custom kernel with ZFS compiled in ... --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/b60ZKj7uljvEjqLtLdGX4N8 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWWOpggAKCRDS528fyFhY lBZIAfkB2WWazVhIby8bHIwmMZab96cj3um/wMSPrOuA7zq6bju53JsxOTAekJ40 xRURmDyZUpDhHol4kx0Sel28FRx0Af42pZk05KaDthiwPokgMdhqbJIi8OuIV3q7 b4GX0j0D70GdbIB78D5UKtAu9pyZHn/mIRAgg2Reu9lfcRhhWp+Z =0kQz -----END PGP SIGNATURE----- --Sig_/b60ZKj7uljvEjqLtLdGX4N8-- From owner-svn-src-all@freebsd.org Mon Jul 10 17:42:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB31DAD444; Mon, 10 Jul 2017 17:42:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB8FF70D05; Mon, 10 Jul 2017 17:42:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6AHgO7O008566; Mon, 10 Jul 2017 17:42:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AHgOcs008564; Mon, 10 Jul 2017 17:42:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707101742.v6AHgOcs008564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Jul 2017 17:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320874 - in releng/11.1/gnu/usr.bin/gdb: gdb kgdb X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in releng/11.1/gnu/usr.bin/gdb: gdb kgdb X-SVN-Commit-Revision: 320874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 17:42:26 -0000 Author: jhb Date: Mon Jul 10 17:42:24 2017 New Revision: 320874 URL: https://svnweb.freebsd.org/changeset/base/320874 Log: MFS11 320824: Add deprecation notices for gdb and kgdb. Even though gdb and kgdb may not be removed for 12.0 on some architectures, the notice is unconditional as these tools will likely be removed at some point in the future when adequate replacements are available (gdb in ports or lldb in base). Approved by: re (gjb) Relnotes: yes Modified: releng/11.1/gnu/usr.bin/gdb/gdb/gdb.1 releng/11.1/gnu/usr.bin/gdb/kgdb/kgdb.1 Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/gnu/usr.bin/gdb/gdb/gdb.1 ============================================================================== --- releng/11.1/gnu/usr.bin/gdb/gdb/gdb.1 Mon Jul 10 15:27:53 2017 (r320873) +++ releng/11.1/gnu/usr.bin/gdb/gdb/gdb.1 Mon Jul 10 17:42:24 2017 (r320874) @@ -44,6 +44,11 @@ gdb \- The GNU Debugger .IR core \||\| procID\c \&\|]\&\|] .ad b +.SH DEPRECATION NOTICE +This version of gdb is deprecated and will be removed from future versions +of the FreeBSD base system. +A newer version of gdb is available from ports or packages +(devel/gdb). .SH DESCRIPTION The purpose of a debugger such as GDB is to allow you to see what is going on ``inside'' another program while it executes\(em\&or what another Modified: releng/11.1/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- releng/11.1/gnu/usr.bin/gdb/kgdb/kgdb.1 Mon Jul 10 15:27:53 2017 (r320873) +++ releng/11.1/gnu/usr.bin/gdb/kgdb/kgdb.1 Mon Jul 10 17:42:24 2017 (r320874) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2006 +.Dd July 5, 2017 .Dt KGDB 1 .Os .Sh NAME @@ -40,6 +40,16 @@ .Op Fl d Ar crashdir .Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device .Op Ar kernel Op Ar core +.Sh DEPRECATION NOTICE +This version of +.Nm +is deprecated and will be removed from future versions of the +.Fx +base system. +A newer version of +.Nm +is available from ports or packages +(devel/gdb). .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Mon Jul 10 17:53:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C14C2DAD682; Mon, 10 Jul 2017 17:53:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8499971488; Mon, 10 Jul 2017 17:53:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6AHrCsq012507; Mon, 10 Jul 2017 17:53:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AHrCug012506; Mon, 10 Jul 2017 17:53:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707101753.v6AHrCug012506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 10 Jul 2017 17:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320875 - releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 320875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 17:53:13 -0000 Author: gjb Date: Mon Jul 10 17:53:12 2017 New Revision: 320875 URL: https://svnweb.freebsd.org/changeset/base/320875 Log: Document r320874, gdb(1) and kgdb(1) deprecation. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jul 10 17:42:24 2017 (r320874) +++ releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jul 10 17:53:12 2017 (r320875) @@ -258,6 +258,12 @@ &man.rshd.8;, and &man.rwhod.8; utilities have been marked as deprecated, and planned for removal in &os; 12.0-RELEASE. + + The &man.gdb.1; and &man.kgdb.1; + utilities have been marked as deprecated, and planned for + removal from the base system in the future. A newer version + is available in the devel/gdb port. From owner-svn-src-all@freebsd.org Mon Jul 10 17:55:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E8E8DAD724; Mon, 10 Jul 2017 17:55:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ADF8717C2; Mon, 10 Jul 2017 17:55:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id B293410AF18; Mon, 10 Jul 2017 13:55:43 -0400 (EDT) From: John Baldwin To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r320824 - in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb Date: Mon, 10 Jul 2017 10:01:45 -0700 Message-ID: <7608713.faVMYlhHnq@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201707090428.v694Shij070144@pdx.rh.CN85.dnsmgr.net> References: <201707090428.v694Shij070144@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 10 Jul 2017 13:55:43 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 17:55:45 -0000 On Saturday, July 08, 2017 09:28:43 PM Rodney W. Grimes wrote: > > Author: jhb > > Date: Sun Jul 9 04:13:33 2017 > > New Revision: 320824 > > URL: https://svnweb.freebsd.org/changeset/base/320824 > > > > Log: > > MFC 320675: Add deprecation notices for gdb and kgdb. > > > > Even though gdb and kgdb may not be removed for 12.0 on some architectures, > > the notice is unconditional as these tools will likely be removed at some > > point in the future when adequate replacements are available (gdb in ports > > or lldb in base). > > Thanks for doing this, but we are still falling slightly short of 17.4 on > deprecation on the aspect of "Use of the deprecated feature generates a warning". Hmm. There may be times when generating a warning is problematic (e.g. could be a POLA violation that breaks scripting if you alter the output of utilities). Other cases like device drivers are easier to reason about (just add a new device_printf during attach), but gdb/kgdb might be more problematic due to POLA. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 10 18:06:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2832FDADB13; Mon, 10 Jul 2017 18:06:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0486A72000; Mon, 10 Jul 2017 18:06:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v6AI6rjc076963; Mon, 10 Jul 2017 11:06:53 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v6AI6rXg076962; Mon, 10 Jul 2017 11:06:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707101806.v6AI6rXg076962@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320824 - in stable: 10/gnu/usr.bin/gdb/gdb 10/gnu/usr.bin/gdb/kgdb 11/gnu/usr.bin/gdb/gdb 11/gnu/usr.bin/gdb/kgdb In-Reply-To: <7608713.faVMYlhHnq@ralph.baldwin.cx> To: John Baldwin Date: Mon, 10 Jul 2017 11:06:53 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 18:06:55 -0000 > On Saturday, July 08, 2017 09:28:43 PM Rodney W. Grimes wrote: > > > Author: jhb > > > Date: Sun Jul 9 04:13:33 2017 > > > New Revision: 320824 > > > URL: https://svnweb.freebsd.org/changeset/base/320824 > > > > > > Log: > > > MFC 320675: Add deprecation notices for gdb and kgdb. > > > > > > Even though gdb and kgdb may not be removed for 12.0 on some architectures, > > > the notice is unconditional as these tools will likely be removed at some > > > point in the future when adequate replacements are available (gdb in ports > > > or lldb in base). > > > > Thanks for doing this, but we are still falling slightly short of 17.4 on > > deprecation on the aspect of "Use of the deprecated feature generates a warning". > > Hmm. There may be times when generating a warning is problematic (e.g. could > be a POLA violation that breaks scripting if you alter the output of utilities). The message should be go to stderr, I would hope the scripts are not parsing stderr. It is a bigger POLA when the utility goes away in 12.0 and the user wasnt informed that it was going away. (Yea, it is in the man page and the release notes but we all know that no one reads that.) It might even be good to break there scripts with a POLA violation, making it very clear they have future action to take. > Other cases like device drivers are easier to reason about (just add a new device_printf > during attach), but gdb/kgdb might be more problematic due to POLA. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Jul 10 19:26:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A144FDAF2A4; Mon, 10 Jul 2017 19:26:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D54574ECF; Mon, 10 Jul 2017 19:26:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6AJQoQO050828; Mon, 10 Jul 2017 19:26:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AJQoEW050827; Mon, 10 Jul 2017 19:26:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707101926.v6AJQoEW050827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 10 Jul 2017 19:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320876 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 320876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 19:26:51 -0000 Author: hselasky Date: Mon Jul 10 19:26:50 2017 New Revision: 320876 URL: https://svnweb.freebsd.org/changeset/base/320876 Log: Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Jul 10 17:53:12 2017 (r320875) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Jul 10 19:26:50 2017 (r320876) @@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri ring->rx_mb_size = priv->rx_mb_size; ring->stride = stride; - if (ring->stride <= TXBB_SIZE) + if (ring->stride <= TXBB_SIZE) { + /* Stamp first unused send wqe */ + __be32 *ptr = (__be32 *)ring->buf; + __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); + *ptr = stamp; + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; + } ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride; From owner-svn-src-all@freebsd.org Mon Jul 10 20:05:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1A9DB01E0 for ; Mon, 10 Jul 2017 20:05:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9683A7679D for ; Mon, 10 Jul 2017 20:05:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id k192so51936428ith.1 for ; Mon, 10 Jul 2017 13:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2UnOKwbjMIa8itB912VtS68QHBk5NgvAASFR4KbTWgQ=; b=Hk8PoRfst2YRTNyAlRVfaNFKpzHtIqhXQRnrylqBN5QqBoNkdSj3y9byJsv17W6B7d YjJ2SwitnYxVKa9IY68J//8NdsUmMbCT4oFIEiqQ6ji1m922GnSPG6zTv6VTpzFYWWTu qwqp933tBjDEJsZgkEpyvfyDVcXO3FD0NVP17daYEtRGDNzq1FCj0BMV6tB3RfB0KLt7 ED5mZYYwYUOo1D0djyr90p8AcWS/pDp/OYWiU1HofKG6PsFkdozGbZkwoG5SZVMT3+t3 A7jhGkgU8UqM6/xreMyuB9nc+9ybjM6UALhvrxHLzs6c/A0VO+8XT/QolHfzO4g6crbQ xmig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2UnOKwbjMIa8itB912VtS68QHBk5NgvAASFR4KbTWgQ=; b=aUoXcJZFJEers/Rkiq+pJAwyOPjoWqL6OqQR+iD4i3orfLDk2A0gzDU5S11nRSbvS4 HZgdgcniWFELzWHCThemWZ1MvA6bNT7JMhNDo/yTM3WgJXPozs/AWYik3Frz6JNnS3Lm PCP6edXlzQ4JDloOyR9Ypui2DXKovW6cMadXwMxHn+j8udBCPRm7ZKGYxp4hXO7qN83a CUPyykQWradc6f+eYIS1kafhgOug6jgO/Q1CfL8Kl9nT+2D+41HvVKMOAAGbcKP6gl25 Y+VGNp6lX3pjV1xpgV7IIfCVLRyLPH12q2i0VZvcoeNoa9yo7hB2B2MFmfCJN5MxS3OQ RkiA== X-Gm-Message-State: AIVw1133rDBlbcdgXMB00C4uh+YMsOTT4k8rKa4QCg441UjoQNnhYC/T eMRBEftzHyP4XbXquiPWXdIRodgCG3N8 X-Received: by 10.107.180.5 with SMTP id d5mr5936377iof.56.1499717158934; Mon, 10 Jul 2017 13:05:58 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Mon, 10 Jul 2017 13:05:58 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:e566:7f4d:9206:5a72] In-Reply-To: <20170710182048.3809fa38@thor.intern.walstatt.dynvpn.de> References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> <20170710182048.3809fa38@thor.intern.walstatt.dynvpn.de> From: Warner Losh Date: Mon, 10 Jul 2017 14:05:58 -0600 X-Google-Sender-Auth: VU-mZXAA5ONDJRITgxGsZGpo_XE Message-ID: Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... To: "O. Hartmann" Cc: Marius Strobl , Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 20:05:59 -0000 On Mon, Jul 10, 2017 at 10:21 AM, O. Hartmann wrote: > Am Sun, 9 Jul 2017 20:42:21 +0200 > Marius Strobl schrieb: > > > On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Sun Jul 9 16:57:24 2017 > > > New Revision: 320844 > > > URL: https://svnweb.freebsd.org/changeset/base/320844 > > > > > > Log: > > > An MMC/SD/SDIO stack using CAM > > > > > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > > flexible queueing will make it easier to write non-storage drivers > > > than the legacy stack. SDIO drivers from both the kernel and as > > > userland daemons are possible, though much of that functionality will > > > come later. > > > > At least with a non-MMCCAM kernel, with this revision in place I get > > an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > > boot. Apparently this is due to the fact that sdhci(4) now enables > > these interrupts, but sdhci_generic_intr() neither actually handles > > them nor clears them from intmask. > > > > Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this commit? > > > > Marius > > I updated just to r320873. > My box is booting off a Samsung SSD 830/UFS2 (GPT) and worked fine with > r320829 and hangs > now again at: > > mountroot: Waiting for device /dev/gpt/root ... > Mounting from ufs:/dev/gpt/root failed with error 19 > > mountroot >: ? > > List of GEOM managed disk devices > > mountroot >: > > What happened here? > > > I run a custom kernel with ZFS compiled in ... > > No clue. the information provided is insufficient to track down the problem. Can you give a full dmesg? And can you bisect the revs from r320829 to r320873 to see which one breaks things? Warner From owner-svn-src-all@freebsd.org Mon Jul 10 21:38:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74520DB1588; Mon, 10 Jul 2017 21:38: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 mx1.freebsd.org (Postfix) with ESMTPS id 0086778D81; Mon, 10 Jul 2017 21:38:27 +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 v6ALcR9Q003359; Mon, 10 Jul 2017 21:38:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ALcR1E003358; Mon, 10 Jul 2017 21:38:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707102138.v6ALcR1E003358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 21:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320877 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 320877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 21:38:28 -0000 Author: imp Date: Mon Jul 10 21:38:26 2017 New Revision: 320877 URL: https://svnweb.freebsd.org/changeset/base/320877 Log: Kill some unnecessary noise. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Jul 10 19:26:50 2017 (r320876) +++ head/sys/cam/cam_xpt.c Mon Jul 10 21:38:26 2017 (r320877) @@ -819,8 +819,6 @@ xpt_scanner_thread(void *dummy) TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_unlock_buses(); - printf("xpt_scanner_thread is firing on path "); - xpt_print_path(ccb->ccb_h.path);printf("\n"); /* * Since lock can be dropped inside and path freed * by completion callback even before return here, From owner-svn-src-all@freebsd.org Mon Jul 10 21:55:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADBEBDB19AD; Mon, 10 Jul 2017 21:55:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA5479653; Mon, 10 Jul 2017 21:55:20 +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 v6ALtJXu011731; Mon, 10 Jul 2017 21:55:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ALtJsH011730; Mon, 10 Jul 2017 21:55:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707102155.v6ALtJsH011730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 21:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320878 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 320878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 21:55:20 -0000 Author: imp Date: Mon Jul 10 21:55:19 2017 New Revision: 320878 URL: https://svnweb.freebsd.org/changeset/base/320878 Log: Move mmc_parmas to the end of the structure for better compatability. Modified: head/sys/cam/cam_ccb.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Jul 10 21:38:26 2017 (r320877) +++ head/sys/cam/cam_ccb.h Mon Jul 10 21:55:19 2017 (r320878) @@ -501,8 +501,8 @@ struct device_match_result { cam_proto protocol; struct scsi_inquiry_data inq_data; struct ata_params ident_data; - struct mmc_params mmc_ident_data; dev_result_flags flags; + struct mmc_params mmc_ident_data; }; struct bus_match_result { From owner-svn-src-all@freebsd.org Mon Jul 10 21:55:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2920BDB19D0; Mon, 10 Jul 2017 21:55:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C9779676; Mon, 10 Jul 2017 21:55:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ALtPcc011785; Mon, 10 Jul 2017 21:55:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ALtPLb011784; Mon, 10 Jul 2017 21:55:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707102155.v6ALtPLb011784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 10 Jul 2017 21:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320879 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 320879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 21:55:26 -0000 Author: imp Date: Mon Jul 10 21:55:24 2017 New Revision: 320879 URL: https://svnweb.freebsd.org/changeset/base/320879 Log: Bump to FreeBSD_version to 1200038 for MMC CAM Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 10 21:55:19 2017 (r320878) +++ head/sys/sys/param.h Mon Jul 10 21:55:24 2017 (r320879) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200037 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200038 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Jul 10 22:11:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862CDDB1D4D; Mon, 10 Jul 2017 22:11:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDD479CD2; Mon, 10 Jul 2017 22:11:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6AMBUqn016651; Mon, 10 Jul 2017 22:11:30 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6AMBUO2016650; Mon, 10 Jul 2017 22:11:30 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201707102211.v6AMBUO2016650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 10 Jul 2017 22:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320880 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: zbb X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 320880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 22:11:31 -0000 Author: zbb Date: Mon Jul 10 22:11:30 2017 New Revision: 320880 URL: https://svnweb.freebsd.org/changeset/base/320880 Log: Fix error check for Rx mbuf allocation in ENA driver ena_alloc_rx_mbuf() will return positive error code on failure. Act accordingly. Submitted by: Krishna Yenduri Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Mon Jul 10 21:55:24 2017 (r320879) +++ head/sys/dev/ena/ena.c Mon Jul 10 22:11:30 2017 (r320880) @@ -1032,7 +1032,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t &rx_ring->rx_buffer_info[next_to_use]; rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); - if (rc < 0) { + if (rc != 0) { device_printf(adapter->pdev, "failed to alloc buffer for rx queue\n"); break; From owner-svn-src-all@freebsd.org Mon Jul 10 23:51:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD9DDB353D; Mon, 10 Jul 2017 23:51:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86A6B7C8D8; Mon, 10 Jul 2017 23:51:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ANppcF060515; Mon, 10 Jul 2017 23:51:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ANppbA060514; Mon, 10 Jul 2017 23:51:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707102351.v6ANppbA060514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 10 Jul 2017 23:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320881 - head/targets/pseudo/userland/share X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/targets/pseudo/userland/share X-SVN-Commit-Revision: 320881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 23:51:52 -0000 Author: bdrewery Date: Mon Jul 10 23:51:51 2017 New Revision: 320881 URL: https://svnweb.freebsd.org/changeset/base/320881 Log: Follow-up r318881: Disconnect groff documents. Modified: head/targets/pseudo/userland/share/Makefile.depend Modified: head/targets/pseudo/userland/share/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/share/Makefile.depend Mon Jul 10 22:11:30 2017 (r320880) +++ head/targets/pseudo/userland/share/Makefile.depend Mon Jul 10 23:51:51 2017 (r320881) @@ -15,76 +15,7 @@ DIRDEPS = \ share/doc/legal/intel_wpi \ share/doc/legal/realtek \ share/doc/llvm/clang \ - share/doc/papers/beyond4.3 \ - share/doc/papers/bufbio \ - share/doc/papers/contents \ - share/doc/papers/devfs \ - share/doc/papers/diskperf \ - share/doc/papers/fsinterface \ - share/doc/papers/hwpmc \ - share/doc/papers/jail \ - share/doc/papers/kernmalloc \ - share/doc/papers/kerntune \ - share/doc/papers/malloc \ - share/doc/papers/newvm \ - share/doc/papers/relengr \ - share/doc/papers/sysperf \ - share/doc/papers/timecounter \ share/doc/pjdfstest \ - share/doc/psd/01.cacm \ - share/doc/psd/02.implement \ - share/doc/psd/03.iosys \ - share/doc/psd/04.uprog \ - share/doc/psd/05.sysman \ - share/doc/psd/06.Clang \ - share/doc/psd/12.make \ - share/doc/psd/13.rcs/rcs \ - share/doc/psd/13.rcs/rcs_func \ - share/doc/psd/15.yacc \ - share/doc/psd/16.lex \ - share/doc/psd/17.m4 \ - share/doc/psd/18.gprof \ - share/doc/psd/20.ipctut \ - share/doc/psd/21.ipc \ - share/doc/psd/22.rpcgen \ - share/doc/psd/23.rpc \ - share/doc/psd/24.xdr \ - share/doc/psd/25.xdrrfc \ - share/doc/psd/26.rpcrfc \ - share/doc/psd/27.nfsrpc \ - share/doc/psd/contents \ - share/doc/psd/title \ - share/doc/smm/01.setup \ - share/doc/smm/02.config \ - share/doc/smm/03.fsck \ - share/doc/smm/04.quotas \ - share/doc/smm/05.fastfs \ - share/doc/smm/06.nfs \ - share/doc/smm/07.lpd \ - share/doc/smm/08.sendmailop \ - share/doc/smm/11.timedop \ - share/doc/smm/12.timed \ - share/doc/smm/18.net \ - share/doc/smm/contents \ - share/doc/smm/title \ - share/doc/usd/04.csh \ - share/doc/usd/05.dc \ - share/doc/usd/06.bc \ - share/doc/usd/07.mail \ - share/doc/usd/10.exref/exref \ - share/doc/usd/10.exref/summary \ - share/doc/usd/11.vitut \ - share/doc/usd/12.vi/summary \ - share/doc/usd/12.vi/vi \ - share/doc/usd/12.vi/viapwh \ - share/doc/usd/13.viref \ - share/doc/usd/18.msdiffs \ - share/doc/usd/19.memacros \ - share/doc/usd/20.meref \ - share/doc/usd/21.troff \ - share/doc/usd/22.trofftut \ - share/doc/usd/contents \ - share/doc/usd/title \ share/dtrace \ share/dtrace/toolkit \ share/examples \ From owner-svn-src-all@freebsd.org Mon Jul 10 23:52:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 943C0DB3570; Mon, 10 Jul 2017 23:52:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607607C9B9; Mon, 10 Jul 2017 23:52:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ANq4MS060571; Mon, 10 Jul 2017 23:52:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ANq4U9060568; Mon, 10 Jul 2017 23:52:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707102352.v6ANq4U9060568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 10 Jul 2017 23:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320882 - in head/usr.sbin: bhyve rpc.statd sesutil X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/usr.sbin: bhyve rpc.statd sesutil X-SVN-Commit-Revision: 320882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 23:52:05 -0000 Author: bdrewery Date: Mon Jul 10 23:52:04 2017 New Revision: 320882 URL: https://svnweb.freebsd.org/changeset/base/320882 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/bhyve/Makefile.depend head/usr.sbin/rpc.statd/Makefile.depend head/usr.sbin/sesutil/Makefile.depend Modified: head/usr.sbin/bhyve/Makefile.depend ============================================================================== --- head/usr.sbin/bhyve/Makefile.depend Mon Jul 10 23:51:51 2017 (r320881) +++ head/usr.sbin/bhyve/Makefile.depend Mon Jul 10 23:52:04 2017 (r320882) @@ -16,6 +16,7 @@ DIRDEPS = \ lib/libutil \ lib/libvmmapi \ lib/libz \ + secure/lib/libcrypto \ .include Modified: head/usr.sbin/rpc.statd/Makefile.depend ============================================================================== --- head/usr.sbin/rpc.statd/Makefile.depend Mon Jul 10 23:51:51 2017 (r320881) +++ head/usr.sbin/rpc.statd/Makefile.depend Mon Jul 10 23:52:04 2017 (r320882) @@ -7,6 +7,7 @@ DIRDEPS = \ include \ include/arpa \ include/rpc \ + include/rpcsvc \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ Modified: head/usr.sbin/sesutil/Makefile.depend ============================================================================== --- head/usr.sbin/sesutil/Makefile.depend Mon Jul 10 23:51:51 2017 (r320881) +++ head/usr.sbin/sesutil/Makefile.depend Mon Jul 10 23:52:04 2017 (r320882) @@ -8,7 +8,9 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcompiler_rt + lib/libcompiler_rt \ + lib/libutil \ + lib/libxo \ .include From owner-svn-src-all@freebsd.org Mon Jul 10 23:52:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE7C0DB359D; Mon, 10 Jul 2017 23:52:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA56B7CA08; Mon, 10 Jul 2017 23:52:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ANq7In060617; Mon, 10 Jul 2017 23:52:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ANq7Wg060616; Mon, 10 Jul 2017 23:52:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707102352.v6ANq7Wg060616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 10 Jul 2017 23:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320883 - head/etc X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 320883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 23:52:09 -0000 Author: bdrewery Date: Mon Jul 10 23:52:07 2017 New Revision: 320883 URL: https://svnweb.freebsd.org/changeset/base/320883 Log: Fix INSTALL_AS_USER after r319020. Reviewed by: vangyzen MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jul 10 23:52:04 2017 (r320882) +++ head/etc/Makefile Mon Jul 10 23:52:07 2017 (r320883) @@ -342,19 +342,6 @@ distribution: MTREE_CMD?= mtree -.if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0 -MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \ - -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \ - -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \ - -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \ - -e 's,\(gid=\)[^ ]*$$,\1${_gid},' -.else -MTREE_FILTER= cat -.if !defined(NO_FSCHG) -MTREE_FSCHG= -i -.endif -.endif - MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ @@ -467,3 +454,16 @@ etc-examples: etc-examples-install DESTDIR=${DESTDIR}${SHAREDIR}/examples .include + +.if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0 +MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \ + -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \ + -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \ + -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \ + -e 's,\(gid=\)[^ ]*$$,\1${_gid},' +.else +MTREE_FILTER= cat +.if !defined(NO_FSCHG) +MTREE_FSCHG= -i +.endif +.endif From owner-svn-src-all@freebsd.org Tue Jul 11 00:32:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFDAFDB3FDC; Tue, 11 Jul 2017 00:32:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB9757D981; Tue, 11 Jul 2017 00:32:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6B0WmuJ076759; Tue, 11 Jul 2017 00:32:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B0WmGH076750; Tue, 11 Jul 2017 00:32:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707110032.v6B0WmGH076750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 11 Jul 2017 00:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320884 - in head: lib/libc++experimental lib/libclang_rt/stats lib/libclang_rt/stats_client lib/libdl lib/libifconfig lib/librss lib/libsysdecode targets/pseudo/userland/lib X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: lib/libc++experimental lib/libclang_rt/stats lib/libclang_rt/stats_client lib/libdl lib/libifconfig lib/librss lib/libsysdecode targets/pseudo/userland/lib X-SVN-Commit-Revision: 320884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 00:32:49 -0000 Author: bdrewery Date: Tue Jul 11 00:32:48 2017 New Revision: 320884 URL: https://svnweb.freebsd.org/changeset/base/320884 Log: DIRDEPS_BUILD: Connect more libraries. Sponsored by: Dell EMC Isilon Added: head/lib/libc++experimental/Makefile.depend (contents, props changed) head/lib/libclang_rt/stats/Makefile.depend (contents, props changed) head/lib/libclang_rt/stats_client/Makefile.depend (contents, props changed) head/lib/libdl/Makefile.depend (contents, props changed) head/lib/libifconfig/Makefile.depend (contents, props changed) head/lib/librss/Makefile.depend (contents, props changed) Modified: head/lib/libsysdecode/Makefile.depend head/targets/pseudo/userland/lib/Makefile.depend Added: head/lib/libc++experimental/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc++experimental/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,14 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libclang_rt/stats/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libclang_rt/stats/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/arpa \ + include/xlocale \ + lib/libc++ \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libclang_rt/stats_client/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libclang_rt/stats_client/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + lib/libc++ \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libdl/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdl/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libifconfig/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifconfig/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/librss/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/librss/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/lib/libsysdecode/Makefile.depend ============================================================================== --- head/lib/libsysdecode/Makefile.depend Mon Jul 10 23:52:07 2017 (r320883) +++ head/lib/libsysdecode/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -74,6 +74,7 @@ DIRDEPS = \ lib/libfigpar \ lib/libgeom \ lib/libgpio \ + lib/libifconfig \ lib/libjail \ lib/libkvm \ lib/liblzma \ @@ -92,6 +93,7 @@ DIRDEPS = \ lib/libproc \ lib/libprocstat \ lib/libradius \ + lib/librss \ lib/librtld_db \ lib/libsdp \ lib/libsqlite3 \ Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Mon Jul 10 23:52:07 2017 (r320883) +++ head/targets/pseudo/userland/lib/Makefile.depend Tue Jul 11 00:32:48 2017 (r320884) @@ -2,9 +2,7 @@ # This file is not autogenerated - take care! -.if !defined(MK_CLANG) .include -.endif DIRDEPS = \ lib/${CSU_DIR} \ @@ -30,9 +28,12 @@ DIRDEPS = \ lib/libbsnmp/libbsnmp \ lib/libbz2 \ lib/libc \ + lib/libc_nonshared \ lib/libc++ \ + lib/libc++experimental \ lib/libcalendar \ lib/libcam \ + lib/libcapsicum \ lib/libcom_err/doc \ lib/libcompat \ lib/libcompiler_rt \ @@ -51,6 +52,7 @@ DIRDEPS = \ lib/libexecinfo \ lib/libexpat \ lib/libfetch \ + lib/libfigpar \ lib/libgeom \ lib/libgssapi \ lib/libiconv_modules/BIG5 \ @@ -76,6 +78,7 @@ DIRDEPS = \ lib/libiconv_modules/mapper_serial \ lib/libiconv_modules/mapper_std \ lib/libiconv_modules/mapper_zone \ + lib/libifconfig \ lib/libipsec \ lib/libipx \ lib/libjail \ @@ -128,6 +131,7 @@ DIRDEPS = \ lib/libradius \ lib/librpcsec_gss \ lib/librpcsvc \ + lib/librss \ lib/librt \ lib/librtld_db \ lib/libsbuf \ @@ -144,6 +148,7 @@ DIRDEPS = \ lib/libtelnet \ lib/libthr \ lib/libthread_db \ + lib/libucl \ lib/libufs \ lib/libugidfw \ lib/libulog \ @@ -158,6 +163,7 @@ DIRDEPS = \ lib/libyaml \ lib/libypclnt \ lib/libz \ + lib/libzstd \ lib/msun \ lib/ncurses/form \ lib/ncurses/formw \ @@ -175,15 +181,22 @@ DIRDEPS = \ DIRDEPS+= \ lib/libclang_rt/asan-preinit \ lib/libclang_rt/asan \ + lib/libclang_rt/asan_dynamic \ lib/libclang_rt/asan_cxx \ lib/libclang_rt/include \ lib/libclang_rt/profile \ lib/libclang_rt/safestack \ + lib/libclang_rt/stats \ + lib/libclang_rt/stats_client \ lib/libclang_rt/ubsan_standalone \ lib/libclang_rt/ubsan_standalone_cxx \ .endif +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} +DIRDEPS+= lib/libdl +.endif + .if ${MK_NAND} != "no" DIRDEPS+= lib/libnandfs .endif @@ -197,6 +210,18 @@ DIRDEPS+= \ lib/libcasper/services/cap_random \ lib/libcasper/services/cap_sysctl \ +.endif + +.if ${MK_DIALOG} != "no" +DIRDEPS+= lib/libdpv +.endif + +.if ${MK_GPIO} != "no" +DIRDEPS+= lib/libgpio +.endif + +.if ${MK_EFI} != "no" +DIRDEPS+= lib/libefivar .endif .if ${MK_OFED} != "no" From owner-svn-src-all@freebsd.org Tue Jul 11 03:45:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EAA9D934E5; Tue, 11 Jul 2017 03:45:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFF64837F1; Tue, 11 Jul 2017 03:45:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6B3jmFa054655; Tue, 11 Jul 2017 03:45:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B3jmkt054654; Tue, 11 Jul 2017 03:45:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201707110345.v6B3jmkt054654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 11 Jul 2017 03:45:48 +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: r320885 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 320885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 03:45:49 -0000 Author: mjg Date: Tue Jul 11 03:45:47 2017 New Revision: 320885 URL: https://svnweb.freebsd.org/changeset/base/320885 Log: Remove waiters check from the inline rw wunlock routine. This is a direct commit to stable/10. r310979 is a merge of depessimisation of locking primitives. The important part was getting rid of an attempt to grab the lock in the slow path immediately after the fast path failed. In addition to that temporary checks were added before all atomic ops. They have no impact on semantic nor correctness, they only avoid an atomic operation which is likely to fail. After the addition of atomic_fcmpset and further changes said checks became pessimal and got removed. This may get merged to stable/10. Reports started showing up about a crash in all branches having extra checks. The codepath is: .. -> vm_map_delete -> __rw_wunlock_hard -> turnstile_broadcast The kernel crashed trying to wake up nonexistent waiters. The lock value as found in the vmcore matches the panicking thread, so in particular there was no waiters bit set. The bit can only be cleared by the current owner. A debug patch was provided, which reportedly had a side effect of getting rid of the issue. Also one of the reporters said that reverting the patch which adds the extra checks makes the crash go away. It was also reported that head with the fcmpset changes (explicit checks removed) also stops crashing. Finally, one user tested crashing stable/10 variant with just the rw wunlock check removed. The common case in all but one reports was an Intel Atom cpu. Claiming a cpu bug at this point is bold and I'm going to refrain from it, but right now apart from cpu-specific optimisation made by the compiler on custom kernel compiles I don't see how this can be a software bug. This will have to be investigated more. Meanwhile, restore rw wunlock to pre-r310979 state. PR: 213903 Modified: stable/10/sys/sys/rwlock.h Modified: stable/10/sys/sys/rwlock.h ============================================================================== --- stable/10/sys/sys/rwlock.h Tue Jul 11 00:32:48 2017 (r320884) +++ stable/10/sys/sys/rwlock.h Tue Jul 11 03:45:47 2017 (r320885) @@ -109,7 +109,7 @@ \ if ((rw)->rw_recurse) \ (rw)->rw_recurse--; \ - else if ((rw)->rw_lock != _tid || !_rw_write_unlock((rw), _tid))\ + else if (!_rw_write_unlock((rw), _tid)) \ _rw_wunlock_hard((rw), _tid, (file), (line)); \ } while (0) From owner-svn-src-all@freebsd.org Tue Jul 11 05:31:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1415D95BA8; Tue, 11 Jul 2017 05:31:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 696F818EA; Tue, 11 Jul 2017 05:31:38 +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 v6B5VbFW096188; Tue, 11 Jul 2017 05:31:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B5Vb3D096187; Tue, 11 Jul 2017 05:31:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707110531.v6B5Vb3D096187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 05:31:37 +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: r320886 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 320886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 05:31:38 -0000 Author: kib Date: Tue Jul 11 05:31:37 2017 New Revision: 320886 URL: https://svnweb.freebsd.org/changeset/base/320886 Log: MFC r320658: When reporting undefined symbol, note the version, if specified. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Tue Jul 11 03:45:47 2017 (r320885) +++ stable/11/libexec/rtld-elf/rtld.c Tue Jul 11 05:31:37 2017 (r320886) @@ -1658,6 +1658,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref const Elf_Sym *ref; const Elf_Sym *def; const Obj_Entry *defobj; + const Ver_Entry *ve; SymLook req; const char *name; int res; @@ -1677,6 +1678,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref name = refobj->strtab + ref->st_name; def = NULL; defobj = NULL; + ve = NULL; /* * We don't have to do a full scale lookup if the symbol is local. @@ -1693,7 +1695,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref } symlook_init(&req, name); req.flags = flags; - req.ventry = fetch_ventry(refobj, symnum); + ve = req.ventry = fetch_ventry(refobj, symnum); req.lockstate = lockstate; res = symlook_default(&req, refobj); if (res == 0) { @@ -1723,7 +1725,8 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref } } else { if (refobj != &obj_rtld) - _rtld_error("%s: Undefined symbol \"%s\"", refobj->path, name); + _rtld_error("%s: Undefined symbol \"%s%s%s\"", refobj->path, name, + ve != NULL ? "@" : "", ve != NULL ? ve->name : ""); } return def; } @@ -3488,7 +3491,8 @@ do_dlsym(void *handle, const char *name, void *retaddr return (sym); } - _rtld_error("Undefined symbol \"%s\"", name); + _rtld_error("Undefined symbol \"%s%s%s\"", name, ve != NULL ? "@" : "", + ve != NULL ? ve->name : ""); lock_release(rtld_bind_lock, &lockstate); LD_UTRACE(UTRACE_DLSYM_STOP, handle, NULL, 0, 0, name); return NULL; From owner-svn-src-all@freebsd.org Tue Jul 11 05:33:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C8AD95DEB; Tue, 11 Jul 2017 05:33:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08E661B61; Tue, 11 Jul 2017 05:33: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 v6B5X7B5099301; Tue, 11 Jul 2017 05:33:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B5X7YS099300; Tue, 11 Jul 2017 05:33:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707110533.v6B5X7YS099300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 05:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320887 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 320887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 05:33:09 -0000 Author: kib Date: Tue Jul 11 05:33:07 2017 New Revision: 320887 URL: https://svnweb.freebsd.org/changeset/base/320887 Log: MFC r320801: Simplify language. Modified: stable/11/lib/libc/sys/mmap.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/mmap.2 ============================================================================== --- stable/11/lib/libc/sys/mmap.2 Tue Jul 11 05:31:37 2017 (r320886) +++ stable/11/lib/libc/sys/mmap.2 Tue Jul 11 05:33:07 2017 (r320887) @@ -329,10 +329,12 @@ stack top is the starting address returned by the call bytes. The bottom of the stack at maximum growth is the starting address returned by the call. -The system uses guards to prevent the inadvertent use of -regions into which stacks created with +.Pp +Stacks created with .Dv MAP_STACK -will automatically grow, without mapping the whole stack in advance. +automatically grow. +Guards prevent inadvertent use of the regions into which those +stacks can grow without requiring mapping the whole stack in advance. .El .Pp The From owner-svn-src-all@freebsd.org Tue Jul 11 05:36:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95E4CD95F51; Tue, 11 Jul 2017 05:36:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id 619661D5E; Tue, 11 Jul 2017 05:36:03 +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 v6B5a2n9099470; Tue, 11 Jul 2017 05:36:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B5a2iL099469; Tue, 11 Jul 2017 05:36:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707110536.v6B5a2iL099469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 05:36:02 +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: r320888 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/libexec/rtld-elf X-SVN-Commit-Revision: 320888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 05:36:03 -0000 Author: kib Date: Tue Jul 11 05:36:02 2017 New Revision: 320888 URL: https://svnweb.freebsd.org/changeset/base/320888 Log: MFC r320658: When reporting undefined symbol, note the version, if specified. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Tue Jul 11 05:33:07 2017 (r320887) +++ stable/10/libexec/rtld-elf/rtld.c Tue Jul 11 05:36:02 2017 (r320888) @@ -1547,6 +1547,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref const Elf_Sym *ref; const Elf_Sym *def; const Obj_Entry *defobj; + const Ver_Entry *ve; SymLook req; const char *name; int res; @@ -1566,6 +1567,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref name = refobj->strtab + ref->st_name; def = NULL; defobj = NULL; + ve = NULL; /* * We don't have to do a full scale lookup if the symbol is local. @@ -1582,7 +1584,7 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref } symlook_init(&req, name); req.flags = flags; - req.ventry = fetch_ventry(refobj, symnum); + ve = req.ventry = fetch_ventry(refobj, symnum); req.lockstate = lockstate; res = symlook_default(&req, refobj); if (res == 0) { @@ -1612,7 +1614,8 @@ find_symdef(unsigned long symnum, const Obj_Entry *ref } } else { if (refobj != &obj_rtld) - _rtld_error("%s: Undefined symbol \"%s\"", refobj->path, name); + _rtld_error("%s: Undefined symbol \"%s%s%s\"", refobj->path, name, + ve != NULL ? "@" : "", ve != NULL ? ve->name : ""); } return def; } @@ -3283,7 +3286,8 @@ do_dlsym(void *handle, const char *name, void *retaddr return (sym); } - _rtld_error("Undefined symbol \"%s\"", name); + _rtld_error("Undefined symbol \"%s%s%s\"", name, ve != NULL ? "@" : "", + ve != NULL ? ve->name : ""); lock_release(rtld_bind_lock, &lockstate); LD_UTRACE(UTRACE_DLSYM_STOP, handle, NULL, 0, 0, name); return NULL; From owner-svn-src-all@freebsd.org Tue Jul 11 05:46:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A750CD962CD; Tue, 11 Jul 2017 05:46:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 65C2A24DA; Tue, 11 Jul 2017 05:46:56 +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 v6B5ktnX003891; Tue, 11 Jul 2017 05:46:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B5ktCG003890; Tue, 11 Jul 2017 05:46:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707110546.v6B5ktCG003890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 05:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320889 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 05:46:56 -0000 Author: kib Date: Tue Jul 11 05:46:55 2017 New Revision: 320889 URL: https://svnweb.freebsd.org/changeset/base/320889 Log: Restore layout of struct vm_map_entry, to restore layout of struct vm_map which embeds vm_map_entries. This is a direct commit to stable/11. Diagnosed by: markj Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/vm/vm_map.h Modified: stable/11/sys/vm/vm_map.h ============================================================================== --- stable/11/sys/vm/vm_map.h Tue Jul 11 05:36:02 2017 (r320888) +++ stable/11/sys/vm/vm_map.h Tue Jul 11 05:46:55 2017 (r320889) @@ -103,6 +103,7 @@ struct vm_map_entry { struct vm_map_entry *right; /* right child in binary search tree */ vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ + vm_offset_t pad0; vm_offset_t next_read; /* vaddr of the next sequential read */ vm_size_t adj_free; /* amount of adjacent free space */ vm_size_t max_free; /* max free space in subtree */ From owner-svn-src-all@freebsd.org Tue Jul 11 05:49:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A92ED9645B; Tue, 11 Jul 2017 05:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6955428F9; Tue, 11 Jul 2017 05:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6B5ngPL004016; Tue, 11 Jul 2017 05:49:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B5nglk004015; Tue, 11 Jul 2017 05:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707110549.v6B5nglk004015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 05:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320890 - releng/11.1/lib/libc/sys X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.1/lib/libc/sys X-SVN-Commit-Revision: 320890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 05:49:43 -0000 Author: kib Date: Tue Jul 11 05:49:42 2017 New Revision: 320890 URL: https://svnweb.freebsd.org/changeset/base/320890 Log: MFC r320801 MFS r320887: Simplify language. Approved by: re (delphij) Modified: releng/11.1/lib/libc/sys/mmap.2 Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/lib/libc/sys/mmap.2 ============================================================================== --- releng/11.1/lib/libc/sys/mmap.2 Tue Jul 11 05:46:55 2017 (r320889) +++ releng/11.1/lib/libc/sys/mmap.2 Tue Jul 11 05:49:42 2017 (r320890) @@ -329,10 +329,12 @@ stack top is the starting address returned by the call bytes. The bottom of the stack at maximum growth is the starting address returned by the call. -The system uses guards to prevent the inadvertent use of -regions into which stacks created with +.Pp +Stacks created with .Dv MAP_STACK -will automatically grow, without mapping the whole stack in advance. +automatically grow. +Guards prevent inadvertent use of the regions into which those +stacks can grow without requiring mapping the whole stack in advance. .El .Pp The From owner-svn-src-all@freebsd.org Tue Jul 11 06:39:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C900DD9731C; Tue, 11 Jul 2017 06:39:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95BFE3BAC; Tue, 11 Jul 2017 06:39:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6B6dCtm023921; Tue, 11 Jul 2017 06:39:12 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6B6dCdR023918; Tue, 11 Jul 2017 06:39:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707110639.v6B6dCdR023918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 11 Jul 2017 06:39: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: r320891 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 320891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 06:39:13 -0000 Author: grehan Date: Tue Jul 11 06:39:12 2017 New Revision: 320891 URL: https://svnweb.freebsd.org/changeset/base/320891 Log: MFC r317542, r317543, r317543 317542 comment fix 317543 set rfb default port 317543 listen on localhost by default for rfb Modified: stable/11/usr.sbin/bhyve/pci_fbuf.c stable/11/usr.sbin/bhyve/pci_xhci.c stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_fbuf.c Tue Jul 11 05:49:42 2017 (r320890) +++ stable/11/usr.sbin/bhyve/pci_fbuf.c Tue Jul 11 06:39:12 2017 (r320891) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * BAR0 points to the current mode information. * BAR1 is the 32-bit framebuffer address. * - * -s ,fbuf,wait,tcp=:port,w=width,h=height + * -s ,fbuf,wait,vga=on|io|off,rfb=:port,w=width,h=height */ static int fbuf_debug = 1; Modified: stable/11/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 11 05:49:42 2017 (r320890) +++ stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 11 06:39:12 2017 (r320891) @@ -28,7 +28,7 @@ -s ,xhci,{devices} devices: - ums USB tablet mouse + tablet USB tablet mouse */ #include __FBSDID("$FreeBSD$"); Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Tue Jul 11 05:49:42 2017 (r320890) +++ stable/11/usr.sbin/bhyve/rfb.c Tue Jul 11 06:39:12 2017 (r320891) @@ -1003,11 +1003,11 @@ rfb_init(char *hostname, int port, int wait, char *pas sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; - sin.sin_port = htons(port); + sin.sin_port = port ? htons(port) : htons(5900); if (hostname && strlen(hostname) > 0) inet_pton(AF_INET, hostname, &(sin.sin_addr)); else - sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("bind"); From owner-svn-src-all@freebsd.org Tue Jul 11 12:32:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06C8FD9E699; Tue, 11 Jul 2017 12:32:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C81D972163; Tue, 11 Jul 2017 12:32:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6BCWegp073061; Tue, 11 Jul 2017 12:32:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BCWeXu073060; Tue, 11 Jul 2017 12:32:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201707111232.v6BCWeXu073060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 11 Jul 2017 12:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320892 - head/etc/defaults X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/etc/defaults X-SVN-Commit-Revision: 320892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 12:32:42 -0000 Author: trasz Date: Tue Jul 11 12:32:40 2017 New Revision: 320892 URL: https://svnweb.freebsd.org/changeset/base/320892 Log: Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition to -y. To me, fsck_y_enable means "try as hard as possible", and without -R, it... well, doesn't. Reviewed by: mckusick Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11490 Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jul 11 06:39:12 2017 (r320891) +++ head/etc/defaults/rc.conf Tue Jul 11 12:32:40 2017 (r320892) @@ -92,7 +92,7 @@ geli_autodetach="YES" # Automatically detach on last c root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. root_hold_delay="30" # Time to wait for root mount hold release. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. -fsck_y_flags="" # Additional flags for fsck -y +fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. From owner-svn-src-all@freebsd.org Tue Jul 11 12:35:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10FA0D9E75D; Tue, 11 Jul 2017 12:35:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id D2C2072317; Tue, 11 Jul 2017 12:35:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6BCZiB7073237; Tue, 11 Jul 2017 12:35:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BCZiFU073236; Tue, 11 Jul 2017 12:35:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707111235.v6BCZiFU073236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Jul 2017 12:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320893 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 320893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 12:35:46 -0000 Author: kib Date: Tue Jul 11 12:35:44 2017 New Revision: 320893 URL: https://svnweb.freebsd.org/changeset/base/320893 Log: Fix BIT_FLS(). The iteration index is unsigned, so testing for larger than or equal to zero makes little sense. Submitted by: Sebastian Huber MFC after: 3 days Modified: head/sys/sys/bitset.h Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Tue Jul 11 12:32:40 2017 (r320892) +++ head/sys/sys/bitset.h Tue Jul 11 12:35:44 2017 (r320893) @@ -218,10 +218,10 @@ int __bit; \ \ __bit = 0; \ - for (__i = __bitset_words((_s)) - 1; __i >= 0; __i--) { \ - if ((p)->__bits[__i] != 0) { \ - __bit = flsl((p)->__bits[__i]); \ - __bit += __i * _BITSET_BITS; \ + for (__i = __bitset_words((_s)); __i > 0; __i--) { \ + if ((p)->__bits[__i - 1] != 0) { \ + __bit = flsl((p)->__bits[__i - 1]); \ + __bit += (__i - 1) * _BITSET_BITS; \ break; \ } \ } \ From owner-svn-src-all@freebsd.org Tue Jul 11 15:22:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3594DA293A; Tue, 11 Jul 2017 15:22:07 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F9A77C60; Tue, 11 Jul 2017 15:22:07 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OSX00900L2Q8H00@mr11p00im-asmtp001.me.com>; Tue, 11 Jul 2017 15:21:57 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1499786516; bh=d/L4QW999gaK+Ep0HH5IAqnWBKF5w6A1zPSJr1PSEZY=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=CGb0gpaiog7YnrschQLuHq5qyn4eCKYRNN9t7BpD53Yta9rLdQlhwNqkQUfkA+izf l6mR/XvJS4UYDsPt4whydMWOUiHiWu+jDpka8dIqZZWDoLN9XUK2FsHukoiQrwmSKd CUsCMBcmNo8QYqhMAdThCMguy5AzGuVl8KqBqjnqN4a8OG7q8sTs3Cz5XsuSGeTqlX TMxtgWTbQlrGsl/j4B6ZqLT1LbCGNLOjX8MLiw5Y2cLaN9BWsyLuUTYuhu+tuyIhRi G0ivQgMrEowlm0hlKXs6YxR0ni5AGj1vs1tJ2LuigYCys56iW7A8U0GFk2wyc/iJcx N9j9jZg2tTTvg== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OSX003P6MOIV700@mr11p00im-asmtp001.me.com>; Tue, 11 Jul 2017 15:21:55 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-11_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1707110245 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Tue, 11 Jul 2017 08:21:54 -0700 Subject: Re: svn commit: r320892 - head/etc/defaults From: Ravi Pokala To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r320892 - head/etc/defaults References: <201707111232.v6BCWeXu073060@repo.freebsd.org> In-reply-to: <201707111232.v6BCWeXu073060@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 15:22:07 -0000 I appreciate the spirit of this change; thanks Trasz! A question though: you're telling the generic `fsck' to pass "-R" to either `fsck_ffs' or `fsck_ufs', as needed. But those are both names for the same executable. Won't the generic `fsck' always end up invoking (per sbin/fsck/fsck.c::ptype_map[]) `fsck_ffs'? In which case, is the `fsck_ufs' case needed here? Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Edward Tomasz Napierala Date: 2017-07-11, Tuesday at 05:32 To: , , Subject: svn commit: r320892 - head/etc/defaults Author: trasz Date: Tue Jul 11 12:32:40 2017 New Revision: 320892 URL: https://svnweb.freebsd.org/changeset/base/320892 Log: Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition to -y. To me, fsck_y_enable means "try as hard as possible", and without -R, it... well, doesn't. Reviewed by: mckusick Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11490 Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jul 11 06:39:12 2017 (r320891) +++ head/etc/defaults/rc.conf Tue Jul 11 12:32:40 2017 (r320892) @@ -92,7 +92,7 @@ geli_autodetach="YES" # Automatically detach on last c root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. root_hold_delay="30" # Time to wait for root mount hold release. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. -fsck_y_flags="" # Additional flags for fsck -y +fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. From owner-svn-src-all@freebsd.org Tue Jul 11 16:30:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3197DDA41E2; Tue, 11 Jul 2017 16:30:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id E2DD379F70; Tue, 11 Jul 2017 16:30:18 +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 v6BGUIAb067156; Tue, 11 Jul 2017 16:30:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BGUGis067140; Tue, 11 Jul 2017 16:30:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707111630.v6BGUGis067140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 11 Jul 2017 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320894 - in head/sys: arm/arm arm/conf arm/freescale/imx arm/include arm/ti arm/ti/omap4 arm/xilinx conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/arm arm/conf arm/freescale/imx arm/include arm/ti arm/ti/omap4 arm/xilinx conf X-SVN-Commit-Revision: 320894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 16:30:19 -0000 Author: andrew Date: Tue Jul 11 16:30:16 2017 New Revision: 320894 URL: https://svnweb.freebsd.org/changeset/base/320894 Log: Add external PLATFORM access on arm, and use it in the pl310 driver. This allows multiple instances of SoCs that use the pl310 driver to be built within the same kernel: * Add access to the platform_t object from outside platform.c * Use this with the pl310 driver There is a new platform_pl310 interface to replace the existing code. SoCs need to implement the init method, and if they have special requirements to write to the two registers we care about will also need to implement the write_ctrl and write_debug methods. Differential Revision: https://reviews.freebsd.org/D11546 Added: head/sys/arm/arm/platform_pl310_if.m (contents, props changed) Modified: head/sys/arm/arm/pl310.c head/sys/arm/arm/platform.c head/sys/arm/conf/GENERIC head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx6_machdep.h head/sys/arm/freescale/imx/imx6_pl310.c head/sys/arm/include/pl310.h head/sys/arm/include/platformvar.h head/sys/arm/ti/omap4/omap4_l2cache.c head/sys/arm/ti/omap4/omap4_machdep.h head/sys/arm/ti/ti_machdep.c head/sys/arm/xilinx/zy7_l2cache.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_machdep.h head/sys/conf/files.arm Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/arm/pl310.c Tue Jul 11 16:30:16 2017 (r320894) @@ -42,11 +42,18 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef PLATFORM +#include +#endif #include #include #include +#ifdef PLATFORM +#include "platform_pl310_if.h" +#endif + /* * Define this if you need to disable PL310 for debugging purpose * Spec: @@ -88,6 +95,29 @@ static struct ofw_compat_data compat_data[] = { {"arm,pl310-cache", true}, {NULL, false} }; + +#ifdef PLATFORM +static void +platform_pl310_init(struct pl310_softc *sc) +{ + + PLATFORM_PL310_INIT(platform_obj(), sc); +} + +static void +platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +{ + + PLATFORM_PL310_WRITE_CTRL(platform_obj(), sc, val); +} + +static void +platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +{ + + PLATFORM_PL310_WRITE_DEBUG(platform_obj(), sc, val); +} +#endif static void pl310_print_config(struct pl310_softc *sc) Modified: head/sys/arm/arm/platform.c ============================================================================== --- head/sys/arm/arm/platform.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/arm/platform.c Tue Jul 11 16:30:16 2017 (r320894) @@ -77,6 +77,13 @@ SET_DECLARE(platform_set, platform_def_t); static delay_func platform_delay; +platform_t +platform_obj(void) +{ + + return (plat_obj); +} + void platform_probe_and_attach(void) { Added: head/sys/arm/arm/platform_pl310_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/platform_pl310_if.m Tue Jul 11 16:30:16 2017 (r320894) @@ -0,0 +1,84 @@ +#- +# Copyright (c) 2017 Andrew Turner +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include +#include +#include + +#include +#include +#include + +INTERFACE platform_pl310; + +HEADER { + struct pl310_softc; +}; + +CODE { + static void platform_pl310_default_write_ctrl(platform_t plat, + struct pl310_softc *sc, uint32_t val) + { + pl310_write4(sc, PL310_CTRL, val); + } + + static void platform_pl310_default_write_debug(platform_t plat, + struct pl310_softc *sc, uint32_t val) + { + pl310_write4(sc, PL310_DEBUG_CTRL, val); + } +}; + +/** + * Initialize the pl310, e.g. to configure the prefetch control. The following + * write functions may have already been called so they must not rely on + * this function. + */ +METHOD void init { + platform_t _plat; + struct pl310_softc *sc; +}; + +/** + * Write to the Control Register. + */ +METHOD void write_ctrl { + platform_t _plat; + struct pl310_softc *sc; + uint32_t val; +} DEFAULT platform_pl310_default_write_ctrl; + +/** + * Write to the Debug Control Register. + */ +METHOD void write_debug { + platform_t _plat; + struct pl310_softc *sc; + uint32_t val; +} DEFAULT platform_pl310_default_write_debug; Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/conf/GENERIC Tue Jul 11 16:30:16 2017 (r320894) @@ -116,6 +116,7 @@ device pty device snp device md # Memory "disks" device random # Entropy device +device pl310 # PL310 L2 cache controller device psci # I2C support Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Jul 11 16:30:16 2017 (r320894) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "platform_if.h" +#include "platform_pl310_if.h" static platform_attach_t imx6_attach; static platform_devmap_init_t imx6_devmap_init; @@ -320,6 +321,8 @@ static platform_method_t imx6_methods[] = { PLATFORMMETHOD(platform_mp_start_ap, imx6_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, imx6_mp_setmaxid), #endif + + PLATFORMMETHOD(platform_pl310_init, imx6_pl310_init), PLATFORMMETHOD_END, }; Modified: head/sys/arm/freescale/imx/imx6_machdep.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.h Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/freescale/imx/imx6_machdep.h Tue Jul 11 16:30:16 2017 (r320894) @@ -29,7 +29,10 @@ #ifndef IMX6_MACHDEP_H #define IMX6_MACHDEP_H +struct pl310_softc; + void imx6_mp_start_ap(platform_t); void imx6_mp_setmaxid(platform_t); +void imx6_pl310_init(platform_t, struct pl310_softc *); #endif /* IMX6_MACHDEP_H */ Modified: head/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_pl310.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/freescale/imx/imx6_pl310.c Tue Jul 11 16:30:16 2017 (r320894) @@ -40,9 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +#include "platform_pl310_if.h" + void -platform_pl310_init(struct pl310_softc *sc) +imx6_pl310_init(platform_t plat, struct pl310_softc *sc) { uint32_t reg; @@ -58,18 +63,3 @@ platform_pl310_init(struct pl310_softc *sc) pl310_set_ram_latency(sc, PL310_TAG_RAM_CTRL, 4, 2, 3); pl310_set_ram_latency(sc, PL310_DATA_RAM_CTRL, 4, 2, 3); } - -void -platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) -{ - - pl310_write4(sc, PL310_CTRL, val); -} - -void -platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) -{ - - pl310_write4(sc, PL310_DEBUG_CTRL, val); -} - Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/include/pl310.h Tue Jul 11 16:30:16 2017 (r320894) @@ -181,8 +181,10 @@ pl310_write4(struct pl310_softc *sc, bus_size_t off, u void pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg, uint32_t read, uint32_t write, uint32_t setup); +#ifndef PLATFORM void platform_pl310_init(struct pl310_softc *); void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t); void platform_pl310_write_debug(struct pl310_softc *, uint32_t); +#endif #endif /* PL310_H_ */ Modified: head/sys/arm/include/platformvar.h ============================================================================== --- head/sys/arm/include/platformvar.h Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/include/platformvar.h Tue Jul 11 16:30:16 2017 (r320894) @@ -114,6 +114,11 @@ DATA_SET(platform_set, VAR_NAME ## _platform) #endif +/* + * Helper to get the platform object + */ +platform_t platform_obj(void); + bool arm_tmr_timed_wait(platform_t, int); #endif /* _MACHINE_PLATFORMVAR_H_ */ Modified: head/sys/arm/ti/omap4/omap4_l2cache.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_l2cache.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/ti/omap4/omap4_l2cache.c Tue Jul 11 16:30:16 2017 (r320894) @@ -32,13 +32,18 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include +#include +#include +#include +#include + +#include "platform_pl310_if.h" + void -platform_pl310_init(struct pl310_softc *sc) +omap4_pl310_init(platform_t plat, struct pl310_softc *sc) { uint32_t aux, prefetch; @@ -70,13 +75,15 @@ platform_pl310_init(struct pl310_softc *sc) } void -platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +omap4_pl310_write_ctrl(platform_t plat, struct pl310_softc *sc, uint32_t val) { + ti_smc0(val, 0, L2CACHE_WRITE_CTRL_REG); } void -platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +omap4_pl310_write_debug(platform_t plat, struct pl310_softc *sc, uint32_t val) { + ti_smc0(val, 0, L2CACHE_WRITE_DEBUG_REG); } Modified: head/sys/arm/ti/omap4/omap4_machdep.h ============================================================================== --- head/sys/arm/ti/omap4/omap4_machdep.h Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/ti/omap4/omap4_machdep.h Tue Jul 11 16:30:16 2017 (r320894) @@ -28,7 +28,13 @@ #ifndef _OMAP4_MACHDEP_H_ #define _OMAP4_MACHDEP_H_ +struct pl310_softc; + void omap4_mp_setmaxid(platform_t plat); void omap4_mp_start_ap(platform_t plat); + +void omap4_pl310_init(platform_t, struct pl310_softc *); +void omap4_pl310_write_ctrl(platform_t, struct pl310_softc *, uint32_t); +void omap4_pl310_write_debug(platform_t, struct pl310_softc *, uint32_t); #endif /* _OMAP4_MACHDEP_H_ */ Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/ti/ti_machdep.c Tue Jul 11 16:30:16 2017 (r320894) @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" #if defined(SOC_OMAP4) +#include "platform_pl310_if.h" + static platform_attach_t omap4_attach; static platform_devmap_init_t ti_omap4_devmap_init; #endif @@ -139,6 +141,11 @@ static platform_method_t omap4_methods[] = { PLATFORMMETHOD(platform_mp_start_ap, omap4_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, omap4_mp_setmaxid), #endif + + PLATFORMMETHOD(platform_pl310_init, omap4_pl310_init), + PLATFORMMETHOD(platform_pl310_write_ctrl, omap4_pl310_write_ctrl), + PLATFORMMETHOD(platform_pl310_write_debug, omap4_pl310_write_debug), + PLATFORMMETHOD_END, }; FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430", 200); Modified: head/sys/arm/xilinx/zy7_l2cache.c ============================================================================== --- head/sys/arm/xilinx/zy7_l2cache.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/xilinx/zy7_l2cache.c Tue Jul 11 16:30:16 2017 (r320894) @@ -39,22 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include -void -platform_pl310_init(struct pl310_softc *softc) -{ -} +#include -void -platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) -{ +#include "platform_pl310_if.h" - pl310_write4(sc, PL310_CTRL, val); -} - void -platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +zynq7_pl310_init(platform_t plat, struct pl310_softc *softc) { - - pl310_write4(sc, PL310_DEBUG_CTRL, val); } Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/xilinx/zy7_machdep.c Tue Jul 11 16:30:16 2017 (r320894) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include "platform_if.h" +#include "platform_pl310_if.h" void (*zynq7_cpu_reset)(void); @@ -92,6 +93,8 @@ static platform_method_t zynq7_methods[] = { PLATFORMMETHOD(platform_mp_setmaxid, zynq7_mp_setmaxid), PLATFORMMETHOD(platform_mp_start_ap, zynq7_mp_start_ap), #endif + + PLATFORMMETHOD(platform_pl310_init, zynq7_pl310_init), PLATFORMMETHOD_END, }; Modified: head/sys/arm/xilinx/zy7_machdep.h ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.h Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/arm/xilinx/zy7_machdep.h Tue Jul 11 16:30:16 2017 (r320894) @@ -28,7 +28,11 @@ #ifndef _ZY7_MACHDEP_H_ #define _ZY7_MACHDEP_H_ +struct pl310_softc; + void zynq7_mp_setmaxid(platform_t); void zynq7_mp_start_ap(platform_t); + +void zynq7_pl310_init(platform_t, struct pl310_softc *); #endif /* _ZY7_MACHDEP_H_ */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Jul 11 12:35:44 2017 (r320893) +++ head/sys/conf/files.arm Tue Jul 11 16:30:16 2017 (r320894) @@ -84,6 +84,7 @@ arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/platform.c optional platform arm/arm/platform_if.m optional platform +arm/arm/platform_pl310_if.m optional platform pl310 arm/arm/pmap-v4.c optional !armv6 arm/arm/pmap-v6.c optional armv6 arm/arm/pmu.c optional pmu | fdt hwpmc From owner-svn-src-all@freebsd.org Tue Jul 11 17:02:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC728DA6818; Tue, 11 Jul 2017 17:02:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5915B7CA62; Tue, 11 Jul 2017 17:02:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v6BH2aCd080929; Tue, 11 Jul 2017 10:02:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v6BH2aFe080928; Tue, 11 Jul 2017 10:02:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707111702.v6BH2aFe080928@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320892 - head/etc/defaults In-Reply-To: <201707111232.v6BCWeXu073060@repo.freebsd.org> To: Edward Tomasz Napierala Date: Tue, 11 Jul 2017 10:02:36 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 17:02:39 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: trasz > Date: Tue Jul 11 12:32:40 2017 > New Revision: 320892 > URL: https://svnweb.freebsd.org/changeset/base/320892 > > Log: > Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition > to -y. To me, fsck_y_enable means "try as hard as possible", and without > -R, it... well, doesn't. To you perhaps, but it has long been and is well known that fsck -y is just that, fsck -y, not something more. If you want it to be more your already given a tunable. I now have to "detune" all installed systems using fsck_y_enable if I do not want them to do this. > > Reviewed by: mckusick > Obtained from: CheriBSD > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D11490 > > Modified: > head/etc/defaults/rc.conf > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Tue Jul 11 06:39:12 2017 (r320891) > +++ head/etc/defaults/rc.conf Tue Jul 11 12:32:40 2017 (r320892) > @@ -92,7 +92,7 @@ geli_autodetach="YES" # Automatically detach on last c > root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. > root_hold_delay="30" # Time to wait for root mount hold release. > fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. ^^^ this variable and this ^^^^^^ this comment are now wrong Would probably be better to introduce a new varaible for this. > -fsck_y_flags="" # Additional flags for fsck -y > +fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y > background_fsck="YES" # Attempt to run fsck in the background where possible. > background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. > netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jul 11 17:59:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDB4DA8D42; Tue, 11 Jul 2017 17:59:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4ED801D8; Tue, 11 Jul 2017 17:59:16 +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 v6BHxFVq008325; Tue, 11 Jul 2017 17:59:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BHxFnH008324; Tue, 11 Jul 2017 17:59:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707111759.v6BHxFnH008324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Jul 2017 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320895 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 320895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 17:59:16 -0000 Author: markj Date: Tue Jul 11 17:59:15 2017 New Revision: 320895 URL: https://svnweb.freebsd.org/changeset/base/320895 Log: Don't dlclose NSS modules from nss_atexit(). As hinted in the commit log message for r259042, this is unnecessary. Moreover, as a result of that change we may invoke a DSO's atexit handler after it has been unmapped. Reviewed by: bdrewery, cem MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/lib/libc/net/nsdispatch.c Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Tue Jul 11 16:30:16 2017 (r320894) +++ head/lib/libc/net/nsdispatch.c Tue Jul 11 17:59:15 2017 (r320895) @@ -525,8 +525,8 @@ fin: vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); } +static int exiting = 0; - static void ns_mod_free(ns_mod *mod) { @@ -536,12 +536,10 @@ ns_mod_free(ns_mod *mod) return; if (mod->unregister != NULL) mod->unregister(mod->mtab, mod->mtabsize); - if (mod->handle != nss_builtin_handle) + if (mod->handle != nss_builtin_handle && !exiting) (void)dlclose(mod->handle); } - - /* * Cleanup */ @@ -550,6 +548,7 @@ nss_atexit(void) { int isthreaded; + exiting = 1; isthreaded = __isthreaded; if (isthreaded) (void)_pthread_rwlock_wrlock(&nss_lock); @@ -560,8 +559,6 @@ nss_atexit(void) if (isthreaded) (void)_pthread_rwlock_unlock(&nss_lock); } - - /* * Finally, the actual implementation. From owner-svn-src-all@freebsd.org Tue Jul 11 18:24:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9866CDA977A; Tue, 11 Jul 2017 18:24: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 mx1.freebsd.org (Postfix) with ESMTPS id 66F698131B; Tue, 11 Jul 2017 18:24: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 v6BIO6Ya020372; Tue, 11 Jul 2017 18:24:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BIO6ZM020371; Tue, 11 Jul 2017 18:24:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707111824.v6BIO6ZM020371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Jul 2017 18:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320896 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 320896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 18:24:07 -0000 Author: markj Date: Tue Jul 11 18:24:05 2017 New Revision: 320896 URL: https://svnweb.freebsd.org/changeset/base/320896 Log: Add a subroutine for comparing kerneldump identifiers. MFC after: 2 weeks Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Tue Jul 11 17:59:15 2017 (r320895) +++ head/sbin/savecore/savecore.c Tue Jul 11 18:24:05 2017 (r320896) @@ -334,6 +334,13 @@ check_space(const char *savedir, off_t dumpsize, int b return (1); } +static bool +compare_magic(const struct kerneldumpheader *kdh, const char *magic) +{ + + return (strncmp(kdh->magic, magic, sizeof(kdh->magic)) == 0); +} + #define BLOCKSIZE (1<<12) #define BLOCKMASK (~(BLOCKSIZE-1)) @@ -564,7 +571,7 @@ DoFile(const char *savedir, const char *device) } memcpy(&kdhl, temp, sizeof(kdhl)); istextdump = 0; - if (strncmp(kdhl.magic, TEXTDUMPMAGIC, sizeof kdhl) == 0) { + if (compare_magic(&kdhl, TEXTDUMPMAGIC)) { if (verbose) printf("textdump magic on last dump header on %s\n", device); @@ -578,8 +585,7 @@ DoFile(const char *savedir, const char *device) if (force == 0) goto closefd; } - } else if (memcmp(kdhl.magic, KERNELDUMPMAGIC, sizeof kdhl.magic) == - 0) { + } else if (compare_magic(&kdhl, KERNELDUMPMAGIC)) { if (dtoh32(kdhl.version) != KERNELDUMPVERSION) { syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", @@ -598,8 +604,7 @@ DoFile(const char *savedir, const char *device) if (force == 0) goto closefd; - if (memcmp(kdhl.magic, KERNELDUMPMAGIC_CLEARED, - sizeof kdhl.magic) == 0) { + if (compare_magic(&kdhl, KERNELDUMPMAGIC_CLEARED)) { if (verbose) printf("forcing magic on %s\n", device); memcpy(kdhl.magic, KERNELDUMPMAGIC, From owner-svn-src-all@freebsd.org Tue Jul 11 18:46:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EEC5DA9D43; Tue, 11 Jul 2017 18:46:33 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ua0-x22e.google.com (mail-ua0-x22e.google.com [IPv6:2607:f8b0:400c:c08::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2461481CC1; Tue, 11 Jul 2017 18:46:33 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ua0-x22e.google.com with SMTP id g40so527917uaa.3; Tue, 11 Jul 2017 11:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OIb/f0ajv5xrLrhKkgTMCeUWbhpln4YoYpBtVXhsHfg=; b=DI0eNuMeZ7CGp805KMKoQ8yipTrFYgAsHVk3vCJkPFq7oZkGQw24hKC8HQKi4holWf +qxBcb4uJ66W6WpteFeB/ai2ViAfC/stTdq39DXFcVkiP2jenu2KBa/mWqCrbQzyfPTg Z2JOEYDStUW44lZozMpDIrUGYe5YNXrnibJXQ/10TXMpDcXdHPxZxEoz7QYjFj+9soqd 64PRyRaHZfhgxV3Hnqf/SWsZIBMBsrvxy6jAhRLfaIwf7INGVAMi/Mubhfia3ZHMQt4r xcJBx/A9G0iIf9PzS20LPxKLO/AFRdkMIMqbVJSb0AesRL1D+KpCUhgkwNZJh6unsiwr Py9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OIb/f0ajv5xrLrhKkgTMCeUWbhpln4YoYpBtVXhsHfg=; b=j9kJ+rR9+DAykhxbK71EOD7rSII4SKV25kGR2hFJSUPsaB/nzzDwbhPol5MjFYWei1 PlJFRW1MUDcCEUW//LddOjYK0hV48hRphooLI1CxBq0PUaEiBsOksXA6WPy/HEoUFPSU DGy+/gR4YFxck+/lhiuWIRCzz0vGgCHbr+ULCb5aIKuopm5D4RXlaT7Kx4fRU1SOSMMC W7tXEUI9W0lBJKAEXCfJQtmbX+L00ZLtSw2DLfqsXrC4O4nySb0tqQq9MMFtpEqBzp33 VMNKfMIpEhBk4F8QAfklvoKlcKdXPLRasedmZR5XqWf2Gt1HunIc7IorqRDQ1YVU2iQJ mzfw== X-Gm-Message-State: AIVw111+KW7sQPY2oFTbaQZVqYO/kAC2PbEpZLAEkR4ESmmWFVfxe+OS O/RTIsQnPJJA2XKfK8P9VgyUSLvlfw== X-Received: by 10.176.76.36 with SMTP id l36mr721503uaf.63.1499798792154; Tue, 11 Jul 2017 11:46:32 -0700 (PDT) MIME-Version: 1.0 Sender: etnapierala@gmail.com Received: by 10.176.83.198 with HTTP; Tue, 11 Jul 2017 11:46:31 -0700 (PDT) In-Reply-To: References: <201707111232.v6BCWeXu073060@repo.freebsd.org> From: Edward Napierala Date: Tue, 11 Jul 2017 19:46:31 +0100 X-Google-Sender-Auth: z3E7LC3lj3mlXpqeRwomkfjI5pw Message-ID: Subject: Re: svn commit: r320892 - head/etc/defaults To: Ravi Pokala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 18:46:33 -0000 Well, fsck(8) is a bit weird. Assuming you don't have /dev/md0 in your fstab(5): [trasz@v2:~]% fsck -d -t ffs -T ufs:-R /dev/md0 start (null) wait fsck_ffs /dev/md0 [trasz@v2:~]% fsck -d -t ufs -T ufs:-R /dev/md0 start (null) wait fsck_ufs -R /dev/md0 However (/ is defined as ufs in my fstab(5)): [trasz@v2:~]% fsck -d -t ffs -T ufs:-R / start / wait fsck_ufs -R /dev/ada0s1a [trasz@v2:~]% fsck -d -t ufs -T ufs:-R / start / wait fsck_ufs -R /dev/ada0s1a 2017-07-11 16:21 GMT+01:00 Ravi Pokala : > I appreciate the spirit of this change; thanks Trasz! > > A question though: you're telling the generic `fsck' to pass "-R" to > either `fsck_ffs' or `fsck_ufs', as needed. But those are both names for > the same executable. Won't the generic `fsck' always end up invoking (per > sbin/fsck/fsck.c::ptype_map[]) `fsck_ffs'? In which case, is the `fsck_ufs' > case needed here? > > Thanks, > > Ravi (rpokala@) > > -----Original Message----- > From: on behalf of Edward Tomasz > Napierala > Date: 2017-07-11, Tuesday at 05:32 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r320892 - head/etc/defaults > > Author: trasz > Date: Tue Jul 11 12:32:40 2017 > New Revision: 320892 > URL: https://svnweb.freebsd.org/changeset/base/320892 > > Log: > Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition > to -y. To me, fsck_y_enable means "try as hard as possible", and without > -R, it... well, doesn't. > > Reviewed by: mckusick > Obtained from: CheriBSD > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D11490 > > Modified: > head/etc/defaults/rc.conf > > Modified: head/etc/defaults/rc.conf > ============================================================ > ================== > --- head/etc/defaults/rc.conf Tue Jul 11 06:39:12 2017 (r320891) > +++ head/etc/defaults/rc.conf Tue Jul 11 12:32:40 2017 (r320892) > @@ -92,7 +92,7 @@ geli_autodetach="YES" # Automatically detach on last c > root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. > root_hold_delay="30" # Time to wait for root mount hold release. > fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen > fails. > -fsck_y_flags="" # Additional flags for fsck -y > +fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y > background_fsck="YES" # Attempt to run fsck in the background where > possible. > background_fsck_delay="60" # Time to wait (seconds) before starting the > fsck. > netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. > > > > > From owner-svn-src-all@freebsd.org Tue Jul 11 18:49:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F90DA9E0E; Tue, 11 Jul 2017 18:49:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ua0-x22a.google.com (mail-ua0-x22a.google.com [IPv6:2607:f8b0:400c:c08::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A70B781EE5; Tue, 11 Jul 2017 18:49:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ua0-x22a.google.com with SMTP id w19so672740uac.0; Tue, 11 Jul 2017 11:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ooFnwcBn1HwiXAaAWd91Zl4xCTx4aVJ0UOdJyYPbIkg=; b=T+OFIfK1PM4qpWVxk+2rRB9ozBViOX71pZg434mNVjnREpC9xAPwfTZHqoPfuuVxth z4fuxmlB9OYIAVHCUOEYzJqLDDkchBebU1tDdq531DbFNeAPQJ+BjIji5VzVfvDUj65C 8FpqMKmC8ic9mrG5X8wApHLjZERtPsNriEuw4ZJUmW9t6YcXA2aPXSNAt2Vk1PKsdDbV WtRGopzQYcGw8euDWY4/RM5RwymGXN0pSsI8Rxa5HanOZKBUX8dxrRnIs36++z7sELAl bQqe+i7I2P97nmJJeNzGC0J0XZSmFE/O+ZYa+Sv1FSnLOWdog0KnLxgtmWA1znRRGFQ2 9qWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ooFnwcBn1HwiXAaAWd91Zl4xCTx4aVJ0UOdJyYPbIkg=; b=LOu7GVx7SH1V1xvo72z9keuoURNQ2tqWv1WJQXYqa6oeSWs0J0GBxdaukglasCPUCq dbzssiQNzsl8Ir9Kng/12N0nIXLgOA7Z31tuh9GVTzEYMEQ9LVmwlXeDP/vgnERCRRH3 NFiLfungPDMgbwW7/ueEx6rEvdkHnDJvcnh+ylLqz8Fiuu4nsnN9QuGtksDcdcSs4Zxc SbSJWuCyNTOl5cz9xB0FxnuAxYTJ/HfBBIWvYn5N48Feej9a51X2kYA5eVdNNupnWfzt FpUdZaN3mtGvcn4uwvFBX6NS5oQs3DuD/UqSLF0CG/J1nBaBBebmLifZGj4IczHYh1vx 1tzw== X-Gm-Message-State: AIVw1116/BT0Jh0AvjQEBYTVsnh2EvS0imoBA39Rp5DhcH5PD8tuW+MK E28UUjZlFtjeXlmvOz4bv8YbBT6h7w== X-Received: by 10.176.3.117 with SMTP id 108mr756081uat.56.1499798985968; Tue, 11 Jul 2017 11:49:45 -0700 (PDT) MIME-Version: 1.0 Sender: etnapierala@gmail.com Received: by 10.176.83.198 with HTTP; Tue, 11 Jul 2017 11:49:45 -0700 (PDT) In-Reply-To: <201707111702.v6BH2aFe080928@pdx.rh.CN85.dnsmgr.net> References: <201707111232.v6BCWeXu073060@repo.freebsd.org> <201707111702.v6BH2aFe080928@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Tue, 11 Jul 2017 19:49:45 +0100 X-Google-Sender-Auth: bDdqQ6ifp0ANTg1DW57-Wv55fH4 Message-ID: Subject: Re: svn commit: r320892 - head/etc/defaults To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 18:49:48 -0000 2017-07-11 18:02 GMT+01:00 Rodney W. Grimes : > [ Charset UTF-8 unsupported, converting... ] > > Author: trasz > > Date: Tue Jul 11 12:32:40 2017 > > New Revision: 320892 > > URL: https://svnweb.freebsd.org/changeset/base/320892 > > > > Log: > > Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in > addition > > to -y. To me, fsck_y_enable means "try as hard as possible", and > without > > -R, it... well, doesn't. > > To you perhaps, but it has long been and is well known that fsck -y is > just that, fsck -y, not something more. If you want it to be more > your already given a tunable. > > I now have to "detune" all installed systems using fsck_y_enable if > I do not want them to do this. > _If_. But in most cases you do want it (imho -R should become the default eventually), and you might learn about it in a unpleasantly surprising way. Making it default is just optimizing for the common case. [..] From owner-svn-src-all@freebsd.org Tue Jul 11 18:55:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C8CDAA1DF; Tue, 11 Jul 2017 18:55:53 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C285825DD; Tue, 11 Jul 2017 18:55:53 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OSX00N00V89O400@mr11p00im-asmtp001.me.com>; Tue, 11 Jul 2017 18:55:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1499799349; bh=h9Mvba9BO0q+6No1tT1rE36WSFgFJW2D0zt86797MlA=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=UY3ZhReSZ9zh4algQZ1k7J7Aft+VKeiT3IngLJZFrkssMQOq+wcQQcJ+uqGAaRhZ6 sXOEgSdNJ59GG9hsSzBrYGRmrFFTWtyIKrCurrtoABxWO9iCkE21GvmLOtXk0pIyry qNnj52RNdYT3O37KipPacK0FtT33ol9erUNdNyn9t02cZhGcfjupNca3ZaXyzozZq0 KbhwNgxh/nlfHSpSP5gHZgGFWkHDOL7V5GrH7iJ1mzNS/lPkn2fqwjhFXa4UTH385k lLS/826j5TS9eHRsNx6HuDe0LbNeUOVrQtXHWdWG81gfN+bLGOrsJV546ko4YMEdS8 3EIjMTC85/fBg== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OSX00N4HWKYY010@mr11p00im-asmtp001.me.com>; Tue, 11 Jul 2017 18:55:47 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-11_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1707110305 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Tue, 11 Jul 2017 11:55:45 -0700 Subject: Re: svn commit: r320892 - head/etc/defaults From: Ravi Pokala To: Edward Napierala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: Thread-topic: svn commit: r320892 - head/etc/defaults References: <201707111232.v6BCWeXu073060@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 18:55:53 -0000 So the answer is "magic!" ;-) Fair enough; I'll RTFSource if I'm still sufficiently curious tomorrow. :-) Thanks again, Ravi (rpokala@) -----Original Message----- From: on behalf of Edward Napierala Date: 2017-07-11, Tuesday at 11:46 To: Ravi Pokala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r320892 - head/etc/defaults Well, fsck(8) is a bit weird. Assuming you don't have /dev/md0 in your fstab(5): [trasz@v2:~]% fsck -d -t ffs -T ufs:-R /dev/md0 start (null) wait fsck_ffs /dev/md0 [trasz@v2:~]% fsck -d -t ufs -T ufs:-R /dev/md0 start (null) wait fsck_ufs -R /dev/md0 However (/ is defined as ufs in my fstab(5)): [trasz@v2:~]% fsck -d -t ffs -T ufs:-R / start / wait fsck_ufs -R /dev/ada0s1a [trasz@v2:~]% fsck -d -t ufs -T ufs:-R / start / wait fsck_ufs -R /dev/ada0s1a 2017-07-11 16:21 GMT+01:00 Ravi Pokala : I appreciate the spirit of this change; thanks Trasz! A question though: you're telling the generic `fsck' to pass "-R" to either `fsck_ffs' or `fsck_ufs', as needed. But those are both names for the same executable. Won't the generic `fsck' always end up invoking (per sbin/fsck/fsck.c::ptype_map[]) `fsck_ffs'? In which case, is the `fsck_ufs' case needed here? Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Edward Tomasz Napierala Date: 2017-07-11, Tuesday at 05:32 To: , , Subject: svn commit: r320892 - head/etc/defaults Author: trasz Date: Tue Jul 11 12:32:40 2017 New Revision: 320892 URL: https://svnweb.freebsd.org/changeset/base/320892 Log: Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition to -y. To me, fsck_y_enable means "try as hard as possible", and without -R, it... well, doesn't. Reviewed by: mckusick Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11490 Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jul 11 06:39:12 2017 (r320891) +++ head/etc/defaults/rc.conf Tue Jul 11 12:32:40 2017 (r320892) @@ -92,7 +92,7 @@ geli_autodetach="YES" # Automatically detach on last c root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. root_hold_delay="30" # Time to wait for root mount hold release. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. -fsck_y_flags="" # Additional flags for fsck -y +fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. From owner-svn-src-all@freebsd.org Tue Jul 11 18:56:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77423DAA251; Tue, 11 Jul 2017 18:56:43 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7A2282736; Tue, 11 Jul 2017 18:56:42 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([80.171.206.93]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MVNDK-1dAj5r2Nwc-00YhyE; Tue, 11 Jul 2017 20:56:33 +0200 Date: Tue, 11 Jul 2017 20:56:24 +0200 From: "O. Hartmann" To: Warner Losh Cc: "O. Hartmann" , "svn-src-head@freebsd.org" , Marius Strobl , src-committers , Warner Losh , "svn-src-all@freebsd.org" Subject: Re: svn commit: r320844 - in head: etc/mtree include lib/libcam sys/amd64/conf sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/cam sys/cam/mmc sys/cam/scsi sys/conf sys/dev/mmc sys/dev/sdhci sys/m... Message-ID: <20170711205624.6b7d9814@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201707091657.v69GvOar096942@repo.freebsd.org> <20170709184221.GB38352@alchemy.franken.de> <20170710182048.3809fa38@thor.intern.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/XjhC+gCxxBm=0w1GDweBtZ/"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:Cw+td4pBC5ZbW4/4F7m8sfjwUmFtYej5M4Rnmroc+po1EcwxKNk 6+0iPLiFlgoYuDB0F3Lh3Cituh9nL7RRRfo7e6BXnFNaWzUBFmrCDaODUVxeIMCuC4AMv4V XwYau9sONbXCriWwcS9kB2BnuGySeT7ZBzvVh2rkInBm7CBr95g9/h95IymLQq3zWIeYcmc s+ebLXUyN039uJuJFueUQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:NRlR7v/5IFI=:9/3iG13UuFu1Pz4Er/xe3W s8YXX6zI1F5a/80h8JHGaCCx7L8XCo7bucqCuHMMjoWM8bPpbAgu0CI/CYm8W40JZglqZj1OU Uc7iqLl8OU9KNp9RJYgcu5jn/byf4uFSf2UdSlHrVQY5o2P7cQ1vU/FKYkRzRZKj28ffdWzn0 9MzuqODv+HCbh4hcf530ZyPq7hC/X/OBsXjL0l1dV6owgg4TlbqAJk0MrGgMArxLAuuT0XBl0 EerQfrQpfLu8JkXMMUn6N8PBtjEUfGrWy2P7ZnT8iQtWaa4wauSl+dh3LZW6f5eJEmMX280hz E0F8hUwvMGrR3KeEoHAF04F6LLqNhlX/pNLX8rY3hzGItJszJjEj2BuoIdL9tRgqcT1sdhmVH D/K/3muozgW9bvaA88UX+UPAb4k6Np/Vz1PSrCO3rfsPrbyEpwvCpdYz8VjVnIddUw89nJn0c MlG2MtXyUoDOUjyaY0iDqXxffcXlycabS8KUd2I/wFCvBtMx7HSUKKrt0+UICN6vZzgL30Oxs 675PI9cIrItI5MO73rOUR4IXUAgXu1vg5fOHXjCgFZzJy6Vdg71fEQyQIPzek31xsBYd9tC2Q qtpoZ2tJXImxdJWVdkgm5iKBU8RDF9o7/AA0hfMFxW8YmYJ+n7SbYE0quUCBOhFv+nwMRRjKC oKtWprabD1PeXSIt6aYcWZvOOpEkVq8ARR5ZEAQkBzzeh1JryDRGrAt0Cr4abv/QNd9Hyc6lm D8W8f25VktkQwiNYb6wCAoS1Kp7RtZQdNC31c+B12LPPC4aIip7PlOWrKhk= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 18:56:43 -0000 --Sig_/XjhC+gCxxBm=0w1GDweBtZ/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Mon, 10 Jul 2017 14:05:58 -0600 Warner Losh schrieb: > On Mon, Jul 10, 2017 at 10:21 AM, O. Hartmann > wrote: >=20 > > Am Sun, 9 Jul 2017 20:42:21 +0200 > > Marius Strobl schrieb: > > =20 > > > On Sun, Jul 09, 2017 at 04:57:24PM +0000, Warner Losh wrote: =20 > > > > Author: imp > > > > Date: Sun Jul 9 16:57:24 2017 > > > > New Revision: 320844 > > > > URL: https://svnweb.freebsd.org/changeset/base/320844 > > > > > > > > Log: > > > > An MMC/SD/SDIO stack using CAM > > > > > > > > Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's > > > > flexible queueing will make it easier to write non-storage drivers > > > > than the legacy stack. SDIO drivers from both the kernel and as > > > > userland daemons are possible, though much of that functionality = will > > > > come later. =20 > > > > > > At least with a non-MMCCAM kernel, with this revision in place I get > > > an endless storm of "unexpected" SDHCI_INT_CARD_INT interrupts during > > > boot. Apparently this is due to the fact that sdhci(4) now enables > > > these interrupts, but sdhci_generic_intr() neither actually handles > > > them nor clears them from intmask. > > > > > > Btw., were mmc.ko and mmcsd.ko disconnected on purpose with this comm= it? > > > > > > Marius =20 > > > > I updated just to r320873. > > My box is booting off a Samsung SSD 830/UFS2 (GPT) and worked fine with > > r320829 and hangs > > now again at: > > > > mountroot: Waiting for device /dev/gpt/root ... > > Mounting from ufs:/dev/gpt/root failed with error 19 > > > > mountroot >: ? > > > > List of GEOM managed disk devices > > > > mountroot >: > > > > What happened here? > > > > > > I run a custom kernel with ZFS compiled in ... > > > > =20 > No clue. the information provided is insufficient to track down the > problem. Can you give a full dmesg? And can you bisect the revs from > r320829 to r320873 to see which one breaks things? >=20 > Warner > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" I followed your advice given to delete /usr/obj/usr/src/sys/KERNELNAME and = rebuild the system. I use META_MODE, but I had recompiled world before from scratch sin= ce I gave up using WITH_LLD_IS_LD and needed a clean world. But after rebuilding the wor= ld, I did several updates and rebuilds with filemon after that and it seems that caus= ed the trouble! I have no sdhci driver compiled into that kernel so far. Now the box is running FreeBSD 12.0-CURRENT #1 r320896: Tue Jul 11 20:34:46= CEST 2017 amd64. Thanks for the hint. Kind regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/XjhC+gCxxBm=0w1GDweBtZ/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWWUfWAAKCRDS528fyFhY lM5cAfoD+oprrxEnbzuOqT952T6LUkcdDn/qksQDFkSQAmFncw4/+JRMGMsQ88xn DcxD3X24MQgXCaNTwqYPFvRd7BEHAgCXnRhMz3FfbbfD+ZcpS59WiNtM6OOMd/je j5X7Np+DM3ch+IwRzZs8uaXpDJwFy3bvNWcDMswNKBWG4p8uOWer =xOca -----END PGP SIGNATURE----- --Sig_/XjhC+gCxxBm=0w1GDweBtZ/-- From owner-svn-src-all@freebsd.org Tue Jul 11 20:12:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5652FDAB66B; Tue, 11 Jul 2017 20:12:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE8BE656DE; Tue, 11 Jul 2017 20:12:34 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x231.google.com with SMTP id k67so4167449wrc.2; Tue, 11 Jul 2017 13:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6JQKWRoaFiS2Froyox2oo022VPU0hB8qOfJIvqDfmRg=; b=WZa5yuB+RW2nK/DpzEFyKRcjaYEBt2BPQ7J334Z61DKFtuIFdS+w/JHdNKNZ9NuAgj sXtjG2zPjgors7yCmPO/ym7bDLiFWHOyfGz2w23MpJgoF1mZvTfznnDw3AgQ6z6tqh3g MAjEOejQwRD8EV2KqNpSs+/iwLkcsN8UdPoCzABRks9yXvx5IeIZFI1XffP67cEPtro1 EgLyBjU8YW3nqFmXFXrPILyEvHuU2OU/fhdq5ta4zWfe8BWuTMzr89VCQEUeGUTehCXR RAZ5VqRydzwVVnuzIZfwcAudKwyok2QBW5/rnejI+j0LZA8ukkxAuIZYj7n9cufAXoIS KlWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=6JQKWRoaFiS2Froyox2oo022VPU0hB8qOfJIvqDfmRg=; b=dglKGKsRTLyPPaDrknqSRTpK0eG6wmENBo28YeUEE3Co3NyfMMt/mfnQRqjXZhdO2M z0knAOEDFvNXLOFFQDVG7SdCXD9I/3L+P1WEf857WuvNNVcRlC5v03KUfNOfPxx+AQ2p /N36HD30ZzgUT+iyIyAiv+wv26TRsMOwaD88i3OQmze7BoeXLGlAN+fIGhSZhdJtOLku PGSiI+GGa1GAZC6LXM4a4Q0g/2d9MLKWcAq1Uw5p43vOi5boKRhWtu1GCyPAH+WfsW4h IOQgLNqcuZbEi/Q65I5psqBgFXPKcDmN+q3EVtHHhqQTNNkwKCSQWsnFG0oNtQJdCiWs ukZg== X-Gm-Message-State: AIVw113Gi6aFKPFfV0jilxFtixbouDFK9VNskDwURK93IUm7oZcjHjhH 4NDJCwG/SG2Ts6rK X-Received: by 10.223.154.206 with SMTP id a72mr933541wrc.47.1499803952982; Tue, 11 Jul 2017 13:12:32 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id k75sm261991wmh.10.2017.07.11.13.12.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 13:12:32 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 11 Jul 2017 21:12:30 +0100 From: Edward Tomasz Napierala To: rgrimes@freebsd.org Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320803 - head/sbin/mount Message-ID: <20170711201230.GB1725@brick> Mail-Followup-To: rgrimes@freebsd.org, Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <20170708171641.GA1129@brick> <201707081734.v68HYpN9068500@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707081734.v68HYpN9068500@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 20:12:35 -0000 On 0708T1034, Rodney W. Grimes wrote: > [ Charset ISO-8859-1 unsupported, converting... ] > > On 0708T1102, Ian Lepore wrote: > > > On Sat, 2017-07-08 at 09:50 -0700, Rodney W. Grimes wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > Author: trasz > > > > > Date: Sat Jul??8 11:06:27 2017 > > > > > New Revision: 320803 > > > > > URL: https://svnweb.freebsd.org/changeset/base/320803 > > > > > > > > > > Log: > > > > > ? Fix "mount -uw /" when the filesystem type doesn't match. > > > > > ?? > > > > > ? This basically makes "mount -uw /" work when the filesystem > > > > > ? mounted on / is NFS, but the one configured in fstab(5) is UFS, > > > > > ? which can happen when you forget to modify fstab. > > > > Please do not silence user errors because they are inconvinient, > > > > this is a configuration error and the system should fail to? > > > > mount the incorrectly configured root. > > > > > > > > If we start changing things to silently ignore user configuration > > > > errors we are going down a very slippery road. > > > > It doesn't silence down the error. What it does is it makes it possible > > to use "mount -uw /" - previously it would fail in a rather nonsensical > > way, by calling "mount_nfs -o upgrade,rw /dev/ada0 /". > > It DOES silence the error. My configuration TOLD it to execute that > rather nonsensical command, your change now causes it to execute something > that my configuration did NOT tell it to do. I don't know your configuration; mine certainly didn't tell it to try to mount /dev/ada0 as NFS. What I certainly _did_ told it was to "mount -uw /", and previously, in some cases, it failed to do this. Now it works. >From a practical standpoint, it's like this: I have an NFS root filesystem mounted read-only. There's a slightly wrong fstab. I want to remount it read-write and fix it. With UFS I can. I expect the same with NFS. > > > IMO, this change fixes the right problem, but maybe does so the wrong > > > way. ?Mount -u is by definition an update to an existing mount. ?There > > > should be no need to consult /etc/fstab for an existing mount since the > > > info is available from the kernel. > > > > > > Note that I say the foregoing with my user hat on. ?I haven't looked at > > > the code to see if there's some reason why my common-sensical way of > > > thinking about it is actually impossible to implement for some reason. > > > > I wouldn't expect it to consult fstab either, to be honest. But it does, > > and I suspect changing that would break someone's config. > > It reads the fstab to get the options that may be specified there > that your mount -uw / command does not specify, realize the kernel > when mounting / does so in a very minimal way, when you invoke > mount -u the parameters in /etc/fstab come in to play. Yup, that's it. So it is right in most cases - it's just that the hack for "/" case sometimes worked in an way that's pretty obviously wrong (using the fstab value for "mounted from", but ignoring the filesystem type), although didn't hurt before reroot, because it could never happen. > I believe KIB refered to this during your differential when he said > something like "what if the options disagree". Possibly. From owner-svn-src-all@freebsd.org Tue Jul 11 20:35:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC6EDABB36 for ; Tue, 11 Jul 2017 20:35:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF22567145 for ; Tue, 11 Jul 2017 20:35:24 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 7624ea03-6678-11e7-bfd0-afd4446ba3af X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 7624ea03-6678-11e7-bfd0-afd4446ba3af; Tue, 11 Jul 2017 20:35:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6BKZFUD044104; Tue, 11 Jul 2017 14:35:15 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1499805315.45330.14.camel@freebsd.org> Subject: Re: svn commit: r320803 - head/sbin/mount From: Ian Lepore To: Edward Tomasz Napierala , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 11 Jul 2017 14:35:15 -0600 In-Reply-To: <20170711201230.GB1725@brick> References: <20170708171641.GA1129@brick> <201707081734.v68HYpN9068500@pdx.rh.CN85.dnsmgr.net> <20170711201230.GB1725@brick> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 20:35:25 -0000 On Tue, 2017-07-11 at 21:12 +0100, Edward Tomasz Napierala wrote: > On 0708T1034, Rodney W. Grimes wrote: > > > > [ Charset ISO-8859-1 unsupported, converting... ] > > > > > > On 0708T1102, Ian Lepore wrote: > > > > > > > > On Sat, 2017-07-08 at 09:50 -0700, Rodney W. Grimes wrote: > > > > > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > > > > > > Author: trasz > > > > > > Date: Sat Jul??8 11:06:27 2017 > > > > > > New Revision: 320803 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/320803 > > > > > > > > > > > > Log: > > > > > > ? Fix "mount -uw /" when the filesystem type doesn't match. > > > > > > ?? > > > > > > ? This basically makes "mount -uw /" work when the > > > > > > filesystem > > > > > > ? mounted on / is NFS, but the one configured in fstab(5) > > > > > > is UFS, > > > > > > ? which can happen when you forget to modify fstab. > > > > > Please do not silence user errors because they are > > > > > inconvinient, > > > > > this is a configuration error and the system should fail to? > > > > > mount the incorrectly configured root. > > > > > > > > > > If we start changing things to silently ignore user > > > > > configuration > > > > > errors we are going down a very slippery road. > > > It doesn't silence down the error.  What it does is it makes it > > > possible > > > to use "mount -uw /" - previously it would fail in a rather > > > nonsensical > > > way, by calling "mount_nfs -o upgrade,rw /dev/ada0 /". > > It DOES silence the error.  My configuration TOLD it to execute > > that > > rather nonsensical command, your change now causes it to execute > > something > > that my configuration did NOT tell it to do. > I don't know your configuration; mine certainly didn't tell it to try > to > mount /dev/ada0 as NFS.  What I certainly _did_ told it was to "mount > -uw /", > and previously, in some cases, it failed to do this.  Now it works. > > From a practical standpoint, it's like this: I have an NFS root > filesystem > mounted read-only.  There's a slightly wrong fstab.  I want to > remount it > read-write and fix it.  With UFS I can.  I expect the same with NFS. > > > > > > > > > > > > > > IMO, this change fixes the right problem, but maybe does so the > > > > wrong > > > > way. ?Mount -u is by definition an update to an existing mount. > > > > ?There > > > > should be no need to consult /etc/fstab for an existing mount > > > > since the > > > > info is available from the kernel. > > > > > > > > Note that I say the foregoing with my user hat on. ?I haven't > > > > looked at > > > > the code to see if there's some reason why my common-sensical > > > > way of > > > > thinking about it is actually impossible to implement for some > > > > reason. > > > I wouldn't expect it to consult fstab either, to be honest.  But > > > it does, > > > and I suspect changing that would break someone's config. > > It reads the fstab to get the options that may be specified there > > that your mount -uw / command does not specify, realize the kernel > > when mounting / does so in a very minimal way, when you invoke > > mount -u the parameters in /etc/fstab come in to play. > Yup, that's it.  So it is right in most cases - it's just that the > hack > for "/" case sometimes worked in an way that's pretty obviously wrong > (using the fstab value for "mounted from", but ignoring the > filesystem > type), although didn't hurt before reroot, because it could never > happen. > > > > > I believe KIB refered to this during your differential when he said > > something like "what if the options disagree". > Possibly. I think the docs on this are pretty clear... under -u it says: The set of options is determined by applying the options specified in the argument to -o and finally applying the -r or -w option. To me, that says that nothing in /etc/fstab is germane to mount -u unless one of the other args to mount -u is -o fstab. This change (r320803) seems like an acceptable workaround, but I think the correct long term fix would be to not even open /etc/fstab on mount -u without -o fstab.  But that may be harder to do than to say; I still haven't actually looked at the code involved. -- Ian From owner-svn-src-all@freebsd.org Tue Jul 11 21:25:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF630DAC4E7; Tue, 11 Jul 2017 21:25:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 94904685CF; Tue, 11 Jul 2017 21:25:08 +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 v6BLP7Ub093953; Tue, 11 Jul 2017 21:25:07 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BLP7Pg093948; Tue, 11 Jul 2017 21:25:07 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201707112125.v6BLP7Pg093948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 11 Jul 2017 21:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Commit-Revision: 320897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 21:25:09 -0000 Author: erj Date: Tue Jul 11 21:25:07 2017 New Revision: 320897 URL: https://svnweb.freebsd.org/changeset/base/320897 Log: MFC r316541, r316544, and r320688 from HEAD to stable/11. r316541: Fix a double free in ixgbe_rxeof() r316544: Don't overwrite vf->flags variable at the end of ixgbe(4) ixgbe_add_vf() r320688: ixgbe(4): Update HEAD (p3) to 3.2.12-k Includes: - Support for X550EM devices. - Support for Bypass adapters. - Flow Director code moved to separate files - SR-IOV code moved to separate files - Netmap code moved to separate files Sponsored by: Intel Corporation Added: stable/11/sys/dev/ixgbe/if_bypass.c - copied unchanged from r320688, head/sys/dev/ixgbe/if_bypass.c stable/11/sys/dev/ixgbe/if_fdir.c - copied unchanged from r320688, head/sys/dev/ixgbe/if_fdir.c stable/11/sys/dev/ixgbe/if_sriov.c - copied unchanged from r320688, head/sys/dev/ixgbe/if_sriov.c stable/11/sys/dev/ixgbe/ixgbe_bypass.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_bypass.h stable/11/sys/dev/ixgbe/ixgbe_fdir.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_fdir.h stable/11/sys/dev/ixgbe/ixgbe_features.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_features.h stable/11/sys/dev/ixgbe/ixgbe_netmap.c - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_netmap.c stable/11/sys/dev/ixgbe/ixgbe_netmap.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_netmap.h stable/11/sys/dev/ixgbe/ixgbe_rss.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_rss.h stable/11/sys/dev/ixgbe/ixgbe_sriov.h - copied unchanged from r320688, head/sys/dev/ixgbe/ixgbe_sriov.h Modified: stable/11/sys/conf/files stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixgbe/if_ixv.c stable/11/sys/dev/ixgbe/ix_txrx.c stable/11/sys/dev/ixgbe/ixgbe.h stable/11/sys/dev/ixgbe/ixgbe_82598.c stable/11/sys/dev/ixgbe/ixgbe_82598.h stable/11/sys/dev/ixgbe/ixgbe_82599.c stable/11/sys/dev/ixgbe/ixgbe_82599.h stable/11/sys/dev/ixgbe/ixgbe_api.c stable/11/sys/dev/ixgbe/ixgbe_api.h stable/11/sys/dev/ixgbe/ixgbe_common.c stable/11/sys/dev/ixgbe/ixgbe_common.h stable/11/sys/dev/ixgbe/ixgbe_dcb.c stable/11/sys/dev/ixgbe/ixgbe_dcb.h stable/11/sys/dev/ixgbe/ixgbe_dcb_82598.c stable/11/sys/dev/ixgbe/ixgbe_dcb_82598.h stable/11/sys/dev/ixgbe/ixgbe_dcb_82599.c stable/11/sys/dev/ixgbe/ixgbe_dcb_82599.h stable/11/sys/dev/ixgbe/ixgbe_mbx.c stable/11/sys/dev/ixgbe/ixgbe_mbx.h stable/11/sys/dev/ixgbe/ixgbe_osdep.c stable/11/sys/dev/ixgbe/ixgbe_osdep.h stable/11/sys/dev/ixgbe/ixgbe_phy.c stable/11/sys/dev/ixgbe/ixgbe_phy.h stable/11/sys/dev/ixgbe/ixgbe_type.h stable/11/sys/dev/ixgbe/ixgbe_vf.c stable/11/sys/dev/ixgbe/ixgbe_vf.h stable/11/sys/dev/ixgbe/ixgbe_x540.c stable/11/sys/dev/ixgbe/ixgbe_x540.h stable/11/sys/dev/ixgbe/ixgbe_x550.c stable/11/sys/dev/ixgbe/ixgbe_x550.h stable/11/sys/modules/ix/Makefile stable/11/sys/modules/ixv/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Tue Jul 11 18:24:05 2017 (r320896) +++ stable/11/sys/conf/files Tue Jul 11 21:25:07 2017 (r320897) @@ -2076,6 +2076,14 @@ dev/ixgbe/if_ix.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" dev/ixgbe/if_ixv.c optional ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" +dev/ixgbe/if_bypass.c optional ix inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_netmap.c optional ix inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/if_fdir.c optional ix inet | ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/if_sriov.c optional ix inet | ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ix_txrx.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet \ Copied: stable/11/sys/dev/ixgbe/if_bypass.c (from r320688, head/sys/dev/ixgbe/if_bypass.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/ixgbe/if_bypass.c Tue Jul 11 21:25:07 2017 (r320897, copy of r320688, head/sys/dev/ixgbe/if_bypass.c) @@ -0,0 +1,808 @@ +/****************************************************************************** + + Copyright (c) 2001-2017, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + + +#include "ixgbe.h" + +/************************************************************************ + * ixgbe_bypass_mutex_enter + * + * Mutex support for the bypass feature. Using a dual lock + * to facilitate a privileged access to the watchdog update + * over other threads. + ************************************************************************/ +static void +ixgbe_bypass_mutex_enter(struct adapter *adapter) +{ + while (atomic_cmpset_int(&adapter->bypass.low, 0, 1) == 0) + usec_delay(3000); + while (atomic_cmpset_int(&adapter->bypass.high, 0, 1) == 0) + usec_delay(3000); + return; +} /* ixgbe_bypass_mutex_enter */ + +/************************************************************************ + * ixgbe_bypass_mutex_clear + ************************************************************************/ +static void +ixgbe_bypass_mutex_clear(struct adapter *adapter) +{ + while (atomic_cmpset_int(&adapter->bypass.high, 1, 0) == 0) + usec_delay(6000); + while (atomic_cmpset_int(&adapter->bypass.low, 1, 0) == 0) + usec_delay(6000); + return; +} /* ixgbe_bypass_mutex_clear */ + +/************************************************************************ + * ixgbe_bypass_wd_mutex_enter + * + * Watchdog entry is allowed to simply grab the high priority + ************************************************************************/ +static void +ixgbe_bypass_wd_mutex_enter(struct adapter *adapter) +{ + while (atomic_cmpset_int(&adapter->bypass.high, 0, 1) == 0) + usec_delay(3000); + return; +} /* ixgbe_bypass_wd_mutex_enter */ + +/************************************************************************ + * ixgbe_bypass_wd_mutex_clear + ************************************************************************/ +static void +ixgbe_bypass_wd_mutex_clear(struct adapter *adapter) +{ + while (atomic_cmpset_int(&adapter->bypass.high, 1, 0) == 0) + usec_delay(6000); + return; +} /* ixgbe_bypass_wd_mutex_clear */ + +/************************************************************************ + * ixgbe_get_bypass_time + ************************************************************************/ +static void +ixgbe_get_bypass_time(u32 *year, u32 *sec) +{ + struct timespec current; + + *year = 1970; /* time starts at 01/01/1970 */ + nanotime(¤t); + *sec = current.tv_sec; + + while(*sec > SEC_THIS_YEAR(*year)) { + *sec -= SEC_THIS_YEAR(*year); + (*year)++; + } +} /* ixgbe_get_bypass_time */ + +/************************************************************************ + * ixgbe_bp_version + * + * Display the feature version + ************************************************************************/ +static int +ixgbe_bp_version(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int version = 0; + u32 cmd; + + ixgbe_bypass_mutex_enter(adapter); + cmd = BYPASS_PAGE_CTL2 | BYPASS_WE; + cmd |= (BYPASS_EEPROM_VER_ADD << BYPASS_CTL2_OFFSET_SHIFT) & + BYPASS_CTL2_OFFSET_M; + if ((error = hw->mac.ops.bypass_rw(hw, cmd, &version) != 0)) + goto err; + msec_delay(100); + cmd &= ~BYPASS_WE; + if ((error = hw->mac.ops.bypass_rw(hw, cmd, &version) != 0)) + goto err; + ixgbe_bypass_mutex_clear(adapter); + version &= BYPASS_CTL2_DATA_M; + error = sysctl_handle_int(oidp, &version, 0, req); + return (error); +err: + ixgbe_bypass_mutex_clear(adapter); + return (error); + +} /* ixgbe_bp_version */ + +/************************************************************************ + * ixgbe_bp_set_state + * + * Show/Set the Bypass State: + * 1 = NORMAL + * 2 = BYPASS + * 3 = ISOLATE + * + * With no argument the state is displayed, + * passing a value will set it. + ************************************************************************/ +static int +ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int state = 0; + + /* Get the current state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, + BYPASS_PAGE_CTL0, &state); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3; + + error = sysctl_handle_int(oidp, &state, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check new state */ + switch (state) { + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + ixgbe_bypass_mutex_enter(adapter); + if ((error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_MODE_OFF_M, state) != 0)) + goto out; + /* Set AUTO back on so FW can receive events */ + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_MODE_OFF_M, BYPASS_AUTO); +out: + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_set_state */ + +/************************************************************************ + * The following routines control the operational + * "rules" of the feature, what behavior will occur + * when particular events occur. + * Values are: + * 0 - no change for the event (NOP) + * 1 - go to Normal operation + * 2 - go to Bypass operation + * 3 - go to Isolate operation + * Calling the entry with no argument just displays + * the current rule setting. + ************************************************************************/ + +/************************************************************************ + * ixgbe_bp_timeout + * + * This is to set the Rule for the watchdog, + * not the actual watchdog timeout value. + ************************************************************************/ +static int +ixgbe_bp_timeout(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int timeout = 0; + + /* Get the current value */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &timeout); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + timeout = (timeout >> BYPASS_WDTIMEOUT_SHIFT) & 0x3; + + error = sysctl_handle_int(oidp, &timeout, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check on the setting */ + switch (timeout) { + case BYPASS_NOP: + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + + /* Set the new state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_WDTIMEOUT_M, timeout << BYPASS_WDTIMEOUT_SHIFT); + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_timeout */ + +/************************************************************************ + * ixgbe_bp_main_on + ************************************************************************/ +static int +ixgbe_bp_main_on(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int main_on = 0; + + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &main_on); + main_on = (main_on >> BYPASS_MAIN_ON_SHIFT) & 0x3; + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + + error = sysctl_handle_int(oidp, &main_on, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check on the setting */ + switch (main_on) { + case BYPASS_NOP: + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + + /* Set the new state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_MAIN_ON_M, main_on << BYPASS_MAIN_ON_SHIFT); + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_main_on */ + +/************************************************************************ + * ixgbe_bp_main_off + ************************************************************************/ +static int +ixgbe_bp_main_off(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int main_off = 0; + + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &main_off); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + main_off = (main_off >> BYPASS_MAIN_OFF_SHIFT) & 0x3; + + error = sysctl_handle_int(oidp, &main_off, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check on the setting */ + switch (main_off) { + case BYPASS_NOP: + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + + /* Set the new state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_MAIN_OFF_M, main_off << BYPASS_MAIN_OFF_SHIFT); + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_main_off */ + +/************************************************************************ + * ixgbe_bp_aux_on + ************************************************************************/ +static int +ixgbe_bp_aux_on(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int aux_on = 0; + + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &aux_on); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + aux_on = (aux_on >> BYPASS_AUX_ON_SHIFT) & 0x3; + + error = sysctl_handle_int(oidp, &aux_on, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check on the setting */ + switch (aux_on) { + case BYPASS_NOP: + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + + /* Set the new state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_AUX_ON_M, aux_on << BYPASS_AUX_ON_SHIFT); + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_aux_on */ + +/************************************************************************ + * ixgbe_bp_aux_off + ************************************************************************/ +static int +ixgbe_bp_aux_off(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error = 0; + static int aux_off = 0; + + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &aux_off); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + aux_off = (aux_off >> BYPASS_AUX_OFF_SHIFT) & 0x3; + + error = sysctl_handle_int(oidp, &aux_off, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Sanity check on the setting */ + switch (aux_off) { + case BYPASS_NOP: + case BYPASS_NORM: + case BYPASS_BYPASS: + case BYPASS_ISOLATE: + break; + default: + return (EINVAL); + } + + /* Set the new state */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, + BYPASS_AUX_OFF_M, aux_off << BYPASS_AUX_OFF_SHIFT); + ixgbe_bypass_mutex_clear(adapter); + usec_delay(6000); + return (error); +} /* ixgbe_bp_aux_off */ + +/************************************************************************ + * ixgbe_bp_wd_set - Set the Watchdog timer value + * + * Valid settings are: + * - 0 will disable the watchdog + * - 1, 2, 3, 4, 8, 16, 32 + * - anything else is invalid and will be ignored + ************************************************************************/ +static int +ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + int error, tmp; + static int timeout = 0; + u32 mask, arg = BYPASS_PAGE_CTL0; + + /* Get the current hardware value */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &tmp); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (error); + /* + * If armed keep the displayed value, + * else change the display to zero. + */ + if ((tmp & (0x1 << BYPASS_WDT_ENABLE_SHIFT)) == 0) + timeout = 0; + + error = sysctl_handle_int(oidp, &timeout, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + mask = BYPASS_WDT_ENABLE_M; + switch (timeout) { + case 0: /* disables the timer */ + break; + case 1: + arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 2: + arg = BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 3: + arg = BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 4: + arg = BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 8: + arg = BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 16: + arg = BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + case 32: + arg = BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT; + arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask |= BYPASS_WDT_VALUE_M; + break; + default: + return (EINVAL); + } + /* Set the new watchdog */ + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg); + ixgbe_bypass_mutex_clear(adapter); + + return (error); +} /* ixgbe_bp_wd_set */ + +/************************************************************************ + * ixgbe_bp_wd_reset - Reset the Watchdog timer + * + * To activate this it must be called with any argument. + ************************************************************************/ +static int +ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + u32 sec, year; + int cmd, count = 0, error = 0; + int reset_wd = 0; + + error = sysctl_handle_int(oidp, &reset_wd, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + cmd = BYPASS_PAGE_CTL1 | BYPASS_WE | BYPASS_CTL1_WDT_PET; + + /* Resync the FW time while writing to CTL1 anyway */ + ixgbe_get_bypass_time(&year, &sec); + + cmd |= (sec & BYPASS_CTL1_TIME_M) | BYPASS_CTL1_VALID; + cmd |= BYPASS_CTL1_OFFTRST; + + ixgbe_bypass_wd_mutex_enter(adapter); + error = hw->mac.ops.bypass_rw(hw, cmd, &reset_wd); + + /* Read until it matches what we wrote, or we time out */ + do { + if (count++ > 10) { + error = IXGBE_BYPASS_FW_WRITE_FAILURE; + break; + } + if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) { + error = IXGBE_ERR_INVALID_ARGUMENT; + break; + } + } while (!hw->mac.ops.bypass_valid_rd(cmd, reset_wd)); + + reset_wd = 0; + ixgbe_bypass_wd_mutex_clear(adapter); + return (error); +} /* ixgbe_bp_wd_reset */ + +/************************************************************************ + * ixgbe_bp_log - Display the bypass log + * + * You must pass a non-zero arg to sysctl + ************************************************************************/ +static int +ixgbe_bp_log(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + u32 cmd, base, head; + u32 log_off, count = 0; + static int status = 0; + u8 data; + struct ixgbe_bypass_eeprom eeprom[BYPASS_MAX_LOGS]; + int i, error = 0; + + error = sysctl_handle_int(oidp, &status, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + /* Keep the log display single-threaded */ + while (atomic_cmpset_int(&adapter->bypass.log, 0, 1) == 0) + usec_delay(3000); + + ixgbe_bypass_mutex_enter(adapter); + + /* Find Current head of the log eeprom offset */ + cmd = BYPASS_PAGE_CTL2 | BYPASS_WE; + cmd |= (0x1 << BYPASS_CTL2_OFFSET_SHIFT) & BYPASS_CTL2_OFFSET_M; + error = hw->mac.ops.bypass_rw(hw, cmd, &status); + if (error) + goto unlock_err; + + /* wait for the write to stick */ + msec_delay(100); + + /* Now read the results */ + cmd &= ~BYPASS_WE; + error = hw->mac.ops.bypass_rw(hw, cmd, &status); + if (error) + goto unlock_err; + + ixgbe_bypass_mutex_clear(adapter); + + base = status & BYPASS_CTL2_DATA_M; + head = (status & BYPASS_CTL2_HEAD_M) >> BYPASS_CTL2_HEAD_SHIFT; + + /* address of the first log */ + log_off = base + (head * 5); + + /* extract all the log entries */ + while (count < BYPASS_MAX_LOGS) { + eeprom[count].logs = 0; + eeprom[count].actions = 0; + + /* Log 5 bytes store in on u32 and a u8 */ + for (i = 0; i < 4; i++) { + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rd_eep(hw, log_off + i, + &data); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (-EINVAL); + eeprom[count].logs += data << (8 * i); + } + + ixgbe_bypass_mutex_enter(adapter); + error = hw->mac.ops.bypass_rd_eep(hw, + log_off + i, &eeprom[count].actions); + ixgbe_bypass_mutex_clear(adapter); + if (error) + return (-EINVAL); + + /* Quit if not a unread log */ + if (!(eeprom[count].logs & BYPASS_LOG_CLEAR_M)) + break; + /* + * Log looks good so store the address where it's + * Unread Log bit is so we can clear it after safely + * pulling out all of the log data. + */ + eeprom[count].clear_off = log_off; + + count++; + head = head ? head - 1 : BYPASS_MAX_LOGS; + log_off = base + (head * 5); + } + + /* reverse order (oldest first) for output */ + while (count--) { + int year; + u32 mon, days, hours, min, sec; + u32 time = eeprom[count].logs & BYPASS_LOG_TIME_M; + u32 event = (eeprom[count].logs & BYPASS_LOG_EVENT_M) >> + BYPASS_LOG_EVENT_SHIFT; + u8 action = eeprom[count].actions & BYPASS_LOG_ACTION_M; + u16 day_mon[2][13] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, + {0, 31, 59, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} + }; + char *event_str[] = {"unknown", "main on", "aux on", + "main off", "aux off", "WDT", "user" }; + char *action_str[] = {"ignore", "normal", "bypass", "isolate",}; + + /* verify vaild data 1 - 6 */ + if (event < BYPASS_EVENT_MAIN_ON || event > BYPASS_EVENT_USR) + event = 0; + + /* + * time is in sec's this year, so convert to something + * printable. + */ + ixgbe_get_bypass_time(&year, &sec); + days = time / SEC_PER_DAY; + for (i = 11; days < day_mon[LEAP_YR(year)][i]; i--) + continue; + mon = i + 1; /* display month as 1-12 */ + time -= (day_mon[LEAP_YR(year)][i] * SEC_PER_DAY); + days = (time / SEC_PER_DAY) + 1; /* first day is 1 */ + time %= SEC_PER_DAY; + hours = time / (60 * 60); + time %= (60 * 60); + min = time / 60; + sec = time % 60; + device_printf(adapter->dev, + "UT %02d/%02d %02d:%02d:%02d %8.8s -> %7.7s\n", + mon, days, hours, min, sec, event_str[event], + action_str[action]); + cmd = BYPASS_PAGE_CTL2 | BYPASS_WE | BYPASS_CTL2_RW; + cmd |= ((eeprom[count].clear_off + 3) + << BYPASS_CTL2_OFFSET_SHIFT) & BYPASS_CTL2_OFFSET_M; + cmd |= ((eeprom[count].logs & ~BYPASS_LOG_CLEAR_M) >> 24); + + ixgbe_bypass_mutex_enter(adapter); + + error = hw->mac.ops.bypass_rw(hw, cmd, &status); + + /* wait for the write to stick */ + msec_delay(100); + + ixgbe_bypass_mutex_clear(adapter); + + if (error) + return (-EINVAL); + } + + status = 0; /* reset */ + /* Another log command can now run */ + while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0) + usec_delay(3000); + return(error); + +unlock_err: + ixgbe_bypass_mutex_clear(adapter); + status = 0; /* reset */ + while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0) + usec_delay(3000); + return (-EINVAL); +} /* ixgbe_bp_log */ + +/************************************************************************ + * ixgbe_bypass_init - Set up infrastructure for the bypass feature + * + * Do time and sysctl initialization here. This feature is + * only enabled for the first port of a bypass adapter. + ************************************************************************/ +void +ixgbe_bypass_init(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + device_t dev = adapter->dev; + struct sysctl_oid *bp_node; + struct sysctl_oid_list *bp_list; + u32 mask, value, sec, year; + + if (!(adapter->feat_cap & IXGBE_FEATURE_BYPASS)) + return; + + /* First set up time for the hardware */ + ixgbe_get_bypass_time(&year, &sec); + + mask = BYPASS_CTL1_TIME_M + | BYPASS_CTL1_VALID_M + | BYPASS_CTL1_OFFTRST_M; + + value = (sec & BYPASS_CTL1_TIME_M) + | BYPASS_CTL1_VALID + | BYPASS_CTL1_OFFTRST; + + ixgbe_bypass_mutex_enter(adapter); + hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL1, mask, value); + ixgbe_bypass_mutex_clear(adapter); + + /* Now set up the SYSCTL infrastructure */ + + /* + * The log routine is kept separate from the other + * children so a general display command like: + * `sysctl dev.ix.0.bypass` will not show the log. + */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "bypass_log", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_log, "I", "Bypass Log"); + + /* All other setting are hung from the 'bypass' node */ + bp_node = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "bypass", CTLFLAG_RD, NULL, "Bypass"); + + bp_list = SYSCTL_CHILDREN(bp_node); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "version", CTLTYPE_INT | CTLFLAG_RD, + adapter, 0, ixgbe_bp_version, "I", "Bypass Version"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_set_state, "I", "Bypass State"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "timeout", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_timeout, "I", "Bypass Timeout"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "main_on", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_main_on, "I", "Bypass Main On"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "main_off", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_main_off, "I", "Bypass Main Off"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "aux_on", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_aux_on, "I", "Bypass Aux On"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "aux_off", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_aux_off, "I", "Bypass Aux Off"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "wd_set", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_bp_wd_set, "I", "Set BP Watchdog"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, + OID_AUTO, "wd_reset", CTLTYPE_INT | CTLFLAG_WR, + adapter, 0, ixgbe_bp_wd_reset, "S", "Bypass WD Reset"); + + adapter->feat_en |= IXGBE_FEATURE_BYPASS; + + return; +} /* ixgbe_bypass_init */ + Copied: stable/11/sys/dev/ixgbe/if_fdir.c (from r320688, head/sys/dev/ixgbe/if_fdir.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/ixgbe/if_fdir.c Tue Jul 11 21:25:07 2017 (r320897, copy of r320688, head/sys/dev/ixgbe/if_fdir.c) @@ -0,0 +1,160 @@ +/****************************************************************************** + + Copyright (c) 2001-2017, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "ixgbe.h" + +#ifdef IXGBE_FDIR + +void +ixgbe_init_fdir(struct adapter *adapter) +{ + u32 hdrm = 32 << fdir_pballoc; + + if (!(adapter->feat_en & IXGBE_FEATURE_FDIR)) + return; + + adapter->hw.mac.ops.setup_rxpba(&adapter->hw, 0, hdrm, + PBA_STRATEGY_EQUAL); + ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); +} /* ixgbe_init_fdir */ + +void +ixgbe_reinit_fdir(void *context, int pending) +{ + struct adapter *adapter = context; + struct ifnet *ifp = adapter->ifp; + + if (!(adapter->feat_en & IXGBE_FEATURE_FDIR)) + return; + if (adapter->fdir_reinit != 1) /* Shouldn't happen */ + return; + ixgbe_reinit_fdir_tables_82599(&adapter->hw); + adapter->fdir_reinit = 0; + /* re-enable flow director interrupts */ + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR); + /* Restart the interface */ + ifp->if_drv_flags |= IFF_DRV_RUNNING; +} /* ixgbe_reinit_fdir */ + +/************************************************************************ + * ixgbe_atr + * + * Parse packet headers so that Flow Director can make + * a hashed filter table entry allowing traffic flows + * to be identified and kept on the same cpu. This + * would be a performance hit, but we only do it at + * IXGBE_FDIR_RATE of packets. + ************************************************************************/ +void +ixgbe_atr(struct tx_ring *txr, struct mbuf *mp) +{ + struct adapter *adapter = txr->adapter; + struct ix_queue *que; + struct ip *ip; + struct tcphdr *th; + struct udphdr *uh; + struct ether_vlan_header *eh; + union ixgbe_atr_hash_dword input = {.dword = 0}; + union ixgbe_atr_hash_dword common = {.dword = 0}; + int ehdrlen, ip_hlen; + u16 etype; + + eh = mtod(mp, struct ether_vlan_header *); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + etype = eh->evl_proto; + } else { + ehdrlen = ETHER_HDR_LEN; + etype = eh->evl_encap_proto; + } + + /* Only handling IPv4 */ + if (etype != htons(ETHERTYPE_IP)) + return; + + ip = (struct ip *)(mp->m_data + ehdrlen); + ip_hlen = ip->ip_hl << 2; + + /* check if we're UDP or TCP */ + switch (ip->ip_p) { + case IPPROTO_TCP: + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + /* src and dst are inverted */ + common.port.dst ^= th->th_sport; + common.port.src ^= th->th_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_TCPV4; + break; + case IPPROTO_UDP: + uh = (struct udphdr *)((caddr_t)ip + ip_hlen); + /* src and dst are inverted */ + common.port.dst ^= uh->uh_sport; + common.port.src ^= uh->uh_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_UDPV4; + break; + default: + return; + } + + input.formatted.vlan_id = htobe16(mp->m_pkthdr.ether_vtag); + if (mp->m_pkthdr.ether_vtag) + common.flex_bytes ^= htons(ETHERTYPE_VLAN); + else + common.flex_bytes ^= etype; + common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr; + + que = &adapter->queues[txr->me]; + /* + * This assumes the Rx queue and Tx + * queue are bound to the same CPU + */ + ixgbe_fdir_add_signature_filter_82599(&adapter->hw, + input, common, que->msix); +} /* ixgbe_atr */ + +#else + +/* TASK_INIT needs this function defined regardless if it's enabled */ +void +ixgbe_reinit_fdir(void *context, int pending) +{ + UNREFERENCED_2PARAMETER(context, pending); +} /* ixgbe_reinit_fdir */ + +void +ixgbe_atr(struct tx_ring *txr, struct mbuf *mp) +{ + UNREFERENCED_2PARAMETER(txr, mp); +} /* ixgbe_atr */ + +#endif Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Tue Jul 11 18:24:05 2017 (r320896) +++ stable/11/sys/dev/ixgbe/if_ix.c Tue Jul 11 21:25:07 2017 (r320897) @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2017, Intel Corporation All rights reserved. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jul 11 21:47:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C16DACA95; Tue, 11 Jul 2017 21:47:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED7B68F26; Tue, 11 Jul 2017 21:47:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2148510AB01; Tue, 11 Jul 2017 17:47:19 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Edward Tomasz Napierala , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320803 - head/sbin/mount Date: Tue, 11 Jul 2017 14:47:02 -0700 Message-ID: <5242112.0aHCQARnit@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <1499805315.45330.14.camel@freebsd.org> References: <20170708171641.GA1129@brick> <20170711201230.GB1725@brick> <1499805315.45330.14.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 11 Jul 2017 17:47:19 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 21:47:21 -0000 On Tuesday, July 11, 2017 02:35:15 PM Ian Lepore wrote: > I think the docs on this are pretty clear... under -u it says: > > The set of options is determined by applying the options specified > in the argument to -o and finally applying the -r or -w option. > > To me, that says that nothing in /etc/fstab is germane to mount -u > unless one of the other args to mount -u is -o fstab. > > This change (r320803) seems like an acceptable workaround, but I think > the correct long term fix would be to not even open /etc/fstab on mount > -u without -o fstab. But that may be harder to do than to say; I still > haven't actually looked at the code involved. I concur with this. I've always viewed '-u' as meaning "apply a delta to the current configuration", not "add this delta to the fstab options and then apply that entire set of options". In practice, it seems that it doesn't do either of those, but instead it seems to treats the options passed to -o as the entire list of options. This is perhaps a bit surprising. For example, suppose you had this: /etc/fstab: /dev/md0 /bar ufs ro,noauto,noexec 0 0 # mount /bar # mount | grep bar /dev/md0 on /bar (ufs, local, noexec, read-only) # mount -u -o rw /bar /dev/md0 on /bar (ufs, local) (We just lost "noexec" from fstab by upgrading to read-write) # mount -u -o nosuid /bar # mount | grep bar /dev/md0 on /bar (ufs, local, nosuid) (Did not lose "read-write" somehow, RO vs RW must be magically sticky?) # mount -u -o fstab,nosuid /bar # mount |grep bar /dev/md0 on /bar (ufs, local, noexec, nosuid) (Did not honor "ro" from fstab! Left mount RW) It would seem that there is no actual rhyme or reason to how mount -u works, and certainly Edward's change doesn't make it worse. I would like to have some kind of mode where you can toggle one or more options without disturbing others. Maybe if we had a new "special" option called "current" or some such that is like "fstab" but instead represents the options currently in force, then you could do true delta operations via 'mount -o current,rw -u /foo'. As it is, there doesn't currently seem to a reliable way to achieve that functionality. (I started this mail expecting that '-u' operated by performing deltas against the current configuration and was quite Astonished to discover the actual behavior. It seems very unsafe to use mount -u if you have any options in your fstab outside of things like "noauto" or "late".) -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jul 11 21:51:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F5ECDACCA7; Tue, 11 Jul 2017 21:51:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E8AF6A455; Tue, 11 Jul 2017 21:51:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6BLphKD006384; Tue, 11 Jul 2017 21:51:43 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BLphMS006383; Tue, 11 Jul 2017 21:51:43 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707112151.v6BLphMS006383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 11 Jul 2017 21:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320898 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/sdhci X-SVN-Commit-Revision: 320898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 21:51:44 -0000 Author: marius Date: Tue Jul 11 21:51:43 2017 New Revision: 320898 URL: https://svnweb.freebsd.org/changeset/base/320898 Log: MFC: r320577, r320620 Retry up to 2 ms to enable bus power as at least with some Intel SDHCI/eMMC controllers the first attempt after a D3 to D0 transition, i. e. when the firmware has put the devices into D3 state before, can fail. Modified: stable/11/sys/dev/sdhci/sdhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Tue Jul 11 21:25:07 2017 (r320897) +++ stable/11/sys/dev/sdhci/sdhci.c Tue Jul 11 21:51:43 2017 (r320898) @@ -366,6 +366,7 @@ sdhci_set_clock(struct sdhci_slot *slot, uint32_t cloc static void sdhci_set_power(struct sdhci_slot *slot, u_char power) { + int i; uint8_t pwr; if (slot->power == power) @@ -394,9 +395,20 @@ sdhci_set_power(struct sdhci_slot *slot, u_char power) break; } WR1(slot, SDHCI_POWER_CONTROL, pwr); - /* Turn on the power. */ + /* + * Turn on VDD1 power. Note that at least some Intel controllers can + * fail to enable bus power on the first try after transiting from D3 + * to D0, so we give them up to 2 ms. + */ pwr |= SDHCI_POWER_ON; - WR1(slot, SDHCI_POWER_CONTROL, pwr); + for (i = 0; i < 20; i++) { + WR1(slot, SDHCI_POWER_CONTROL, pwr); + if (RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON) + break; + DELAY(100); + } + if (!(RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON)) + slot_printf(slot, "Bus power failed to enable"); if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); From owner-svn-src-all@freebsd.org Tue Jul 11 21:52:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C104EDACCFF; Tue, 11 Jul 2017 21:52:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5A96A5C8; Tue, 11 Jul 2017 21:52:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6BLqB9b006446; Tue, 11 Jul 2017 21:52:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BLqBu7006445; Tue, 11 Jul 2017 21:52:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707112152.v6BLqBu7006445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 11 Jul 2017 21:52:11 +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: r320899 - stable/10/sys/dev/sdhci X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/sdhci X-SVN-Commit-Revision: 320899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 21:52:12 -0000 Author: marius Date: Tue Jul 11 21:52:11 2017 New Revision: 320899 URL: https://svnweb.freebsd.org/changeset/base/320899 Log: MFC: r320577, r320620 Retry up to 2 ms to enable bus power as at least with some Intel SDHCI/eMMC controllers the first attempt after a D3 to D0 transition, i. e. when the firmware has put the devices into D3 state before, can fail. Modified: stable/10/sys/dev/sdhci/sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Tue Jul 11 21:51:43 2017 (r320898) +++ stable/10/sys/dev/sdhci/sdhci.c Tue Jul 11 21:52:11 2017 (r320899) @@ -367,6 +367,7 @@ sdhci_set_clock(struct sdhci_slot *slot, uint32_t cloc static void sdhci_set_power(struct sdhci_slot *slot, u_char power) { + int i; uint8_t pwr; if (slot->power == power) @@ -395,9 +396,20 @@ sdhci_set_power(struct sdhci_slot *slot, u_char power) break; } WR1(slot, SDHCI_POWER_CONTROL, pwr); - /* Turn on the power. */ + /* + * Turn on VDD1 power. Note that at least some Intel controllers can + * fail to enable bus power on the first try after transiting from D3 + * to D0, so we give them up to 20 ms. + */ pwr |= SDHCI_POWER_ON; - WR1(slot, SDHCI_POWER_CONTROL, pwr); + for (i = 0; i < 20; i++) { + WR1(slot, SDHCI_POWER_CONTROL, pwr); + if (RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON) + break; + DELAY(100); + } + if (!(RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON)) + slot_printf(slot, "Bus power failed to enable"); if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); From owner-svn-src-all@freebsd.org Tue Jul 11 21:55:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8631DACD90; Tue, 11 Jul 2017 21:55:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E026A773; Tue, 11 Jul 2017 21:55:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6BLtLAF006627; Tue, 11 Jul 2017 21:55:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6BLtKbZ006618; Tue, 11 Jul 2017 21:55:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707112155.v6BLtKbZ006618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jul 2017 21:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320900 - in head/sys: fs/cd9660 fs/ext2fs fs/fifofs fs/msdosfs fs/nandfs fs/nfsclient fs/smbfs fs/tmpfs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: fs/cd9660 fs/ext2fs fs/fifofs fs/msdosfs fs/nandfs fs/nfsclient fs/smbfs fs/tmpfs ufs/ufs X-SVN-Commit-Revision: 320900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 21:55:22 -0000 Author: jhb Date: Tue Jul 11 21:55:20 2017 New Revision: 320900 URL: https://svnweb.freebsd.org/changeset/base/320900 Log: Consistently use vop_stdpathconf() for default pathconf values. Update filesystems not currently using vop_stdpathconf() in pathconf VOPs to use vop_stdpathconf() for any configuration variables that do not have filesystem-specific values. vop_stdpathconf() is used for variables that have system-wide settings as well as providing default values for some values based on system limits. Filesystems can still explicitly override individual settings. PR: 219851 Reported by: cem Reviewed by: cem, kib, ngie MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D11541 Modified: head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -792,20 +792,11 @@ cd9660_pathconf(ap) else *ap->a_retval = 37; return (0); - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - return (0); - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - return (0); - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - return (0); case _PC_NO_TRUNC: *ap->a_retval = 1; return (0); default: - return (EINVAL); + return (vop_stdpathconf(ap)); } /* NOTREACHED */ } Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -1627,18 +1627,6 @@ ext2_pathconf(struct vop_pathconf_args *ap) else *ap->a_retval = ext2_max_nlink(VTOI(ap->a_vp)); break; - case _PC_NAME_MAX: - *ap->a_retval = NAME_MAX; - break; - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - break; - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - break; - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; @@ -1661,11 +1649,6 @@ ext2_pathconf(struct vop_pathconf_args *ap) case _PC_MIN_HOLE_SIZE: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; break; - case _PC_ASYNC_IO: - /* _PC_ASYNC_IO should have been handled by upper layers. */ - KASSERT(0, ("_PC_ASYNC_IO should not get here")); - error = EINVAL; - break; case _PC_PRIO_IO: *ap->a_retval = 0; break; @@ -1695,7 +1678,7 @@ ext2_pathconf(struct vop_pathconf_args *ap) break; default: - error = EINVAL; + error = vop_stdpathconf(ap); break; } return (error); Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -71,7 +71,6 @@ struct fifoinfo { static vop_print_t fifo_print; static vop_open_t fifo_open; static vop_close_t fifo_close; -static vop_pathconf_t fifo_pathconf; static vop_advlock_t fifo_advlock; struct vop_vector fifo_specops = { @@ -87,7 +86,7 @@ struct vop_vector fifo_specops = { .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, .vop_open = fifo_open, - .vop_pathconf = fifo_pathconf, + .vop_pathconf = vop_stdpathconf, .vop_print = fifo_print, .vop_read = VOP_PANIC, .vop_readdir = VOP_PANIC, @@ -337,34 +336,6 @@ fifo_print(ap) fifo_printinfo(ap->a_vp); printf("\n"); return (0); -} - -/* - * Return POSIX pathconf information applicable to fifo's. - */ -static int -fifo_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - int *a_retval; - } */ *ap; -{ - - switch (ap->a_name) { - case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; - return (0); - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - return (0); - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - return (0); - default: - return (EINVAL); - } - /* NOTREACHED */ } /* Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -1875,17 +1875,11 @@ msdosfs_pathconf(struct vop_pathconf_args *ap) case _PC_NAME_MAX: *ap->a_retval = pmp->pm_flags & MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12; return (0); - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - return (0); - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - return (0); case _PC_NO_TRUNC: *ap->a_retval = 0; return (0); default: - return (EINVAL); + return (vop_stdpathconf(ap)); } /* NOTREACHED */ } Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/nandfs/nandfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -2236,21 +2236,6 @@ nandfs_pathconf(struct vop_pathconf_args *ap) error = 0; switch (ap->a_name) { - case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; - break; - case _PC_NAME_MAX: - *ap->a_retval = NAME_MAX; - break; - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - break; - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - break; - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; @@ -2273,7 +2258,7 @@ nandfs_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; break; default: - error = EINVAL; + error = vop_stdpathconf(ap); break; } return (error); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -3481,12 +3481,6 @@ nfs_pathconf(struct vop_pathconf_args *ap) case _PC_NAME_MAX: *ap->a_retval = pc.pc_namemax; break; - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - break; - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = pc.pc_chownrestricted; break; @@ -3512,11 +3506,6 @@ nfs_pathconf(struct vop_pathconf_args *ap) case _PC_MAC_PRESENT: *ap->a_retval = 0; break; - case _PC_ASYNC_IO: - /* _PC_ASYNC_IO should have been handled by upper layers. */ - KASSERT(0, ("_PC_ASYNC_IO should not get here")); - error = EINVAL; - break; case _PC_PRIO_IO: *ap->a_retval = 0; break; @@ -3549,7 +3538,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) break; default: - error = EINVAL; + error = vop_stdpathconf(ap); break; } return (error); Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/smbfs/smbfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -907,7 +907,7 @@ smbfs_pathconf (ap) *retval = 800; /* XXX: a correct one ? */ break; default: - error = EINVAL; + error = vop_stdpathconf(ap); } return error; } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -1344,26 +1344,6 @@ tmpfs_pathconf(struct vop_pathconf_args *v) error = 0; switch (name) { - case _PC_LINK_MAX: - *retval = LINK_MAX; - break; - - case _PC_NAME_MAX: - *retval = NAME_MAX; - break; - - case _PC_PATH_MAX: - *retval = PATH_MAX; - break; - - case _PC_PIPE_BUF: - *retval = PIPE_BUF; - break; - - case _PC_CHOWN_RESTRICTED: - *retval = 1; - break; - case _PC_NO_TRUNC: *retval = 1; break; @@ -1377,7 +1357,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v) break; default: - error = EINVAL; + error = vop_stdpathconf(v); } return error; Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) @@ -2442,21 +2442,9 @@ ufs_pathconf(ap) error = 0; switch (ap->a_name) { - case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; - break; case _PC_NAME_MAX: *ap->a_retval = UFS_MAXNAMLEN; break; - case _PC_PATH_MAX: - *ap->a_retval = PATH_MAX; - break; - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - break; - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; @@ -2505,11 +2493,6 @@ ufs_pathconf(ap) case _PC_MIN_HOLE_SIZE: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; break; - case _PC_ASYNC_IO: - /* _PC_ASYNC_IO should have been handled by upper layers. */ - KASSERT(0, ("_PC_ASYNC_IO should not get here")); - error = EINVAL; - break; case _PC_PRIO_IO: *ap->a_retval = 0; break; @@ -2539,7 +2522,7 @@ ufs_pathconf(ap) break; default: - error = EINVAL; + error = vop_stdpathconf(ap); break; } return (error); From owner-svn-src-all@freebsd.org Wed Jul 12 02:42:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8398DB12BF; Wed, 12 Jul 2017 02:42:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945E3755D4; Wed, 12 Jul 2017 02:42:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6C2gvXL026202; Wed, 12 Jul 2017 02:42:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C2gvDB026199; Wed, 12 Jul 2017 02:42:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707120242.v6C2gvDB026199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Jul 2017 02:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320901 - in head/sys: amd64/amd64 isa x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: amd64/amd64 isa x86/isa X-SVN-Commit-Revision: 320901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 02:42:58 -0000 Author: ian Date: Wed Jul 12 02:42:57 2017 New Revision: 320901 URL: https://svnweb.freebsd.org/changeset/base/320901 Log: Protect access to the AT realtime clock with its own mutex. The mutex protecting access to the registered realtime clock should not be overloaded to protect access to the atrtc hardware, which might not even be the registered rtc. More importantly, the resettodr mutex needs to be eliminated to remove locking/sleeping restrictions on clock drivers, and that can't happen if MD code for amd64 depends on it. This change moves the protection into what's really being protected: access to the atrtc date and time registers. This change also adds protection when the clock is accessed from xentimer_settime(), which bypasses the resettodr locking. Differential Revision: https://reviews.freebsd.org/D11483 Modified: head/sys/amd64/amd64/efirt.c head/sys/isa/rtc.h head/sys/x86/isa/atrtc.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Tue Jul 11 21:55:20 2017 (r320900) +++ head/sys/amd64/amd64/efirt.c Wed Jul 12 02:42:57 2017 (r320901) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -445,7 +446,7 @@ efi_get_time_locked(struct efi_tm *tm) efi_status status; int error; - mtx_assert(&resettodr_lock, MA_OWNED); + mtx_assert(&atrtc_time_lock, MA_OWNED); error = efi_enter(); if (error != 0) return (error); @@ -462,9 +463,9 @@ efi_get_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - mtx_lock(&resettodr_lock); + mtx_lock(&atrtc_time_lock); error = efi_get_time_locked(tm); - mtx_unlock(&resettodr_lock); + mtx_unlock(&atrtc_time_lock); return (error); } @@ -487,7 +488,7 @@ efi_set_time_locked(struct efi_tm *tm) efi_status status; int error; - mtx_assert(&resettodr_lock, MA_OWNED); + mtx_assert(&atrtc_time_lock, MA_OWNED); error = efi_enter(); if (error != 0) return (error); @@ -504,9 +505,9 @@ efi_set_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - mtx_lock(&resettodr_lock); + mtx_lock(&atrtc_time_lock); error = efi_set_time_locked(tm); - mtx_unlock(&resettodr_lock); + mtx_unlock(&atrtc_time_lock); return (error); } Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Tue Jul 11 21:55:20 2017 (r320900) +++ head/sys/isa/rtc.h Wed Jul 12 02:42:57 2017 (r320901) @@ -113,6 +113,7 @@ #ifdef _KERNEL extern struct mtx clock_lock; +extern struct mtx atrtc_time_lock; extern int atrtcclock_disable; int rtcin(int reg); void atrtc_restore(void); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jul 11 21:55:20 2017 (r320900) +++ head/sys/x86/isa/atrtc.c Wed Jul 12 02:42:57 2017 (r320901) @@ -53,9 +53,17 @@ __FBSDID("$FreeBSD$"); #include #include "clock_if.h" +/* + * clock_lock protects low-level access to individual hardware registers. + * atrtc_time_lock protects the entire sequence of accessing multiple registers + * to read or write the date and time. + */ #define RTC_LOCK do { if (!kdb_active) mtx_lock_spin(&clock_lock); } while (0) #define RTC_UNLOCK do { if (!kdb_active) mtx_unlock_spin(&clock_lock); } while (0) +struct mtx atrtc_time_lock; +MTX_SYSINIT(atrtc_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); + int atrtcclock_disable = 0; static int rtc_reg = -1; @@ -163,6 +171,8 @@ atrtc_set(struct timespec *ts) clock_ts_to_ct(ts, &ct); + mtx_lock(&atrtc_time_lock); + /* Disable RTC updates and interrupts. */ writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); @@ -181,6 +191,8 @@ atrtc_set(struct timespec *ts) /* Re-enable RTC updates and interrupts. */ writertc(RTC_STATUSB, rtc_statusb); rtcin(RTC_INTR); + + mtx_unlock(&atrtc_time_lock); } /********************************************************************** @@ -352,6 +364,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) * to make sure that no more than 240us pass after we start reading, * and try again if so. */ + mtx_lock(&atrtc_time_lock); while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; critical_enter(); @@ -369,6 +382,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) ct.year += (ct.year < 80 ? 2000 : 1900); #endif critical_exit(); + mtx_unlock(&atrtc_time_lock); /* Set dow = -1 because some clocks don't set it correctly. */ ct.dow = -1; return (clock_ct_to_ts(&ct, ts)); From owner-svn-src-all@freebsd.org Wed Jul 12 02:53:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB15DB162B; Wed, 12 Jul 2017 02:53:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC20675C31; Wed, 12 Jul 2017 02:53:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6C2rtwK030632; Wed, 12 Jul 2017 02:53:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C2rs2W030630; Wed, 12 Jul 2017 02:53:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707120253.v6C2rs2W030630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Jul 2017 02:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320902 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 320902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 02:53:56 -0000 Author: ian Date: Wed Jul 12 02:53:54 2017 New Revision: 320902 URL: https://svnweb.freebsd.org/changeset/base/320902 Log: Support multiple realtime clocks, and remove locking/sleeping restrictions on clock drivers. This tracks multiple concurrent realtime clock drivers in a list sorted by clock resolution. When system time changes (and periodically) the clock_settime() methods of all registered clocks are invoked. To initialize system time, each driver is tried in turn from best to worst resolution, until one succesfully returns a valid time. The code no longer holds a mutex while calling the clock_settime() and clock_gettime() methods of the registered clocks. This allows clock drivers to do whatever kind of locking or sleeping is necessary (this is especially important for i2c clock chips since i2c drivers often need to sleep). A new clock_register_flags() function allows the clock driver to pass flags. The flags currently defined help support drivers that use their own techniques to avoid roundoff errors (prevents the 4/5 rounding done by the subr_rtc code). A driver which may need to wait for resources (such as bus ownership) may pass a flag to indicate that it will obtain system time for itself after waiting for resources; this is merely an optimization to avoid the common code retrieving a timespec that will never get used. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11484 Modified: head/sys/kern/subr_rtc.c head/sys/sys/clock.h Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Wed Jul 12 02:42:57 2017 (r320901) +++ head/sys/kern/subr_rtc.c Wed Jul 12 02:53:54 2017 (r320902) @@ -63,8 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include +#include #include +#include #ifdef FFCLOCK #include #endif @@ -72,116 +74,210 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" -static device_t clock_dev = NULL; -static long clock_res; -static struct timespec clock_adj; -struct mtx resettodr_lock; -MTX_SYSINIT(resettodr_init, &resettodr_lock, "tod2rl", MTX_DEF); - /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, 0, "Disallow adjusting time-of-day clock"); +/* + * An instance of a realtime clock. A list of these tracks all the registered + * clocks in the system. + * + * The resadj member is used to apply a "resolution adjustment" equal to half + * the clock's resolution, which is useful mainly on clocks with a whole-second + * resolution. Because the clock truncates the fractional part, adding half the + * resolution performs 4/5 rounding. The same adjustment is applied to the + * times returned from clock_gettime(), because the fraction returned will + * always be zero, but on average the actual fraction at the time of the call + * should be about .5. + */ +struct rtc_instance { + device_t clockdev; + int resolution; + int flags; + struct timespec resadj; + LIST_ENTRY(rtc_instance) + rtc_entries; +}; + +/* + * Clocks are updated using a task running on taskqueue_thread. + */ +static void settime_task_func(void *arg, int pending); +static struct task settime_task = TASK_INITIALIZER(0, settime_task_func, NULL); + +/* + * Registered clocks are kept in a list which is sorted by resolution; the more + * accurate clocks get the first shot at providing the time. + */ +LIST_HEAD(rtc_listhead, rtc_instance); +static struct rtc_listhead rtc_list = LIST_HEAD_INITIALIZER(rtc_list); +static struct sx rtc_list_lock; +SX_SYSINIT(rtc_list_lock_init, &rtc_list_lock, "rtc list"); + +/* + * On the task thread, invoke the clock_settime() method of each registered + * clock. Do so holding only an sxlock, so that clock drivers are free to do + * whatever kind of locking or sleeping they need to. + */ +static void +settime_task_func(void *arg, int pending) +{ + struct timespec ts; + struct rtc_instance *rtc; + + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) { + getnanotime(&ts); + if (!(rtc->flags & CLOCKF_SETTIME_NO_ADJ)) { + ts.tv_sec -= utc_offset(); + timespecadd(&ts, &rtc->resadj); + } + } else { + ts.tv_sec = 0; + ts.tv_nsec = 0; + } + CLOCK_SETTIME(rtc->clockdev, &ts); + } + sx_xunlock(&rtc_list_lock); +} + void -clock_register(device_t dev, long res) /* res has units of microseconds */ +clock_register_flags(device_t clockdev, long resolution, int flags) { + struct rtc_instance *rtc, *newrtc; - if (clock_dev != NULL) { - if (clock_res <= res) { - if (bootverbose) - device_printf(dev, "not installed as " - "time-of-day clock: clock %s has higher " - "resolution\n", device_get_name(clock_dev)); - return; + newrtc = malloc(sizeof(*newrtc), M_DEVBUF, M_WAITOK); + newrtc->clockdev = clockdev; + newrtc->resolution = (int)resolution; + newrtc->flags = flags; + newrtc->resadj.tv_sec = newrtc->resolution / 2 / 1000000; + newrtc->resadj.tv_nsec = newrtc->resolution / 2 % 1000000 * 1000; + + sx_xlock(&rtc_list_lock); + if (LIST_EMPTY(&rtc_list)) { + LIST_INSERT_HEAD(&rtc_list, newrtc, rtc_entries); + } else { + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if (rtc->resolution > newrtc->resolution) { + LIST_INSERT_BEFORE(rtc, newrtc, rtc_entries); + break; + } else if (LIST_NEXT(rtc, rtc_entries) == NULL) { + LIST_INSERT_AFTER(rtc, newrtc, rtc_entries); + break; + } } - if (bootverbose) - device_printf(clock_dev, "removed as " - "time-of-day clock: clock %s has higher " - "resolution\n", device_get_name(dev)); } - clock_dev = dev; - clock_res = res; - clock_adj.tv_sec = res / 2 / 1000000; - clock_adj.tv_nsec = res / 2 % 1000000 * 1000; - if (bootverbose) - device_printf(dev, "registered as a time-of-day clock " - "(resolution %ldus, adjustment %jd.%09jds)\n", res, - (intmax_t)clock_adj.tv_sec, (intmax_t)clock_adj.tv_nsec); + sx_xunlock(&rtc_list_lock); + + device_printf(clockdev, + "registered as a time-of-day clock, resolution %d.%6.6ds\n", + newrtc->resolution / 1000000, newrtc->resolution % 1000000); } -/* - * inittodr and settodr derived from the i386 versions written - * by Christoph Robitschko , reintroduced and - * updated by Chris Stenton 8/10/94 - */ +void +clock_register(device_t dev, long res) +{ + clock_register_flags(dev, res, 0); +} + +void +clock_unregister(device_t clockdev) +{ + struct rtc_instance *rtc, *tmp; + + sx_xlock(&rtc_list_lock); + LIST_FOREACH_SAFE(rtc, &rtc_list, rtc_entries, tmp) { + if (rtc->clockdev == clockdev) { + LIST_REMOVE(rtc, rtc_entries); + free(rtc, M_DEVBUF); + } + } + sx_xunlock(&rtc_list_lock); +} + /* - * Initialize the time of day register, based on the time base which is, e.g. - * from a filesystem. + * Initialize the system time. Must be called from a context which does not + * restrict any locking or sleeping that clock drivers may need to do. + * + * First attempt to get the time from a registered realtime clock. The clocks + * are queried in order of resolution until one provides the time. If no clock + * can provide the current time, use the 'base' time provided by the caller, if + * non-zero. The 'base' time is potentially highly inaccurate, such as the last + * known good value of the system clock, or even a filesystem last-updated + * timestamp. It is used to prevent system time from appearing to move + * backwards in logs. */ void inittodr(time_t base) { struct timespec ts; + struct rtc_instance *rtc; int error; - if (clock_dev == NULL) { - printf("warning: no time-of-day clock registered, system time " - "will not be set accurately\n"); - goto wrong_time; + error = ENXIO; + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if ((error = CLOCK_GETTIME(rtc->clockdev, &ts)) != 0) + continue; + if (ts.tv_sec < 0 || ts.tv_nsec < 0) { + error = EINVAL; + continue; + } + if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) { + timespecadd(&ts, &rtc->resadj); + ts.tv_sec += utc_offset(); + } + if (bootverbose) + device_printf(rtc->clockdev, + "providing initial system time\n"); + break; } - /* XXX: We should poll all registered RTCs in case of failure */ - mtx_lock(&resettodr_lock); - error = CLOCK_GETTIME(clock_dev, &ts); - mtx_unlock(&resettodr_lock); - if (error != 0 && error != EINVAL) { - printf("warning: clock_gettime failed (%d), the system time " - "will not be set accurately\n", error); - goto wrong_time; + sx_xunlock(&rtc_list_lock); + + /* + * Do not report errors from each clock; it is expected that some clocks + * cannot provide results in some situations. Only report problems when + * no clocks could provide the time. + */ + if (error != 0) { + switch (error) { + case ENXIO: + printf("Warning: no time-of-day clock registered, "); + break; + case EINVAL: + printf("Warning: bad time from time-of-day clock, "); + break; + default: + printf("Error reading time-of-day clock (%d), ", error); + break; + } + printf("system time will not be set accurately\n"); + ts.tv_sec = (base > 0) ? base : -1; + ts.tv_nsec = 0; } - if (error == EINVAL || ts.tv_sec < 0) { - printf("Invalid time in real time clock.\n" - "Check and reset the date immediately!\n"); - goto wrong_time; - } - ts.tv_sec += utc_offset(); - timespecadd(&ts, &clock_adj); - tc_setclock(&ts); + if (ts.tv_sec >= 0) { + tc_setclock(&ts); #ifdef FFCLOCK - ffclock_reset_clock(&ts); + ffclock_reset_clock(&ts); #endif - return; - -wrong_time: - if (base > 0) { - ts.tv_sec = base; - ts.tv_nsec = 0; - tc_setclock(&ts); } } /* - * Write system time back to RTC + * Write system time back to all registered clocks, unless disabled by admin. + * This can be called from a context that restricts locking and/or sleeping; the + * actual updating is done asynchronously on a task thread. */ void resettodr(void) { - struct timespec ts; - int error; - if (disable_rtc_set || clock_dev == NULL) + if (disable_rtc_set) return; - getnanotime(&ts); - timespecadd(&ts, &clock_adj); - ts.tv_sec -= utc_offset(); - /* XXX: We should really set all registered RTCs */ - mtx_lock(&resettodr_lock); - error = CLOCK_SETTIME(clock_dev, &ts); - mtx_unlock(&resettodr_lock); - if (error != 0) - printf("warning: clock_settime failed (%d), time-of-day clock " - "not adjusted to system time\n", error); + taskqueue_enqueue(taskqueue_thread, &settime_task); } Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Wed Jul 12 02:42:57 2017 (r320901) +++ head/sys/sys/clock.h Wed Jul 12 02:53:54 2017 (r320902) @@ -54,7 +54,6 @@ */ extern int tz_minuteswest; extern int tz_dsttime; -extern struct mtx resettodr_lock; int utc_offset(void); @@ -76,7 +75,34 @@ struct clocktime { int clock_ct_to_ts(struct clocktime *, struct timespec *); void clock_ts_to_ct(struct timespec *, struct clocktime *); -void clock_register(device_t, long); + +/* + * Time-of-day clock register/unregister functions, and associated flags. These + * functions can sleep. Upon return from unregister, the clock's methods are + * not running and will not be called again. + * + * Flags: + * + * CLOCKF_SETTIME_NO_TS + * Do not pass a timespec to clock_settime(), the driver obtains its own time + * and applies its own adjustments (this flag implies CLOCKF_SETTIME_NO_ADJ). + * + * CLOCKF_SETTIME_NO_ADJ + * Do not apply utc offset and resolution/accuracy adjustments to the value + * passed to clock_settime(), the driver applies them itself. + * + * CLOCKF_GETTIME_NO_ADJ + * Do not apply utc offset and resolution/accuracy adjustments to the value + * returned from clock_gettime(), the driver has already applied them. + */ + +#define CLOCKF_SETTIME_NO_TS 0x00000001 +#define CLOCKF_SETTIME_NO_ADJ 0x00000002 +#define CLOCKF_GETTIME_NO_ADJ 0x00000004 + +void clock_register(device_t _clockdev, long _resolution_us); +void clock_register_flags(device_t _clockdev, long _resolution_us, int _flags); +void clock_unregister(device_t _clockdev); /* * BCD to decimal and decimal to BCD. From owner-svn-src-all@freebsd.org Wed Jul 12 06:08:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8533DDB3BF1; Wed, 12 Jul 2017 06:08:20 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1497A95E; Wed, 12 Jul 2017 06:08:20 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 99A22493; Tue, 11 Jul 2017 23:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1499839699; bh=zVVOlvq+HMluN8cFh0BkLWYTHfzE1LlOP+HMLm2ROyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CRQZ0y8l+tzJEC5xHK1VtMgfGO5RWgMIOLoWzaeLGdjRzMnNFmYlzvuQd2qoBTQ3K jrS7NxYf2wrNNowRcsqXw0k5Ow6iDS5eV3R08YsddVUclwoVbNjrgk/MMxSnIvxIcU En4O2l70DX83ACEK1DnScUp4pttO3gD8ePtj6J0Y= From: Peter Wemm To: Andriy Gapon Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r320452 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Date: Tue, 11 Jul 2017 23:08:15 -0700 Message-ID: <2865573.6VCVxXl8ZR@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <201706281359.v5SDxKDB033681@repo.freebsd.org> References: <201706281359.v5SDxKDB033681@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4989529.jmlK0HNQCM"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 06:08:20 -0000 --nextPart4989529.jmlK0HNQCM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Wednesday, June 28, 2017 01:59:20 PM Andriy Gapon wrote: > A side bonus of this change is that now a vdev zio has a pointer > to its corresponding bio while the zio is active. > @@ -1094,6 +1088,15 @@ sendreq: > static void > vdev_geom_io_done(zio_t *zio) > { > +=09struct bio *bp =3D zio->io_bio; > + > +=09if (zio->io_type =3D=3D ZIO_TYPE_READ) { > +=09=09abd_return_buf_copy(zio->io_abd, bp->bio_data, zio->io_size); > +=09} else if (zio->io_type =3D=3D ZIO_TYPE_WRITE) { > +=09=09abd_return_buf(zio->io_abd, bp->bio_data, zio->io_size); > +=09} > + > +=09g_destroy_bio(bp); > } We are getting a 100% repeatable failure when trying to boot machines w= ith=20 degraded volumes in the freebsd.org cluster. <118>Setting hostname: tiny.nyi.freebsd.org. <118>Setting up harvesting: [UMA], [FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,D <118>Feeding entropy: . Fatal trap 12: page fault while in kernel mode cpuid =3D 1; apic id =3D 01 fault virtual address=09=3D 0x28 Fatal trap 12: page fault while in kernel mode cpuid =3D 3; apic id =3D 07 fault virtual address=09=3D 0x28 Fatal trap 12: page fault while in kernel mode cpuid =3D 2; apic id =3D 06 apic id =3D 00 fault virtual address =3D 0x28 =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, fault virtual ad= dress =20 =3D 0x28 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff803aab56 stack pointer =3D 0x28:0xfffffe0239fa3a90 fault code =3D supervisor read data, page not present IOPL =3D 0 current process =3D 0 (zio_write_intr_0) frame pointer =3D 0x28:0xfffffe0239fa3aa0 db> where =20 Tracing pid 0 tid 100471 td 0xfffff80005452000 vdev_geom_io_done() at vdev_geom_io_done+0x36/frame 0xfffffe0239f9eaa0 zio_vdev_io_done() at zio_vdev_io_done+0x176/frame 0xfffffe0239f9ead0 zio_execute() at zio_execute+0xac/frame 0xfffffe0239f9eb20 This is dereferencing a null bp (ie: zio->io_bio). It traps on multipl= e cores=20 concurrently. FreeBSD 12.0-CURRENT #0 r320900: Wed Jul 12 03:00:15 UTC 2017 (This is a smoke-test machine, recycled from somewhere else) =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart4989529.jmlK0HNQCM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAlllvM8ACgkQNdaXCeyA ngR9Vwf/dqaqhTJA8ny6hZyEsbB+lEJyfw198wADxJ+uzz9opjem/qk7wtp8dFRC zHF6JeHkQXJ9x6z2AqLeySLmoDEGCfYi6fjlZq0Qw0si8sAclgZVjIl9Vklc1aYd 3Z9cTG41RwwZsEi3oPsgx1tNWsdo3lZJAwzg9fCb2x/U+WSJlQCvOgtCEqNTgMR+ +5SeqX7vLEJ+0m0Ylf4YJbTfQC+/87TYdnlvTyYbYY8FZNODFR1gCkXNLA7uWoI2 SMM6h9HqEpg/WP4yU1nZrbg71jH5sfyV3PQcCqUcPZgZX6n8YV7Aa52kK0ndY/S5 80YWn4xVc3rqIcVm997FAWKrO7E9FA== =IFnl -----END PGP SIGNATURE----- --nextPart4989529.jmlK0HNQCM-- From owner-svn-src-all@freebsd.org Wed Jul 12 06:49:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAA1EDB44C3; Wed, 12 Jul 2017 06:49:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7AFDE7B948; Wed, 12 Jul 2017 06:49:33 +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 v6C6nWUa024932; Wed, 12 Jul 2017 06:49:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C6nW3P024931; Wed, 12 Jul 2017 06:49:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707120649.v6C6nW3P024931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Jul 2017 06:49:32 +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: r320903 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 320903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 06:49:33 -0000 Author: kib Date: Wed Jul 12 06:49:32 2017 New Revision: 320903 URL: https://svnweb.freebsd.org/changeset/base/320903 Log: MFC r320843: Fix loop termination in vm_map_find_min(). Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Jul 12 02:53:54 2017 (r320902) +++ stable/11/sys/vm/vm_map.c Wed Jul 12 06:49:32 2017 (r320903) @@ -1571,7 +1571,7 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o find_space, prot, max, cow); if (rv == KERN_SUCCESS || min_addr >= hint) return (rv); - *addr = min_addr; + *addr = hint = min_addr; } } From owner-svn-src-all@freebsd.org Wed Jul 12 06:55:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A0EDB464C; Wed, 12 Jul 2017 06:55:49 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEFB77BD2A; Wed, 12 Jul 2017 06:55:49 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 109C94A9; Tue, 11 Jul 2017 23:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1499842549; bh=a6owOUc7EccgG8pj7mgEYYCfmLJfjRQJJEShEd9KsY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l7kf/6NrRsR1DPj8efkZNGcI6NDsajlnZtosjQdOrODDC2rFSHS0oJBl7SpVDnF3a twTq/4gZbqvDpLvTj6Pdp5hAoBRuT0C6NPCgIadRUCp+HyC4seAjEW5OjT8CgzmUwq ixAD3Xn2H9KNnk6EdVZXesH6csVrtEg5MFNKzpy4= From: Peter Wemm To: Andriy Gapon Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r320452 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Date: Tue, 11 Jul 2017 23:55:47 -0700 Message-ID: <2227668.mxUYtcVILl@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <2865573.6VCVxXl8ZR@overcee.wemm.org> References: <201706281359.v5SDxKDB033681@repo.freebsd.org> <2865573.6VCVxXl8ZR@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11714779.Zx5v9CJLM2"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 06:55:50 -0000 --nextPart11714779.Zx5v9CJLM2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday, July 11, 2017 11:08:15 PM Peter Wemm wrote: > On Wednesday, June 28, 2017 01:59:20 PM Andriy Gapon wrote: > > A side bonus of this change is that now a vdev zio has a pointer > > to its corresponding bio while the zio is active. > fault virtual address =3D 0x28 >=20 > db> where > Tracing pid 0 tid 100471 td 0xfffff80005452000 > vdev_geom_io_done() at vdev_geom_io_done+0x36/frame 0xfffffe0239f9eaa= 0 > zio_vdev_io_done() at zio_vdev_io_done+0x176/frame 0xfffffe0239f9ead0= > zio_execute() at zio_execute+0xac/frame 0xfffffe0239f9eb20 Oops, truncated. taskqueue_run_locked() at taskqueue_run_locked+0x127/frame 0xfffffe0239= f9eb80 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe023= 9f9ebb0 fork_exit() at fork_exit+0x85/frame 0xfffffe0239f9ebf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0239f9ebf0 =2D-- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart11714779.Zx5v9CJLM2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAlllx/MACgkQNdaXCeyA ngShSgf/ZCeBGbpHC80AHWOQ+bxLgzVxTW9QXoSLatw3Nh6pIGOALOq7vkzJgdEd t8B1S8osadtqFN49+B1K8R66QP9fuFN+a5ZolwBfIwUZfGDobW6905qVwrNbIsjT dKNZA6+3iN4hqWEkTs5EelW6Ni6838pudzZdysckvQXd4QcG/cUFO2nRaSd6QnVu TyGjj5DLlqwMt5SeiNszjwbuY/mfclREPzxI68yYyX2AbueriqwBb5oDa1tIY+sq RKu7JJ9W3xnyx/Go/A1nPr4+OzmXJjUo21Ipd7P3pfRHtqKNhFTWofIsVE7LKsDU gebyM9tk8LIAsfrb6Dy9WaysdJcdww== =Ip/u -----END PGP SIGNATURE----- --nextPart11714779.Zx5v9CJLM2-- From owner-svn-src-all@freebsd.org Wed Jul 12 07:00:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B62DB46E5; Wed, 12 Jul 2017 07:00:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43CB57C013; Wed, 12 Jul 2017 07:00:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6C70u4s029094; Wed, 12 Jul 2017 07:00:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C70uZO029093; Wed, 12 Jul 2017 07:00:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707120700.v6C70uZO029093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Jul 2017 07:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320904 - releng/11.1/sys/vm X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.1/sys/vm X-SVN-Commit-Revision: 320904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:00:57 -0000 Author: kib Date: Wed Jul 12 07:00:56 2017 New Revision: 320904 URL: https://svnweb.freebsd.org/changeset/base/320904 Log: MFC r320843 MFS r320903: Fix loop termination in vm_map_find_min(). Approved by: re (delphij) Modified: releng/11.1/sys/vm/vm_map.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/sys/vm/vm_map.c ============================================================================== --- releng/11.1/sys/vm/vm_map.c Wed Jul 12 06:49:32 2017 (r320903) +++ releng/11.1/sys/vm/vm_map.c Wed Jul 12 07:00:56 2017 (r320904) @@ -1571,7 +1571,7 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o find_space, prot, max, cow); if (rv == KERN_SUCCESS || min_addr >= hint) return (rv); - *addr = min_addr; + *addr = hint = min_addr; } } From owner-svn-src-all@freebsd.org Wed Jul 12 07:13:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F7BDB4A12; Wed, 12 Jul 2017 07:13:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id 154F47C578; Wed, 12 Jul 2017 07:13:58 +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 v6C7DvW1037047; Wed, 12 Jul 2017 07:13:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7Dvgm037046; Wed, 12 Jul 2017 07:13:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120713.v6C7Dvgm037046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 07:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320905 - vendor-crypto/heimdal/dist/lib/krb5 X-SVN-Group: vendor-crypto X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor-crypto/heimdal/dist/lib/krb5 X-SVN-Commit-Revision: 320905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:13:58 -0000 Author: delphij Date: Wed Jul 12 07:13:56 2017 New Revision: 320905 URL: https://svnweb.freebsd.org/changeset/base/320905 Log: Import upstream fix for CVE-2017-11103: CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation In _krb5_extract_ticket() the KDC-REP service name must be obtained from encrypted version stored in 'enc_part' instead of the unencrypted version stored in 'ticket'. Use of the unecrypted version provides an opportunity for successful server impersonation and other attacks. Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams. Change-Id: I45ef61e8a46e0f6588d64b5bd572a24c7432547c Submitted by: hrs Obtained from: https://github.com/heimdal/heimdal/commit/6dd3eb836bbb80a00ffced4ad57077a1cdf227ea Security: CVE-2017-11103 Security: FreeBSD-SA-17:05.heimdal Modified: vendor-crypto/heimdal/dist/lib/krb5/ticket.c Modified: vendor-crypto/heimdal/dist/lib/krb5/ticket.c ============================================================================== --- vendor-crypto/heimdal/dist/lib/krb5/ticket.c Wed Jul 12 07:00:56 2017 (r320904) +++ vendor-crypto/heimdal/dist/lib/krb5/ticket.c Wed Jul 12 07:13:56 2017 (r320905) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 07:19:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2920DB4A95; Wed, 12 Jul 2017 07:19:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 84B907C714; Wed, 12 Jul 2017 07:19:07 +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 v6C7J6og037262; Wed, 12 Jul 2017 07:19:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7J6oW037261; Wed, 12 Jul 2017 07:19:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120719.v6C7J6oW037261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 07:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320906 - head/crypto/heimdal/lib/krb5 X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/crypto/heimdal/lib/krb5 X-SVN-Commit-Revision: 320906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:19:07 -0000 Author: delphij Date: Wed Jul 12 07:19:06 2017 New Revision: 320906 URL: https://svnweb.freebsd.org/changeset/base/320906 Log: MFV r320905: Import upstream fix for CVE-2017-11103. In _krb5_extract_ticket() the KDC-REP service name must be obtained from encrypted version stored in 'enc_part' instead of the unencrypted version stored in 'ticket'. Use of the unecrypted version provides an opportunity for successful server impersonation and other attacks. Submitted by: hrs Obtained from: Heimdal Security: FreeBSD-SA-17:05.heimdal Security: CVE-2017-11103 Modified: head/crypto/heimdal/lib/krb5/ticket.c Directory Properties: head/crypto/heimdal/ (props changed) Modified: head/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- head/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:13:56 2017 (r320905) +++ head/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:19:06 2017 (r320906) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 07:26:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61632DB4C67; Wed, 12 Jul 2017 07:26:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F20C7CAEE; Wed, 12 Jul 2017 07:26:09 +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 v6C7Q8D8041112; Wed, 12 Jul 2017 07:26:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7Q8ho041111; Wed, 12 Jul 2017 07:26:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120726.v6C7Q8ho041111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 07:26:08 +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: r320907 - in stable: 10/crypto/heimdal/lib/krb5 11/crypto/heimdal/lib/krb5 X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable: 10/crypto/heimdal/lib/krb5 11/crypto/heimdal/lib/krb5 X-SVN-Commit-Revision: 320907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:26:09 -0000 Author: delphij Date: Wed Jul 12 07:26:07 2017 New Revision: 320907 URL: https://svnweb.freebsd.org/changeset/base/320907 Log: MFC r320906: MFV r320905: Import upstream fix for CVE-2017-11103. In _krb5_extract_ticket() the KDC-REP service name must be obtained from encrypted version stored in 'enc_part' instead of the unencrypted version stored in 'ticket'. Use of the unecrypted version provides an opportunity for successful server impersonation and other attacks. Submitted by: hrs Obtained from: Heimdal Security: FreeBSD-SA-17:05.heimdal Security: CVE-2017-11103 Modified: stable/10/crypto/heimdal/lib/krb5/ticket.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/crypto/heimdal/lib/krb5/ticket.c Directory Properties: stable/11/ (props changed) Modified: stable/10/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- stable/10/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:19:06 2017 (r320906) +++ stable/10/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:26:07 2017 (r320907) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 07:26:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62273DB4C68; Wed, 12 Jul 2017 07:26:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8E47CAEF; Wed, 12 Jul 2017 07:26:09 +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 v6C7Q8dq041106; Wed, 12 Jul 2017 07:26:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7Q78c041105; Wed, 12 Jul 2017 07:26:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120726.v6C7Q78c041105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 07:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320907 - in stable: 10/crypto/heimdal/lib/krb5 11/crypto/heimdal/lib/krb5 X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable: 10/crypto/heimdal/lib/krb5 11/crypto/heimdal/lib/krb5 X-SVN-Commit-Revision: 320907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:26:09 -0000 Author: delphij Date: Wed Jul 12 07:26:07 2017 New Revision: 320907 URL: https://svnweb.freebsd.org/changeset/base/320907 Log: MFC r320906: MFV r320905: Import upstream fix for CVE-2017-11103. In _krb5_extract_ticket() the KDC-REP service name must be obtained from encrypted version stored in 'enc_part' instead of the unencrypted version stored in 'ticket'. Use of the unecrypted version provides an opportunity for successful server impersonation and other attacks. Submitted by: hrs Obtained from: Heimdal Security: FreeBSD-SA-17:05.heimdal Security: CVE-2017-11103 Modified: stable/11/crypto/heimdal/lib/krb5/ticket.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/crypto/heimdal/lib/krb5/ticket.c Directory Properties: stable/10/ (props changed) Modified: stable/11/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- stable/11/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:19:06 2017 (r320906) +++ stable/11/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:26:07 2017 (r320907) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 07:30:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 839CADB4D8A; Wed, 12 Jul 2017 07:30:15 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAC37CE5C; Wed, 12 Jul 2017 07:30:15 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6C7UEkg041448; Wed, 12 Jul 2017 07:30:14 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7UExf041447; Wed, 12 Jul 2017 07:30:14 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707120730.v6C7UExf041447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 12 Jul 2017 07:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320908 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 320908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:30:15 -0000 Author: rlibby Date: Wed Jul 12 07:30:14 2017 New Revision: 320908 URL: https://svnweb.freebsd.org/changeset/base/320908 Log: kvprintf %b enhancements Make the %b formatter accept number formatting flags. It will now accept alternate form, precision, and length modifiers. It also now partially supports field width (but forces left justification). Reviewed by: markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11284 Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Wed Jul 12 07:26:07 2017 (r320907) +++ head/sys/kern/subr_prf.c Wed Jul 12 07:30:14 2017 (r320908) @@ -650,7 +650,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), vo uintmax_t num; int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; int cflag, hflag, jflag, tflag, zflag; - int dwidth, upper; + int bconv, dwidth, upper; char padc; int stop = 0, retval = 0; @@ -676,7 +676,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), vo } percent = fmt - 1; qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; - sign = 0; dot = 0; dwidth = 0; upper = 0; + sign = 0; dot = 0; bconv = 0; dwidth = 0; upper = 0; cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { case '.': @@ -724,28 +724,9 @@ reswitch: switch (ch = (u_char)*fmt++) { width = n; goto reswitch; case 'b': - num = (u_int)va_arg(ap, int); - p = va_arg(ap, char *); - for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;) - PCHAR(*q--); - - if (num == 0) - break; - - for (tmp = 0; *p;) { - n = *p++; - if (num & (1 << (n - 1))) { - PCHAR(tmp ? ',' : '<'); - for (; (n = *p) > ' '; ++p) - PCHAR(n); - tmp = 1; - } else - for (; *p > ' '; ++p) - continue; - } - if (tmp) - PCHAR('>'); - break; + ladjust = 1; + bconv = 1; + goto handle_nosign; case 'c': width -= 1; @@ -883,6 +864,10 @@ handle_nosign: num = (u_char)va_arg(ap, int); else num = va_arg(ap, u_int); + if (bconv) { + q = va_arg(ap, char *); + base = *q++; + } goto number; handle_sign: if (jflag) @@ -939,6 +924,26 @@ number: while (*p) PCHAR(*p--); + + if (bconv && num != 0) { + /* %b conversion flag format. */ + tmp = retval; + while (*q) { + n = *q++; + if (num & (1 << (n - 1))) { + PCHAR(retval != tmp ? + ',' : '<'); + for (; (n = *q) > ' '; ++q) + PCHAR(n); + } else + for (; *q > ' '; ++q) + continue; + } + if (retval != tmp) { + PCHAR('>'); + width -= retval - tmp; + } + } if (ladjust) while (width-- > 0) From owner-svn-src-all@freebsd.org Wed Jul 12 07:31:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ACC2DB4F2E; Wed, 12 Jul 2017 07:31:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC2437D090; Wed, 12 Jul 2017 07:31:29 +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 v6C7VSPp043053; Wed, 12 Jul 2017 07:31:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C7VSFP043052; Wed, 12 Jul 2017 07:31:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707120731.v6C7VSFP043052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Jul 2017 07:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320909 - releng/11.1/sys/vm X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.1/sys/vm X-SVN-Commit-Revision: 320909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:31:30 -0000 Author: kib Date: Wed Jul 12 07:31:28 2017 New Revision: 320909 URL: https://svnweb.freebsd.org/changeset/base/320909 Log: MFS r320889: Restore layout of struct vm_map_entry. Approved by: re (delphij) Modified: releng/11.1/sys/vm/vm_map.h Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/sys/vm/vm_map.h ============================================================================== --- releng/11.1/sys/vm/vm_map.h Wed Jul 12 07:30:14 2017 (r320908) +++ releng/11.1/sys/vm/vm_map.h Wed Jul 12 07:31:28 2017 (r320909) @@ -103,6 +103,7 @@ struct vm_map_entry { struct vm_map_entry *right; /* right child in binary search tree */ vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ + vm_offset_t pad0; vm_offset_t next_read; /* vaddr of the next sequential read */ vm_size_t adj_free; /* amount of adjacent free space */ vm_size_t max_free; /* max free space in subtree */ From owner-svn-src-all@freebsd.org Wed Jul 12 07:55:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2669DB54B5; Wed, 12 Jul 2017 07:55:12 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 41D7D7DB31; Wed, 12 Jul 2017 07:55:11 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: by vlakno.cz (Postfix, from userid 1002) id B30DCC03A30; Wed, 12 Jul 2017 09:43:26 +0200 (CEST) Date: Wed, 12 Jul 2017 09:43:26 +0200 From: Roman Divacky To: Ryan Libby Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320908 - head/sys/kern Message-ID: <20170712074326.GA41347@vlakno.cz> References: <201707120730.v6C7UExf041447@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707120730.v6C7UExf041447@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 07:55:12 -0000 Clang knows about %b modifier and can do some semantic analysis on it. Currently it type checks the first arg to be an int and the second to be a char*. Do you think it would be worth modifying the checks to include this new functionality? Do you think you would like to take a stab at it? Search for FreeBSDbArg in contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp if you want to take a look. Thanks, Roman On Wed, Jul 12, 2017 at 07:30:14AM +0000, Ryan Libby wrote: > Author: rlibby > Date: Wed Jul 12 07:30:14 2017 > New Revision: 320908 > URL: https://svnweb.freebsd.org/changeset/base/320908 > > Log: > kvprintf %b enhancements > > Make the %b formatter accept number formatting flags. It will now accept > alternate form, precision, and length modifiers. It also now partially > supports field width (but forces left justification). > > Reviewed by: markj > Approved by: markj (mentor) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D11284 > > Modified: > head/sys/kern/subr_prf.c > > Modified: head/sys/kern/subr_prf.c > ============================================================================== > --- head/sys/kern/subr_prf.c Wed Jul 12 07:26:07 2017 (r320907) > +++ head/sys/kern/subr_prf.c Wed Jul 12 07:30:14 2017 (r320908) > @@ -650,7 +650,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), vo > uintmax_t num; > int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; > int cflag, hflag, jflag, tflag, zflag; > - int dwidth, upper; > + int bconv, dwidth, upper; > char padc; > int stop = 0, retval = 0; > > @@ -676,7 +676,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), vo > } > percent = fmt - 1; > qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; > - sign = 0; dot = 0; dwidth = 0; upper = 0; > + sign = 0; dot = 0; bconv = 0; dwidth = 0; upper = 0; > cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; > reswitch: switch (ch = (u_char)*fmt++) { > case '.': > @@ -724,28 +724,9 @@ reswitch: switch (ch = (u_char)*fmt++) { > width = n; > goto reswitch; > case 'b': > - num = (u_int)va_arg(ap, int); > - p = va_arg(ap, char *); > - for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;) > - PCHAR(*q--); > - > - if (num == 0) > - break; > - > - for (tmp = 0; *p;) { > - n = *p++; > - if (num & (1 << (n - 1))) { > - PCHAR(tmp ? ',' : '<'); > - for (; (n = *p) > ' '; ++p) > - PCHAR(n); > - tmp = 1; > - } else > - for (; *p > ' '; ++p) > - continue; > - } > - if (tmp) > - PCHAR('>'); > - break; > + ladjust = 1; > + bconv = 1; > + goto handle_nosign; > case 'c': > width -= 1; > > @@ -883,6 +864,10 @@ handle_nosign: > num = (u_char)va_arg(ap, int); > else > num = va_arg(ap, u_int); > + if (bconv) { > + q = va_arg(ap, char *); > + base = *q++; > + } > goto number; > handle_sign: > if (jflag) > @@ -939,6 +924,26 @@ number: > > while (*p) > PCHAR(*p--); > + > + if (bconv && num != 0) { > + /* %b conversion flag format. */ > + tmp = retval; > + while (*q) { > + n = *q++; > + if (num & (1 << (n - 1))) { > + PCHAR(retval != tmp ? > + ',' : '<'); > + for (; (n = *q) > ' '; ++q) > + PCHAR(n); > + } else > + for (; *q > ' '; ++q) > + continue; > + } > + if (retval != tmp) { > + PCHAR('>'); > + width -= retval - tmp; > + } > + } > > if (ladjust) > while (width-- > 0) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Wed Jul 12 08:07:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1202DB59CC; Wed, 12 Jul 2017 08:07:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8DEF77E129; Wed, 12 Jul 2017 08:07:17 +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 v6C87GlJ057561; Wed, 12 Jul 2017 08:07:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C87GIi057560; Wed, 12 Jul 2017 08:07:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120807.v6C87GIi057560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 08:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320910 - releng/11.1/crypto/heimdal/lib/krb5 X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/11.1/crypto/heimdal/lib/krb5 X-SVN-Commit-Revision: 320910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 08:07:17 -0000 Author: delphij Date: Wed Jul 12 08:07:16 2017 New Revision: 320910 URL: https://svnweb.freebsd.org/changeset/base/320910 Log: MFS r320907: MFC r320906: MFV r320905: Import upstream fix for CVE-2017-11103. In _krb5_extract_ticket() the KDC-REP service name must be obtained from encrypted version stored in 'enc_part' instead of the unencrypted version stored in 'ticket'. Use of the unecrypted version provides an opportunity for successful server impersonation and other attacks. Submitted by: hrs Obtained from: Heimdal Security: FreeBSD-SA-17:05.heimdal Security: CVE-2017-11103 Approved by: re (kib) Modified: releng/11.1/crypto/heimdal/lib/krb5/ticket.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- releng/11.1/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 07:31:28 2017 (r320909) +++ releng/11.1/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 08:07:16 2017 (r320910) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 08:07:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A17BDDB5A11; Wed, 12 Jul 2017 08:07:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6E7E47E242; Wed, 12 Jul 2017 08:07:37 +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 v6C87a39057619; Wed, 12 Jul 2017 08:07:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C87a8c057616; Wed, 12 Jul 2017 08:07:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120807.v6C87a8c057616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 08:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320911 - in releng/11.0: . crypto/heimdal/lib/krb5 sys/conf X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in releng/11.0: . crypto/heimdal/lib/krb5 sys/conf X-SVN-Commit-Revision: 320911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 08:07:37 -0000 Author: delphij Date: Wed Jul 12 08:07:36 2017 New Revision: 320911 URL: https://svnweb.freebsd.org/changeset/base/320911 Log: Fix heimdal KDC-REP service name validation vulnerability [SA-17:05] Approved by: so Modified: releng/11.0/UPDATING releng/11.0/crypto/heimdal/lib/krb5/ticket.c releng/11.0/sys/conf/newvers.sh Modified: releng/11.0/UPDATING ============================================================================== --- releng/11.0/UPDATING Wed Jul 12 08:07:16 2017 (r320910) +++ releng/11.0/UPDATING Wed Jul 12 08:07:36 2017 (r320911) @@ -16,7 +16,11 @@ 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. -20170427 p10 FreeBSD-SA-17:04.ipfilter +20170712 p11 FreeBSD-SA-17:05.heimdal + + Fix heimdal KDC-REP service name validation vulnerability. + +20170427 p10 FreeBSD-SA-17:04.ipfilter Fix ipfilter(4) fragment handling panic. [SA-17:04] Modified: releng/11.0/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- releng/11.0/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 08:07:16 2017 (r320910) +++ releng/11.0/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 08:07:36 2017 (r320911) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ Modified: releng/11.0/sys/conf/newvers.sh ============================================================================== --- releng/11.0/sys/conf/newvers.sh Wed Jul 12 08:07:16 2017 (r320910) +++ releng/11.0/sys/conf/newvers.sh Wed Jul 12 08:07:36 2017 (r320911) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Jul 12 08:07:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB236DB5A5E; Wed, 12 Jul 2017 08:07: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 mx1.freebsd.org (Postfix) with ESMTPS id 82A8F7E369; Wed, 12 Jul 2017 08:07: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 v6C87uIp057683; Wed, 12 Jul 2017 08:07:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C87tpG057671; Wed, 12 Jul 2017 08:07:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707120807.v6C87tpG057671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 08:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320912 - in releng/10.3: . sys/cam/ata sys/conf sys/dev/hyperv/include sys/dev/hyperv/storvsc sys/dev/hyperv/utilities sys/dev/hyperv/vmbus sys/sys sys/x86/x86 X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in releng/10.3: . sys/cam/ata sys/conf sys/dev/hyperv/include sys/dev/hyperv/storvsc sys/dev/hyperv/utilities sys/dev/hyperv/vmbus sys/sys sys/x86/x86 X-SVN-Commit-Revision: 320912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 08:07:57 -0000 Author: delphij Date: Wed Jul 12 08:07:55 2017 New Revision: 320912 URL: https://svnweb.freebsd.org/changeset/base/320912 Log: Fix heimdal KDC-REP service name validation vulnerability [SA-17:05] Boot compatibility improvements with Azure VMs. [EN-17:06] Approved by: so Modified: releng/10.3/UPDATING releng/10.3/sys/cam/ata/ata_xpt.c releng/10.3/sys/conf/files.amd64 releng/10.3/sys/conf/files.i386 releng/10.3/sys/conf/newvers.sh releng/10.3/sys/dev/hyperv/include/hyperv.h releng/10.3/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c releng/10.3/sys/dev/hyperv/storvsc/hv_vstorage.h releng/10.3/sys/dev/hyperv/utilities/hv_kvp.c releng/10.3/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c releng/10.3/sys/sys/eventhandler.h releng/10.3/sys/x86/x86/intr_machdep.c Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/UPDATING Wed Jul 12 08:07:55 2017 (r320912) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20170712 p20 FreeBSD-SA-17:05.heimdal + FreeBSD-EN-17:06.hyperv + + Fix heimdal KDC-REP service name validation vulnerability [SA-17:05] + + Boot compatibility improvements with Azure VMs. [EN-17:06] + 20170427 p19 FreeBSD-SA-17:04.ipfilter Fix ipfilter(4) fragment handling panic. [SA-17:04] Modified: releng/10.3/sys/cam/ata/ata_xpt.c ============================================================================== --- releng/10.3/sys/cam/ata/ata_xpt.c Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/cam/ata/ata_xpt.c Wed Jul 12 08:07:55 2017 (r320912) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -827,12 +828,18 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; + int veto = 0; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); + if (veto) { + goto device_fail; + } + if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && Modified: releng/10.3/sys/conf/files.amd64 ============================================================================== --- releng/10.3/sys/conf/files.amd64 Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/conf/files.amd64 Wed Jul 12 08:07:55 2017 (r320912) @@ -262,7 +262,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/hyperv/netvsc/hv_net_vsc.c optional hyperv dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optional hyperv dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv -dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv Modified: releng/10.3/sys/conf/files.i386 ============================================================================== --- releng/10.3/sys/conf/files.i386 Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/conf/files.i386 Wed Jul 12 08:07:55 2017 (r320912) @@ -240,7 +240,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/hyperv/netvsc/hv_net_vsc.c optional hyperv dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optional hyperv dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv -dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv Modified: releng/10.3/sys/conf/newvers.sh ============================================================================== --- releng/10.3/sys/conf/newvers.sh Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/conf/newvers.sh Wed Jul 12 08:07:55 2017 (r320912) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="RELEASE-p19" +BRANCH="RELEASE-p20" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.3/sys/dev/hyperv/include/hyperv.h ============================================================================== --- releng/10.3/sys/dev/hyperv/include/hyperv.h Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/dev/hyperv/include/hyperv.h Wed Jul 12 08:07:55 2017 (r320912) @@ -124,6 +124,8 @@ typedef struct hv_guid { unsigned char data[16]; } __packed hv_guid; +int snprintf_hv_guid(char *, size_t, const hv_guid *); + #define HV_NIC_GUID \ .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} Modified: releng/10.3/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- releng/10.3/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jul 12 08:07:55 2017 (r320912) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -198,6 +199,7 @@ static struct storvsc_driver_props g_drv_props_table[] STORVSC_RINGBUFFER_SIZE} }; +static eventhandler_tag storvsc_handler_tag; /* * Sense buffer size changed in win8; have a run-time * variable to track the size we should use. @@ -818,6 +820,7 @@ hv_storvsc_on_iocompletion(struct storvsc_softc *sc, * because the fields will be used later in storvsc_io_done(). */ request->vstor_packet.u.vm_srb.scsi_status = vm_srb->scsi_status; + request->vstor_packet.u.vm_srb.srb_status = vm_srb->srb_status; request->vstor_packet.u.vm_srb.transfer_len = vm_srb->transfer_len; if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) && @@ -966,20 +969,13 @@ hv_storvsc_on_channel_callback(void *context) static int storvsc_probe(device_t dev) { - int ata_disk_enable = 0; int ret = ENXIO; switch (storvsc_get_storage_type(dev)) { case DRIVER_BLKVSC: if(bootverbose) - device_printf(dev, "DRIVER_BLKVSC-Emulated ATA/IDE probe\n"); - if (!getenv_int("hw.ata.disk_enable", &ata_disk_enable)) { - if(bootverbose) - device_printf(dev, - "Enlightened ATA/IDE detected\n"); - ret = BUS_PROBE_DEFAULT; - } else if(bootverbose) - device_printf(dev, "Emulated ATA/IDE set (hw.ata.disk_enable set)\n"); + device_printf(dev, "Enlightened ATA/IDE detected\n"); + ret = BUS_PROBE_DEFAULT; break; case DRIVER_STORVSC: if(bootverbose) @@ -1967,28 +1963,17 @@ create_storvsc_request(union ccb *ccb, struct hv_storv return(0); } -/* - * SCSI Inquiry checks qualifier and type. - * If qualifier is 011b, means the device server is not capable - * of supporting a peripheral device on this logical unit, and - * the type should be set to 1Fh. - * - * Return 1 if it is valid, 0 otherwise. - */ -static inline int -is_inquiry_valid(const struct scsi_inquiry_data *inq_data) +static uint32_t +is_scsi_valid(const struct scsi_inquiry_data *inq_data) { - uint8_t type; - if (SID_QUAL(inq_data) != SID_QUAL_LU_CONNECTED) { - return (0); - } + u_int8_t type; type = SID_TYPE(inq_data); - if (type == T_NODEVICE) { + if (type == T_NODEVICE) return (0); - } + if (SID_QUAL(inq_data) == SID_QUAL_BAD_LU) + return (0); return (1); } - /** * @brief completion function before returning to CAM * @@ -2057,75 +2042,108 @@ storvsc_io_done(struct hv_storvsc_request *reqp) callout_drain(&reqp->callout); } #endif - ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; - /* - * Check whether the data for INQUIRY cmd is valid or - * not. Windows 10 and Windows 2016 send all zero - * inquiry data to VM even for unpopulated slots. - */ cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); - if (cmd->opcode == INQUIRY) { - /* - * The host of Windows 10 or 2016 server will response - * the inquiry request with invalid data for unexisted device: - [0x7f 0x0 0x5 0x2 0x1f ... ] - * But on windows 2012 R2, the response is: - [0x7f 0x0 0x0 0x0 0x0 ] - * That is why here wants to validate the inquiry response. - * The validation will skip the INQUIRY whose response is short, - * which is less than SHORT_INQUIRY_LENGTH (36). - * - * For more information about INQUIRY, please refer to: - * ftp://ftp.avc-pioneer.com/Mtfuji_7/Proposal/Jun09/INQUIRY.pdf - */ - const struct scsi_inquiry_data *inq_data = - (const struct scsi_inquiry_data *)csio->data_ptr; - uint8_t* resp_buf = (uint8_t*)csio->data_ptr; - /* Get the buffer length reported by host */ - int resp_xfer_len = vm_srb->transfer_len; - /* Get the available buffer length */ - int resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; - int data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; - if (data_len < SHORT_INQUIRY_LENGTH) { - ccb->ccb_h.status |= CAM_REQ_CMP; - if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc skips the validation for short inquiry (%d)" - " [%x %x %x %x %x]\n", - data_len,resp_buf[0],resp_buf[1],resp_buf[2], - resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); - } - } else if (is_inquiry_valid(inq_data) == 0) { - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; - if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc uninstalled invalid device" - " [%x %x %x %x %x]\n", - resp_buf[0],resp_buf[1],resp_buf[2],resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); - } - } else { - ccb->ccb_h.status |= CAM_REQ_CMP; + if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { + /* + * If there are errors, for example, invalid LUN, + * host will inform VM through SRB status. + */ if (bootverbose) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc has passed inquiry response (%d) validation\n", - data_len); - mtx_unlock(&sc->hs_lock); + if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { + xpt_print(ccb->ccb_h.path, + "invalid LUN %d for op: %s\n", + vm_srb->lun, + scsi_op_desc(cmd->opcode, NULL)); + } else { + xpt_print(ccb->ccb_h.path, + "Unknown SRB flag: %d for op: %s\n", + vm_srb->srb_status, + scsi_op_desc(cmd->opcode, NULL)); + } } - } + + /* + * XXX For a selection timeout, all of the LUNs + * on the target will be gone. It works for SCSI + * disks, but does not work for IDE disks. + * + * For CAM_DEV_NOT_THERE, CAM will only get + * rid of the device(s) specified by the path. + */ + if (storvsc_get_storage_type(sc->hs_dev->device) == + DRIVER_STORVSC) + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; + else + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; } else { ccb->ccb_h.status |= CAM_REQ_CMP; } + + if (cmd->opcode == INQUIRY && + vm_srb->srb_status == SRB_STATUS_SUCCESS) { + int resp_xfer_len, resp_buf_len, data_len; + struct scsi_inquiry_data *inq_data = + (struct scsi_inquiry_data *)csio->data_ptr; + /* Get the buffer length reported by host */ + resp_xfer_len = vm_srb->transfer_len; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; + + /* Get the available buffer length */ + resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; + data_len = (resp_buf_len < resp_xfer_len) ? + resp_buf_len : resp_xfer_len; + if (bootverbose && data_len >= 5) { + xpt_print(ccb->ccb_h.path, "storvsc inquiry " + "(%d) [%x %x %x %x %x ... ]\n", data_len, + resp_buf[0], resp_buf[1], resp_buf[2], + resp_buf[3], resp_buf[4]); + } + /* + * XXX: Manually fix the wrong response returned from WS2012 + */ + if (!is_scsi_valid(inq_data) && + (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN7)) { + if (data_len >= 4 && + (resp_buf[2] == 0 || resp_buf[3] == 0)) { + resp_buf[2] = 5; // verion=5 means SPC-3 + resp_buf[3] = 2; // resp fmt must be 2 + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "fix version and resp fmt for 0x%x\n", + vmstor_proto_version); + } + } else if (data_len >= SHORT_INQUIRY_LENGTH) { + char vendor[16]; + + cam_strvis(vendor, inq_data->vendor, + sizeof(inq_data->vendor), sizeof(vendor)); + /* + * XXX: Upgrade SPC2 to SPC3 if host is WIN8 or + * WIN2012 R2 in order to support UNMAP feature. + */ + if (!strncmp(vendor, "Msft", 4) && + SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 && + (vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8)) { + inq_data->version = SCSI_REV_SPC3; + if (bootverbose) { + xpt_print(ccb->ccb_h.path, + "storvsc upgrades " + "SPC2 to SPC3\n"); + } + } + } + } } else { mtx_lock(&sc->hs_lock); xpt_print(ccb->ccb_h.path, @@ -2193,3 +2211,51 @@ storvsc_get_storage_type(device_t dev) return (DRIVER_UNKNOWN); } +#define PCI_VENDOR_INTEL 0x8086 +#define PCI_PRODUCT_PIIX4 0x7111 + +static void +storvsc_ada_probe_veto(void *arg __unused, struct cam_path *path, + struct ata_params *ident_buf __unused, int *veto) +{ + /* + * Hyper-V should ignore ATA + */ + if (path->device->protocol == PROTO_ATA) { + struct ccb_pathinq cpi; + + bzero(&cpi, sizeof(cpi)); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + if (cpi.ccb_h.status == CAM_REQ_CMP && + cpi.hba_vendor == PCI_VENDOR_INTEL && + cpi.hba_device == PCI_PRODUCT_PIIX4) { + (*veto)++; + xpt_print(path, + "Disable ATA for vendor: %x, device: %x\n", + cpi.hba_vendor, cpi.hba_device); + } + } +} + +static void +storvsc_sysinit(void *arg __unused) +{ + if (vm_guest == VM_GUEST_HV) { + storvsc_handler_tag = EVENTHANDLER_REGISTER(ada_probe_veto, + storvsc_ada_probe_veto, NULL, EVENTHANDLER_PRI_ANY); + } +} +SYSINIT(storvsc_sys_init, SI_SUB_DRIVERS, SI_ORDER_SECOND, storvsc_sysinit, + NULL); + +static void +storvsc_sysuninit(void *arg __unused) +{ + if (storvsc_handler_tag != NULL) { + EVENTHANDLER_DEREGISTER(ada_probe_veto, storvsc_handler_tag); + } +} +SYSUNINIT(storvsc_sys_uninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, + storvsc_sysuninit, NULL); Modified: releng/10.3/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- releng/10.3/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Jul 12 08:07:55 2017 (r320912) @@ -249,9 +249,9 @@ struct vstor_packet { /** * SRB Status Masks (can be combined with above status codes) */ -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - +#define SRB_STATUS_QUEUE_FROZEN 0x40 +#define SRB_STATUS_AUTOSENSE_VALID 0x80 +#define SRB_STATUS_INVALID_LUN 0X20 /** * Packet flags Modified: releng/10.3/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- releng/10.3/sys/dev/hyperv/utilities/hv_kvp.c Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/dev/hyperv/utilities/hv_kvp.c Wed Jul 12 08:07:55 2017 (r320912) @@ -311,28 +311,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(struct hv_kvp_ip_m { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - int guid_index; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ char if_name[4]; - unsigned char guid_instance[40]; - char *guid_data = NULL; char buf[39]; - struct guid_extract { - char a1[2]; - char a2[2]; - char a3[2]; - char a4[2]; - char b1[2]; - char b2[2]; - char c1[2]; - char c2[2]; - char d[4]; - char e[12]; - }; - - struct guid_extract *id; device_t *devs; int devcnt; @@ -359,17 +342,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(struct hv_kvp_ip_m /* Trying to find GUID of Network Device */ hv_dev = sc->hn_dev_obj; - for (guid_index = 0; guid_index < 16; guid_index++) { - sprintf(&guid_instance[guid_index * 2], "%02x", - hv_dev->device_id.data[guid_index]); - } - - guid_data = (char *)guid_instance; - id = (struct guid_extract *)guid_data; - snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", - id->a4, id->a3, id->a2, id->a1, - id->b2, id->b1, id->c2, id->c1, id->d, id->e); - guid_data = NULL; + snprintf_hv_guid(buf, sizeof(buf), &hv_dev->device_id); sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { Modified: releng/10.3/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- releng/10.3/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jul 12 08:07:55 2017 (r320912) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_vmbus_priv.h" #include @@ -298,6 +299,23 @@ vmbus_write_ivar( return (ENOENT); } +static int +vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) +{ + char guidbuf[40]; + struct hv_device *dev_ctx = device_get_ivars(child); + + strlcat(buf, "classid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); + strlcat(buf, guidbuf, buflen); + + strlcat(buf, " deviceid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); + strlcat(buf, guidbuf, buflen); + + return (0); +} + struct hv_device* hv_vmbus_child_device_create( hv_guid type, @@ -324,15 +342,17 @@ hv_vmbus_child_device_create( return (child_dev); } -static void -print_dev_guid(struct hv_device *dev) +int +snprintf_hv_guid(char *buf, size_t sz, const hv_guid *guid) { - int i; - unsigned char guid_name[100]; - for (i = 0; i < 32; i += 2) - sprintf(&guid_name[i], "%02x", dev->class_id.data[i / 2]); - if(bootverbose) - printf("VMBUS: Class ID: %s\n", guid_name); + int cnt; + const unsigned char *d = guid->data; + + cnt = snprintf(buf, sz, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6], + d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); + return (cnt); } int @@ -341,9 +361,12 @@ hv_vmbus_child_device_register(struct hv_device *child device_t child; int ret = 0; - print_dev_guid(child_dev); + if (bootverbose) { + char name[40]; + snprintf_hv_guid(name, sizeof(name), &child_dev->class_id); + printf("VMBUS: Class ID: %s\n", name); + } - child = device_add_child(vmbus_devp, NULL, -1); child_dev->device = child; device_set_ivars(child, child_dev); @@ -747,6 +770,7 @@ static device_method_t vmbus_methods[] = { DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_write_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), { 0, 0 } }; Modified: releng/10.3/sys/sys/eventhandler.h ============================================================================== --- releng/10.3/sys/sys/eventhandler.h Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/sys/eventhandler.h Wed Jul 12 08:07:55 2017 (r320912) @@ -283,4 +283,11 @@ typedef void (*unregister_framebuffer_fn)(void *, stru EVENTHANDLER_DECLARE(register_framebuffer, register_framebuffer_fn); EVENTHANDLER_DECLARE(unregister_framebuffer, unregister_framebuffer_fn); +/* veto ada probing */ +struct cam_path; +struct ata_params; +typedef void (*ada_probe_veto_fn)(void *, struct cam_path *, + struct ata_params *, int *); +EVENTHANDLER_DECLARE(ada_probe_veto, ada_probe_veto_fn); + #endif /* SYS_EVENTHANDLER_H */ Modified: releng/10.3/sys/x86/x86/intr_machdep.c ============================================================================== --- releng/10.3/sys/x86/x86/intr_machdep.c Wed Jul 12 08:07:36 2017 (r320911) +++ releng/10.3/sys/x86/x86/intr_machdep.c Wed Jul 12 08:07:55 2017 (r320912) @@ -535,6 +535,9 @@ intr_shuffle_irqs(void *arg __unused) if (mp_ncpus == 1) return; + /* Does not work properly on Hyper-V. */ + if (vm_guest == VM_GUEST_HV) + return; /* Round-robin assign a CPU to each enabled source. */ mtx_lock(&intr_table_lock); assign_cpu = 1; From owner-svn-src-all@freebsd.org Wed Jul 12 08:09:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E69DB5AE3; Wed, 12 Jul 2017 08:09:42 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3ADB7E4D8; Wed, 12 Jul 2017 08:09:41 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wr0-x232.google.com with SMTP id c11so22523755wrc.3; Wed, 12 Jul 2017 01:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HvWo7n1N4TbDRQHKM7dO4jOrjlalYDz7WrqehRBfNxM=; b=kMcys1lRNA4OwNMnfp3pOhPO7xWWyum8rzRXOEyz6GyyU5DrmPE5NOEP1hMmGEKKp/ aVGfetezFmu5BpeF66PJqwjxwFQqM/Zh/U1EqRnNDRAHmhlos3y4mewI+9MDB5R3GhZu TuZ8cG38bNzLvCJ5JnvoD+33okTUIAGxZ10a392ugkxxI3JdhdTzNnhsHMYMZcktzD/P v4V+U+muGQpRkUzk4ziASp1atVz3Lz7eLlbflaMlwcKDVEujp/AFU2b/K3jSZxOhk0Ve 38hN/1VGos4Hvml/cfFh2evR2ruUFT/cu4UEGZHBgIXVp2+jVwvrqlNKIb3NqyTviSAi ttjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HvWo7n1N4TbDRQHKM7dO4jOrjlalYDz7WrqehRBfNxM=; b=lkrs0RC3uEzbjGxDrJ8s4luaZle2C3O1fa9eE/F/+uFbHUMLTNvTW0jbTGNdbaz6kd paBdKedoDBeKXPzT1b44iTud2xQGqcp3o4yhkS7Ws2jYqI+mvmP1pOAX7z6K1KsMRebh isF8fmGGl4VIDtigUHgGs+5Rp1WsEUJdoGob++6o85ahEAXti9i2+JbWgICX5Nvz/b7w JiTNsafuypUydZRic8EuuWOIX0RZT3TEoCuvL55vFEHwKCJM4GQkbyUZxPuyro4zsQIP SEAhLlunqEj8QsQPz1f85NvRTklwT/o3E2xXR1k0VZCYO5eRf569eFNdEJm4XpbFViVk SCTg== X-Gm-Message-State: AIVw112eYnje1FEEwcH4dz2u9QoHoqHX6htcUnCT68lDMnkGZIpfeUQu FuHg8Mb5972jX7XsgM4vCX7ziPK3ijg4 X-Received: by 10.28.9.205 with SMTP id 196mr1543707wmj.126.1499846979939; Wed, 12 Jul 2017 01:09:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.81 with HTTP; Wed, 12 Jul 2017 01:09:39 -0700 (PDT) In-Reply-To: <20170712074326.GA41347@vlakno.cz> References: <201707120730.v6C7UExf041447@repo.freebsd.org> <20170712074326.GA41347@vlakno.cz> From: Ryan Libby Date: Wed, 12 Jul 2017 01:09:39 -0700 Message-ID: Subject: Re: svn commit: r320908 - head/sys/kern To: Roman Divacky Cc: Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 08:09:42 -0000 On Wed, Jul 12, 2017 at 12:43 AM, Roman Divacky wrote: > Clang knows about %b modifier and can do some semantic analysis on it. > Currently it type checks the first arg to be an int and the second to be > a char*. > > Do you think it would be worth modifying the checks to include > this new functionality? Do you think you would like to take a stab > at it? Yes, I plan to send that to clang upstream. I originally had those changes in this commit but I was directed rather to send them first to upstream. See here [1] for roughly what I plan to send upstream (although I have since noticed some unit tests that I guess should be extended). For now, the semantic analysis should be fine as the change should be backward compatible and I haven't yet changed any of the users of %b to use the new capabilities. Ryan [1] https://reviews.freebsd.org/D11284?id=29866 From owner-svn-src-all@freebsd.org Wed Jul 12 10:28:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145F8D93BE1; Wed, 12 Jul 2017 10:28:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id B3B9C827CE; Wed, 12 Jul 2017 10:28:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7CCC31A3B3F; Wed, 12 Jul 2017 20:08:43 +1000 (AEST) Date: Wed, 12 Jul 2017 20:08:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320900 - in head/sys: fs/cd9660 fs/ext2fs fs/fifofs fs/msdosfs fs/nandfs fs/nfsclient fs/smbfs fs/tmpfs ufs/ufs In-Reply-To: <201707112155.v6BLtKbZ006618@repo.freebsd.org> Message-ID: <20170712184348.Q1271@besplex.bde.org> References: <201707112155.v6BLtKbZ006618@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=K9qLy5Vgh6matLySN4AA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 10:28:41 -0000 On Tue, 11 Jul 2017, John Baldwin wrote: > Log: > Consistently use vop_stdpathconf() for default pathconf values. > > Update filesystems not currently using vop_stdpathconf() in pathconf > VOPs to use vop_stdpathconf() for any configuration variables that do > not have filesystem-specific values. vop_stdpathconf() is used for > variables that have system-wide settings as well as providing default > values for some values based on system limits. Filesystems can still > explicitly override individual settings. This is sort of backwards. Not many settings are the same for most file systems, and many that did were wrong. Now more are wrong. > Modified: head/sys/fs/cd9660/cd9660_vnops.c > ============================================================================== > --- head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > +++ head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > @@ -792,20 +792,11 @@ cd9660_pathconf(ap) > else > *ap->a_retval = 37; > return (0); > - case _PC_PATH_MAX: > - *ap->a_retval = PATH_MAX; > - return (0); PATH_MAX is one of the few that is system-wide. > - case _PC_PIPE_BUF: > - *ap->a_retval = PIPE_BUF; > - return (0); PIPE_BUF isn't system wide. cd9660 does support fifos, but setting it for files that aren't fifos or directories is bogus. POSIX allows such bogus settings, and needs complicated wording to describe this. E.g., PIPE_BUF for a directory is not completely bogus and it means that the value for the directory applies to all fifos in the directory and is ignored for all non-fifos in the directory. It is unclear if PIPE_BUF must be set for a directory if there is any fifo in the directory. FreeBSD's man pages give no details about this. > - case _PC_CHOWN_RESTRICTED: > - *ap->a_retval = 1; > - return (0); This is system-wide. > case _PC_NO_TRUNC: > *ap->a_retval = 1; > return (0); This is almost system-wide. > default: > - return (EINVAL); > + return (vop_stdpathconf(ap)); This is fail-unsafe. It gives bogus settings like PIPE_BUF for all cases. Case statements in file systems need to be even larger to kill defaults, and the code becomes harder to read since it is harder to see the final values. vop_stdpathconf() has defaults for: - ASYNC_IO. Is this system-wide (all in vfs?) - NAME_MAX. This is very far from system-wide - PATH_MAX. This is system-wide. - LINK_MAX. This is very far from system-wide, especially after expansion of nlink_t. Most file systems get this wrong. LINK_MAX is bogusly defined to be the constant 32767, but the value is very variable. zfs_pathconf() returns INT_MAX and zfs uses something like int32_t internally, but zfs_getattr() clamps to LINK_MAX. ext2fs limits to 32000 for ext2 and 65000 for ext4 internally but ext2_pathconf() only returns this limit in some cases -- other cases return INT_MAX. - MAX_CANON. This is garbage except for terminals (and directories). Its value is also wrong. - MAX_INPUT. Like MAX_CANON. - PIPE_BUF. Like MAX_CANON, for fifos instead of terminals. - CHOWN_RESTRICTED. Wrong for file systems that don't support ownerships or changing them. Might depend on mount options. - VDISABLE. Like MAX_CANON. This is easy to improve: - NAME_MAX, LINK_MAX: move to individual fs's - MAX_CANON, MAX_INPUT, VDISABLE: move to devfs_pathconf(). - PIPE_BUF: move to fifo_pathconf()? What about directories? > } > /* NOTREACHED */ Bogus comment. Even lint should understand that default prevents reaching this. > Modified: head/sys/fs/fifofs/fifo_vnops.c > ============================================================================== > --- head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > +++ head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > @@ -337,34 +336,6 @@ fifo_print(ap) > fifo_printinfo(ap->a_vp); > printf("\n"); > return (0); > -} > - > -/* > - * Return POSIX pathconf information applicable to fifo's. > - */ > -static int > -fifo_pathconf(ap) > - struct vop_pathconf_args /* { > - struct vnode *a_vp; > - int a_name; > - int *a_retval; > - } */ *ap; > -{ > - > - switch (ap->a_name) { > - case _PC_LINK_MAX: > - *ap->a_retval = LINK_MAX; > - return (0); > - case _PC_PIPE_BUF: > - *ap->a_retval = PIPE_BUF; > - return (0); > - case _PC_CHOWN_RESTRICTED: > - *ap->a_retval = 1; > - return (0); > - default: > - return (EINVAL); > - } > - /* NOTREACHED */ > } This was small and hopefully correct. Not many settings apply to fifos. It seems a but too small to be correct -- why would LINK_MAX apply but not PATH_MAX? Using the default, a pathconf which wants to set only 3 value would need about 15 cases to kill all the defaults. > Modified: head/sys/fs/msdosfs/msdosfs_vnops.c > ============================================================================== > --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > @@ -1875,17 +1875,11 @@ msdosfs_pathconf(struct vop_pathconf_args *ap) > case _PC_NAME_MAX: > *ap->a_retval = pmp->pm_flags & MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12; > return (0); > - case _PC_PATH_MAX: > - *ap->a_retval = PATH_MAX; > - return (0); > - case _PC_CHOWN_RESTRICTED: > - *ap->a_retval = 1; > - return (0); > case _PC_NO_TRUNC: > *ap->a_retval = 0; > return (0); > default: > - return (EINVAL); > + return (vop_stdpathconf(ap)); msdosfs doesn't support pipes. It used to indicate this by not having _PC_PIPE_MAX. Now it gets this via pollution in vop_stdpathconf(ap). msdosfs also has unusual handling for LINK_MAX, NAME_MAX and NO_TRUNC. It still has this, with buggy limits in all cases: - msdosfs doesn't support links. It returns 1 for LINK_MAX instead of -1 (unsupported) - NAME_MAX doesn't really apply to shortnames. 12 is returned instead of the 2 limits 8 and 3. - msdosfs truncates only for shortnames, so NO_TRUNC = 0 is wrong for !shortnames. Almost all file systems except msdosfs return 1 for NO_TRUNC, but this is not defaulted. > Modified: head/sys/ufs/ufs/ufs_vnops.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > +++ head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > @@ -2442,21 +2442,9 @@ ufs_pathconf(ap) > > error = 0; > switch (ap->a_name) { > - case _PC_LINK_MAX: > - *ap->a_retval = LINK_MAX; > - break; > case _PC_NAME_MAX: > *ap->a_retval = UFS_MAXNAMLEN; > break; LINK_MAX is basically ffs's limit. NAME_MAX _is_ ffs's limit, but it is still defaulted. I expect that some of the other defaulted limits will become more variable (so unsuitable as defaults). LINK_MAX is almost there. > @@ -2505,11 +2493,6 @@ ufs_pathconf(ap) > case _PC_MIN_HOLE_SIZE: > *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; > break; > - case _PC_ASYNC_IO: > - /* _PC_ASYNC_IO should have been handled by upper layers. */ > - KASSERT(0, ("_PC_ASYNC_IO should not get here")); > - error = EINVAL; > - break; > case _PC_PRIO_IO: > *ap->a_retval = 0; > break; But some of the newer limits like are in vfs so should have been defaulted? Bruce From owner-svn-src-all@freebsd.org Wed Jul 12 11:40:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1624D9521D; Wed, 12 Jul 2017 11:40:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id BCE9684501; Wed, 12 Jul 2017 11:40:10 +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 v6CBe9HL045210; Wed, 12 Jul 2017 11:40:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CBe9ox045209; Wed, 12 Jul 2017 11:40:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707121140.v6CBe9ox045209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 12 Jul 2017 11:40:09 +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: r320913 - stable/10/release X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/10/release X-SVN-Commit-Revision: 320913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 11:40:11 -0000 Author: gjb Date: Wed Jul 12 11:40:09 2017 New Revision: 320913 URL: https://svnweb.freebsd.org/changeset/base/320913 Log: MFC r300761, r300762: r300761: Disconnect the AZURE target from the CLOUDWARE list. Microsoft has graciously overtaken publication of FreeBSD on Azure since 10.3-RELEASE. Many thanks to Microsoft for their support of FreeBSD on Azure. r300762: Disconnect the OPENSTACK target from the CLOUDWARE list. This was reported to not work as expected, and feedback following the report was never received. In addition, we do not publish these anywhere publicly. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.vm ============================================================================== --- stable/10/release/Makefile.vm Wed Jul 12 08:07:55 2017 (r320912) +++ stable/10/release/Makefile.vm Wed Jul 12 11:40:09 2017 (r320913) @@ -16,10 +16,8 @@ VMDK_DESC= VMWare, VirtualBox disk image QCOW2_DESC= Qemu, KVM disk image RAW_DESC= Unformatted raw disk image -CLOUDWARE?= AZURE \ - EC2 \ +CLOUDWARE?= EC2 \ GCE \ - OPENSTACK \ VAGRANT-VIRTUALBOX \ VAGRANT-VMWARE AZURE_FORMAT= vhdf From owner-svn-src-all@freebsd.org Wed Jul 12 12:20:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D68D964BF; Wed, 12 Jul 2017 12:20:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 6C5179DB; Wed, 12 Jul 2017 12:20:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id EAC25104FB4; Wed, 12 Jul 2017 22:19:52 +1000 (AEST) Date: Wed, 12 Jul 2017 22:19:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Ian Lepore , Edward Tomasz Napierala , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320803 - head/sbin/mount In-Reply-To: <5242112.0aHCQARnit@ralph.baldwin.cx> Message-ID: <20170712200850.T1271@besplex.bde.org> References: <20170708171641.GA1129@brick> <20170711201230.GB1725@brick> <1499805315.45330.14.camel@freebsd.org> <5242112.0aHCQARnit@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=LvD3IBYkoAyHHyboNZsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 12:20:01 -0000 On Tue, 11 Jul 2017, John Baldwin wrote: > On Tuesday, July 11, 2017 02:35:15 PM Ian Lepore wrote: >> I think the docs on this are pretty clear... under -u it says: >> >> The set of options is determined by applying the options specified >> in the argument to -o and finally applying the -r or -w option. >> >> To me, that says that nothing in /etc/fstab is germane to mount -u >> unless one of the other args to mount -u is -o fstab. >> >> This change (r320803) seems like an acceptable workaround, but I think >> the correct long term fix would be to not even open /etc/fstab on mount >> -u without -o fstab. But that may be harder to do than to say; I still >> haven't actually looked at the code involved. I thought that it did do that (not look in fstab, except possibly for pathnames). > I concur with this. I've always viewed '-u' as meaning "apply a delta > to the current configuration", not "add this delta to the fstab options > and then apply that entire set of options". In practice, it seems that > it doesn't do either of those, but instead it seems to treats the options > passed to -o as the entire list of options. This is perhaps a bit > surprising. I thought that everyone knew that the behaviour is to blow away the current options, since this is surprisingly bad. My fingers know this, and exploit it to reduce typing for mounting the root file system rw: - "rw" is not an option, but is the absense of the "ro" option, so to change the root file system from read-only to read-write, my fingers type "mount /" -- this blows away "ro" - however, all my fs's are mounted with noatime and I don't want to blow this away unintentionally. My fingers know this, so they actually type "mount -o noatime" for the previous operation. This is part of a large suite of design and implementation bugs. dwmalone@ added [-u -o] "fstab" and "current" options to give more control and save typing, but these weren't complete and they rotted with the larger design and implementation bug nmount(2). "current" only gives the current settings that are in the mount flags returned by statfs(2), and "fstab" doesn't blow away the current settings that aren't in the mount flags. nmount(2) increased the problem by making it too easy to add unstructured options that are not in the mount flags and moving parsing of options to the kernel. mount(8) with no args only displays the options in the mount flags. > For example, suppose you had this: > > /etc/fstab: > > /dev/md0 /bar ufs ro,noauto,noexec 0 0 > > # mount /bar > # mount | grep bar ooooooop > /dev/md0 on /bar (ufs, local, noexec, read-only) > # mount -u -o rw /bar > /dev/md0 on /bar (ufs, local) > > (We just lost "noexec" from fstab by upgrading to read-write) Expect to lose that are in the mount flags like this. But unstructured options tend to be sticky due to undocumented implementation details. This causes my most problems with nfs tcp/udp flags and nfs read/write sizes. Even when these were parsed in nfs_mount(8), IIRC the absence of an option in the command line was passed to the kernel as nothing and interpreted by the kernel as a null change. With nmount(2), userland does almost no option processing so more clearly passes absent options as nothing so the result is whatever undocumented interpretation the kernel prefers. For read/write sizes, nfs also "fixes" wrong sizes by adjusting to limits. There is API for determining what sizes its ends up with, so the only way to know what sizes you are setting is to always set sizes that won't be adjusted and remember what these are in userland. > # mount -u -o nosuid /bar > # mount | grep bar > /dev/md0 on /bar (ufs, local, nosuid) > > (Did not lose "read-write" somehow, RO vs RW must be magically sticky?) RW is just the default. It is not a flag, but the absense of the "ro" flag. nmount(2) still handles negative options worse than mount(8) using much much larger code, but after many years of fixes it handles this "rw" negative option well enough. Most generic flags have 3 variants like "ro", "noro" and "nonoro", and "ro" also has variants "" "rw". Non-generic flags (implemented in individual file systems) tend to have less orthogonality. Sometimes if the basic flag is "nofoo", there is no flag "foo". Sometimes there is a flag "nonofoo" to negate "foo". > # mount -u -o fstab,nosuid /bar > # mount |grep bar > /dev/md0 on /bar (ufs, local, noexec, nosuid) > > (Did not honor "ro" from fstab! Left mount RW) Correction: after many years of fixes, nmount(2) still doesn't understand the "ro" flag. This example works correctly with old mount utilities using mount(2). This is with the same current kernel -- mount(8) from FreeBSD-~5.2 parses the options correctly and then uses mount(2), while mount(8) from FreeBSD-10 uses nmount(2). Even nmount(2) can handle this, so the bug must be in parsing or concatenating fstab options. "fstab" seems to work correctly with newer mount(8) for options in fstab except "ro". > It would seem that there is no actual rhyme or reason to how mount -u works, > and certainly Edward's change doesn't make it worse. I would like to have > some kind of mode where you can toggle one or more options without disturbing > others. Maybe if we had a new "special" option called "current" or some such > that is like "fstab" but instead represents the options currently in force, > then you could do true delta operations via 'mount -o current,rw -u /foo'. > As it is, there doesn't currently seem to a reliable way to achieve that > functionality. -u -o current was implemented in 1999, but never really worked. To summarize, -u tends to preserve the current settings for everything except the mount flags that you can actually see, and should change all of those flags to 0. So -u -o -current tends to preserve everything. Bruce From owner-svn-src-all@freebsd.org Wed Jul 12 12:43:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 384B0D96E1A for ; Wed, 12 Jul 2017 12:43:50 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.smtpout.orange.fr (smtp13.smtpout.orange.fr [80.12.242.135]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3641821 for ; Wed, 12 Jul 2017 12:43:48 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-yb0-f181.google.com ([209.85.213.181]) by mwinf5d71 with ME id joc71v00G3vPQnD03oc7yj; Wed, 12 Jul 2017 14:36:09 +0200 X-ME-Helo: mail-yb0-f181.google.com X-ME-Auth: Y29jaGFyZC1sYWJiZS5vbGl2aWVyQG9yYW5nZS5mcg== X-ME-Date: Wed, 12 Jul 2017 14:36:09 +0200 X-ME-IP: 209.85.213.181 Received: by mail-yb0-f181.google.com with SMTP id f194so6439594yba.3; Wed, 12 Jul 2017 05:36:07 -0700 (PDT) X-Gm-Message-State: AIVw113f5JO6BwjYhYecen14wUlEiTyb/THbt/LVGX7ChY6IxCrz3kZY 0z8jVHyl5PzejvpCYVn8kTKZR4RClw== X-Received: by 10.37.170.13 with SMTP id s13mr544275ybi.239.1499862966596; Wed, 12 Jul 2017 05:36:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.4.195 with HTTP; Wed, 12 Jul 2017 05:35:46 -0700 (PDT) In-Reply-To: <201707112125.v6BLP7Pg093948@repo.freebsd.org> References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Wed, 12 Jul 2017 14:35:46 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: Eric Joyner Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 12:43:50 -0000 On Tue, Jul 11, 2017 at 11:25 PM, Eric Joyner wrote: > Author: erj > Date: Tue Jul 11 21:25:07 2017 > New Revision: 320897 > URL: https://svnweb.freebsd.org/changeset/base/320897 > > Log: > MFC r316541, r316544, and r320688 from HEAD to stable/11. > > =E2=80=8BHi Eric, I've got a regression with this commit: My Intel 82599ES is no more detected. Before this commit: =E2=80=8B[root@R1]~# uname -a FreeBSD R1 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE r320896M amd64 [root@R1]~# pciconf -lv ix0@pci0:21:0:0: class=3D0x020000 card=3D0x00038086 chip=3D0x10fb808= 6 rev=3D0x01 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' class =3D network subclass =3D ethernet ix1@pci0:21:0:1: class=3D0x020000 card=3D0x00038086 chip=3D0x10fb808= 6 rev=3D0x01 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' class =3D network subclass =3D ethernet =E2=80=8B =E2=80=8BAfter this commit:=E2=80=8B =E2=80=8B[root@R1]~# uname -a FreeBSD R1 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE r320897M amd64 [root@R1]~# pciconf -lv none17@pci0:21:0:0: class=3D0x020000 card=3D0x00038086 chip=3D0x10fb808= 6 rev=3D0x01 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' class =3D network subclass =3D ethernet none18@pci0:21:0:1: class=3D0x020000 card=3D0x00038086 chip=3D0x10fb808= 6 rev=3D0x01 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' class =3D network subclass =3D ethernet From owner-svn-src-all@freebsd.org Wed Jul 12 14:34:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1F2D98E09; Wed, 12 Jul 2017 14:34:09 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E3FE6490A; Wed, 12 Jul 2017 14:34:08 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (75-173-114-235.albq.qwest.net [75.173.114.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 975471928AB; Wed, 12 Jul 2017 14:34:05 +0000 (UTC) Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= , Eric Joyner Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: Sean Bruno Message-ID: Date: Wed, 12 Jul 2017 08:34:01 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d74dnrfV52f4tWqMGT3SDuS3hN84fKfev" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 14:34:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d74dnrfV52f4tWqMGT3SDuS3hN84fKfev Content-Type: multipart/mixed; boundary="Iaq062jUuMa1c8cEtFvQ3SckMAnnH8rXB"; protected-headers="v1" From: Sean Bruno To: =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= , Eric Joyner Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> In-Reply-To: --Iaq062jUuMa1c8cEtFvQ3SckMAnnH8rXB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/12/17 06:35, Olivier Cochard-Labb=C3=A9 wrote: > On Tue, Jul 11, 2017 at 11:25 PM, Eric Joyner > wrote: >=20 > Author: erj > Date: Tue Jul 11 21:25:07 2017 > New Revision: 320897 > URL: https://svnweb.freebsd.org/changeset/base/320897 > >=20 > Log: > MFC r316541, r316544, and r320688 from HEAD to stable/11. >=20 >=20 > =E2=80=8BHi Eric, >=20 > I've got a regression with this commit: My Intel 82599ES is no more > detected. >=20 > Before this commit: >=20 > =E2=80=8B[root@R1]~# uname -a > FreeBSD R1 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE r320896M amd64 > [root@R1]~# pciconf -lv > ix0@pci0:21:0:0: class=3D0x020000 card=3D0x00038086 chip=3D0x10f= b8086 > rev=3D0x01 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' > class =3D network > subclass =3D ethernet > ix1@pci0:21:0:1: class=3D0x020000 card=3D0x00038086 chip=3D0x10f= b8086 > rev=3D0x01 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' > class =3D network > subclass =3D ethernet > =E2=80=8B > =E2=80=8BAfter this commit:=E2=80=8B > =E2=80=8B[root@R1]~# uname -a > FreeBSD R1 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE r320897M amd64 > [root@R1]~# pciconf -lv > none17@pci0:21:0:0: class=3D0x020000 card=3D0x00038086 chip=3D0x10f= b8086 > rev=3D0x01 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' > class =3D network > subclass =3D ethernet > none18@pci0:21:0:1: class=3D0x020000 card=3D0x00038086 chip=3D0x10f= b8086 > rev=3D0x01 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D '82599ES 10-Gigabit SFI/SFP+ Network Connection' > class =3D network > subclass =3D ethernet Huh ... is there anything in your console boot messages that would seem to indicate an error on attach? sean --Iaq062jUuMa1c8cEtFvQ3SckMAnnH8rXB-- --d74dnrfV52f4tWqMGT3SDuS3hN84fKfev Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAllmM1lfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZAPAf/fUYXXUsc/YhPoyAeMHj0jPe3cgB1mlZKGnViDDwFydw3tl5WRi8lZTa6 aXYpz+4qc7ln7IV/eUObFULQh52GnRW4iRIn0PfOZyneAInNa7oEhlJ80WvmC27b rJmpzCKNYjPtwKaY3uRnCwUe8szdRez3CdhttwJ7EG2wR9W74iu84leeW5I8w6tr d2ggf7Jo5B7Up1hcOeO7RdiNd/8BJhWAgVam6I/D+oP9CrIIwXLljz39x0BK05x/ zDgQ+qRNolU6Or4sTHkN4UTVnl0hXaiAzW52n/svRixOLZyUBlKCT+FxAP1Mjm3l rvF8xnwssH5WcSUieBDfxGcXbUv7OQ== =q0x2 -----END PGP SIGNATURE----- --d74dnrfV52f4tWqMGT3SDuS3hN84fKfev-- From owner-svn-src-all@freebsd.org Wed Jul 12 14:51:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FE8D99589; Wed, 12 Jul 2017 14:51:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFC5665288; Wed, 12 Jul 2017 14:51:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CEpWHH022778; Wed, 12 Jul 2017 14:51:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CEpW0p022777; Wed, 12 Jul 2017 14:51:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707121451.v6CEpW0p022777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 12 Jul 2017 14:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320914 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/gen X-SVN-Commit-Revision: 320914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 14:51:34 -0000 Author: asomers Date: Wed Jul 12 14:51:32 2017 New Revision: 320914 URL: https://svnweb.freebsd.org/changeset/base/320914 Log: Remove an extraneous strlen from t_setdomainname.c Reported by: Coverity CID: 1377568 MFC after: 15 days X-MFC-With: 320737 Sponsored by: Spectra Logic Corp Modified: head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Wed Jul 12 11:40:09 2017 (r320913) +++ head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Wed Jul 12 14:51:32 2017 (r320914) @@ -83,7 +83,7 @@ restore_domain(void) n += r; if (r < 0) err(1, "read"); - if (setdomainname(domain, strlen(domain)) != 0) + if (setdomainname(domain, n) != 0) err(1, "setdomainname"); close(fd); } From owner-svn-src-all@freebsd.org Wed Jul 12 14:58:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A13D99955 for ; Wed, 12 Jul 2017 14:58:28 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C1ADA656CB for ; Wed, 12 Jul 2017 14:58:27 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-yw0-f172.google.com ([209.85.161.172]) by mwinf5d69 with ME id jqyF1v00S3jUb6x03qyGvS; Wed, 12 Jul 2017 16:58:17 +0200 X-ME-Helo: mail-yw0-f172.google.com X-ME-Auth: Y29jaGFyZC1sYWJiZS5vbGl2aWVyQG9yYW5nZS5mcg== X-ME-Date: Wed, 12 Jul 2017 16:58:17 +0200 X-ME-IP: 209.85.161.172 Received: by mail-yw0-f172.google.com with SMTP id x125so11711903ywa.0; Wed, 12 Jul 2017 07:58:16 -0700 (PDT) X-Gm-Message-State: AIVw1130vTAqlQ2dnV97XytdRtp/lPD+9KWjw6UJc/9z8liJNddArG7y 3TAIAIoY96bzbTfb13HRcGAmpVYKOQ== X-Received: by 10.129.172.103 with SMTP id z39mr2701476ywj.338.1499871495308; Wed, 12 Jul 2017 07:58:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.4.195 with HTTP; Wed, 12 Jul 2017 07:57:54 -0700 (PDT) In-Reply-To: References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Wed, 12 Jul 2017 16:57:54 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: Sean Bruno Cc: Eric Joyner , src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 14:58:28 -0000 On Wed, Jul 12, 2017 at 4:34 PM, Sean Bruno wrote: > Huh ... is there anything in your console boot messages that would seem > to indicate an error on attach? > > =E2=80=8BGood catch, I didn't notice it before: "device_attach: ix0 attach = returned 5". dmeg before this commit: ix0: port 0x2020-0x203f mem 0xfbe80000-0xfbefffff,0xfbf04000-0xfbf07fff irq 24 at device 0.0 on pci3 ix0: Using MSIX interrupts with 5 vectors WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules. ix0: Ethernet address: 90:e2:ba:84:20:38 WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules. ix0: PCI Express Bus: Speed 5.0GT/s Width x8 ix0: netmap queues/slots: TX 4/2048, RX 4/2048 ix1: port 0x2000-0x201f mem 0xfbe00000-0xfbe7ffff,0xfbf00000-0xfbf03fff irq 34 at device 0.1 on pci3 ix1: Using MSIX interrupts with 5 vectors WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules. ix1: Ethernet address: 90:e2:ba:84:20:39 WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules. ix1: PCI Express Bus: Speed 5.0GT/s Width x8 ix1: netmap queues/slots: TX 4/2048, RX 4/2048 dmesg after this commit: =E2=80=8Bix0: port 0x2020-0x203f mem 0xfbe80000-0xfbefffff,0xfbf04000-0xfbf07fff irq 24 at device 0.0 on pci3 ix0: Using MSI-X interrupts with 5 vectors ix0: Unsupported SFP+ module detected! device_attach: ix0 attach returned 5 ix0: port 0x2000-0x201f mem 0xfbe00000-0xfbe7ffff,0xfbf00000-0xfbf03fff irq 34 at device 0.1 on pci3 ix0: Using MSI-X interrupts with 5 vectors ix0: Unsupported SFP+ module detected! device_attach: ix0 attach returned 5 Is it a regression regarding hw.ix.unsupported_sfp=3D"1" value ? From owner-svn-src-all@freebsd.org Wed Jul 12 15:16:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD19FD99ECB; Wed, 12 Jul 2017 15:16:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9E422661A1; Wed, 12 Jul 2017 15:16:02 +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 v6CFG1Ku034303; Wed, 12 Jul 2017 15:16:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CFG14N034302; Wed, 12 Jul 2017 15:16:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707121516.v6CFG14N034302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Jul 2017 15:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320915 - releng/10.3/crypto/heimdal/lib/krb5 X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/10.3/crypto/heimdal/lib/krb5 X-SVN-Commit-Revision: 320915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 15:16:03 -0000 Author: delphij Date: Wed Jul 12 15:16:01 2017 New Revision: 320915 URL: https://svnweb.freebsd.org/changeset/base/320915 Log: Add the missed Heimdal patch, freebsd-update bits are not affected. Noticed by: gordon Approved by: so Modified: releng/10.3/crypto/heimdal/lib/krb5/ticket.c Modified: releng/10.3/crypto/heimdal/lib/krb5/ticket.c ============================================================================== --- releng/10.3/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 14:51:32 2017 (r320914) +++ releng/10.3/crypto/heimdal/lib/krb5/ticket.c Wed Jul 12 15:16:01 2017 (r320915) @@ -713,8 +713,8 @@ _krb5_extract_ticket(krb5_context context, /* check server referral and save principal */ ret = _krb5_principalname2krb5_principal (context, &tmp_principal, - rep->kdc_rep.ticket.sname, - rep->kdc_rep.ticket.realm); + rep->enc_part.sname, + rep->enc_part.srealm); if (ret) goto out; if((flags & EXTRACT_TICKET_ALLOW_SERVER_MISMATCH) == 0){ From owner-svn-src-all@freebsd.org Wed Jul 12 15:42:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9929CD9B4EA; Wed, 12 Jul 2017 15:42:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 4698867975; Wed, 12 Jul 2017 15:42:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 73B79D69A54; Thu, 13 Jul 2017 01:42:26 +1000 (AEST) Date: Thu, 13 Jul 2017 01:42:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320901 - in head/sys: amd64/amd64 isa x86/isa In-Reply-To: <201707120242.v6C2gvDB026199@repo.freebsd.org> Message-ID: <20170712224803.G1991@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=MLXom4X1Ctjlc9KFhS4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 15:42:34 -0000 On Wed, 12 Jul 2017, Ian Lepore wrote: > Log: > Protect access to the AT realtime clock with its own mutex. > > The mutex protecting access to the registered realtime clock should not be > overloaded to protect access to the atrtc hardware, which might not even be > the registered rtc. More importantly, the resettodr mutex needs to be > eliminated to remove locking/sleeping restrictions on clock drivers, and > that can't happen if MD code for amd64 depends on it. This change moves the > protection into what's really being protected: access to the atrtc date and > time registers. The spin mutex provided some protection against timing bugs caused by preemption, but it is impossible to hold the mutex around the user code that is setting the time, so both the kernel and user code should check if the operation took too long and fail/retry if it did. With correct code like that, spin mutexes are still good for limiting retries. I think it is best to try to hold one around the entire kernel part of the operation, and release it when sleeping at lower levels. > Modified: head/sys/x86/isa/atrtc.c > ============================================================================== > --- head/sys/x86/isa/atrtc.c Tue Jul 11 21:55:20 2017 (r320900) > +++ head/sys/x86/isa/atrtc.c Wed Jul 12 02:42:57 2017 (r320901) > @@ -53,9 +53,17 @@ __FBSDID("$FreeBSD$"); > #include > #include "clock_if.h" > > +/* > + * clock_lock protects low-level access to individual hardware registers. > + * atrtc_time_lock protects the entire sequence of accessing multiple registers > + * to read or write the date and time. > + */ > #define RTC_LOCK do { if (!kdb_active) mtx_lock_spin(&clock_lock); } while (0) > #define RTC_UNLOCK do { if (!kdb_active) mtx_unlock_spin(&clock_lock); } while (0) This has a lot of old design and implementation bugs: - it abuses the i8254 mutex for the rtc - it obfuscates this using macros - locking individual register accesses is buggy. Register accesses need to be locked in groups like your new code does - the kdb_active hack is buggy (it can't use mutexes and is unnecessarily non-reentrant) The locks should be separate and statically allocated. > > +struct mtx atrtc_time_lock; > +MTX_SYSINIT(atrtc_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); > + I think the old mutex should be used here, after fixing it. Locking individual register access is a special case of locking groups of register acceses. It must be a spin mutex for low-level use, and that is good for high-level use too, to complete the high-level operations as soon as possible. You used this mutex for efirt.c, but I think that is another error like sharing the i8254 mutex (or the resettodr mutex). Different clock drivers should just use different mutexes. Perhaps some drivers actually need sleep mutexes. > ... > @@ -352,6 +364,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) > * to make sure that no more than 240us pass after we start reading, > * and try again if so. > */ > + mtx_lock(&atrtc_time_lock); > while (rtcin(RTC_STATUSA) & RTCSA_TUP) > continue; > critical_enter(); Note the comment about the 240us window. On i386, this was broken by SMPng, and almost fixed by starting the locking outside of the loop (a spin mutex would fix it). On i386, before SMPng, there was an splhigh() starting before the loop. rtcin() also used splhigh(). This was only shortly before SMPng -- FreeBSD-4 had both splhigh()'s, but FreeBSD-3 had neither. With no locking, an interrupt after the read of the status register can occur, and interrupt handling can easily take longer than the 240us window even if it doesn't cause preemption. critical_enter() in the above gives poor man's locking which blocks preemption but not-so-fast interrupt handlers. The race is not very important since this code only runs at boot time. The old splhigh() locking and a [spin] mutex around the loop lock out interrupts and/or preemption for too long (0-1 seconds), but again this is not very important since this code only runs at boot time. This is fixed in my version, but only for spl locking. The lock is acquired before each test in the loop and dropped after each failing test in the loop. Then operation is completed as far as necessary while the lock is still held. > @@ -369,6 +382,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) > ct.year += (ct.year < 80 ? 2000 : 1900); > #endif > critical_exit(); > + mtx_unlock(&atrtc_time_lock); > /* Set dow = -1 because some clocks don't set it correctly. */ > ct.dow = -1; > return (clock_ct_to_ts(&ct, ts)); The new mtx_lock() should be placed next to the old critical_enter() too. Put these before or after the loop depending on whether races or high latency are preferred. Bruce From owner-svn-src-all@freebsd.org Wed Jul 12 15:44:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E64B5D9B5F0; Wed, 12 Jul 2017 15:44:49 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-yb0-f174.google.com (mail-yb0-f174.google.com [209.85.213.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8EA867AEF; Wed, 12 Jul 2017 15:44:49 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-yb0-f174.google.com with SMTP id f194so8326860yba.3; Wed, 12 Jul 2017 08:44:49 -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=MWBwLMIP0V+/K6pTtnE/fT+nq3orB1bRd8OcWsjGyfw=; b=aj01s9DUQDRTt1bHnLiy3t+OINh4yLe0xWcFqeGb22wgp8zdOt0V0JuAd3082wTLGs Zke1gFxazFsQUiCnGqW6nMFmwEQamxVrFSLIMPvx7oJIcCar+R9H4hNTGflevvUN/VjJ HVORV/dicTVR2eaT0n2jcSWuB5uIcZBeJXe1fmcFujisS38yZM/oSrrrdX9fUJ1VZcHT Ft90F0qvbI9wGluxCmJ7B7YBaLe866CnCC48hab45UAuUuIlj9bImpgp9XQsphgUH9CE aNCzbpN50prKCxqNRodxvA54AsYkoGsgPOcAICkJBFr/mx7YhIZxabO2/9naVgFe873g 945w== X-Gm-Message-State: AIVw112v2PYLP61fP2hL3SbjTfh1leXL0i5w+ybOx1kn4m+8A6vKPxG3 zcZo2MZ8zr6F4nxM9MsHYA== X-Received: by 10.37.175.211 with SMTP id d19mr1314724ybj.78.1499873966976; Wed, 12 Jul 2017 08:39:26 -0700 (PDT) Received: from mail-yb0-f179.google.com (mail-yb0-f179.google.com. [209.85.213.179]) by smtp.gmail.com with ESMTPSA id b126sm962139ywc.38.2017.07.12.08.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 08:39:26 -0700 (PDT) Received: by mail-yb0-f179.google.com with SMTP id n200so2986812ybg.2; Wed, 12 Jul 2017 08:39:26 -0700 (PDT) X-Received: by 10.37.38.5 with SMTP id m5mr1260114ybm.66.1499873965946; Wed, 12 Jul 2017 08:39:25 -0700 (PDT) MIME-Version: 1.0 References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Wed, 12 Jul 2017 15:39:15 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= , Sean Bruno Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 15:44:50 -0000 I think it may have been silently renamed to "allow_unsupported_sfp" instead of "unsupported_sfp". Could you try changing the name of that tunable in your config? On Wed, Jul 12, 2017 at 7:58 AM Olivier Cochard-Labb=C3=A9 wrote: > On Wed, Jul 12, 2017 at 4:34 PM, Sean Bruno wrote: > >> Huh ... is there anything in your console boot messages that would seem >> to indicate an error on attach? >> >> > =E2=80=8BGood catch, I didn't notice it before: "device_attach: ix0 attac= h > returned 5". > > dmeg before this commit: > > ix0: > port 0x2020-0x203f mem 0xfbe80000-0xfbefffff,0xfbf04000-0xfbf07fff irq 24 > at device 0.0 on pci3 > ix0: Using MSIX interrupts with 5 vectors > WARNING: Intel (R) Network Connections are quality tested using Intel (R) > Ethernet Optics. Using untested modules is not supported and may cause > unstable operation or damage to the module or the adapter. Intel > Corporation is not responsible for any harm caused by using untested > modules. > ix0: Ethernet address: 90:e2:ba:84:20:38 > WARNING: Intel (R) Network Connections are quality tested using Intel (R) > Ethernet Optics. Using untested modules is not supported and may cause > unstable operation or damage to the module or the adapter. Intel > Corporation is not responsible for any harm caused by using untested > modules. > ix0: PCI Express Bus: Speed 5.0GT/s Width x8 > ix0: netmap queues/slots: TX 4/2048, RX 4/2048 > ix1: > port 0x2000-0x201f mem 0xfbe00000-0xfbe7ffff,0xfbf00000-0xfbf03fff irq 34 > at device 0.1 on pci3 > ix1: Using MSIX interrupts with 5 vectors > WARNING: Intel (R) Network Connections are quality tested using Intel (R) > Ethernet Optics. Using untested modules is not supported and may cause > unstable operation or damage to the module or the adapter. Intel > Corporation is not responsible for any harm caused by using untested > modules. > ix1: Ethernet address: 90:e2:ba:84:20:39 > WARNING: Intel (R) Network Connections are quality tested using Intel (R) > Ethernet Optics. Using untested modules is not supported and may cause > unstable operation or damage to the module or the adapter. Intel > Corporation is not responsible for any harm caused by using untested > modules. > ix1: PCI Express Bus: Speed 5.0GT/s Width x8 > ix1: netmap queues/slots: TX 4/2048, RX 4/2048 > > dmesg after this commit: > > =E2=80=8Bix0: > port 0x2020-0x203f mem 0xfbe80000-0xfbefffff,0xfbf04000-0xfbf07fff irq 24 > at device 0.0 on pci3 > ix0: Using MSI-X interrupts with 5 vectors > ix0: Unsupported SFP+ module detected! > device_attach: ix0 attach returned 5 > ix0: > port 0x2000-0x201f mem 0xfbe00000-0xfbe7ffff,0xfbf00000-0xfbf03fff irq 34 > at device 0.1 on pci3 > ix0: Using MSI-X interrupts with 5 vectors > ix0: Unsupported SFP+ module detected! > device_attach: ix0 attach returned 5 > > Is it a regression regarding hw.ix.unsupported_sfp=3D"1" value ? > From owner-svn-src-all@freebsd.org Wed Jul 12 16:27:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31208D9C9A2 for ; Wed, 12 Jul 2017 16:27:15 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BDDC66A499 for ; Wed, 12 Jul 2017 16:27:13 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-yb0-f175.google.com ([209.85.213.175]) by mwinf5d17 with ME id jsT81v00B3ndNld03sT8Z6; Wed, 12 Jul 2017 18:27:10 +0200 X-ME-Helo: mail-yb0-f175.google.com X-ME-Auth: Y29jaGFyZC1sYWJiZS5vbGl2aWVyQG9yYW5nZS5mcg== X-ME-Date: Wed, 12 Jul 2017 18:27:10 +0200 X-ME-IP: 209.85.213.175 Received: by mail-yb0-f175.google.com with SMTP id n205so6499810yba.1; Wed, 12 Jul 2017 09:27:08 -0700 (PDT) X-Gm-Message-State: AIVw110vMoogTfk787ENHUvVeQ/RM+wF7OGK2J8tD1KRtX2WVgZCb5i0 qSoAfywYTOUfyjyo1W7sHD1Mm9nv5w== X-Received: by 10.129.172.103 with SMTP id z39mr3007344ywj.338.1499876827869; Wed, 12 Jul 2017 09:27:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.4.195 with HTTP; Wed, 12 Jul 2017 09:26:47 -0700 (PDT) In-Reply-To: References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Wed, 12 Jul 2017 18:26:47 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: Eric Joyner Cc: Sean Bruno , src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 16:27:15 -0000 On Wed, Jul 12, 2017 at 5:39 PM, Eric Joyner wrote: > I think it may have been silently renamed to "allow_unsupported_sfp" > instead of "unsupported_sfp". Could you try changing the name of that > tunable in your config? > > =E2=80=8BThanks Eric! Replacing this previous line into my /boot/loader.conf hw.ix.unsupported_sfp=3D"1" by this new one: hw.ix.allow_unsupported_sfp=3D"1"=E2=80=8B =E2=80=8Bsolved the problem: -) but this broke POLA :-( And the default behavior is not very sysadmin friendly: How, with the message "device_attach: ix0 attach returned 5" and no more ix interface detected, can I know it just came from using unsupported SFP ? From owner-svn-src-all@freebsd.org Wed Jul 12 16:28:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A8F2D9CA33; Wed, 12 Jul 2017 16:28:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B7326A5EF; Wed, 12 Jul 2017 16:28:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D992310AF07; Wed, 12 Jul 2017 12:28:45 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320900 - in head/sys: fs/cd9660 fs/ext2fs fs/fifofs fs/msdosfs fs/nandfs fs/nfsclient fs/smbfs fs/tmpfs ufs/ufs Date: Wed, 12 Jul 2017 09:28:42 -0700 Message-ID: <2198764.5xJVkxmjDt@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170712184348.Q1271@besplex.bde.org> References: <201707112155.v6BLtKbZ006618@repo.freebsd.org> <20170712184348.Q1271@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 12 Jul 2017 12:28:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 16:28:47 -0000 On Wednesday, July 12, 2017 08:08:42 PM Bruce Evans wrote: > On Tue, 11 Jul 2017, John Baldwin wrote: > > > Log: > > Consistently use vop_stdpathconf() for default pathconf values. > > > > Update filesystems not currently using vop_stdpathconf() in pathconf > > VOPs to use vop_stdpathconf() for any configuration variables that do > > not have filesystem-specific values. vop_stdpathconf() is used for > > variables that have system-wide settings as well as providing default > > values for some values based on system limits. Filesystems can still > > explicitly override individual settings. > > This is sort of backwards. Not many settings are the same for most > file systems, and many that did were wrong. Now more are wrong. > > > Modified: head/sys/fs/cd9660/cd9660_vnops.c > > ============================================================================== > > --- head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > > +++ head/sys/fs/cd9660/cd9660_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > > @@ -792,20 +792,11 @@ cd9660_pathconf(ap) > > else > > *ap->a_retval = 37; > > return (0); > > - case _PC_PATH_MAX: > > - *ap->a_retval = PATH_MAX; > > - return (0); > > PATH_MAX is one of the few that is system-wide. > > > - case _PC_PIPE_BUF: > > - *ap->a_retval = PIPE_BUF; > > - return (0); > > PIPE_BUF isn't system wide. cd9660 does support fifos, but setting it > for files that aren't fifos or directories is bogus. POSIX allows such > bogus settings, and needs complicated wording to describe this. E.g., > PIPE_BUF for a directory is not completely bogus and it means that the > value for the directory applies to all fifos in the directory and is > ignored for all non-fifos in the directory. It is unclear if PIPE_BUF > must be set for a directory if there is any fifo in the directory. > FreeBSD's man pages give no details about this. PIPE_BUF is system wide because all FIFOs in FreeBSD are implemented via a common fifo implementation that has a single size. The wording about PIPE_BUF from http://pubs.opengroup.org/onlinepubs/009695399/functions/fpathconf.html: If path refers to a FIFO, or fildes refers to a pipe or FIFO, the value returned shall apply to the referenced object. If path or fildes refers to a directory, the value returned shall apply to any FIFO that exists or can be created within the directory. If path or fildes refers to any other type of file, it is unspecified whether an implementation supports an association of the variable name with the specified file. This leaves the value for non-directories and non-FIFOs undefined. We could perhaps add more complexity to fail with EINVAL for types other than VFIFO or VDIR, and filesystems that do not support FIFOs could fail _PC_PIPE_BUF in their fs-specific vnop, but this would not be any more correct as both behaviors fall into "undefined", but the current one is simpler to implement. > > - case _PC_CHOWN_RESTRICTED: > > - *ap->a_retval = 1; > > - return (0); > > This is system-wide. > > > case _PC_NO_TRUNC: > > *ap->a_retval = 1; > > return (0); > > This is almost system-wide. > > > default: > > - return (EINVAL); > > + return (vop_stdpathconf(ap)); > > This is fail-unsafe. It gives bogus settings like PIPE_BUF for all cases. > Case statements in file systems need to be even larger to kill defaults, > and the code becomes harder to read since it is harder to see the final > values. > > vop_stdpathconf() has defaults for: > - ASYNC_IO. Is this system-wide (all in vfs?) Yes. > - NAME_MAX. This is very far from system-wide > - PATH_MAX. This is system-wide. > - LINK_MAX. This is very far from system-wide, especially after expansion > of nlink_t. Most file systems get this wrong. LINK_MAX is bogusly > defined to be the constant 32767, but the value is very variable. > zfs_pathconf() returns INT_MAX and zfs uses something like int32_t > internally, but zfs_getattr() clamps to LINK_MAX. ext2fs limits to > 32000 for ext2 and 65000 for ext4 internally but ext2_pathconf() > only returns this limit in some cases -- other cases return INT_MAX. In theory if a filesystem supported an infinite link count or name count it would have no filesystem-specific limit and having LINK_MAX and NAME_MAX provide the system limits gives a reasonable default in that case. I don't know if any filesystem supports infinite limits in practice, but it's also true that the correct behavior in each filesystem would be to return a value like MIN(fs_limit, system_limit), not just the native filesystem limit. Perhaps this could be implemented by a post-processing step for VOP_PATHCONF that truncates values that exceed system limits to system limits. > - MAX_CANON. This is garbage except for terminals (and directories). > Its value is also wrong. > - MAX_INPUT. Like MAX_CANON. Again, POSIX leaves it undefined for other types, so it doesn't matter what we return. Quoting from the same URL for a note on these two: If path or fildes does not refer to a terminal file, it is unspecified whether an implementation supports an association of the variable name with the specified file. > - PIPE_BUF. Like MAX_CANON, for fifos instead of terminals. > - CHOWN_RESTRICTED. Wrong for file systems that don't support ownerships > or changing them. Might depend on mount options. > - VDISABLE. Like MAX_CANON. Same note for MAX_CANON applies. > > This is easy to improve: > - NAME_MAX, LINK_MAX: move to individual fs's That probably is true. In this case I was just trying to reduce overrides to the ones that were really fs-specific. The existing places that used NAME_MAX and LINK_MAX were also likely wrong as they did not return a filesystem-specific value. > - MAX_CANON, MAX_INPUT, VDISABLE: move to devfs_pathconf(). That is probably fine as well as it is simple and doesn't add complexity. > - PIPE_BUF: move to fifo_pathconf()? What about directories? I think this one should be standard for the reasons I gave above. If we really wanted to, we could make it conditional on the type (VFIFO and VDIR) without adding a lot of complexity. > > Modified: head/sys/fs/fifofs/fifo_vnops.c > > ============================================================================== > > --- head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > > +++ head/sys/fs/fifofs/fifo_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > > @@ -337,34 +336,6 @@ fifo_print(ap) > > fifo_printinfo(ap->a_vp); > > printf("\n"); > > return (0); > > -} > > - > > -/* > > - * Return POSIX pathconf information applicable to fifo's. > > - */ > > -static int > > -fifo_pathconf(ap) > > - struct vop_pathconf_args /* { > > - struct vnode *a_vp; > > - int a_name; > > - int *a_retval; > > - } */ *ap; > > -{ > > - > > - switch (ap->a_name) { > > - case _PC_LINK_MAX: > > - *ap->a_retval = LINK_MAX; > > - return (0); > > - case _PC_PIPE_BUF: > > - *ap->a_retval = PIPE_BUF; > > - return (0); > > - case _PC_CHOWN_RESTRICTED: > > - *ap->a_retval = 1; > > - return (0); > > - default: > > - return (EINVAL); > > - } > > - /* NOTREACHED */ > > } > > This was small and hopefully correct. Not many settings apply to fifos. > It seems a but too small to be correct -- why would LINK_MAX apply but > not PATH_MAX? Using the default, a pathconf which wants to set only 3 > value would need about 15 cases to kill all the defaults. This was not really correct since at least NAME_MAX was missing, but it also should never have been used as a full VOP. The parent filesystem in which the FIFO resides dictates values like LINK_MAX and NAME_MAX. The only safe way to use fifo_pathconf() is to have a per-fs wrapper that supplies FS-specific properties like NAME_MAX and LINK_MAX and only invokes fifo_pathconf for FIFO-specific properties. However, the only FIFO-specific property is PIPE_BUF, and the parent fs already has to handle that in the FS-specific pathconf VOP to support PIPE_BUF on directories, so the FS-specific pathconf VOP already works correctly for FIFOs and there is no need for a fifo_pathconf. > > Modified: head/sys/fs/msdosfs/msdosfs_vnops.c > > ============================================================================== > > --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > > +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > > @@ -1875,17 +1875,11 @@ msdosfs_pathconf(struct vop_pathconf_args *ap) > > case _PC_NAME_MAX: > > *ap->a_retval = pmp->pm_flags & MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12; > > return (0); > > - case _PC_PATH_MAX: > > - *ap->a_retval = PATH_MAX; > > - return (0); > > - case _PC_CHOWN_RESTRICTED: > > - *ap->a_retval = 1; > > - return (0); > > case _PC_NO_TRUNC: > > *ap->a_retval = 0; > > return (0); > > default: > > - return (EINVAL); > > + return (vop_stdpathconf(ap)); > > msdosfs doesn't support pipes. It used to indicate this by not having > _PC_PIPE_MAX. Now it gets this via pollution in vop_stdpathconf(ap). >From what I can tell (and from the note I referenced above), POSIX doesn't define if the variable is defined on filesystems that don't support FIFOs. It only says that the value on a directory must be true for any FIFO that "exists or can be created". Since mkfifo() will fail and open() will never return a vnode with VFIFO on such filesystems, the value is meaningless. > msdosfs also has unusual handling for LINK_MAX, NAME_MAX and NO_TRUNC. > It still has this, with buggy limits in all cases: > - msdosfs doesn't support links. It returns 1 for LINK_MAX instead of -1 > (unsupported) > - NAME_MAX doesn't really apply to shortnames. 12 is returned instead > of the 2 limits 8 and 3. > - msdosfs truncates only for shortnames, so NO_TRUNC = 0 is wrong for > !shortnames. > > Almost all file systems except msdosfs return 1 for NO_TRUNC, but this > is not defaulted. That may indeed be a good candidate for moving to stdpathconf. > > Modified: head/sys/ufs/ufs/ufs_vnops.c > > ============================================================================== > > --- head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:52:11 2017 (r320899) > > +++ head/sys/ufs/ufs/ufs_vnops.c Tue Jul 11 21:55:20 2017 (r320900) > > @@ -2442,21 +2442,9 @@ ufs_pathconf(ap) > > > > error = 0; > > switch (ap->a_name) { > > - case _PC_LINK_MAX: > > - *ap->a_retval = LINK_MAX; > > - break; > > case _PC_NAME_MAX: > > *ap->a_retval = UFS_MAXNAMLEN; > > break; > > LINK_MAX is basically ffs's limit. > > NAME_MAX _is_ ffs's limit, but it is still defaulted. > > I expect that some of the other defaulted limits will become more variable > (so unsuitable as defaults). LINK_MAX is almost there. > > > @@ -2505,11 +2493,6 @@ ufs_pathconf(ap) > > case _PC_MIN_HOLE_SIZE: > > *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; > > break; > > - case _PC_ASYNC_IO: > > - /* _PC_ASYNC_IO should have been handled by upper layers. */ > > - KASSERT(0, ("_PC_ASYNC_IO should not get here")); > > - error = EINVAL; > > - break; > > case _PC_PRIO_IO: > > *ap->a_retval = 0; > > break; > > But some of the newer limits like are in vfs so should have been defaulted? _PC_ASYNC_IO used to be explicitly handled in the pathconf system calls as a special case. I had moved it to vop_stdpathconf() so that it was handled in one place (rather than 3), but had missed these specific handlers in existing pathconf VOPs. System-wide pathconf values should really be in one place in vop_stdpathconf(). We might want to alter the list of things in vop_stdpathconf(), but I think all filesystems should fall through to it and only override values that are filesystem-specific. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jul 12 17:00:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E250D9D729; Wed, 12 Jul 2017 17:00:59 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-yb0-f177.google.com (mail-yb0-f177.google.com [209.85.213.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF296E51C; Wed, 12 Jul 2017 17:00:59 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-yb0-f177.google.com with SMTP id 84so9526918ybe.0; Wed, 12 Jul 2017 10:00:59 -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=O3FmflRm7X6rFzRUDlI2Ze6FsOLFObtlOIEig67LmB0=; b=P6mCdKPD07prxRVmRN2JzNJSUx+z/G+3jqq7O+/6osLHoeBxAPHmWub7cveQ8yoN80 lICOLJIG/Uu5lNEvRCdj1KLZxX00s5APgN0MWQzcjqZzVJbrPmcVyEa9wL129RiTmqpL OES/TdPl2/tP0Fa1WCMPgU7IC2r5f0rdhMfrcJUHl468KCBt8J29HJjFIMV90Ho9LMpc TGgR3DXo4QIlmTNA++LRCResJro2t3p3mSdsg3iMD28YNtRvC/ooQzuBgXClAfnUlAf8 3J71N4cpabpSK57T/oz2WekoLjGIa6CKJWzcF9mDV9YMA0wYnhTV05El6PktFZaR1urt xhSQ== X-Gm-Message-State: AIVw113Yj8DOd9mGGyPFpBrQZ5wh6EO+PkniBDcfglGdmu2a2rIvwshN 6o9tHp7HNRgovxHHP0f9Vw== X-Received: by 10.13.212.206 with SMTP id w197mr2998426ywd.63.1499877312215; Wed, 12 Jul 2017 09:35:12 -0700 (PDT) Received: from mail-yb0-f172.google.com (mail-yb0-f172.google.com. [209.85.213.172]) by smtp.gmail.com with ESMTPSA id b126sm1007849ywc.38.2017.07.12.09.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 09:35:11 -0700 (PDT) Received: by mail-yb0-f172.google.com with SMTP id 84so9010706ybe.0; Wed, 12 Jul 2017 09:35:11 -0700 (PDT) X-Received: by 10.13.219.140 with SMTP id d134mr2638419ywe.220.1499877311545; Wed, 12 Jul 2017 09:35:11 -0700 (PDT) MIME-Version: 1.0 References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Wed, 12 Jul 2017 16:35:00 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Sean Bruno , src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 17:00:59 -0000 Olivier, There is a message about it in dmesg, right? For the error code, there's not much we can do there aside from adding a new unsupported SFP+ code to errno.h, which doesn't seem appropriate. On Wed, Jul 12, 2017 at 9:27 AM Olivier Cochard-Labb=C3=A9 wrote: > On Wed, Jul 12, 2017 at 5:39 PM, Eric Joyner wrote: > >> I think it may have been silently renamed to "allow_unsupported_sfp" >> instead of "unsupported_sfp". Could you try changing the name of that >> tunable in your config? >> >> > =E2=80=8BThanks Eric! > > Replacing this previous line into my /boot/loader.conf > hw.ix.unsupported_sfp=3D"1" > by this new one: > hw.ix.allow_unsupported_sfp=3D"1"=E2=80=8B > > > =E2=80=8Bsolved the problem: -) but this broke POLA :-( > > And the default behavior is not very sysadmin friendly: > How, with the message "device_attach: ix0 attach returned 5" and no more > ix interface detected, can I know it just came from using unsupported SFP= ? > > From owner-svn-src-all@freebsd.org Wed Jul 12 17:16:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B543D9E46B; Wed, 12 Jul 2017 17:16:21 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost2.sentex.ca (smarthost2.sentex.ca [205.211.164.50]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "smarthost.sentex.ca", Issuer "smarthost.sentex.ca" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D73A6F664; Wed, 12 Jul 2017 17:16:21 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (lava.sentex.ca [IPv6:2607:f3e0:0:5::11]) by smarthost2.sentex.ca (8.15.2/8.15.2) with ESMTPS id v6CHG9fQ058321 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 12 Jul 2017 13:16:09 -0400 (EDT) (envelope-from mike@sentex.net) Received: from [192.168.43.26] (saphire3.sentex.net [192.168.43.26]) by lava.sentex.ca (8.15.2/8.15.2) with ESMTP id v6CHG79t068819; Wed, 12 Jul 2017 13:16:07 -0400 (EDT) (envelope-from mike@sentex.net) Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: Eric Joyner , =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= Cc: svn-src-stable@freebsd.org, Sean Bruno , src-committers , svn-src-all , svn-src-stable-11@freebsd.org References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: Mike Tancsa Organization: Sentex Communications Message-ID: Date: Wed, 12 Jul 2017 13:16:07 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 17:16:21 -0000 Hi Eric, For stable users, can the loader.conf variable not be the original one ? Especially for servers that are physically remote, a sysadmin might expect (wrongly or not) for the name not the change in a stable branch. If the box is remote, they would not be able to see the new dmesg error. Rather than change the name, perhaps a deprecation warning saying "In FreeBSD 12, this will be hw.ix.allow_unsupported_sfp" ? ---Mike On 7/12/2017 12:35 PM, Eric Joyner wrote: > Olivier, > > There is a message about it in dmesg, right? For the error code, there's > not much we can do there aside from adding a new unsupported SFP+ code to > errno.h, which doesn't seem appropriate. > > On Wed, Jul 12, 2017 at 9:27 AM Olivier Cochard-Labbé > wrote: > >> On Wed, Jul 12, 2017 at 5:39 PM, Eric Joyner wrote: >> >>> I think it may have been silently renamed to "allow_unsupported_sfp" >>> instead of "unsupported_sfp". Could you try changing the name of that >>> tunable in your config? >>> >>> >> ​Thanks Eric! >> >> Replacing this previous line into my /boot/loader.conf >> hw.ix.unsupported_sfp="1" >> by this new one: >> hw.ix.allow_unsupported_sfp="1"​ >> >> >> ​solved the problem: -) but this broke POLA :-( >> >> And the default behavior is not very sysadmin friendly: >> How, with the message "device_attach: ix0 attach returned 5" and no more >> ix interface detected, can I know it just came from using unsupported SFP ? >> >> > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" > > -- ------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ From owner-svn-src-all@freebsd.org Wed Jul 12 17:30:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4747D9EB7D; Wed, 12 Jul 2017 17:30:35 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5C146FF49; Wed, 12 Jul 2017 17:30:35 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (75-173-114-235.albq.qwest.net [75.173.114.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1268E1928AB; Wed, 12 Jul 2017 17:30:32 +0000 (UTC) Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv To: Mike Tancsa , Eric Joyner , =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= Cc: svn-src-stable@freebsd.org, src-committers , svn-src-all , svn-src-stable-11@freebsd.org References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> From: Sean Bruno Message-ID: <4e74f325-5fbf-d53c-49df-dd2321f0bbf3@freebsd.org> Date: Wed, 12 Jul 2017 11:30:28 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RB08XEWuRsTNe1x9MiJ8AD3MiHwD6S0Oq" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 17:30:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RB08XEWuRsTNe1x9MiJ8AD3MiHwD6S0Oq Content-Type: multipart/mixed; boundary="mqcVd27kTUk20I933pSCJUFKKGm4EVuFO"; protected-headers="v1" From: Sean Bruno To: Mike Tancsa , Eric Joyner , =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= Cc: svn-src-stable@freebsd.org, src-committers , svn-src-all , svn-src-stable-11@freebsd.org Message-ID: <4e74f325-5fbf-d53c-49df-dd2321f0bbf3@freebsd.org> Subject: Re: svn commit: r320897 - in stable/11/sys: conf dev/ixgbe modules/ix modules/ixv References: <201707112125.v6BLP7Pg093948@repo.freebsd.org> In-Reply-To: --mqcVd27kTUk20I933pSCJUFKKGm4EVuFO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Just so that its clear, this will be changed back to the original string shortly. sean On 07/12/17 11:16, Mike Tancsa wrote: > Hi Eric, > For stable users, can the loader.conf variable not be the original one= > ? Especially for servers that are physically remote, a sysadmin might > expect (wrongly or not) for the name not the change in a stable branch.= > If the box is remote, they would not be able to see the new dmesg error= =2E > Rather than change the name, perhaps a deprecation warning saying "In > FreeBSD 12, this will be hw.ix.allow_unsupported_sfp" ? >=20 > ---Mike >=20 >=20 > On 7/12/2017 12:35 PM, Eric Joyner wrote: >> Olivier, >> >> There is a message about it in dmesg, right? For the error code, there= 's >> not much we can do there aside from adding a new unsupported SFP+ code= to >> errno.h, which doesn't seem appropriate. >> >> On Wed, Jul 12, 2017 at 9:27 AM Olivier Cochard-Labb=C3=A9 >> wrote: >> >>> On Wed, Jul 12, 2017 at 5:39 PM, Eric Joyner wrote:= >>> >>>> I think it may have been silently renamed to "allow_unsupported_sfp"= >>>> instead of "unsupported_sfp". Could you try changing the name of tha= t >>>> tunable in your config? >>>> >>>> >>> =E2=80=8BThanks Eric! >>> >>> Replacing this previous line into my /boot/loader.conf >>> hw.ix.unsupported_sfp=3D"1" >>> by this new one: >>> hw.ix.allow_unsupported_sfp=3D"1"=E2=80=8B >>> >>> >>> =E2=80=8Bsolved the problem: -) but this broke POLA :-( >>> >>> And the default behavior is not very sysadmin friendly: >>> How, with the message "device_attach: ix0 attach returned 5" and no m= ore >>> ix interface detected, can I know it just came from using unsupported= SFP ? >>> >>> >> _______________________________________________ >> svn-src-stable-11@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 >> To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebs= d.org" >> >> >=20 >=20 --mqcVd27kTUk20I933pSCJUFKKGm4EVuFO-- --RB08XEWuRsTNe1x9MiJ8AD3MiHwD6S0Oq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAllmXLRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /Lb84wgAju1N6jasSQsDrn41ED0wnzP8YPnul9T1DIun1PWQNvKuGn40akXnE/oE DT3hgeUe4J7IAYPrytwKXIB7N+7deKt6ec6UZ1JbA8/TGqS22leoqxlruuzLJkMj JsE8pIhDQ9p+Zxiq/gAfqouKh7HHPqNis5xh2yXSUof1kD2bLlrpO75mkm3GF8Wh 0B67lILQsnMF7V4Sk+j3KbLvuPqsw/cDtJUxpzRHX6W8Pp9MHC7aeF6YdPhDY+H7 lnFWA+onagdqlFsGwpQsADHxBrIdg/L+kgebUH9pT2aEfUsUBvUAk6j1ihfSS3jJ zj/0VBoj/T4M747dPGRyj+LvIA5Lbg== =Tqs3 -----END PGP SIGNATURE----- --RB08XEWuRsTNe1x9MiJ8AD3MiHwD6S0Oq-- From owner-svn-src-all@freebsd.org Wed Jul 12 17:35:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042D1D9EDDA; Wed, 12 Jul 2017 17:35:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C49C070368; Wed, 12 Jul 2017 17:35:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CHZWWF091334; Wed, 12 Jul 2017 17:35:32 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CHZWNY091333; Wed, 12 Jul 2017 17:35:32 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707121735.v6CHZWNY091333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 12 Jul 2017 17:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320916 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 320916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 17:35:34 -0000 Author: sbruno Date: Wed Jul 12 17:35:32 2017 New Revision: 320916 URL: https://svnweb.freebsd.org/changeset/base/320916 Log: Reset unsupported SFP tuneable back to original entry name. Reported by: olivier@ Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Jul 12 15:16:01 2017 (r320915) +++ head/sys/dev/ixgbe/if_ix.c Wed Jul 12 17:35:32 2017 (r320916) @@ -333,7 +333,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgb * doing so you are on your own :) */ static int allow_unsupported_sfp = FALSE; -SYSCTL_INT(_hw_ix, OID_AUTO, allow_unsupported_sfp, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN, &allow_unsupported_sfp, 0, "Allow unsupported SFP modules...use at your own risk"); From owner-svn-src-all@freebsd.org Wed Jul 12 17:51:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F8FCD9F158; Wed, 12 Jul 2017 17:51:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD69F708F1; Wed, 12 Jul 2017 17:51:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CHp00g096298; Wed, 12 Jul 2017 17:51:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CHp0tJ096297; Wed, 12 Jul 2017 17:51:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707121751.v6CHp0tJ096297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 12 Jul 2017 17:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320917 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 320917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 17:51:02 -0000 Author: sbruno Date: Wed Jul 12 17:51:00 2017 New Revision: 320917 URL: https://svnweb.freebsd.org/changeset/base/320917 Log: MFC r320916 Reset unsupported SFP tuneable back to original entry name. Reported by: olivier@ Modified: stable/11/sys/dev/ixgbe/if_ix.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Wed Jul 12 17:35:32 2017 (r320916) +++ stable/11/sys/dev/ixgbe/if_ix.c Wed Jul 12 17:51:00 2017 (r320917) @@ -333,7 +333,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgb * doing so you are on your own :) */ static int allow_unsupported_sfp = FALSE; -SYSCTL_INT(_hw_ix, OID_AUTO, allow_unsupported_sfp, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN, &allow_unsupported_sfp, 0, "Allow unsupported SFP modules...use at your own risk"); From owner-svn-src-all@freebsd.org Wed Jul 12 18:29:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD53ED9FF68; Wed, 12 Jul 2017 18:29:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7038F71EE4; Wed, 12 Jul 2017 18:29:26 +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 v6CITPO4012103; Wed, 12 Jul 2017 18:29:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CITPxG012102; Wed, 12 Jul 2017 18:29:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707121829.v6CITPxG012102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 12 Jul 2017 18:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320918 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 320918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 18:29:26 -0000 Author: markj Date: Wed Jul 12 18:29:25 2017 New Revision: 320918 URL: https://svnweb.freebsd.org/changeset/base/320918 Log: Add a newline after the version string. MFC after: 3 days Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Jul 12 17:51:00 2017 (r320917) +++ head/sbin/savecore/savecore.c Wed Jul 12 18:29:25 2017 (r320918) @@ -119,7 +119,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); - xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}\n", h->versionstring); xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); From owner-svn-src-all@freebsd.org Wed Jul 12 19:01:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D2BDA0B0F; Wed, 12 Jul 2017 19:01:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0014731D1; Wed, 12 Jul 2017 19:01:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CJ1PUx025374; Wed, 12 Jul 2017 19:01:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CJ1P7A025373; Wed, 12 Jul 2017 19:01:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707121901.v6CJ1P7A025373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 12 Jul 2017 19:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320919 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 320919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 19:01:27 -0000 Author: bdrewery Date: Wed Jul 12 19:01:25 2017 New Revision: 320919 URL: https://svnweb.freebsd.org/changeset/base/320919 Log: META_MODE: Fix not writing .meta files in the kernel build. This was a regression in r320220 due to improper porting of the same logic from share/mk/bsd.dep.mk and having only tested with -DNO_FILEMON at the time. Pointyhat to: bdrewery Reported by: Mark Millard, dhw, O. Hartmann Sponsored by: Dell EMC Isilon Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Jul 12 18:29:25 2017 (r320918) +++ head/sys/conf/kern.post.mk Wed Jul 12 19:01:25 2017 (r320919) @@ -203,8 +203,7 @@ _meta_filemon= 1 # for _meta_filemon but not for _SKIP_DEPEND. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(*obj) || \ ${.TARGETS:M*clean*} == ${.TARGETS} || \ - ${.TARGETS:M*install*} == ${.TARGETS} || \ - defined(_meta_filemon) + ${.TARGETS:M*install*} == ${.TARGETS} _SKIP_DEPEND= 1 .endif .if defined(_SKIP_DEPEND) || defined(_meta_filemon) From owner-svn-src-all@freebsd.org Wed Jul 12 19:52:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF7F3DA2265; Wed, 12 Jul 2017 19:52:22 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B901C75676; Wed, 12 Jul 2017 19:52:22 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 6662D69A; Wed, 12 Jul 2017 12:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1499889136; bh=4x1gbAAvvLCg6yTMlZdcLHw0xHqRu5uIbzDq1sPq5Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BgxmegaSa8U7lkjqpWIjStFuBGgxbget5A/OuH1u7/nP3NdJ4bbytwEcKmIQ2d90B vwinc0NtXhrjdTQqnFLPXc7y6Vgl1RgAjUjHs+AE/ylt7vGR7wcmDn31MxYBFXhoUa +cxBFCONZDVtKEbzwA0hmGsOCs3N3kyYmMSzrXzo= From: Peter Wemm To: Andriy Gapon Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r320452 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Date: Wed, 12 Jul 2017 12:52:14 -0700 Message-ID: <1620155.k5U0yJ7ekR@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <2227668.mxUYtcVILl@overcee.wemm.org> References: <201706281359.v5SDxKDB033681@repo.freebsd.org> <2865573.6VCVxXl8ZR@overcee.wemm.org> <2227668.mxUYtcVILl@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2290573.tQ58bQ8BqM"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 19:52:22 -0000 --nextPart2290573.tQ58bQ8BqM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday, July 11, 2017 11:55:47 PM Peter Wemm wrote: > On Tuesday, July 11, 2017 11:08:15 PM Peter Wemm wrote: > > On Wednesday, June 28, 2017 01:59:20 PM Andriy Gapon wrote: > > > A side bonus of this change is that now a vdev zio has a pointe= r > > > to its corresponding bio while the zio is active. > >=20 > > fault virtual address =3D 0x28 > >=20 > >=20 > > db> where > > Tracing pid 0 tid 100471 td 0xfffff80005452000 > > vdev_geom_io_done() at vdev_geom_io_done+0x36/frame 0xfffffe0239f9e= aa0 > > zio_vdev_io_done() at zio_vdev_io_done+0x176/frame 0xfffffe0239f9ea= d0 > > zio_execute() at zio_execute+0xac/frame 0xfffffe0239f9eb20 >=20 > Oops, truncated. >=20 >=20 > taskqueue_run_locked() at taskqueue_run_locked+0x127/frame > 0xfffffe0239f9eb80 taskqueue_thread_loop() at > taskqueue_thread_loop+0xc8/frame 0xfffffe0239f9ebb0 fork_exit() at > fork_exit+0x85/frame 0xfffffe0239f9ebf0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0239f9ebf0 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- Likewise with a disk failing or being put offline. eg: the explicit o= fflining=20 case, making a vdev degrade: root@nope.ysv:/home/peter # zpool offline zroot mfid5p3 atal trap 12: page fault while in kernel mode cpuid =3D 4; apic id =3D 04 Fatal trap 12: page fault while in kernel mode fault virtual address=09=3D 0x28 Fatal trap 12: page fault while in kernel mode Fatal trap 12: page fault while in kernel mode Fatal trap 12: page fault while in kernel mode cpuid =3D 7; apic id =3D 07 cpuid =3D 1; apic id =3D 01 fault virtual address=09=3D 0x28 fault code=09=09=3D supervisor read data, page not present cpuid =3D 3; cpuid =3D 5; apic id =3D 03 Fatal trap 12: page fault while in kernel mode apic id =3D 05 fault virtual address=09=3D 0x28 fault virtual address=09=3D 0x28 fault code=09=09=3D supervisor read data, page not present instruction pointer=09=3D 0x20:0xffffffff803aab56 stack pointer=09 =3D 0x28:0xfffffe085fb3aa90 instruction pointer=09=3D 0x20:0xffffffff803aab56 fault code=09=09=3D supervisor read data, page not present cpuid =3D 6; fault virtual address=09=3D 0x28 Fatal trap 12: page fault while in kernel mode fault code=09=09=3D supervisor read data, page not present instruction pointer=09=3D 0x20:0xffffffff803aab56 stack pointer=09 =3D 0x28:0xfffffe085fb3fa90 frame pointer=09 =3D 0x28:0xfffffe085fb3aaa0 fault code=09=09=3D supervisor read data, page not present cpuid =3D 2; apic id =3D 02 apic id =3D 06 instruction pointer=09=3D 0x20:0xffffffff803aab56 fault virtual address=09=3D 0x28 fault code=09=09=3D supervisor read data, page not present stack pointer=09 =3D 0x28:0xfffffe085fb30a90 instruction pointer=09=3D 0x20:0xffffffff803aab56 stack pointer=09 =3D 0x28:0xfffffe085fb35a90 frame pointer=09 =3D 0x28:0xfffffe085fb3faa0 code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b stack pointer=09 =3D 0x28:0xfffffe085fb44a90 frame pointer=09 =3D 0x28:0xfffffe085fb44aa0 code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 fault virtual address=09=3D 0x28 =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags=09=3D interrupt enabled, instruction pointer=09=3D 0x2= 0:6 frame pointer=09 =3D 0x28:0xfffffe085fb30aa0 code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b frame pointer=09 =3D 0x28:0xfffffe085fb35aa0 code segment=09=09=3D base 0x0, limit 0xfffff, type 0x1b resume, IOPL =3D 0 stack pointer=09 =3D 0x28:0xfffffe085fb26a90 =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags=09=3D fault code=09=09=3D supervisor read data, page n= ot frame pointer=09 =3D 0x28:0xfffffe085fb26aa0 instruction pointer=09=3D 0x20:0xffffffff803aab56 processor eflags=09=3D interrupt enabled, code segment=09=09=3D base b =09=09=09=3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags=09=3D interrupt enabled, resume, IOPL =3D 0 current process=09=09=3D 0 (zio_write_intr_2) [ thread pid 0 tid 100500 ] Stopped at vdev_geom_io_done+0x36: movq 0x28(%rbx),%rsi db> where Tracing pid 0 tid 100500 td 0xfffff8000aae6000 vdev_geom_io_done() at vdev_geom_io_done+0x36/frame 0xfffffe085fb30aa0 zio_vdev_io_done() at zio_vdev_io_done+0x176/frame 0xfffffe085fb30ad0 zio_execute() at zio_execute+0xac/frame 0xfffffe085fb30b20 taskqueue_run_locked() at taskqueue_run_locked+0x127/frame 0xfffffe085f= b30b80 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe085= fb30bb0 fork_exit() at fork_exit+0x85/frame 0xfffffe085fb30bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe085fb30bf0 =2D-- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- db>=20 =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2290573.tQ58bQ8BqM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAllmfe4ACgkQNdaXCeyA ngSo5ggAgZhd2TJF8LgBHNPATXvpnRBc6Cc75ziyroB5GXwkNnpwFy+bNIECsvff 4mxpw76talPoBbbyfjPlL7yBHnBsYKqU2KbH883If7eslPe1GHDzNta8o4z+jVje rk2QfM1hr/z6iQrT4Fj8KHFiuw3t0BVpoIhm1EripSvL+UEjwc1T8UJINnP9EFle CboNc4MHzZWM8Z3VL+8jg/d5I0uL+K/SrtCzlZHYB1b4LdN5mrABWdfuCMv9tvUO eVXZEy605xFRrj+OpfmbRaTCmwNqAMFF9X3IQSR0T86TyvOq8ggD7jOGUqV/KeEm oQzkFYOMQDJxIkcElB/gAAVDP7ZGqA== =epb0 -----END PGP SIGNATURE----- --nextPart2290573.tQ58bQ8BqM-- From owner-svn-src-all@freebsd.org Wed Jul 12 20:10:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 156FCDA2831; Wed, 12 Jul 2017 20:10:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E52F0760CB; Wed, 12 Jul 2017 20:10:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CKAtlo055719; Wed, 12 Jul 2017 20:10:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CKAr6F055703; Wed, 12 Jul 2017 20:10:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707122010.v6CKAr6F055703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 12 Jul 2017 20:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320921 - in stable/11: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Commit-Revision: 320921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 20:10:56 -0000 Author: jhb Date: Wed Jul 12 20:10:53 2017 New Revision: 320921 URL: https://svnweb.freebsd.org/changeset/base/320921 Log: Add deprecation notices for various device drivers removed in 12.0. This is a direct commit to stable/11 since these files have already been removed in head. Reviewed by: sbruno, gjb Differential Revision: https://reviews.freebsd.org/D11542 Modified: stable/11/share/man/man4/digi.4 stable/11/share/man/man4/man4.i386/ie.4 stable/11/share/man/man4/man4.i386/wl.4 stable/11/share/man/man4/mcd.4 stable/11/share/man/man4/scd.4 stable/11/share/man/man4/si.4 stable/11/share/man/man4/spic.4 stable/11/sys/dev/digi/digi.c stable/11/sys/dev/ie/if_ie.c stable/11/sys/dev/mcd/mcd.c stable/11/sys/dev/scd/scd.c stable/11/sys/dev/si/si.c stable/11/sys/dev/wl/if_wl.c stable/11/sys/i386/isa/spic.c stable/11/usr.sbin/sicontrol/sicontrol.8 stable/11/usr.sbin/wlconfig/wlconfig.8 Modified: stable/11/share/man/man4/digi.4 ============================================================================== --- stable/11/share/man/man4/digi.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/digi.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -33,7 +33,7 @@ .\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp .\" $FreeBSD$ .\" -.Dd December 7, 2003 +.Dd July 8, 2017 .Dt DIGI 4 .Os .Sh NAME @@ -80,6 +80,11 @@ Device numbering: \fBI\fPnitial \fBPPPPP\fPort number .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/share/man/man4/man4.i386/ie.4 ============================================================================== --- stable/11/share/man/man4/man4.i386/ie.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/man4.i386/ie.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 8, 2017 .Dt IE 4 i386 .Os .Sh NAME @@ -52,6 +52,11 @@ In .Cd hint.ie.0.port="0x300" .Cd hint.ie.0.irq="5" .Cd hint.ie.0.maddr="0xd0000" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh HARDWARE The .Nm Modified: stable/11/share/man/man4/man4.i386/wl.4 ============================================================================== --- stable/11/share/man/man4/man4.i386/wl.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/man4.i386/wl.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 29, 2006 +.Dd July 8, 2017 .Dt WL 4 i386 .Os .Sh NAME @@ -37,6 +37,11 @@ .Nd T1 speed ISA/radio lan card .Sh SYNOPSIS .Cd "device wl0 at isa? port 0x300 irq 5" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/share/man/man4/mcd.4 ============================================================================== --- stable/11/share/man/man4/mcd.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/mcd.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 1994 +.Dd July 8, 2017 .Dt MCD 4 .Os .Sh NAME @@ -40,6 +40,11 @@ In .Cd hint.mcd.0.at="isa" .Cd hint.mcd.0.port="0x300" .Cd hint.mcd.0.irq="10" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/share/man/man4/scd.4 ============================================================================== --- stable/11/share/man/man4/scd.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/scd.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2008 +.Dd July 8, 2017 .Dt SCD 4 .Os .Sh NAME @@ -39,6 +39,11 @@ In .Pa /boot/device.hints : .Cd hint.scd.0.at="isa" .Cd hint.scd.0.port="0x230" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/share/man/man4/si.4 ============================================================================== --- stable/11/share/man/man4/si.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/si.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 16, 1995 +.Dd July 8, 2017 .Dt SI 4 .Os .Sh NAME @@ -13,6 +13,11 @@ For ISA host cards put the following lines in .Cd hint.si.0.at="isa" .Cd hint.si.0.maddr="0xd0000" .Cd hint.si.0.irq="12" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The Specialix SI/XIO and SX hardware makes up an 8 to 32 port RS-232 serial multiplexor. Modified: stable/11/share/man/man4/spic.4 ============================================================================== --- stable/11/share/man/man4/spic.4 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/share/man/man4/spic.4 Wed Jul 12 20:10:53 2017 (r320921) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd July 8, 2017 .Dt SPIC 4 .Os .Sh NAME @@ -33,6 +33,11 @@ .Nd Sony Programmable I/O Controller device driver .Sh SYNOPSIS .Cd "device spic" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/sys/dev/digi/digi.c ============================================================================== --- stable/11/sys/dev/digi/digi.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/digi/digi.c Wed Jul 12 20:10:53 2017 (r320921) @@ -1458,6 +1458,8 @@ digi_attach(struct digi_softc *sc) digi_loadmoduledata(sc); digi_init(sc); digi_freemoduledata(sc); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/dev/ie/if_ie.c ============================================================================== --- stable/11/sys/dev/ie/if_ie.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/ie/if_ie.c Wed Jul 12 20:10:53 2017 (r320921) @@ -327,6 +327,8 @@ ie_attach(device_t dev) mtx_destroy(&sc->lock); return (error); } + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/dev/mcd/mcd.c ============================================================================== --- stable/11/sys/dev/mcd/mcd.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/mcd/mcd.c Wed Jul 12 20:10:53 2017 (r320921) @@ -209,6 +209,8 @@ mcd_attach(struct mcd_softc *sc) sc->mcd_dev_t->si_drv1 = (void *)sc; callout_init_mtx(&sc->timer, &sc->mtx, 0); + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/dev/scd/scd.c ============================================================================== --- stable/11/sys/dev/scd/scd.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/scd/scd.c Wed Jul 12 20:10:53 2017 (r320921) @@ -174,6 +174,8 @@ scd_attach(struct scd_softc *sc) sc->scd_dev_t = make_dev(&scd_cdevsw, 8 * unit, UID_ROOT, GID_OPERATOR, 0640, "scd%d", unit); sc->scd_dev_t->si_drv1 = (void *)sc; + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/dev/si/si.c ============================================================================== --- stable/11/sys/dev/si/si.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/si/si.c Wed Jul 12 20:10:53 2017 (r320921) @@ -604,6 +604,8 @@ try_next2: if (unit == 0) make_dev(&si_Scdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "si_control"); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/dev/wl/if_wl.c Wed Jul 12 20:10:53 2017 (r320921) @@ -564,6 +564,8 @@ wlattach(device_t device) if (bootverbose) wldump(sc); + device_printf(device, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/11/sys/i386/isa/spic.c ============================================================================== --- stable/11/sys/i386/isa/spic.c Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/sys/i386/isa/spic.c Wed Jul 12 20:10:53 2017 (r320921) @@ -350,6 +350,8 @@ spic_attach(device_t dev) /* There can be only one */ sc->sc_cdev = make_dev(&spic_cdevsw, 0, 0, 0, 0600, "jogdial"); sc->sc_cdev->si_drv1 = sc; + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return 0; } Modified: stable/11/usr.sbin/sicontrol/sicontrol.8 ============================================================================== --- stable/11/usr.sbin/sicontrol/sicontrol.8 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/usr.sbin/sicontrol/sicontrol.8 Wed Jul 12 20:10:53 2017 (r320921) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd September 26, 1995 +.Dd July 8, 2017 .Dt SICONTROL 8 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm device .Ar command Op Ar param ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/usr.sbin/wlconfig/wlconfig.8 ============================================================================== --- stable/11/usr.sbin/wlconfig/wlconfig.8 Wed Jul 12 19:13:58 2017 (r320920) +++ stable/11/usr.sbin/wlconfig/wlconfig.8 Wed Jul 12 20:10:53 2017 (r320921) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd December 26, 1996 +.Dd July 8, 2017 .Dt WLCONFIG 8 i386 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm .Ar ifname .Op Ar param value ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Wed Jul 12 21:46:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E35CDA4AD1; Wed, 12 Jul 2017 21:46:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E14A278F0C; Wed, 12 Jul 2017 21:46:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CLkHYn095711; Wed, 12 Jul 2017 21:46:17 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CLkH7C095710; Wed, 12 Jul 2017 21:46:17 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707122146.v6CLkH7C095710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 12 Jul 2017 21:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320922 - releng/11.1/sys/dev/sdhci X-SVN-Group: releng X-SVN-Commit-Author: marius X-SVN-Commit-Paths: releng/11.1/sys/dev/sdhci X-SVN-Commit-Revision: 320922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 21:46:18 -0000 Author: marius Date: Wed Jul 12 21:46:16 2017 New Revision: 320922 URL: https://svnweb.freebsd.org/changeset/base/320922 Log: MF11: r320898; MFC: r320577, r320620 Retry up to 2 ms to enable bus power as at least with some Intel SDHCI/eMMC controllers the first attempt after a D3 to D0 transition, i. e. when the firmware has put the devices into D3 state before, can fail. Approved by: re (gjb) Modified: releng/11.1/sys/dev/sdhci/sdhci.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/sys/dev/sdhci/sdhci.c ============================================================================== --- releng/11.1/sys/dev/sdhci/sdhci.c Wed Jul 12 20:10:53 2017 (r320921) +++ releng/11.1/sys/dev/sdhci/sdhci.c Wed Jul 12 21:46:16 2017 (r320922) @@ -366,6 +366,7 @@ sdhci_set_clock(struct sdhci_slot *slot, uint32_t cloc static void sdhci_set_power(struct sdhci_slot *slot, u_char power) { + int i; uint8_t pwr; if (slot->power == power) @@ -394,9 +395,20 @@ sdhci_set_power(struct sdhci_slot *slot, u_char power) break; } WR1(slot, SDHCI_POWER_CONTROL, pwr); - /* Turn on the power. */ + /* + * Turn on VDD1 power. Note that at least some Intel controllers can + * fail to enable bus power on the first try after transiting from D3 + * to D0, so we give them up to 2 ms. + */ pwr |= SDHCI_POWER_ON; - WR1(slot, SDHCI_POWER_CONTROL, pwr); + for (i = 0; i < 20; i++) { + WR1(slot, SDHCI_POWER_CONTROL, pwr); + if (RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON) + break; + DELAY(100); + } + if (!(RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON)) + slot_printf(slot, "Bus power failed to enable"); if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); From owner-svn-src-all@freebsd.org Wed Jul 12 22:16:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B000DA6424; Wed, 12 Jul 2017 22:16:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08F6B79CEB; Wed, 12 Jul 2017 22:16:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6CMGuxf008200; Wed, 12 Jul 2017 22:16:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6CMGs2t008184; Wed, 12 Jul 2017 22:16:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707122216.v6CMGs2t008184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 12 Jul 2017 22:16:54 +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: r320923 - in stable/10: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/10: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Commit-Revision: 320923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 22:16:57 -0000 Author: jhb Date: Wed Jul 12 22:16:54 2017 New Revision: 320923 URL: https://svnweb.freebsd.org/changeset/base/320923 Log: Add deprecation notices for various device drivers removed in 12.0. This is a direct commit to stable/10 since these files have already been removed in head. Modified: stable/10/share/man/man4/digi.4 stable/10/share/man/man4/man4.i386/ie.4 stable/10/share/man/man4/man4.i386/wl.4 stable/10/share/man/man4/mcd.4 stable/10/share/man/man4/scd.4 stable/10/share/man/man4/si.4 stable/10/share/man/man4/spic.4 stable/10/sys/dev/digi/digi.c stable/10/sys/dev/ie/if_ie.c stable/10/sys/dev/mcd/mcd.c stable/10/sys/dev/scd/scd.c stable/10/sys/dev/si/si.c stable/10/sys/dev/wl/if_wl.c stable/10/sys/i386/isa/spic.c stable/10/usr.sbin/sicontrol/sicontrol.8 stable/10/usr.sbin/wlconfig/wlconfig.8 Modified: stable/10/share/man/man4/digi.4 ============================================================================== --- stable/10/share/man/man4/digi.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/digi.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -37,7 +37,7 @@ .\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp .\" $FreeBSD$ .\" -.Dd December 7, 2003 +.Dd July 8, 2017 .Dt DIGI 4 .Os .Sh NAME @@ -84,6 +84,11 @@ Device numbering: \fBI\fPnitial \fBPPPPP\fPort number .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/share/man/man4/man4.i386/ie.4 ============================================================================== --- stable/10/share/man/man4/man4.i386/ie.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/man4.i386/ie.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 8, 2017 .Dt IE 4 i386 .Os .Sh NAME @@ -52,6 +52,11 @@ In .Cd hint.ie.0.port="0x300" .Cd hint.ie.0.irq="5" .Cd hint.ie.0.maddr="0xd0000" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh HARDWARE The .Nm Modified: stable/10/share/man/man4/man4.i386/wl.4 ============================================================================== --- stable/10/share/man/man4/man4.i386/wl.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/man4.i386/wl.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 29, 2006 +.Dd July 8, 2017 .Dt WL 4 i386 .Os .Sh NAME @@ -37,6 +37,11 @@ .Nd T1 speed ISA/radio lan card .Sh SYNOPSIS .Cd "device wl0 at isa? port 0x300 irq 5" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/share/man/man4/mcd.4 ============================================================================== --- stable/10/share/man/man4/mcd.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/mcd.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 1994 +.Dd July 8, 2017 .Dt MCD 4 .Os .Sh NAME @@ -40,6 +40,11 @@ In .Cd hint.mcd.0.at="isa" .Cd hint.mcd.0.port="0x300" .Cd hint.mcd.0.irq="10" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/share/man/man4/scd.4 ============================================================================== --- stable/10/share/man/man4/scd.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/scd.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2008 +.Dd July 8, 2017 .Dt SCD 4 .Os .Sh NAME @@ -39,6 +39,11 @@ In .Pa /boot/device.hints : .Cd hint.scd.0.at="isa" .Cd hint.scd.0.port="0x230" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/share/man/man4/si.4 ============================================================================== --- stable/10/share/man/man4/si.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/si.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 16, 1995 +.Dd July 8, 2017 .Dt SI 4 .Os .Sh NAME @@ -13,6 +13,11 @@ For ISA host cards put the following lines in .Cd hint.si.0.at="isa" .Cd hint.si.0.maddr="0xd0000" .Cd hint.si.0.irq="12" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The Specialix SI/XIO and SX hardware makes up an 8 to 32 port RS-232 serial multiplexor. Modified: stable/10/share/man/man4/spic.4 ============================================================================== --- stable/10/share/man/man4/spic.4 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/share/man/man4/spic.4 Wed Jul 12 22:16:54 2017 (r320923) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd July 8, 2017 .Dt SPIC 4 .Os .Sh NAME @@ -33,6 +33,11 @@ .Nd Sony Programmable I/O Controller device driver .Sh SYNOPSIS .Cd "device spic" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/sys/dev/digi/digi.c ============================================================================== --- stable/10/sys/dev/digi/digi.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/digi/digi.c Wed Jul 12 22:16:54 2017 (r320923) @@ -1458,6 +1458,8 @@ digi_attach(struct digi_softc *sc) digi_loadmoduledata(sc); digi_init(sc); digi_freemoduledata(sc); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/dev/ie/if_ie.c ============================================================================== --- stable/10/sys/dev/ie/if_ie.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/ie/if_ie.c Wed Jul 12 22:16:54 2017 (r320923) @@ -326,6 +326,8 @@ ie_attach(device_t dev) mtx_destroy(&sc->lock); return (error); } + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/dev/mcd/mcd.c ============================================================================== --- stable/10/sys/dev/mcd/mcd.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/mcd/mcd.c Wed Jul 12 22:16:54 2017 (r320923) @@ -206,6 +206,8 @@ mcd_attach(struct mcd_softc *sc) UID_ROOT, GID_OPERATOR, 0640, "mcd%d", unit); sc->mcd_dev_t->si_drv1 = (void *)sc; + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/dev/scd/scd.c ============================================================================== --- stable/10/sys/dev/scd/scd.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/scd/scd.c Wed Jul 12 22:16:54 2017 (r320923) @@ -172,6 +172,8 @@ scd_attach(struct scd_softc *sc) sc->scd_dev_t = make_dev(&scd_cdevsw, 8 * unit, UID_ROOT, GID_OPERATOR, 0640, "scd%d", unit); sc->scd_dev_t->si_drv1 = (void *)sc; + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/dev/si/si.c ============================================================================== --- stable/10/sys/dev/si/si.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/si/si.c Wed Jul 12 22:16:54 2017 (r320923) @@ -605,6 +605,8 @@ try_next2: if (unit == 0) make_dev(&si_Scdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "si_control"); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/dev/wl/if_wl.c ============================================================================== --- stable/10/sys/dev/wl/if_wl.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/dev/wl/if_wl.c Wed Jul 12 22:16:54 2017 (r320923) @@ -575,6 +575,8 @@ wlattach(device_t device) if (bootverbose) wldump(sc); + device_printf(device, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: stable/10/sys/i386/isa/spic.c ============================================================================== --- stable/10/sys/i386/isa/spic.c Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/sys/i386/isa/spic.c Wed Jul 12 22:16:54 2017 (r320923) @@ -346,6 +346,8 @@ spic_attach(device_t dev) /* There can be only one */ make_dev(&spic_cdevsw, 0, 0, 0, 0600, "jogdial"); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return 0; } Modified: stable/10/usr.sbin/sicontrol/sicontrol.8 ============================================================================== --- stable/10/usr.sbin/sicontrol/sicontrol.8 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/usr.sbin/sicontrol/sicontrol.8 Wed Jul 12 22:16:54 2017 (r320923) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd September 26, 1995 +.Dd July 8, 2017 .Dt SICONTROL 8 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm device .Ar command Op Ar param ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: stable/10/usr.sbin/wlconfig/wlconfig.8 ============================================================================== --- stable/10/usr.sbin/wlconfig/wlconfig.8 Wed Jul 12 21:46:16 2017 (r320922) +++ stable/10/usr.sbin/wlconfig/wlconfig.8 Wed Jul 12 22:16:54 2017 (r320923) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd December 26, 1996 +.Dd July 8, 2017 .Dt WLCONFIG 8 i386 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm .Ar ifname .Op Ar param value ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Wed Jul 12 22:17:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E4D2DA64BD; Wed, 12 Jul 2017 22:17:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A67E79E1A; Wed, 12 Jul 2017 22:17:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8F88910AF07; Wed, 12 Jul 2017 18:17:11 -0400 (EDT) From: John Baldwin To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320918 - head/sbin/savecore Date: Wed, 12 Jul 2017 14:23:52 -0700 Message-ID: <1930640.IHpqZ2aWqS@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201707121829.v6CITPxG012102@repo.freebsd.org> References: <201707121829.v6CITPxG012102@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 12 Jul 2017 18:17:11 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 22:17:18 -0000 On Wednesday, July 12, 2017 06:29:25 PM Mark Johnston wrote: > Author: markj > Date: Wed Jul 12 18:29:25 2017 > New Revision: 320918 > URL: https://svnweb.freebsd.org/changeset/base/320918 > > Log: > Add a newline after the version string. > > MFC after: 3 days I think the version string normally has a trailing \n emedded in it? Also, have you verified that crashinfo is still able to match the Version String from the generated info.X file? I think it might as it stops printing lines once it matches the second line of the version, so I think (just reading the awk) that it will not include the extra newline in the 'ivers' compared against 'version' from gdb. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jul 12 22:26:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69835DA6719; Wed, 12 Jul 2017 22:26:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43C857A2B4; Wed, 12 Jul 2017 22:26:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id ACB5F10AF01; Wed, 12 Jul 2017 18:26:05 -0400 (EDT) From: John Baldwin To: Ryan Libby Cc: Roman Divacky , Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320908 - head/sys/kern Date: Wed, 12 Jul 2017 15:20:58 -0700 Message-ID: <25032740.sJOsNDzvpa@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201707120730.v6C7UExf041447@repo.freebsd.org> <20170712074326.GA41347@vlakno.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 12 Jul 2017 18:26:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 22:26:07 -0000 On Wednesday, July 12, 2017 01:09:39 AM Ryan Libby wrote: > On Wed, Jul 12, 2017 at 12:43 AM, Roman Divacky wrote: > > Clang knows about %b modifier and can do some semantic analysis on it. > > Currently it type checks the first arg to be an int and the second to be > > a char*. > > > > Do you think it would be worth modifying the checks to include > > this new functionality? Do you think you would like to take a stab > > at it? > > Yes, I plan to send that to clang upstream. I originally had those > changes in this commit but I was directed rather to send them first to > upstream. See here [1] for roughly what I plan to send upstream > (although I have since noticed some unit tests that I guess should be > extended). > > For now, the semantic analysis should be fine as the change should be > backward compatible and I haven't yet changed any of the users of > %b to use the new capabilities. There is also '%b' support in GCC via -fformat-extensions. GCC 4.2.1 probably matters less, but the external GCC toolchain ports use a patch in /usr/ports/devel/powerpc64-gcc/files/freebsd-format-extensions that you may need to adjust as well. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jul 12 23:41:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 520C3DA7AEA; Wed, 12 Jul 2017 23:41:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 091107C0F4; Wed, 12 Jul 2017 23:41:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x232.google.com with SMTP id b40so25623316qtb.2; Wed, 12 Jul 2017 16:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ErrCiTdt6Lgf7vbZUBMNWE3Eizdxj7MUZsnH2tuwbkU=; b=UdkWVDPucXNgnyt4Xz9hhfE6sqBxcy9RxxV1HO4d18gZnPbR6SGbx89JyIxEDKveS6 zmnKUh5SaMPWNeTh2kJJY9to9CTKfkyH+cuNk5t7fiwfuAO4nQ/xoHaIpwgLu7ZrhU9t 7aBIUrvlc0dYKMVfKoOE0/DbCi4C70rP9uJw39N4jE3EYQkssuTQ2JHO1AJ22o4SU8S/ tW5/k7EbLFnDaLHWozDZoQWu4GCWLp+nS2qujZ7njvuO0MGfzqDpmcoAOv+V0mDQEpQY r+mrLXpLf46daVjVUZxaZJSyjQNu9Byoz0pySsUpETS09opt3PZK7zj0Uf/U+3lgdGq6 gg6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ErrCiTdt6Lgf7vbZUBMNWE3Eizdxj7MUZsnH2tuwbkU=; b=J5+TIdNpSeXVfd3CUKxIFql373jyShHqFSwutMABy2yCbFjhzQUtiiYJd5lo2xfqOq GLsOB3GJhqrK/CKcFMJv87CU1KVvIRQhMHBYcBmE2xliKEUt2/ZW9QfOGOyxzpz9VID0 b/cqO+gd/6wH9RNtIUaerVkki88VILWPewf5aVhutXQxfSjgrp/3M4OCNnKTF1QFVqbl PERyrPIfNGR+6Dz94MtYsDHk1sTIGakUwTFrkoFNvPaRyIX7fFskU2X++unDqy2d7CEP BQPJA/JSQgMH02Pb+eMfICGcIw5RJIoPv/2oz5gD0DiXJVDLYynJqp4ySQRD6YM+dOUi c2IA== X-Gm-Message-State: AIVw110A9yj1jyaHolo54qoj7rHWgIzWOw+ESgRw5x5XId4h3/zTJymx qQqaUXBCl3zaH3Al X-Received: by 10.200.50.93 with SMTP id y29mr1536931qta.108.1499902898817; Wed, 12 Jul 2017 16:41:38 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id y17sm3181706qtb.37.2017.07.12.16.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 16:41:38 -0700 (PDT) Sender: Mark Johnston Date: Wed, 12 Jul 2017 16:41:09 -0700 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320918 - head/sbin/savecore Message-ID: <20170712234108.GA48612@wkstn-mjohnston.west.isilon.com> References: <201707121829.v6CITPxG012102@repo.freebsd.org> <1930640.IHpqZ2aWqS@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1930640.IHpqZ2aWqS@ralph.baldwin.cx> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 23:41:40 -0000 On Wed, Jul 12, 2017 at 02:23:52PM -0700, John Baldwin wrote: > On Wednesday, July 12, 2017 06:29:25 PM Mark Johnston wrote: > > Author: markj > > Date: Wed Jul 12 18:29:25 2017 > > New Revision: 320918 > > URL: https://svnweb.freebsd.org/changeset/base/320918 > > > > Log: > > Add a newline after the version string. > > > > MFC after: 3 days > > I think the version string normally has a trailing \n emedded in it? You're right. The problem in my case is that the version string is getting truncated in mkdumpheader(), and so the trailing \n is omitted. > Also, > have you verified that crashinfo is still able to match the Version String > from the generated info.X file? I think it might as it stops printing lines > once it matches the second line of the version, so I think (just reading the > awk) that it will not include the extra newline in the 'ivers' compared > against 'version' from gdb. That's true, but it looks like it doesn't work properly in the truncated case. What if we declare a match when the version string in the info.X file matches a prefix of the version string reported by gdb? diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 22b4793f4ff5..f5862782bb21 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -119,7 +119,7 @@ printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *devic xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); - xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}\n", h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 5c6c0e136769..d87b63461de5 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -1229,6 +1229,7 @@ void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, uint64_t dumplen, uint32_t dumpkeysize, uint32_t blksz) { + size_t dstsize; bzero(kdh, sizeof(*kdh)); strlcpy(kdh->magic, magic, sizeof(kdh->magic)); @@ -1240,7 +1241,9 @@ mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, kdh->dumpkeysize = htod32(dumpkeysize); kdh->blocksize = htod32(blksz); strlcpy(kdh->hostname, prison0.pr_hostname, sizeof(kdh->hostname)); - strlcpy(kdh->versionstring, version, sizeof(kdh->versionstring)); + dstsize = sizeof(kdh->versionstring); + if (strlcpy(kdh->versionstring, version, dstsize) >= dstsize) + kdh->versionstring[dstsize - 2] = '\n'; if (panicstr != NULL) strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->parity = kerneldump_parity(kdh); diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh index e52c01419b0d..b3029c6eea4a 100755 --- a/usr.sbin/crashinfo/crashinfo.sh +++ b/usr.sbin/crashinfo/crashinfo.sh @@ -85,8 +85,9 @@ find_kernel() # Look for a matching kernel version. for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do - kvers=$(gdb_command $k 'printf " Version String: %s", version' \ - 2>/dev/null) + kvers=$(gdb_command $k 'printf " Version String: %s", version' | \ + awk "{line=line\$0\"\n\"} END{print substr(line,1,${#ivers})}" \ + 2>/dev/null) if [ "$ivers" = "$kvers" ]; then KERNEL=$k break From owner-svn-src-all@freebsd.org Wed Jul 12 23:48:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D145DA7E17; Wed, 12 Jul 2017 23:48:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484D37C5C8; Wed, 12 Jul 2017 23:48:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22b.google.com with SMTP id 16so38015632qkg.2; Wed, 12 Jul 2017 16:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5DjrsfHiOM7G/4uzt3QovxQ7pdwsN2v7If1q1r8HTlI=; b=PB9/ArMOGSFur2QkvgfFA/ZsEqp4Ow0FGJUpijgA+S2+wP5ImLcq8Onf/I4AhWeJrR QmRQYbz+xbX/aZoeoSjDPYKIJxm+bbpv6I9HURXZQPuP2+Gu4H0J80O5DS+WcMXDucEU ut/H0MduV/fuB6bAvIX8v//El4gBivvWScIgdn/APlCUP7DmE1ClkhZzkXAHLwqy6BHN XrF4S1+yZ1TOVxUOEE9yjwj951KQSI4mzhx2Oujh1Ve1fHtRZuSheJ1tv2rArdHjktKl HqpEPSLm6BM2TDJY3m1clyF2+rzb29zRwkdyf+JrieTAlmriTzupAgdgomui6u4S/WnC Yk3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5DjrsfHiOM7G/4uzt3QovxQ7pdwsN2v7If1q1r8HTlI=; b=r7iTYJJ/CL2FhaX9pnf6FATe/yjg0rkTvf/2H9DBGZhnsgAhZ9cwcasZmQpEm51iLK HiIGrkMfkdKLAQAE4KPhtKQCVxYXl0iclfk5KJ350jPuBLeiKDJRDSvc7DBLxwdgRcIM avCCJbsYjeUJ82c0fzkpYHnA51cqI0aK/VpxwCcuDRST9RWIlJkfff1ZXSFkhQaXJAul R0kZK7WWLPJyEk2woSykcPzfEhCJPwquT7yH9rHyzVZ+UixZI20kIDBPaMfFXW+AAoJj C4n2owXiL23wUktPomH3FzYncg/zAunIxXAYRny+e7PM+irBvpPUk0J0bls5rQnf067G yW/A== X-Gm-Message-State: AIVw1125b420sadJ1LomkOT4xypJhMwD/lEYwtSMGo4VnP4O1Qs37/Fn 0y1Z3IBg5GtgyGEf48pW+WHBwuy/sH/y X-Received: by 10.55.72.1 with SMTP id v1mr1298151qka.103.1499903329238; Wed, 12 Jul 2017 16:48:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.92.142 with HTTP; Wed, 12 Jul 2017 16:48:48 -0700 (PDT) In-Reply-To: <201707121735.v6CHZWNY091333@repo.freebsd.org> References: <201707121735.v6CHZWNY091333@repo.freebsd.org> From: Ngie Cooper Date: Wed, 12 Jul 2017 16:48:48 -0700 Message-ID: Subject: Re: svn commit: r320916 - head/sys/dev/ixgbe To: Sean Bruno Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 23:48:50 -0000 On Wed, Jul 12, 2017 at 10:35 AM, Sean Bruno wrote: > Author: sbruno > Date: Wed Jul 12 17:35:32 2017 > New Revision: 320916 > URL: https://svnweb.freebsd.org/changeset/base/320916 > > Log: > Reset unsupported SFP tuneable back to original entry name. > > Reported by: olivier@ The new name kinda makes more sense -- why not keep it and make a backwards compatible OID for the old name? Thanks, -Ngie From owner-svn-src-all@freebsd.org Thu Jul 13 00:11:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D20DA8C70; Thu, 13 Jul 2017 00:11:03 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E254E7DBC5; Thu, 13 Jul 2017 00:11:02 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wr0-x233.google.com with SMTP id c11so45234925wrc.3; Wed, 12 Jul 2017 17:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Vt5lvUGPqJhQn6UdSibP/Mu7tXjOdrnTkcJf05Ac51A=; b=hoS8M2e3RPhx/sw0Sa/gaXt5yBcdzYpElbBQz43jelX4iVMPtIja38fHWjifk056pR c59yiggKdHUStA0wLjYKRUw3+rtDSs6WB3+gWGiEXiV+zJixFXY264N7SZY9/P1NYgL5 YfsUyISoqfwEuUCTnywdIo9vysTG1VZ0vkFM3TMBt380g5m96yXe9WiXhqiaM9Dx2l34 K80jOuMlYWcl84cnkHsGKqid6dzmvYA6srq18PwebP1IfWGzL4JJVZxYwhl61Njbp0wC zBHLeJT3oMAzQLlfkz1DLvBtO4KP38iokVqQWtOQdfRLEEGYatrcJqDWmCSwqyFFrCav pLDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vt5lvUGPqJhQn6UdSibP/Mu7tXjOdrnTkcJf05Ac51A=; b=ZeFRgWVzQEXcxkSq5+FsAFh77X0d5yKisbPkr3dcpfbAiytMzBZ974MWiCZ1JC3j+f qskG3SEuF4OLhMksb0XTlVWu2AgqlgCYGJIh097Rbxpjw/5XsDHRa+toWvD8ORhyidmI Zuv721vda75k1zOFj+Z7JxEnAwH1xlWEjHUJYRja6xzsjAHQ3kiKBt7stQ7iLOuYN/WT FaQ4GgIqHHznP4NLOTttBWd+H53dBM6hRdTg9JQcdSYd4uLxcSCw8RqqjzLiZyWtmcCj 13+3r8Jsf9f39dhXzdk3IhrQSP7oP5I24D0QiewYhzvbEHbC9YxjVJxdFWBw6UhhTMkR M6Rg== X-Gm-Message-State: AIVw113XxR+WVZaXyCHGyleU2pvIW3BAByyKemzEXNEIdFSzcELT9edn X9I08gwm/38L/VRpuOmPuez9QGHB+Q1wtzw= X-Received: by 10.223.129.163 with SMTP id 32mr574995wra.185.1499904660743; Wed, 12 Jul 2017 17:11:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.81 with HTTP; Wed, 12 Jul 2017 17:11:00 -0700 (PDT) In-Reply-To: <25032740.sJOsNDzvpa@ralph.baldwin.cx> References: <201707120730.v6C7UExf041447@repo.freebsd.org> <20170712074326.GA41347@vlakno.cz> <25032740.sJOsNDzvpa@ralph.baldwin.cx> From: Ryan Libby Date: Wed, 12 Jul 2017 17:11:00 -0700 Message-ID: Subject: Re: svn commit: r320908 - head/sys/kern To: John Baldwin Cc: Roman Divacky , Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 00:11:03 -0000 On Wed, Jul 12, 2017 at 3:20 PM, John Baldwin wrote: > On Wednesday, July 12, 2017 01:09:39 AM Ryan Libby wrote: >> On Wed, Jul 12, 2017 at 12:43 AM, Roman Divacky wrote: >> > Clang knows about %b modifier and can do some semantic analysis on it. >> > Currently it type checks the first arg to be an int and the second to be >> > a char*. >> > >> > Do you think it would be worth modifying the checks to include >> > this new functionality? Do you think you would like to take a stab >> > at it? >> >> Yes, I plan to send that to clang upstream. I originally had those >> changes in this commit but I was directed rather to send them first to >> upstream. See here [1] for roughly what I plan to send upstream >> (although I have since noticed some unit tests that I guess should be >> extended). >> >> For now, the semantic analysis should be fine as the change should be >> backward compatible and I haven't yet changed any of the users of >> %b to use the new capabilities. > > There is also '%b' support in GCC via -fformat-extensions. GCC 4.2.1 > probably matters less, but the external GCC toolchain ports use a patch in > /usr/ports/devel/powerpc64-gcc/files/freebsd-format-extensions that you may > need to adjust as well. Thanks. I knew about the in-tree gcc format extensions, but hadn't considered ports. I'll follow up with this in a little bit. I currently have a few other patches in gestation working through some bitrot with gcc amd64 kernel builds. From owner-svn-src-all@freebsd.org Thu Jul 13 00:16:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61350DA8F1B; Thu, 13 Jul 2017 00:16:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD8C7DFCF; Thu, 13 Jul 2017 00:16:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D0GqUg058959; Thu, 13 Jul 2017 00:16:52 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D0Gpba058952; Thu, 13 Jul 2017 00:16:51 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130016.v6D0Gpba058952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 00:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320924 - in vendor/libarchive/dist: . build libarchive libarchive/test X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: . build libarchive libarchive/test X-SVN-Commit-Revision: 320924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 00:16:53 -0000 Author: mm Date: Thu Jul 13 00:16:51 2017 New Revision: 320924 URL: https://svnweb.freebsd.org/changeset/base/320924 Log: Update vendor/libarchive to git 98a695399e8e7420635a5448aecde8b0a82fb83a Release 3.3.2 Vendor changes: PR #901: don't depend on stdin in a testcase Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/CMakeLists.txt Thu Jul 13 00:16:51 2017 (r320924) @@ -15,7 +15,7 @@ endif() # RelWithDebInfo : Release build with Debug Info # MinSizeRel : Release Min Size build IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the # value type is "UNINITIALIZED". Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/Makefile.am Thu Jul 13 00:16:51 2017 (r320924) @@ -23,7 +23,7 @@ TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(b DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio # The next line is commented out by default in shipping libarchive releases. # It is uncommented by default in trunk. -DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g +# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g AM_CFLAGS=$(DEV_CFLAGS) PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) @@ -850,6 +850,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_winzip_aes256.zip.uu \ libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu \ libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu \ + libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu \ libarchive/test/test_read_format_zip_zip64a.zip.uu \ libarchive/test/test_read_format_zip_zip64b.zip.uu \ libarchive/test/test_read_large_splitted_rar_aa.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/NEWS Thu Jul 13 00:16:51 2017 (r320924) @@ -1,3 +1,5 @@ +Jul 09, 2017: libarchive 3.3.2 released + Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) Feb 26, 2017: libarchive 3.3.1 released Modified: vendor/libarchive/dist/build/version ============================================================================== --- vendor/libarchive/dist/build/version Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/build/version Thu Jul 13 00:16:51 2017 (r320924) @@ -1 +1 @@ -3003002dev +3003002 Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/configure.ac Thu Jul 13 00:16:51 2017 (r320924) @@ -4,7 +4,7 @@ dnl First, define all of the version numbers up front. dnl In particular, this allows the version macro to be used in AC_INIT dnl These first two version numbers are updated automatically on each release. -m4_define([LIBARCHIVE_VERSION_S],[3.3.2dev]) +m4_define([LIBARCHIVE_VERSION_S],[3.3.2]) m4_define([LIBARCHIVE_VERSION_N],[3003002]) dnl bsdtar and bsdcpio versioning tracks libarchive Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/libarchive/archive.h Thu Jul 13 00:16:51 2017 (r320924) @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.2dev" +#define ARCHIVE_VERSION_ONLY_STRING "3.3.2" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c Wed Jul 12 22:16:54 2017 (r320923) +++ vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 13 00:16:51 2017 (r320924) @@ -28,10 +28,12 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_archive_read_close_twice_open_filename) { + const char *filename = "empty.file"; struct archive* a = archive_read_new(); + assertMakeFile(filename, 0644, ""); assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a)); - assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, 0, 0)); + assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, filename, 0)); assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); From owner-svn-src-all@freebsd.org Thu Jul 13 00:17:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D446DA8FA1; Thu, 13 Jul 2017 00:17:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009777E0FD; Thu, 13 Jul 2017 00:17:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D0Hexd059047; Thu, 13 Jul 2017 00:17:40 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D0Hec2059045; Thu, 13 Jul 2017 00:17:40 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130017.v6D0Hec2059045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 00:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320925 - in vendor/libarchive/3.3.2: . build libarchive libarchive/test X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/3.3.2: . build libarchive libarchive/test X-SVN-Commit-Revision: 320925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 00:17:41 -0000 Author: mm Date: Thu Jul 13 00:17:40 2017 New Revision: 320925 URL: https://svnweb.freebsd.org/changeset/base/320925 Log: Tag libarchive 3.3.2 Added: vendor/libarchive/3.3.2/ - copied from r320923, vendor/libarchive/dist/ Replaced: vendor/libarchive/3.3.2/CMakeLists.txt - copied unchanged from r320924, vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/3.3.2/Makefile.am - copied unchanged from r320924, vendor/libarchive/dist/Makefile.am vendor/libarchive/3.3.2/NEWS - copied unchanged from r320924, vendor/libarchive/dist/NEWS vendor/libarchive/3.3.2/build/version - copied unchanged from r320924, vendor/libarchive/dist/build/version vendor/libarchive/3.3.2/configure.ac - copied unchanged from r320924, vendor/libarchive/dist/configure.ac vendor/libarchive/3.3.2/libarchive/archive.h - copied unchanged from r320924, vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/3.3.2/libarchive/test/test_archive_read_close_twice_open_filename.c - copied unchanged from r320924, vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c Copied: vendor/libarchive/3.3.2/CMakeLists.txt (from r320924, vendor/libarchive/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/3.3.2/CMakeLists.txt Thu Jul 13 00:17:40 2017 (r320925, copy of r320924, vendor/libarchive/dist/CMakeLists.txt) @@ -0,0 +1,1916 @@ +# +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) +# +PROJECT(libarchive C) +# +SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") +if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) +endif() +# +# Set the Build type for make based generators. +# You can choose following types: +# Debug : Debug build +# Release : Release build +# RelWithDebInfo : Release build with Debug Info +# MinSizeRel : Release Min Size build +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) +# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the +# value type is "UNINITIALIZED". +GET_PROPERTY(cached_type CACHE CMAKE_BUILD_TYPE PROPERTY TYPE) +IF("${cached_type}" STREQUAL "UNINITIALIZED") + SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build Type" FORCE) +ENDIF("${cached_type}" STREQUAL "UNINITIALIZED") +# Check the Build Type. +IF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") + MESSAGE(FATAL_ERROR + "Unknown keyword for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n" + "Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel") +ENDIF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") + +# On MacOS, prefer MacPorts libraries to system libraries. +# I haven't come up with a compelling argument for this to be conditional. +list(APPEND CMAKE_PREFIX_PATH /opt/local) +# Enable @rpath in the install name. +# detail in "cmake --help-policy CMP0042" +SET(CMAKE_MACOSX_RPATH ON) + +# +# Version - read from 'version' file. +# +FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version) +STRING(REGEX REPLACE + "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]*$" "\\1" _major ${_version}) +STRING(REGEX REPLACE + "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]*$" "\\1" _minor ${_version}) +STRING(REGEX REPLACE + "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]*$" "\\1" _revision ${_version}) +STRING(REGEX REPLACE + "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]*)$" "\\1" _quality ${_version}) +SET(_version_number ${_major}${_minor}${_revision}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_minor ${_minor}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_revision ${_revision}) +# +SET(VERSION "${_major}.${_trimmed_minor}.${_trimmed_revision}${_quality}") +SET(BSDCPIO_VERSION_STRING "${VERSION}") +SET(BSDTAR_VERSION_STRING "${VERSION}") +SET(BSDCAT_VERSION_STRING "${VERSION}") +SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}") +SET(LIBARCHIVE_VERSION_STRING "${VERSION}") + +# INTERFACE_VERSION increments with every release +# libarchive 2.7 == interface version 9 = 2 + 7 +# libarchive 2.8 == interface version 10 = 2 + 8 +# libarchive 2.9 == interface version 11 = 2 + 9 +# libarchive 3.0 == interface version 12 +# libarchive 3.1 == interface version 13 +math(EXPR INTERFACE_VERSION "13 + ${_minor}") + +# Set SOVERSION == Interface version +# ?? Should there be more here ?? +SET(SOVERSION "${INTERFACE_VERSION}") + +# Enalbe CMAKE_PUSH_CHECK_STATE() and CMAKE_POP_CHECK_STATE() macros +# saving and restoring the state of the variables. +INCLUDE(CMakePushCheckState) + +# Initialize the state of the variables. This initialization is not +# necessary but this shows you what value the variables initially have. +SET(CMAKE_REQUIRED_DEFINITIONS) +SET(CMAKE_REQUIRED_INCLUDES) +SET(CMAKE_REQUIRED_LIBRARIES) +SET(CMAKE_REQUIRED_FLAGS) + +# Especially for early development, we want to be a little +# aggressive about diagnosing build problems; this can get +# relaxed somewhat in final shipping versions. +IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") +ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$") +IF (CMAKE_C_COMPILER_ID MATCHES "^Clang$") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") +ENDIF (CMAKE_C_COMPILER_ID MATCHES "^Clang$") +IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_C_COMPILER "xlc_r") + SET(CMAKE_REQUIRED_FLAGS "-qflag=e:e -qformat=sec") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qflag=e:e -qformat=sec") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qhalt=w") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qflag=w:w") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use") +ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$") +IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + # Enable level 4 C4061: The enumerate has no associated handler in a switch + # statement. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + # Enable level 4 C4295: An array was initialized but the last character in + # the array is not a null; accessing the array may + # produce unexpected results. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") + # Enable level 4 C4296: An unsigned variable was used in a comparison + # operation with zero. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296") + # Enable level 4 C4389: An operation involved signed and unsigned variables. + # This could result in a loss of data. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4389") + # Enable level 4 C4505: The given function is local and not referenced in + # the body of the module; therefore, the function is + # dead code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505") + # Enable level 4 C4514: The optimizer removed an inline function that is not + # called. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514") + # Enable level 4 C4702: Unreachable code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702") + # Enable level 4 C4706: The test value in a conditional expression was the + # result of an assignment. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + # /WX option is the same as gcc's -Werror option. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") + # /Oi option enables built-in functions. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") + ################################################################# + # Set compile flags for release build. + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi") +ENDIF (MSVC) + +# Enable CTest/CDash support +include(CTest) + +OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) +OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) +OPTION(ENABLE_LZO "Enable the use of the system LZO library if found" OFF) +OPTION(ENABLE_LZMA "Enable the use of the system LZMA library if found" ON) + +OPTION(ENABLE_ZLIB "Enable the use of the system ZLIB library if found" ON) +OPTION(ENABLE_BZip2 "Enable the use of the system BZip2 library if found" ON) +OPTION(ENABLE_LIBXML2 "Enable the use of the system libxml2 library if found" ON) +OPTION(ENABLE_EXPAT "Enable the use of the system EXPAT library if found" ON) +OPTION(ENABLE_PCREPOSIX "Enable the use of the system PCREPOSIX library if found" ON) +OPTION(ENABLE_LibGCC "Enable the use of the system LibGCC library if found" ON) +# CNG is used for encrypt/decrypt Zip archives on Windows. +OPTION(ENABLE_CNG "Enable the use of CNG(Crypto Next Generation)" ON) + +OPTION(ENABLE_TAR "Enable tar building" ON) +OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE) +OPTION(ENABLE_CPIO "Enable cpio building" ON) +OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE) +OPTION(ENABLE_CAT "Enable cat building" ON) +OPTION(ENABLE_CAT_SHARED "Enable dynamic build of cat" FALSE) +OPTION(ENABLE_XATTR "Enable extended attribute support" ON) +OPTION(ENABLE_ACL "Enable ACL support" ON) +OPTION(ENABLE_ICONV "Enable iconv support" ON) +OPTION(ENABLE_TEST "Enable unit and regression tests" ON) +OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE) +OPTION(ENABLE_INSTALL "Enable installing of libraries" ON) + +SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support") +SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)") +SET(WINDOWS_VERSION "WIN7" CACHE STRING "Set Windows version to use (Windows only)") + +IF(ENABLE_COVERAGE) + include(LibarchiveCodeCoverage) +ENDIF(ENABLE_COVERAGE) + +IF(ENABLE_TEST) + ENABLE_TESTING() +ENDIF(ENABLE_TEST) + +IF(WIN32) + IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(NTDDI_VERSION 0x06020000) + SET(_WIN32_WINNT 0x0602) + SET(WINVER 0x0602) + ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(NTDDI_VERSION 0x06010000) + SET(_WIN32_WINNT 0x0601) + SET(WINVER 0x0601) + ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(NTDDI_VERSION 0x06000100) + SET(_WIN32_WINNT 0x0600) + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(NTDDI_VERSION 0x06000000) + SET(_WIN32_WINNT 0x0600) + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) + SET(WINVER 0x0502) + ELSEIF(WINDOWS_VERSION STREQUAL "WINXP") + SET(NTDDI_VERSION 0x05010000) + SET(_WIN32_WINNT 0x0501) + SET(WINVER 0x0501) + ELSE(WINDOWS_VERSION STREQUAL "WIN8") + # Default to Windows Server 2003 API if we don't recognize the specifier + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) + SET(WINVER 0x0502) + ENDIF(WINDOWS_VERSION STREQUAL "WIN8") +ENDIF(WIN32) + +IF(MSVC) + IF(ENABLE_SAFESEH STREQUAL "YES") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH") + SET(ENV{LDFLAGS} "$ENV{LDFLAGS} /SAFESEH") + ELSEIF(ENABLE_SAFESEH STREQUAL "NO") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") + SET(ENV{LDFLAGS} "$ENV{LDFLAGS} /SAFESEH:NO") + ENDIF(ENABLE_SAFESEH STREQUAL "YES") +ENDIF(MSVC) + +IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$") + ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t +ENDIF() + +# +INCLUDE(CheckCSourceCompiles) +INCLUDE(CheckCSourceRuns) +INCLUDE(CheckFileOffsetBits) +INCLUDE(CheckFuncs) +INCLUDE(CheckHeaderDirent) +INCLUDE(CheckIncludeFile) +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckLibraryExists) +INCLUDE(CheckStructHasMember) +INCLUDE(CheckSymbolExists) +INCLUDE(CheckTypeExists) +INCLUDE(CheckTypeSize) + +# +# Generate list.h +# +MACRO (GENERATE_LIST_H _listfile _cmlist __list_sources) + SET(_argv ${ARGV}) + # Remove _listfile and _cmlist from _argv + LIST(REMOVE_AT _argv 0 1) + IF (NOT EXISTS "${_listfile}" OR + ${_cmlist} IS_NEWER_THAN "${_listfile}") + + MESSAGE(STATUS "Generating ${_listfile}") + FILE(WRITE ${_listfile} "") + FOREACH (testfile ${_argv}) + IF (testfile MATCHES "^test_[^/]+[.]c$") + FILE(STRINGS ${testfile} testvar REGEX "^DEFINE_TEST") + FOREACH (deftest ${testvar}) + FILE(APPEND ${_listfile} "${deftest}\n") + ENDFOREACH (deftest) + ENDIF (testfile MATCHES "^test_[^/]+[.]c$") + ENDFOREACH (testfile) + + ENDIF (NOT EXISTS "${_listfile}" OR + ${_cmlist} IS_NEWER_THAN "${_listfile}") +ENDMACRO (GENERATE_LIST_H) +# +# Generate installation rules for man pages. +# +MACRO (INSTALL_MAN __mans) + FOREACH (_man ${ARGV}) + STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man}) + INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") + ENDFOREACH (_man) +ENDMACRO (INSTALL_MAN __mans) +# +# Find out what macro is needed to use libraries on Windows. +# +MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES + TRY_TYPE SAMPLE_SOURCE MACRO_LIST) + IF(WIN32 AND NOT CYGWIN) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBRARIES}) + FOREACH(VAR ${MACRO_LIST}) + # Clear ${VAR} from CACHE If the libraries which ${VAR} was + # checked with are changed. + SET(VAR_WITH_LIB "${VAR}_WITH_LIB") + GET_PROPERTY(PREV_VAR_WITH_LIB VARIABLE PROPERTY ${VAR_WITH_LIB}) + IF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + UNSET(${VAR} CACHE) + ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + # Check if the library can be used with the macro. + IF("${TRY_TYPE}" MATCHES "COMPILES") + CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) + ELSEIF("${TRY_TYPE}" MATCHES "RUNS") + CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) + ELSE("${TRY_TYPE}" MATCHES "COMPILES") + MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE") + ENDIF("${TRY_TYPE}" MATCHES "COMPILES") + # Save the libraries which ${VAR} is checked with. + SET(${VAR_WITH_LIB} "${LIBRARIES}" CACHE INTERNAL + "Macro ${VAR} is checked with") + ENDFOREACH(VAR) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(WIN32 AND NOT CYGWIN) +ENDMACRO (TRY_MACRO_FOR_LIBRARY) +# +# Check compress/decompress libraries +# +IF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) + # GnuWin32 is only for Win32, not Win64. + SET(__GNUWIN32PATH "C:/Program Files/GnuWin32") +ENDIF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) +IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # You have to add a path availabel DLL file into PATH environment variable. + # Maybe DLL path is "C:/Program Files/GnuWin32/bin". + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. + # This is convenience setting for Windows. + SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, + # you should execute cmake with -DCMAKE_PREFIX_PATH option. + # e.g. + # cmake -DCMAKE_PREFIX_PATH= + # + # If compiling error occurred in zconf.h, You may need patch to zconf.h. + #--- zconf.h.orig 2005-07-21 00:40:26.000000000 + #+++ zconf.h 2009-01-19 11:39:10.093750000 + #@@ -286,7 +286,7 @@ + # + # #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */ + # # include /* for off_t */ + #-# include /* for SEEK_* and off_t */ + #+# include /* for SEEK_* and off_t */ + # # ifdef VMS + # # include /* for off_t */ + # # endif +ENDIF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + +SET(ADDITIONAL_LIBS "") +# +# Find ZLIB +# +IF(ENABLE_ZLIB) + FIND_PACKAGE(ZLIB) +ELSE() + SET(ZLIB_FOUND FALSE) # Override cached value +ENDIF() +IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) + # + # Test if ZLIB_WINAPI macro is needed to use. + # + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + RUNS + "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" + ZLIB_WINAPI) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + COMPILES + "#include \nint main() {return zlibVersion()?1:0; }" + "ZLIB_DLL;WITHOUT_ZLIB_DLL") + IF(ZLIB_DLL) + ADD_DEFINITIONS(-DZLIB_DLL) + ENDIF(ZLIB_DLL) + ENDIF(ZLIB_WINAPI) + ENDIF(WIN32 AND NOT CYGWIN) +ENDIF(ZLIB_FOUND) +MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) +# +# Find BZip2 +# +IF(ENABLE_BZip2) + FIND_PACKAGE(BZip2) +ELSE() + SET(BZIP2_FOUND FALSE) # Override cached value +ENDIF() +IF(BZIP2_FOUND) + SET(HAVE_LIBBZ2 1) + SET(HAVE_BZLIB_H 1) + INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${BZIP2_INCLUDE_DIR}" "${BZIP2_LIBRARIES}" + COMPILES + "#include \nint main() {return BZ2_bzlibVersion()?1:0; }" + "USE_BZIP2_DLL;USE_BZIP2_STATIC") + IF(USE_BZIP2_DLL) + ADD_DEFINITIONS(-DUSE_BZIP2_DLL) + ELSEIF(USE_BZIP2_STATIC) + ADD_DEFINITIONS(-DUSE_BZIP2_STATIC) + ENDIF(USE_BZIP2_DLL) +ENDIF(BZIP2_FOUND) +MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) + + +# +# Find LZMA +# +IF(ENABLE_LZMA) + FIND_PACKAGE(LibLZMA) +ELSE() + SET(LIBZMA_FOUND FALSE) # Override cached value +ENDIF() + +IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${LIBLZMA_INCLUDE_DIRS}" "${LIBLZMA_LIBRARIES}" + COMPILES + "#include \nint main() {return (int)lzma_version_number(); }" + "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") + IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ADD_DEFINITIONS(-DLZMA_API_STATIC) + ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) +ELSE(LIBLZMA_FOUND) +# LZMA not found and will not be used. +ENDIF(LIBLZMA_FOUND) +# +# Find LZO2 +# +IF(ENABLE_LZO) + IF (LZO2_INCLUDE_DIR) + # Already in cache, be silent + SET(LZO2_FIND_QUIETLY TRUE) + ENDIF (LZO2_INCLUDE_DIR) + + FIND_PATH(LZO2_INCLUDE_DIR lzo/lzoconf.h) + FIND_LIBRARY(LZO2_LIBRARY NAMES lzo2 liblzo2) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO2 DEFAULT_MSG LZO2_LIBRARY LZO2_INCLUDE_DIR) +ELSE(ENABLE_LZO) + SET(LIBZMA_FOUND FALSE) # Override cached value +ENDIF(ENABLE_LZO) +IF(LZO2_FOUND) + SET(HAVE_LIBLZO2 1) + SET(HAVE_LZO_LZOCONF_H 1) + SET(HAVE_LZO_LZO1X_H 1) + INCLUDE_DIRECTORIES(${LZO2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZO2_LIBRARY}) + # + # TODO: test for static library. + # +ENDIF(LZO2_FOUND) +MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) +# +# Find LZ4 +# +IF (LZ4_INCLUDE_DIR) + # Already in cache, be silent + SET(LZ4_FIND_QUIETLY TRUE) +ENDIF (LZ4_INCLUDE_DIR) + +FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) +IF(LZ4_FOUND) + SET(HAVE_LIBLZ4 1) + SET(HAVE_LZ4_H 1) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR}) + CHECK_INCLUDE_FILES("lz4hc.h" HAVE_LZ4HC_H) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZ4_LIBRARY}) + # + # TODO: test for static library. + # +ENDIF(LZ4_FOUND) +MARK_AS_ADVANCED(CLEAR LZ4_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LZ4_LIBRARY) + +# +# Check headers +# +CHECK_HEADER_DIRENT() + +SET(INCLUDES "") +MACRO (LA_CHECK_INCLUDE_FILE header var) + CHECK_INCLUDE_FILES("${INCLUDES};${header}" ${var}) + IF (${var}) + SET(INCLUDES ${INCLUDES} ${header}) + ENDIF (${var}) +ENDMACRO (LA_CHECK_INCLUDE_FILE) + +# Some FreeBSD headers assume sys/types.h was already included. +LA_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) + +# Alphabetize the rest unless there's a compelling reason +LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H) +LA_CHECK_INCLUDE_FILE("attr/xattr.h" HAVE_ATTR_XATTR_H) +LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H) +LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) +LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) +LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) +LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) + +CHECK_C_SOURCE_COMPILES("#include +#include +int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) + +LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) +LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) +LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H) +LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H) +LA_CHECK_INCLUDE_FILE("linux/types.h" HAVE_LINUX_TYPES_H) +LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H) +LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H) + +CHECK_C_SOURCE_COMPILES("#include +#include +int main(void) { return FS_IOC_GETFLAGS; }" HAVE_WORKING_FS_IOC_GETFLAGS) + +LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H) +LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H) +LA_CHECK_INCLUDE_FILE("membership.h" HAVE_MEMBERSHIP_H) +LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H) +LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H) +LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H) +LA_CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H) +LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H) +LA_CHECK_INCLUDE_FILE("readpassphrase.h" HAVE_READPASSPHRASE_H) +LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) +LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) +LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H) +LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H) +LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H) +LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H) +LA_CHECK_INCLUDE_FILE("sys/extattr.h" HAVE_SYS_EXTATTR_H) +LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H) +LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H) +LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H) +LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H) +LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H) +LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H) +LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H) +LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H) +LA_CHECK_INCLUDE_FILE("sys/statvfs.h" HAVE_SYS_STATVFS_H) +LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H) +LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H) +LA_CHECK_INCLUDE_FILE("sys/utsname.h" HAVE_SYS_UTSNAME_H) +LA_CHECK_INCLUDE_FILE("sys/vfs.h" HAVE_SYS_VFS_H) +LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H) +LA_CHECK_INCLUDE_FILE("sys/xattr.h" HAVE_SYS_XATTR_H) +LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H) +LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) +LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H) +LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H) +LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H) +LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) +IF(ENABLE_CNG) + LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H) + IF(HAVE_BCRYPT_H) + LIST(APPEND ADDITIONAL_LIBS "Bcrypt") + ENDIF(HAVE_BCRYPT_H) +ELSE(ENABLE_CNG) + UNSET(HAVE_BCRYPT_H CACHE) +ENDIF(ENABLE_CNG) +# Following files need windows.h, so we should test it after windows.h test. +LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H) +LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H) + +# +# Check whether use of __EXTENSIONS__ is safe. +# We need some macro such as _GNU_SOURCE to use extension functions. +# +SET(_INCLUDE_FILES) +FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") +ENDFOREACH (it) + +CHECK_C_SOURCE_COMPILES( + "#define __EXTENSIONS__ 1 + ${_INCLUDE_FILES} + int main() { return 0;}" + SAFE_TO_DEFINE_EXTENSIONS) + +# +# Find Nettle +# +IF(ENABLE_NETTLE) + FIND_PACKAGE(Nettle) + IF(NETTLE_FOUND) + SET(HAVE_LIBNETTLE 1) + LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES}) + INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) + + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${NETTLE_INCLUDE_DIR}) + LA_CHECK_INCLUDE_FILE("nettle/aes.h" HAVE_NETTLE_AES_H) + LA_CHECK_INCLUDE_FILE("nettle/hmac.h" HAVE_NETTLE_HMAC_H) + LA_CHECK_INCLUDE_FILE("nettle/md5.h" HAVE_NETTLE_MD5_H) + LA_CHECK_INCLUDE_FILE("nettle/pbkdf2.h" HAVE_NETTLE_PBKDF2_H) + LA_CHECK_INCLUDE_FILE("nettle/ripemd160.h" HAVE_NETTLE_RIPEMD160_H) + LA_CHECK_INCLUDE_FILE("nettle/sha.h" HAVE_NETTLE_SHA_H) + + ENDIF(NETTLE_FOUND) + MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES) +ENDIF(ENABLE_NETTLE) + +# +# Find OpenSSL +# (Except on Mac, where OpenSSL is deprecated.) +# +IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) + ENDIF(OPENSSL_FOUND) +ELSE() + SET(OPENSSL_FOUND FALSE) # Override cached value +ENDIF() + +# FreeBSD libmd +IF(NOT OPENSSL_FOUND) + CHECK_LIBRARY_EXISTS(md "MD5Init" "" LIBMD_FOUND) + IF(LIBMD_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_LIBRARIES "md") + FIND_LIBRARY(LIBMD_LIBRARY NAMES md) + LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(LIBMD_FOUND) +ENDIF(NOT OPENSSL_FOUND) + +# +# How to prove that CRYPTO functions, which have several names on various +# platforms, just see if archive_digest.c can compile and link against +# required libraries. +# +MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NOT NETTLE_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + + IF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + # Probe the local implementation for whether this + # crypto implementation is available on this platform. + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") + SET(TRY_CRYPTO_REQUIRED_LIBS) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NETTLE_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${NETTLE_INCLUDE_DIR}") + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_digest.c" + ARCHIVE_CRYPTO_C) + + SET(SOURCE "${CONFDEFS_H} + +#define ARCHIVE_${algorithm}_COMPILE_TEST +#define ARCHIVE_CRYPTO_${algorithm}_${IMPLEMENTATION} +#define PLATFORM_CONFIG_H \"check_crypto_md.h\" + +${ARCHIVE_CRYPTO_C} + +int +main(int argc, char **argv) +{ + archive_${lower_algorithm}_ctx ctx; + archive_${lower_algorithm}_init(&ctx); + archive_${lower_algorithm}_update(&ctx, *argv, argc); + archive_${lower_algorithm}_final(&ctx, NULL); + return 0; +} +") + + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.h" "") + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}") + + TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c + CMAKE_FLAGS + "${TRY_CRYPTO_REQUIRED_LIBS}" + "${TRY_CRYPTO_REQUIRED_INCLUDES}" + OUTPUT_VARIABLE OUTPUT) + + # Inform user whether or not we found it; if not, log why we didn't. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- found") + SET(ARCHIVE_CRYPTO_${ALGORITHM} 1) + ELSE (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- not found") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + + # Add appropriate libs/includes depending on whether the implementation + # was found on this platform. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) + LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) + ENDFOREACH(ALGORITHM ${ALGORITHMS}) +ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + +# +# CRYPTO functions on Windows is defined at archive_windows.c, thus we do not +# need the test what the functions can be mapped to archive_{crypto name}_init, +# archive_{crypto name}_update and archive_{crypto name}_final. +# The functions on Windows use CALG_{crypto name} macro to create a crypt object +# and then we need to know what CALG_{crypto name} macros is available to show +# ARCHIVE_CRYPTO_{crypto name}_WIN macros because Windows 2000 and earlier version +# of Windows XP do not support SHA256, SHA384 and SHA512. +# +MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) + IF(WIN32 AND NOT CYGWIN) + FOREACH(CRYPTO ${CRYPTO_LIST}) + IF(NOT ARCHIVE_CRYPTO_${CRYPTO}) + IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + STRING(TOUPPER "${CRYPTO}" crypto) + SET(ALGID "") + IF ("${CRYPTO}" MATCHES "^MD5$") + SET(ALGID "CALG_MD5") + ENDIF ("${CRYPTO}" MATCHES "^MD5$") + IF ("${CRYPTO}" MATCHES "^SHA1$") + SET(ALGID "CALG_SHA1") + ENDIF ("${CRYPTO}" MATCHES "^SHA1$") + IF ("${CRYPTO}" MATCHES "^SHA256$") + SET(ALGID "CALG_SHA_256") + ENDIF ("${CRYPTO}" MATCHES "^SHA256$") + IF ("${CRYPTO}" MATCHES "^SHA384$") + SET(ALGID "CALG_SHA_384") + ENDIF ("${CRYPTO}" MATCHES "^SHA384$") + IF ("${CRYPTO}" MATCHES "^SHA512$") + SET(ALGID "CALG_SHA_512") + ENDIF ("${CRYPTO}" MATCHES "^SHA512$") + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) + + SET(SOURCE "${CONFDEFS_H} + +#define ${crypto}_COMPILE_TEST +#include +#include + +int +main(int argc, char **argv) +{ + return ${ALGID}; +} +") + SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_win.c") + + FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN") + + TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN + ${CMAKE_BINARY_DIR} + ${SOURCE_FILE} + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" + OUTPUT_VARIABLE OUTPUT) + + IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + MESSAGE(STATUS + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found") + SET(ARCHIVE_CRYPTO_${CRYPTO} 1) + ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + MESSAGE(STATUS + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found") + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + ENDIF(NOT ARCHIVE_CRYPTO_${CRYPTO}) + ENDFOREACH(CRYPTO) + ENDIF(WIN32 AND NOT CYGWIN) +ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) + +# +# Find iconv +# POSIX defines the second arg as const char ** +# and requires it to be in libc. But we can accept +# a non-const argument here and can support iconv() +# being in libiconv. +# +MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) + IF(NOT HAVE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") + # + # During checking iconv proto type, we should use -Werror to avoid the + # success of iconv detection with a warnig which success is a miss + # detection. So this needs for all build mode(even it's a release mode). + # + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") + ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") + IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -qhalt=w -qflag=w:w") + ENDIF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + IF (MSVC) + # NOTE: /WX option is the same as gcc's -Werror option. + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX") + ENDIF (MSVC) + # + CHECK_C_SOURCE_COMPILES( + "#include + #include + int main() { + ${TRY_ICONV_CONST} char *ccp; + iconv_t cd = iconv_open(\"\", \"\"); + iconv(cd, &ccp, (size_t *)0, (char **)0, (size_t *)0); + iconv_close(cd); + return 0; + }" + HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + IF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + SET(HAVE_ICONV true) + SET(ICONV_CONST ${TRY_ICONV_CONST}) + ENDIF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(NOT HAVE_ICONV) +ENDMACRO(CHECK_ICONV TRY_ICONV_CONST) + +IF(ENABLE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + FIND_PATH(ICONV_INCLUDE_DIR iconv.h) + IF(ICONV_INCLUDE_DIR) + #SET(INCLUDES ${INCLUDES} "iconv.h") + SET(HAVE_ICONV_H 1) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + CHECK_ICONV("libc" "const") + CHECK_ICONV("libc" "") + + # If iconv isn't in libc and we have a libiconv, try that. + FIND_LIBRARY(LIBICONV_PATH NAMES iconv libiconv) + IF(NOT HAVE_ICONV AND LIBICONV_PATH) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBICONV_PATH}" + COMPILES + "#include \nint main() {return iconv_close((iconv_t)0);}" + "WITHOUT_LIBICONV_STATIC;LIBICONV_STATIC") + IF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + ADD_DEFINITIONS(-DLIBICONV_STATIC) + ENDIF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + # + # Set up CMAKE_REQUIRED_* for CHECK_ICONV + # + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + IF(LIBICONV_STATIC) + # LIBICONV_STATIC is necessary for the success of CHECK_ICONV + # on Windows. + SET(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") + ELSE(LIBICONV_STATIC) + SET(CMAKE_REQUIRED_DEFINITIONS) + ENDIF(LIBICONV_STATIC) + CHECK_ICONV("libiconv" "const") + CHECK_ICONV("libiconv" "") + IF (HAVE_ICONV) + LIST(APPEND ADDITIONAL_LIBS ${LIBICONV_PATH}) + ENDIF(HAVE_ICONV) + ENDIF(NOT HAVE_ICONV AND LIBICONV_PATH) + ENDIF(ICONV_INCLUDE_DIR) + # + # Find locale_charset() for libiconv. + # + IF(LIBICONV_PATH) + SET(CMAKE_REQUIRED_DEFINITIONS) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES) + CHECK_INCLUDE_FILES("localcharset.h" HAVE_LOCALCHARSET_H) + FIND_LIBRARY(LIBCHARSET_PATH NAMES charset libcharset) + IF(LIBCHARSET_PATH) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_PATH}) + IF(WIN32 AND NOT CYGWIN) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBCHARSET_PATH}" + COMPILES + "#include \nint main() {return locale_charset()?1:0;}" + "WITHOUT_LIBCHARSET_STATIC;LIBCHARSET_STATIC") + IF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + ADD_DEFINITIONS(-DLIBCHARSET_STATIC) + ENDIF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + IF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + SET(HAVE_LOCALE_CHARSET ON CACHE INTERNAL + "Have function locale_charset") + ENDIF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + ELSE(WIN32 AND NOT CYGWIN) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 00:20:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CB3DA9083; Thu, 13 Jul 2017 00:20:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33D817E322; Thu, 13 Jul 2017 00:20:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D0Kbww059354; Thu, 13 Jul 2017 00:20:37 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D0KbSd059353; Thu, 13 Jul 2017 00:20:37 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130020.v6D0KbSd059353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 00:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320926 - vendor/libarchive/3.3.2 X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: vendor/libarchive/3.3.2 X-SVN-Commit-Revision: 320926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 00:20:38 -0000 Author: mm Date: Thu Jul 13 00:20:37 2017 New Revision: 320926 URL: https://svnweb.freebsd.org/changeset/base/320926 Log: Re-tag 3.3.2 Replaced: vendor/libarchive/3.3.2/ - copied from r320925, vendor/libarchive/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 00:28:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47BC1DA9376; Thu, 13 Jul 2017 00:28:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA3E7E9B9; Thu, 13 Jul 2017 00:28:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D0Sb6E063428; Thu, 13 Jul 2017 00:28:37 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D0Sad1063422; Thu, 13 Jul 2017 00:28:36 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130028.v6D0Sad1063422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 00:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320927 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 320927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 00:28:38 -0000 Author: mm Date: Thu Jul 13 00:28:36 2017 New Revision: 320927 URL: https://svnweb.freebsd.org/changeset/base/320927 Log: MFV r320924: Bump libarchive to 3.3.2 Vendor changes: PR #901: don't depend on stdin in a testcase MFC after: 1 week Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Thu Jul 13 00:20:37 2017 (r320926) +++ head/contrib/libarchive/NEWS Thu Jul 13 00:28:36 2017 (r320927) @@ -1,3 +1,5 @@ +Jul 09, 2017: libarchive 3.3.2 released + Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) Feb 26, 2017: libarchive 3.3.1 released Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Jul 13 00:20:37 2017 (r320926) +++ head/contrib/libarchive/libarchive/archive.h Thu Jul 13 00:28:36 2017 (r320927) @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.1" +#define ARCHIVE_VERSION_ONLY_STRING "3.3.2" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: head/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 13 00:20:37 2017 (r320926) +++ head/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 13 00:28:36 2017 (r320927) @@ -28,10 +28,12 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_archive_read_close_twice_open_filename) { + const char *filename = "empty.file"; struct archive* a = archive_read_new(); + assertMakeFile(filename, 0644, ""); assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a)); - assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, 0, 0)); + assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, filename, 0)); assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); Modified: head/usr.bin/bsdcat/Makefile ============================================================================== --- head/usr.bin/bsdcat/Makefile Thu Jul 13 00:20:37 2017 (r320926) +++ head/usr.bin/bsdcat/Makefile Thu Jul 13 00:28:36 2017 (r320927) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.3.1 +BSDCAT_VERSION_STRING= 3.3.2 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Thu Jul 13 00:20:37 2017 (r320926) +++ head/usr.bin/cpio/Makefile Thu Jul 13 00:28:36 2017 (r320927) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.3.1 +BSDCPIO_VERSION_STRING= 3.3.2 .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Thu Jul 13 00:20:37 2017 (r320926) +++ head/usr.bin/tar/Makefile Thu Jul 13 00:28:36 2017 (r320927) @@ -4,7 +4,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.3.1 +BSDTAR_VERSION_STRING= 3.3.2 .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-svn-src-all@freebsd.org Thu Jul 13 02:09:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFBADAAF10; Thu, 13 Jul 2017 02:09:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57E4581231; Thu, 13 Jul 2017 02:09:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x236.google.com with SMTP id i2so27369356qta.3; Wed, 12 Jul 2017 19:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SFEvwxxtmoQC4Pk7PkFBqM1RPGVHAc2mytTvl8ydFdY=; b=jR0WUzpxYUs3DRN6AkFM/h3eW+WpVwdeUlsetBzm28V34y3rJUR1DlKKcLdSBPbI7k Mt8u0EQjxgszlgtabQEw7XlfWTiae6Nu+EzZZ3ej4ZpRUuuCa+rRsaMi6fs8BhYdA5Kr JaFJO8Y/GDszNmpfqwFa2hyb71qKGL/qJAGCbPY+Dccryfj9LYwN0MQlkcDIIhJOqorb hsKhnkmRtxB+dTfEZpivWtf1cMHh95z/zegoyLJl6p/xzIwB2I1ji6oIVPustJd6Dxw/ X+09SCsgPvpnYksTX3JSAeMR2lj7T5+ysQ5nRLqeuhHJDgp2jDWLgPGciFhMAQlJQtZv w92w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SFEvwxxtmoQC4Pk7PkFBqM1RPGVHAc2mytTvl8ydFdY=; b=hquPUEqgQSBY9ocreDNh8ek5b4cGZL3tEDTXPAHJkIESGfC82uy8lsDZSo7r69RDx6 3OH9/8o/q8HEtoOySpnR06NAC6mvzMVczk9NtJ8/ow17TVz//KYAGeBmu80NQ0YDULK+ tAO9wkK9I82cTTsGQOIW3oZViXNocI6l2I4H1wxyWW/4IhMpFbuT+m4drKc6LbnNRijy yubl6vOaE8Hk/ChKvULJ19eKJSQuOr3aiLA/TqnrIGCECt4UQr/J094W7rZFflJsROem uEHMUB2vJGCJnUWJ4IHw+XqnaoqjK3Y9sC6v9/2aIh0Ub8Rn3+djH70ckYu80dygJuzY VP1g== X-Gm-Message-State: AIVw110SE2dxTfaHJhOh7qxrRhiwdwYN8gRTgXwt2pa9lZMuFUPPmcum 8eaHRWz17rCaIa44hcBMm6G3GDhoilI8hIY= X-Received: by 10.237.58.167 with SMTP id o36mr1936801qte.128.1499911748067; Wed, 12 Jul 2017 19:09:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.92.142 with HTTP; Wed, 12 Jul 2017 19:09:07 -0700 (PDT) In-Reply-To: <201707130028.v6D0Sad1063422@repo.freebsd.org> References: <201707130028.v6D0Sad1063422@repo.freebsd.org> From: Ngie Cooper Date: Wed, 12 Jul 2017 19:09:07 -0700 Message-ID: Subject: Re: svn commit: r320927 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar To: Martin Matuska Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "freebsd-testing@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 02:09:09 -0000 On Wed, Jul 12, 2017 at 5:28 PM, Martin Matuska wrote: > Author: mm > Date: Thu Jul 13 00:28:36 2017 > New Revision: 320927 > URL: https://svnweb.freebsd.org/changeset/base/320927 > > Log: > MFV r320924: > Bump libarchive to 3.3.2 > > Vendor changes: > PR #901: don't depend on stdin in a testcase > > MFC after: 1 week This commit broke the tests: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/3457/testReport/junit/lib.libarchive/functional_test/test_archive_api_feature/ Thanks, -Ngie From owner-svn-src-all@freebsd.org Thu Jul 13 02:16:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81E98D9122D; Thu, 13 Jul 2017 02:16:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C6762A5; Thu, 13 Jul 2017 02:16:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D2GFbS007689; Thu, 13 Jul 2017 02:16:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D2GFA3007687; Thu, 13 Jul 2017 02:16:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707130216.v6D2GFA3007687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 13 Jul 2017 02:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320928 - in head/sys: arm/freescale/imx dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/freescale/imx dev/usb/controller X-SVN-Commit-Revision: 320928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 02:16:16 -0000 Author: ian Date: Thu Jul 13 02:16:15 2017 New Revision: 320928 URL: https://svnweb.freebsd.org/changeset/base/320928 Log: Support the "disable-over-current" property for imx ehci controllers. It turns out that this is more than a power optization. The OTG port won't work on boards that have this property unless this setting is honored. Also ensure that the usb phy device attaches before ehci. Modified: head/sys/arm/freescale/imx/imx6_usbphy.c head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Thu Jul 13 00:28:36 2017 (r320927) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Thu Jul 13 02:16:15 2017 (r320928) @@ -198,5 +198,11 @@ static driver_t usbphy_driver = { static devclass_t usbphy_devclass; -DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0); +/* + * This driver needs to start before the ehci driver, but later than the usual + * "special" drivers like clocks and cpu. Ehci starts at DEFAULT so + * DEFAULT-1000 seems good. + */ +EARLY_DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0, + BUS_PASS_DEFAULT - 1000); Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Thu Jul 13 00:28:36 2017 (r320927) +++ head/sys/dev/usb/controller/ehci_imx.c Thu Jul 13 02:16:15 2017 (r320928) @@ -83,12 +83,11 @@ __FBSDID("$FreeBSD$"); * data, this means that the resources (memory-mapped register range) for the * non-core registers belongs to a device other than the echi devices. * - * At the moment we have no need to access the non-core registers, so all of - * this amounts to documenting what's known. The following compat strings have - * been seen in existing FDT data: - * - "fsl,imx25-usbmisc" - * - "fsl,imx51-usbmisc"; - * - "fsl,imx6q-usbmisc"; + * Because the main ehci device cannot access registers in a range that's + * defined in the fdt data as belonging to another device, we implement a teeny + * little "usbmisc" driver which exists only to provide access to the usbmisc + * control register for each of the 4 usb controller instances. That little + * driver is implemented here in this file, before the main driver. * * In addition to the single usbmisc device, the existing FDT data defines a * separate device for each of the OTG or EHCI cores within the USBOH3. Each of @@ -133,18 +132,127 @@ __FBSDID("$FreeBSD$"); * */ -static struct ofw_compat_data compat_data[] = { - {"fsl,imx6q-usb", 1}, - {"fsl,imx53-usb", 1}, - {"fsl,imx51-usb", 1}, - {"fsl,imx28-usb", 1}, - {"fsl,imx27-usb", 1}, - {"fsl,imx25-usb", 1}, - {"fsl,imx23-usb", 1}, - {NULL, 0}, +/*----------------------------------------------------------------------------- + * imx_usbmisc driver + *---------------------------------------------------------------------------*/ + +#define USBNC_OVER_CUR_POL (1u << 8) +#define USBNC_OVER_CUR_DIS (1u << 7) + +struct imx_usbmisc_softc { + device_t dev; + struct resource *mmio; }; +static struct ofw_compat_data usbmisc_compat_data[] = { + {"fsl,imx6q-usbmisc", true}, + {"fsl,imx51-usbmisc", true}, + {"fsl,imx25-usbmisc", true}, + {NULL, false}, +}; + +static void +imx_usbmisc_set_ctrl(device_t dev, u_int index, uint32_t bits) +{ + struct imx_usbmisc_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + reg = bus_read_4(sc->mmio, index * sizeof(uint32_t)); + bus_write_4(sc->mmio, index * sizeof(uint32_t), reg | bits); +} + +static void +imx_usbmisc_clr_ctrl(device_t dev, u_int index, uint32_t bits) +{ + struct imx_usbmisc_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + reg = bus_read_4(sc->mmio, index * sizeof(uint32_t)); + bus_write_4(sc->mmio, index * sizeof(uint32_t), reg & ~bits); +} + +static int +imx_usbmisc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, usbmisc_compat_data)->ocd_data) { + device_set_desc(dev, "i.MX USB Misc Control"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +imx_usbmisc_detach(device_t dev) +{ + struct imx_usbmisc_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mmio != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mmio); + + return (0); +} + +static int +imx_usbmisc_attach(device_t dev) +{ + struct imx_usbmisc_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mmio = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mmio == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + return (ENXIO); + } + + OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); + + return (0); +} + +static device_method_t imx_usbmisc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_usbmisc_probe), + DEVMETHOD(device_attach, imx_usbmisc_attach), + DEVMETHOD(device_detach, imx_usbmisc_detach), + + DEVMETHOD_END +}; + +static driver_t imx_usbmisc_driver = { + "imx_usbmisc", + imx_usbmisc_methods, + sizeof(struct imx_usbmisc_softc) +}; + +static devclass_t imx_usbmisc_devclass; + /* + * This driver needs to start before the ehci driver, but later than the usual + * "special" drivers like clocks and cpu. Ehci starts at DEFAULT so + * DEFAULT-1000 seems good. + */ +EARLY_DRIVER_MODULE(imx_usbmisc, simplebus, imx_usbmisc_driver, + imx_usbmisc_devclass, 0, 0, BUS_PASS_DEFAULT - 1000); + +/*----------------------------------------------------------------------------- + * imx_ehci driver... + *---------------------------------------------------------------------------*/ + +/* * Each EHCI device in the SoC has some SoC-specific per-device registers at an * offset of 0, then the standard EHCI registers begin at an offset of 0x100. */ @@ -153,10 +261,22 @@ static struct ofw_compat_data compat_data[] = { struct imx_ehci_softc { ehci_softc_t ehci_softc; + device_t dev; struct resource *ehci_mem_res; /* EHCI core regs. */ struct resource *ehci_irq_res; /* EHCI core IRQ. */ }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usb", 1}, + {"fsl,imx53-usb", 1}, + {"fsl,imx51-usb", 1}, + {"fsl,imx28-usb", 1}, + {"fsl,imx27-usb", 1}, + {"fsl,imx25-usb", 1}, + {"fsl,imx23-usb", 1}, + {NULL, 0}, +}; + static void imx_ehci_post_reset(struct ehci_softc *ehci_softc) { @@ -215,6 +335,36 @@ imx_ehci_detach(device_t dev) return (0); } +static void +imx_ehci_disable_oc(struct imx_ehci_softc *sc) +{ + device_t usbmdev; + pcell_t usbmprops[2]; + phandle_t node; + ssize_t size; + int index; + + /* Get the reference to the usbmisc driver from the fdt data */ + node = ofw_bus_get_node(sc->dev); + size = OF_getencprop(node, "fsl,usbmisc", usbmprops, + sizeof(usbmprops)); + if (size < sizeof(usbmprops)) { + device_printf(sc->dev, "failed to retrieve fsl,usbmisc " + "property, cannot disable overcurrent protection"); + return; + } + /* Retrieve the device_t via the xref handle. */ + usbmdev = OF_device_from_xref(usbmprops[0]); + if (usbmdev == NULL) { + device_printf(sc->dev, "usbmisc device not found, " + "cannot disable overcurrent protection"); + return; + } + /* Call the device routine to set the overcurrent disable bit. */ + index = usbmprops[1]; + imx_usbmisc_set_ctrl(usbmdev, index, USBNC_OVER_CUR_DIS); +} + static int imx_ehci_attach(device_t dev) { @@ -223,6 +373,7 @@ imx_ehci_attach(device_t dev) int err, rid; sc = device_get_softc(dev); + sc->dev = dev; esc = &sc->ehci_softc; err = 0; @@ -282,6 +433,10 @@ imx_ehci_attach(device_t dev) /* Turn on clocks. */ imx_ccm_usb_enable(dev); + + /* Disable overcurrent detection, if configured to do so. */ + if (OF_hasprop(ofw_bus_get_node(sc->dev), "disable-over-current")) + imx_ehci_disable_oc(sc); /* Add USB bus device. */ esc->sc_bus.bdev = device_add_child(dev, "usbus", -1); From owner-svn-src-all@freebsd.org Thu Jul 13 02:20:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A627CD9144E; Thu, 13 Jul 2017 02:20:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E935775; Thu, 13 Jul 2017 02:20:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D2K75b007869; Thu, 13 Jul 2017 02:20:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D2K7IV007868; Thu, 13 Jul 2017 02:20:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707130220.v6D2K7IV007868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 13 Jul 2017 02:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320929 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 320929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 02:20:08 -0000 Author: ian Date: Thu Jul 13 02:20:07 2017 New Revision: 320929 URL: https://svnweb.freebsd.org/changeset/base/320929 Log: Put an #ifdef notyet wrapper around a function that's not being used yet, to avoid compile warnings. Modified: head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Thu Jul 13 02:16:15 2017 (r320928) +++ head/sys/dev/usb/controller/ehci_imx.c Thu Jul 13 02:20:07 2017 (r320929) @@ -162,6 +162,7 @@ imx_usbmisc_set_ctrl(device_t dev, u_int index, uint32 bus_write_4(sc->mmio, index * sizeof(uint32_t), reg | bits); } +#ifdef notyet static void imx_usbmisc_clr_ctrl(device_t dev, u_int index, uint32_t bits) { @@ -172,6 +173,7 @@ imx_usbmisc_clr_ctrl(device_t dev, u_int index, uint32 reg = bus_read_4(sc->mmio, index * sizeof(uint32_t)); bus_write_4(sc->mmio, index * sizeof(uint32_t), reg & ~bits); } +#endif static int imx_usbmisc_probe(device_t dev) From owner-svn-src-all@freebsd.org Thu Jul 13 03:52:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE99D93A50; Thu, 13 Jul 2017 03:52:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id 543243820; Thu, 13 Jul 2017 03:52:58 +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 v6D3qvBF049089; Thu, 13 Jul 2017 03:52:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D3qsXX049061; Thu, 13 Jul 2017 03:52:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201707130352.v6D3qsXX049061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 13 Jul 2017 03:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320930 - in head: etc/mtree usr.bin/hexdump usr.bin/hexdump/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree usr.bin/hexdump usr.bin/hexdump/tests X-SVN-Commit-Revision: 320930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 03:52:58 -0000 Author: kevans Date: Thu Jul 13 03:52:54 2017 New Revision: 320930 URL: https://svnweb.freebsd.org/changeset/base/320930 Log: Add some basic tests for hexdump(1)'s various output flags. Formatting tests are omitted for this initial run as there are still some bugs to work out there. This covers -s flag testing on devices and non-devices that would have caught breakage found in PR 219173 as well as other subtle breakage caused locally. Reviewed by: cem, ngie Approved by: cem (acting co-mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11279 Added: head/usr.bin/hexdump/tests/ head/usr.bin/hexdump/tests/Makefile (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_UCflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_UCflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_UCflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_a.in (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_b.in (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_bflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_bflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_bflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_c.in (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_cflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_cflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_cflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_dflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_dflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_nflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_oflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_oflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_sflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_xflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_xflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out (contents, props changed) head/usr.bin/hexdump/tests/hexdump_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/hexdump/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jul 13 02:20:07 2017 (r320929) +++ head/etc/mtree/BSD.tests.dist Thu Jul 13 03:52:54 2017 (r320930) @@ -644,6 +644,8 @@ .. gzip .. + hexdump + .. ident .. indent Modified: head/usr.bin/hexdump/Makefile ============================================================================== --- head/usr.bin/hexdump/Makefile Thu Jul 13 02:20:07 2017 (r320929) +++ head/usr.bin/hexdump/Makefile Thu Jul 13 03:52:54 2017 (r320930) @@ -1,11 +1,17 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= hexdump SRCS= conv.c display.c hexdump.c hexsyntax.c odsyntax.c parse.c MAN= hexdump.1 od.1 MLINKS= hexdump.1 hd.1 LINKS= ${BINDIR}/hexdump ${BINDIR}/od LINKS+= ${BINDIR}/hexdump ${BINDIR}/hd + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Added: head/usr.bin/hexdump/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/Makefile Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= hexdump_test + +${PACKAGE}FILES+= d_hexdump_a.in +${PACKAGE}FILES+= d_hexdump_b.in +${PACKAGE}FILES+= d_hexdump_c.in +${PACKAGE}FILES+= d_hexdump_bflag_a.out +${PACKAGE}FILES+= d_hexdump_bflag_b.out +${PACKAGE}FILES+= d_hexdump_bflag_c.out +${PACKAGE}FILES+= d_hexdump_cflag_a.out +${PACKAGE}FILES+= d_hexdump_cflag_b.out +${PACKAGE}FILES+= d_hexdump_cflag_c.out +${PACKAGE}FILES+= d_hexdump_dflag_a.out +${PACKAGE}FILES+= d_hexdump_dflag_b.out +${PACKAGE}FILES+= d_hexdump_dflag_c.out +${PACKAGE}FILES+= d_hexdump_nflag_a.out +${PACKAGE}FILES+= d_hexdump_oflag_a.out +${PACKAGE}FILES+= d_hexdump_oflag_b.out +${PACKAGE}FILES+= d_hexdump_oflag_c.out +${PACKAGE}FILES+= d_hexdump_sflag_a.out +${PACKAGE}FILES+= d_hexdump_UCflag_a.out +${PACKAGE}FILES+= d_hexdump_UCflag_b.out +${PACKAGE}FILES+= d_hexdump_UCflag_c.out +${PACKAGE}FILES+= d_hexdump_xflag_a.out +${PACKAGE}FILES+= d_hexdump_xflag_b.out +${PACKAGE}FILES+= d_hexdump_xflag_c.out + +.include Added: head/usr.bin/hexdump/tests/d_hexdump_UCflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_UCflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +00000000 54 65 73 74 0a |Test.| +00000005 Added: head/usr.bin/hexdump/tests/d_hexdump_UCflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_UCflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +00000000 54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20 |The quick brown | +00000010 66 6f 78 20 6a 75 6d 70 65 64 20 6f 76 65 72 20 |fox jumped over | +00000020 74 68 65 20 62 6c 75 65 20 68 6f 75 73 65 0a 0a |the blue house..| +00000030 Added: head/usr.bin/hexdump/tests/d_hexdump_UCflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_UCflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +00000000 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 |AAAAAAAAAAAAAAAA| +* +00000020 41 41 41 41 41 41 41 0a |AAAAAAA.| +00000028 Added: head/usr.bin/hexdump/tests/d_hexdump_a.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_a.in Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1 @@ +Test Added: head/usr.bin/hexdump/tests/d_hexdump_b.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_b.in Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +The quick brown fox jumped over the blue house + Added: head/usr.bin/hexdump/tests/d_hexdump_bflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_bflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 124 145 163 164 012 +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_bflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_bflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 124 150 145 040 161 165 151 143 153 040 142 162 157 167 156 040 +0000010 146 157 170 040 152 165 155 160 145 144 040 157 166 145 162 040 +0000020 164 150 145 040 142 154 165 145 040 150 157 165 163 145 012 012 +0000030 Added: head/usr.bin/hexdump/tests/d_hexdump_bflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_bflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 +* +0000020 101 101 101 101 101 101 101 012 +0000028 Added: head/usr.bin/hexdump/tests/d_hexdump_c.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_c.in Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1 @@ +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Added: head/usr.bin/hexdump/tests/d_hexdump_cflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_cflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 T e s t \n +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_cflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_cflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 T h e q u i c k b r o w n +0000010 f o x j u m p e d o v e r +0000020 t h e b l u e h o u s e \n \n +0000030 Added: head/usr.bin/hexdump/tests/d_hexdump_cflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_cflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 A A A A A A A A A A A A A A A A +* +0000020 A A A A A A A \n +0000028 Added: head/usr.bin/hexdump/tests/d_hexdump_dflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_dflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 25940 29811 00010 +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_dflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_dflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 26708 08293 30065 25449 08299 29282 30575 08302 +0000010 28518 08312 30058 28781 25701 28448 25974 08306 +0000020 26740 08293 27746 25973 26656 30063 25971 02570 +0000030 Added: head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 16705 16705 16705 16705 16705 16705 16705 16705 +* +0000020 16705 16705 16705 02625 +0000028 Added: head/usr.bin/hexdump/tests/d_hexdump_nflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_nflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 124 +0000001 Added: head/usr.bin/hexdump/tests/d_hexdump_oflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_oflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 062524 072163 000012 +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_oflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_oflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 064124 020145 072561 061551 020153 071142 073557 020156 +0000010 067546 020170 072552 070155 062145 067440 062566 020162 +0000020 064164 020145 066142 062565 064040 072557 062563 005012 +0000030 Added: head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 040501 040501 040501 040501 040501 040501 040501 040501 +* +0000020 040501 040501 040501 005101 +0000028 Added: head/usr.bin/hexdump/tests/d_hexdump_sflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_sflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000004 012 +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_xflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_xflag_a.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,2 @@ +0000000 6554 7473 000a +0000005 Added: head/usr.bin/hexdump/tests/d_hexdump_xflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_xflag_b.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 6854 2065 7571 6369 206b 7262 776f 206e +0000010 6f66 2078 756a 706d 6465 6f20 6576 2072 +0000020 6874 2065 6c62 6575 6820 756f 6573 0a0a +0000030 Added: head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,4 @@ +0000000 4141 4141 4141 4141 4141 4141 4141 4141 +* +0000020 4141 4141 4141 0a41 +0000028 Added: head/usr.bin/hexdump/tests/hexdump_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/hexdump_test.sh Thu Jul 13 03:52:54 2017 (r320930) @@ -0,0 +1,192 @@ +# +# Copyright (c) 2017 Kyle Evans +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case b_flag +b_flag_head() +{ + atf_set "descr" "Verify -b output" +} +b_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_bflag_a.out" \ + hexdump -b "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_bflag_b.out" \ + hexdump -b "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_bflag_c.out" \ + hexdump -b "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case c_flag +c_flag_head() +{ + atf_set "descr" "Verify -c output" +} +c_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_cflag_a.out" \ + hexdump -c "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_cflag_b.out" \ + hexdump -c "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_cflag_c.out" \ + hexdump -c "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case C_flag +C_flag_head() +{ + atf_set "descr" "Verify -C output" +} +C_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_a.out" \ + hexdump -C "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_b.out" \ + hexdump -C "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_c.out" \ + hexdump -C "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case hd_name +hd_name_head() +{ + atf_set "descr" "Verify hd output matching -C output" +} +hd_name_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_a.out" \ + hd "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_b.out" \ + hd "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_UCflag_c.out" \ + hd "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case d_flag +d_flag_head() +{ + atf_set "descr" "Verify -d output" +} +d_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_dflag_a.out" \ + hexdump -d "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_dflag_b.out" \ + hexdump -d "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_dflag_c.out" \ + hexdump -d "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case n_flag +n_flag_head() +{ + atf_set "descr" "Check -n functionality" +} +n_flag_body() +{ + atf_check -o empty hexdump -bn 0 "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_nflag_a.out" \ + hexdump -bn 1 "$(atf_get_srcdir)/d_hexdump_a.in" +} + +atf_test_case o_flag +o_flag_head() +{ + atf_set "descr" "Verify -o output" +} +o_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_oflag_a.out" \ + hexdump -o "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_oflag_b.out" \ + hexdump -o "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_oflag_c.out" \ + hexdump -o "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case s_flag +s_flag_head() +{ + atf_set "descr" "Verify -s output" +} +s_flag_body() +{ + atf_expect_fail "-s option is currently broken due to capsicum (PR 219173)" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_sflag_a.out" \ + hexdump -bs 4 "$(atf_get_srcdir)/d_hexdump_a.in" + + atf_check -o not-empty hexdump -n 100 -s 1024 /dev/random +} + +atf_test_case v_flag +v_flag_head() +{ + atf_set "descr" "Verify -v functionality" +} +v_flag_body() +{ + atf_expect_fail "-s option is currently broken due to capsicum (PR 219173)" + for i in $(seq 0 7); do + atf_check -o match:"^\*$" \ + hexdump -s ${i} "$(atf_get_srcdir)/d_hexdump_c.in" + atf_check -o not-match:"^\*$" \ + hexdump -vs ${i} "$(atf_get_srcdir)/d_hexdump_c.in" + done + + atf_check -o not-match:"^\*$" \ + hexdump -s 8 "$(atf_get_srcdir)/d_hexdump_c.in" + atf_check -o not-match:"^\*$" \ + hexdump -vs 8 "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_test_case x_flag +x_flag_head() +{ + atf_set "descr" "Verify -x output" +} +x_flag_body() +{ + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_xflag_a.out" \ + hexdump -x "$(atf_get_srcdir)/d_hexdump_a.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_xflag_b.out" \ + hexdump -x "$(atf_get_srcdir)/d_hexdump_b.in" + atf_check -o file:"$(atf_get_srcdir)/d_hexdump_xflag_c.out" \ + hexdump -x "$(atf_get_srcdir)/d_hexdump_c.in" +} + +atf_init_test_cases() +{ + atf_add_test_case b_flag + atf_add_test_case c_flag + atf_add_test_case C_flag + atf_add_test_case hd_name + atf_add_test_case d_flag + atf_add_test_case n_flag + atf_add_test_case o_flag + atf_add_test_case s_flag + atf_add_test_case v_flag + atf_add_test_case x_flag +} From owner-svn-src-all@freebsd.org Thu Jul 13 04:42:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA76D949F1; Thu, 13 Jul 2017 04:42:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9910164B1E; Thu, 13 Jul 2017 04:42:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D4gT5Y069333; Thu, 13 Jul 2017 04:42:29 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D4gTw2069332; Thu, 13 Jul 2017 04:42:29 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130442.v6D4gTw2069332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 04:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320931 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 320931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 04:42:30 -0000 Author: mm Date: Thu Jul 13 04:42:29 2017 New Revision: 320931 URL: https://svnweb.freebsd.org/changeset/base/320931 Log: Fix libarchive mismerge of r320927 MFC after: 1 week X-MFC-with: 320927 Reported by: Ngie Cooper Modified: head/contrib/libarchive/libarchive/archive.h Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Jul 13 03:52:54 2017 (r320930) +++ head/contrib/libarchive/libarchive/archive.h Thu Jul 13 04:42:29 2017 (r320931) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003001 +#define ARCHIVE_VERSION_NUMBER 3003002 #include #include /* for wchar_t */ From owner-svn-src-all@freebsd.org Thu Jul 13 04:46:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 581A9D94AF6; Thu, 13 Jul 2017 04:46:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21C9164CA3; Thu, 13 Jul 2017 04:46:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D4k0ph069540; Thu, 13 Jul 2017 04:46:00 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D4k0vF069539; Thu, 13 Jul 2017 04:46:00 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707130446.v6D4k0vF069539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Jul 2017 04:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320932 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 320932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 04:46:01 -0000 Author: mm Date: Thu Jul 13 04:46:00 2017 New Revision: 320932 URL: https://svnweb.freebsd.org/changeset/base/320932 Log: Fix libarchive mismerge of r320927 in libarchive_entry.h MFC after: 1 week X-MFC-with: 320927 Reported by: Ngie Cooper Modified: head/contrib/libarchive/libarchive/archive_entry.h Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Thu Jul 13 04:42:29 2017 (r320931) +++ head/contrib/libarchive/libarchive/archive_entry.h Thu Jul 13 04:46:00 2017 (r320932) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003001 +#define ARCHIVE_VERSION_NUMBER 3003002 /* * Note: archive_entry.h is for use outside of libarchive; the From owner-svn-src-all@freebsd.org Thu Jul 13 07:32:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C068D99F96; Thu, 13 Jul 2017 07:32:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 360BC68CAE; Thu, 13 Jul 2017 07:32:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D7WtL7038639; Thu, 13 Jul 2017 07:32:55 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D7Wt3G038638; Thu, 13 Jul 2017 07:32:55 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707130732.v6D7Wt3G038638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 13 Jul 2017 07:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320933 - releng/11.1/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: releng/11.1/usr.sbin/bhyve X-SVN-Commit-Revision: 320933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 07:32:56 -0000 Author: grehan Date: Thu Jul 13 07:32:55 2017 New Revision: 320933 URL: https://svnweb.freebsd.org/changeset/base/320933 Log: MFS r320855 ps2 mouse fixes, found by plan9/9front. Approved by: re (kib) Modified: releng/11.1/usr.sbin/bhyve/ps2mouse.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/usr.sbin/bhyve/ps2mouse.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/ps2mouse.c Thu Jul 13 04:46:00 2017 (r320932) +++ releng/11.1/usr.sbin/bhyve/ps2mouse.c Thu Jul 13 07:32:55 2017 (r320933) @@ -62,6 +62,16 @@ __FBSDID("$FreeBSD$"); /* mouse device id */ #define PS2MOUSE_DEV_ID 0x0 +/* mouse data bits */ +#define PS2M_DATA_Y_OFLOW 0x80 +#define PS2M_DATA_X_OFLOW 0x40 +#define PS2M_DATA_Y_SIGN 0x20 +#define PS2M_DATA_X_SIGN 0x10 +#define PS2M_DATA_AONE 0x08 +#define PS2M_DATA_MID_BUTTON 0x04 +#define PS2M_DATA_RIGHT_BUTTON 0x02 +#define PS2M_DATA_LEFT_BUTTON 0x01 + /* mouse status bits */ #define PS2M_STS_REMOTE_MODE 0x40 #define PS2M_STS_ENABLE_DEV 0x20 @@ -169,19 +179,20 @@ movement_get(struct ps2mouse_softc *sc) assert(pthread_mutex_isowned_np(&sc->mtx)); - val0 = sc->status & (PS2M_STS_LEFT_BUTTON | - PS2M_STS_RIGHT_BUTTON | PS2M_STS_MID_BUTTON); + val0 = PS2M_DATA_AONE; + val0 |= sc->status & (PS2M_DATA_LEFT_BUTTON | + PS2M_DATA_RIGHT_BUTTON | PS2M_DATA_MID_BUTTON); if (sc->delta_x >= 0) { if (sc->delta_x > 255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; } else { - val0 |= (1 << 4); + val0 |= PS2M_DATA_X_SIGN; if (sc->delta_x < -255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; @@ -190,14 +201,14 @@ movement_get(struct ps2mouse_softc *sc) if (sc->delta_y >= 0) { if (sc->delta_y > 255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; } else { - val0 |= (1 << 5); + val0 |= PS2M_DATA_Y_SIGN; if (sc->delta_y < -255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; From owner-svn-src-all@freebsd.org Thu Jul 13 07:55:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFF80D9A9DE; Thu, 13 Jul 2017 07:55:02 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8E4F6A89D; Thu, 13 Jul 2017 07:55:02 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D7t1HP047108; Thu, 13 Jul 2017 07:55:01 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D7t0MS047095; Thu, 13 Jul 2017 07:55:00 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707130755.v6D7t0MS047095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 13 Jul 2017 07:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320934 - in releng/11.1: lib/libvmmapi usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in releng/11.1: lib/libvmmapi usr.sbin/bhyve X-SVN-Commit-Revision: 320934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 07:55:03 -0000 Author: grehan Date: Thu Jul 13 07:55:00 2017 New Revision: 320934 URL: https://svnweb.freebsd.org/changeset/base/320934 Log: MFS 320866 MFC 313727, 317483 In addition, replace the missing caph routines with small helper functions (bhyverun.c) or an open-coded replacement (uart_emul.c) 313727 Capsicumize bhyve 317483 Allow CAP_MMAP_RW on memfd for PCI passthru Approved by: re (kib) Modified: releng/11.1/lib/libvmmapi/vmmapi.c releng/11.1/lib/libvmmapi/vmmapi.h releng/11.1/usr.sbin/bhyve/bhyverun.c releng/11.1/usr.sbin/bhyve/block_if.c releng/11.1/usr.sbin/bhyve/consport.c releng/11.1/usr.sbin/bhyve/dbgport.c releng/11.1/usr.sbin/bhyve/mevent.c releng/11.1/usr.sbin/bhyve/pci_e82545.c releng/11.1/usr.sbin/bhyve/pci_passthru.c releng/11.1/usr.sbin/bhyve/pci_virtio_net.c releng/11.1/usr.sbin/bhyve/pci_virtio_rnd.c releng/11.1/usr.sbin/bhyve/rfb.c releng/11.1/usr.sbin/bhyve/uart_emul.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/lib/libvmmapi/vmmapi.c ============================================================================== --- releng/11.1/lib/libvmmapi/vmmapi.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/lib/libvmmapi/vmmapi.c Thu Jul 13 07:55:00 2017 (r320934) @@ -1416,3 +1416,45 @@ vm_restart_instruction(void *arg, int vcpu) return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); } + +int +vm_get_device_fd(struct vmctx *ctx) +{ + + return (ctx->fd); +} + +const cap_ioctl_t * +vm_get_ioctls(size_t *len) +{ + cap_ioctl_t *cmds; + /* keep in sync with machine/vmm_dev.h */ + static const cap_ioctl_t vm_ioctl_cmds[] = { VM_RUN, VM_SUSPEND, VM_REINIT, + VM_ALLOC_MEMSEG, VM_GET_MEMSEG, VM_MMAP_MEMSEG, VM_MMAP_MEMSEG, + VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, + VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, + VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, + VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, + VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, + VM_ISA_DEASSERT_IRQ, VM_ISA_PULSE_IRQ, VM_ISA_SET_IRQ_TRIGGER, + VM_SET_CAPABILITY, VM_GET_CAPABILITY, VM_BIND_PPTDEV, + VM_UNBIND_PPTDEV, VM_MAP_PPTDEV_MMIO, VM_PPTDEV_MSI, + VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, + VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, + VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, + VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, + VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, + VM_RESTART_INSTRUCTION }; + + if (len == NULL) { + cmds = malloc(sizeof(vm_ioctl_cmds)); + if (cmds == NULL) + return (NULL); + bcopy(vm_ioctl_cmds, cmds, sizeof(vm_ioctl_cmds)); + return (cmds); + } + + *len = nitems(vm_ioctl_cmds); + return (NULL); +} + Modified: releng/11.1/lib/libvmmapi/vmmapi.h ============================================================================== --- releng/11.1/lib/libvmmapi/vmmapi.h Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/lib/libvmmapi/vmmapi.h Thu Jul 13 07:55:00 2017 (r320934) @@ -36,7 +36,7 @@ * API version for out-of-tree consumers like grub-bhyve for making compile * time decisions. */ -#define VMMAPI_VERSION 0102 /* 2 digit major followed by 2 digit minor */ +#define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ struct iovec; struct vmctx; @@ -102,6 +102,7 @@ int vm_mmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, vm_ooffset_t segoff, size_t len, int prot); int vm_create(const char *name); +int vm_get_device_fd(struct vmctx *ctx); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); int vm_parse_memsize(const char *optarg, size_t *memsize); @@ -161,6 +162,8 @@ int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); + +const cap_ioctl_t *vm_get_ioctls(size_t *len); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: releng/11.1/usr.sbin/bhyve/bhyverun.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/bhyverun.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/bhyverun.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include @@ -40,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -48,8 +52,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#include +#endif #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include "bhyverun.h" @@ -152,7 +163,44 @@ usage(int code) exit(code); } +#ifndef WITHOUT_CAPSICUM +/* + * 11-stable capsicum helpers + */ +static void +bhyve_caph_cache_catpages(void) +{ + + (void)catopen("libc", NL_CAT_LOCALE); +} + static int +bhyve_caph_limit_stdoe(void) +{ + cap_rights_t rights; + unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ }; + int i, fds[] = { STDOUT_FILENO, STDERR_FILENO }; + + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL); + cap_rights_set(&rights, CAP_WRITE); + + for (i = 0; i < nitems(fds); i++) { + if (cap_rights_limit(fds[i], &rights) < 0 && errno != ENOSYS) + return (-1); + + if (cap_ioctls_limit(fds[i], cmds, nitems(cmds)) < 0 && errno != ENOSYS) + return (-1); + + if (cap_fcntls_limit(fds[i], CAP_FCNTL_GETFL) < 0 && errno != ENOSYS) + return (-1); + } + + return (0); +} + +#endif + +static int pincpu_parse(const char *opt) { int vcpu, pcpu; @@ -706,6 +754,11 @@ do_open(const char *vmname) struct vmctx *ctx; int error; bool reinit, romboot; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + const cap_ioctl_t *cmds; + size_t ncmds; +#endif reinit = romboot = false; @@ -744,6 +797,21 @@ do_open(const char *vmname) exit(1); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); + if (cap_rights_limit(vm_get_device_fd(ctx), &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + vm_get_ioctls(&ncmds); + cmds = vm_get_ioctls(NULL); + if (cmds == NULL) + errx(EX_OSERR, "out of memory"); + if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + free((cap_ioctl_t *)cmds); +#endif + if (reinit) { error = vm_reinit(ctx); if (error) { @@ -951,6 +1019,16 @@ main(int argc, char *argv[]) if (lpc_bootrom()) fwctl_init(); + +#ifndef WITHOUT_CAPSICUM + + + if (bhyve_caph_limit_stdoe() == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + + if (cap_enter() == -1 && errno != ENOSYS) + errx(EX_OSERR, "cap_enter() failed"); +#endif /* * Change the proc title to include the VM name. Modified: releng/11.1/usr.sbin/bhyve/block_if.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/block_if.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/block_if.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -45,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -400,6 +404,10 @@ blockif_open(const char *optstr, const char *ident) off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; +#endif pthread_once(&blockif_once, blockif_init); @@ -457,6 +465,16 @@ blockif_open(const char *optstr, const char *ident) goto err; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_FSYNC, CAP_IOCTL, CAP_READ, CAP_SEEK, + CAP_WRITE); + if (ro) + cap_rights_clear(&rights, CAP_FSYNC, CAP_WRITE); + + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Deal with raw devices */ @@ -482,6 +500,11 @@ blockif_open(const char *optstr, const char *ident) geom = 1; } else psectsz = sbuf.st_blksize; + +#ifndef WITHOUT_CAPSICUM + if (cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif if (ssopt != 0) { if (!powerof2(ssopt) || !powerof2(pssopt) || ssopt < 512 || Modified: releng/11.1/usr.sbin/bhyve/consport.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/consport.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/consport.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,13 +30,19 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include +#include +#include #include #include #include #include #include +#include #include "inout.h" #include "pci_lpc.h" @@ -104,6 +110,10 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i uint32_t *eax, void *arg) { static int opened; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif if (bytes == 2 && in) { *eax = BVM_CONS_SIG; @@ -123,6 +133,13 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i return (-1); if (!opened) { +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif ttyopen(); opened = 1; } Modified: releng/11.1/usr.sbin/bhyve/dbgport.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/dbgport.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/dbgport.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,13 +30,18 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include +#include #include #include +#include #include #include #include @@ -125,6 +130,9 @@ void init_dbgport(int sport) { int reuse; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif conn_fd = -1; @@ -154,6 +162,12 @@ init_dbgport(int sport) perror("listen"); exit(1); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(listen_fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif register_inout(&dbgport); } Modified: releng/11.1/usr.sbin/bhyve/mevent.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/mevent.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/mevent.c Thu Jul 13 07:55:00 2017 (r320934) @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include +#include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include @@ -401,6 +406,9 @@ mevent_dispatch(void) int mfd; int numev; int ret; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif mevent_tid = pthread_self(); mevent_set_name(); @@ -408,6 +416,12 @@ mevent_dispatch(void) mfd = kqueue(); assert(mfd > 0); +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_KQUEUE); + if (cap_rights_limit(mfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Open the pipe that will be used for other threads to force * the blocking kqueue call to exit by writing to it. Set the @@ -418,6 +432,14 @@ mevent_dispatch(void) perror("pipe"); exit(0); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(mevent_pipefd[0], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_rights_limit(mevent_pipefd[1], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif /* * Add internal event handler for the pipe write fd Modified: releng/11.1/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_e82545.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/pci_e82545.c Thu Jul 13 07:55:00 2017 (r320934) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -38,12 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -2202,6 +2207,9 @@ static void e82545_open_tap(struct e82545_softc *sc, char *opts) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif if (opts == NULL) { sc->esc_tapfd = -1; @@ -2228,6 +2236,12 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) sc->esc_tapfd = -1; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->esc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + sc->esc_mevp = mevent_add(sc->esc_tapfd, EVF_READ, e82545_tap_callback, Modified: releng/11.1/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_passthru.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/pci_passthru.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -44,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -639,10 +644,19 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p { int bus, slot, func, error, memflags; struct passthru_softc *sc; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t pci_ioctls[] = { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR }; + cap_ioctl_t io_ioctls[] = { IODEV_PIO }; +#endif sc = NULL; error = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_WRITE); +#endif + memflags = vm_get_memflags(ctx); if (!(memflags & VM_MEM_F_WIRED)) { warnx("passthru requires guest memory to be wired"); @@ -657,6 +671,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(pcifd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(pcifd, pci_ioctls, nitems(pci_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (iofd < 0) { iofd = open(_PATH_DEVIO, O_RDWR, 0); if (iofd < 0) { @@ -665,6 +686,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(iofd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(iofd, io_ioctls, nitems(io_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (memfd < 0) { memfd = open(_PATH_MEM, O_RDWR, 0); if (memfd < 0) { @@ -672,6 +700,13 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p goto done; } } + +#ifndef WITHOUT_CAPSICUM + cap_rights_clear(&rights, CAP_IOCTL); + cap_rights_set(&rights, CAP_MMAP_RW); + if (cap_rights_limit(memfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif if (opts == NULL || sscanf(opts, "%d/%d/%d", &bus, &slot, &func) != 3) { Modified: releng/11.1/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_virtio_net.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/pci_virtio_net.c Thu Jul 13 07:55:00 2017 (r320934) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -41,6 +44,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include #include @@ -53,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -743,6 +748,9 @@ static void pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif strcpy(tbuf, "/dev/"); strlcat(tbuf, devname, sizeof(tbuf)); @@ -766,6 +774,12 @@ pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char * close(sc->vsc_tapfd); sc->vsc_tapfd = -1; } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->vsc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif sc->vsc_mevp = mevent_add(sc->vsc_tapfd, EVF_READ, Modified: releng/11.1/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_virtio_rnd.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/pci_virtio_rnd.c Thu Jul 13 07:55:00 2017 (r320934) @@ -35,9 +35,13 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include +#include #include #include #include @@ -46,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -138,6 +143,9 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * int fd; int len; uint8_t v; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif /* * Should always be able to open /dev/random. @@ -145,6 +153,12 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * fd = open("/dev/random", O_RDONLY | O_NONBLOCK); assert(fd >= 0); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_READ); + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif /* * Check that device is seeded and non-blocking. Modified: releng/11.1/usr.sbin/bhyve/rfb.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/rfb.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/rfb.c Thu Jul 13 07:55:00 2017 (r320934) @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -38,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -45,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -868,6 +874,9 @@ rfb_init(char *hostname, int port, int wait) struct rfb_softc *rc; struct sockaddr_in sin; int on = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif rc = calloc(1, sizeof(struct rfb_softc)); @@ -903,6 +912,12 @@ rfb_init(char *hostname, int port, int wait) perror("listen"); return (-1); } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(rc->sfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif rc->hw_crc = sse42_supported(); Modified: releng/11.1/usr.sbin/bhyve/uart_emul.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/uart_emul.c Thu Jul 13 07:32:55 2017 (r320933) +++ releng/11.1/usr.sbin/bhyve/uart_emul.c Thu Jul 13 07:55:00 2017 (r320934) @@ -32,16 +32,22 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include +#include +#include #include #include #include #include #include #include +#include #include "mevent.h" #include "uart_emul.h" @@ -638,7 +644,7 @@ uart_tty_backend(struct uart_softc *sc, const char *op sc->tty.opened = true; retval = 0; } - + return (retval); } @@ -646,6 +652,11 @@ int uart_set_backend(struct uart_softc *sc, const char *opts) { int retval; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; + cap_ioctl_t sicmds[] = { TIOCGETA, TIOCGWINSZ }; +#endif retval = -1; @@ -666,6 +677,23 @@ uart_set_backend(struct uart_softc *sc, const char *op /* Make the backend file descriptor non-blocking */ if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (!uart_stdio) { + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_READ); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, sicmds, nitems(sicmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_fcntls_limit(STDIN_FILENO, CAP_FCNTL_GETFL) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + } +#endif if (retval == 0) uart_opentty(sc); From owner-svn-src-all@freebsd.org Thu Jul 13 08:13:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7835ED9B218; Thu, 13 Jul 2017 08:13:30 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44A4E6E196; Thu, 13 Jul 2017 08:13:30 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D8DTt1055259; Thu, 13 Jul 2017 08:13:29 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8DT14055256; Thu, 13 Jul 2017 08:13:29 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201707130813.v6D8DT14055256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 13 Jul 2017 08:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320935 - releng/11.1/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: releng/11.1/usr.sbin/bhyve X-SVN-Commit-Revision: 320935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:13:30 -0000 Author: grehan Date: Thu Jul 13 08:13:29 2017 New Revision: 320935 URL: https://svnweb.freebsd.org/changeset/base/320935 Log: MFS 320891 MFC r317542, r317543, r317543 317542 comment fix 317543 set rfb default port 317543 listen on localhost by default for rfb Approved by: re (kib) Modified: releng/11.1/usr.sbin/bhyve/pci_fbuf.c releng/11.1/usr.sbin/bhyve/pci_xhci.c releng/11.1/usr.sbin/bhyve/rfb.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_fbuf.c Thu Jul 13 07:55:00 2017 (r320934) +++ releng/11.1/usr.sbin/bhyve/pci_fbuf.c Thu Jul 13 08:13:29 2017 (r320935) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * BAR0 points to the current mode information. * BAR1 is the 32-bit framebuffer address. * - * -s ,fbuf,wait,tcp=:port,w=width,h=height + * -s ,fbuf,wait,vga=on|io|off,rfb=:port,w=width,h=height */ static int fbuf_debug = 1; Modified: releng/11.1/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/pci_xhci.c Thu Jul 13 07:55:00 2017 (r320934) +++ releng/11.1/usr.sbin/bhyve/pci_xhci.c Thu Jul 13 08:13:29 2017 (r320935) @@ -28,7 +28,7 @@ -s ,xhci,{devices} devices: - ums USB tablet mouse + tablet USB tablet mouse */ #include __FBSDID("$FreeBSD$"); Modified: releng/11.1/usr.sbin/bhyve/rfb.c ============================================================================== --- releng/11.1/usr.sbin/bhyve/rfb.c Thu Jul 13 07:55:00 2017 (r320934) +++ releng/11.1/usr.sbin/bhyve/rfb.c Thu Jul 13 08:13:29 2017 (r320935) @@ -897,11 +897,11 @@ rfb_init(char *hostname, int port, int wait) sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; - sin.sin_port = htons(port); + sin.sin_port = port ? htons(port) : htons(5900); if (hostname && strlen(hostname) > 0) inet_pton(AF_INET, hostname, &(sin.sin_addr)); else - sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("bind"); From owner-svn-src-all@freebsd.org Thu Jul 13 08:19:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E530ED9B43C; Thu, 13 Jul 2017 08:19:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id B05BF6E3F7; Thu, 13 Jul 2017 08:19:51 +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 v6D8JoVP055516; Thu, 13 Jul 2017 08:19:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8JoJJ055515; Thu, 13 Jul 2017 08:19:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130819.v6D8JoJJ055515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320936 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 320936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:19:52 -0000 Author: kib Date: Thu Jul 13 08:19:50 2017 New Revision: 320936 URL: https://svnweb.freebsd.org/changeset/base/320936 Log: It is believed to be only cosmetic. Noted by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Thu Jul 13 08:13:29 2017 (r320935) +++ head/sys/amd64/amd64/efirt.c Thu Jul 13 08:19:50 2017 (r320936) @@ -194,8 +194,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int uint64_t idx; int bits, i, mode; - obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, 1 + NPML4EPG + - NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG, + obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, ptoa(1 + + NPML4EPG + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG), VM_PROT_ALL, 0, NULL); VM_OBJECT_WLOCK(obj_1t1_pt); efi_pml4_page = efi_1t1_page(0); From owner-svn-src-all@freebsd.org Thu Jul 13 08:23:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 534F6D9B6F6; Thu, 13 Jul 2017 08:23:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 228856E8A9; Thu, 13 Jul 2017 08:23:13 +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 v6D8NCBF059461; Thu, 13 Jul 2017 08:23:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8NCYI059460; Thu, 13 Jul 2017 08:23:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130823.v6D8NCYI059460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320937 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 320937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:23:13 -0000 Author: kib Date: Thu Jul 13 08:23:12 2017 New Revision: 320937 URL: https://svnweb.freebsd.org/changeset/base/320937 Log: Revert r320936 to recommit with the correct log message. Modified: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Thu Jul 13 08:19:50 2017 (r320936) +++ head/sys/amd64/amd64/efirt.c Thu Jul 13 08:23:12 2017 (r320937) @@ -194,8 +194,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int uint64_t idx; int bits, i, mode; - obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, ptoa(1 + - NPML4EPG + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG), + obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, 1 + NPML4EPG + + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG, VM_PROT_ALL, 0, NULL); VM_OBJECT_WLOCK(obj_1t1_pt); efi_pml4_page = efi_1t1_page(0); From owner-svn-src-all@freebsd.org Thu Jul 13 08:23:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA2CD9B779; Thu, 13 Jul 2017 08:23:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id E15A06E9EE; Thu, 13 Jul 2017 08:23:38 +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 v6D8NcgF059517; Thu, 13 Jul 2017 08:23:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8NcpB059516; Thu, 13 Jul 2017 08:23:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130823.v6D8NcpB059516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320938 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 320938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:23:39 -0000 Author: kib Date: Thu Jul 13 08:23:37 2017 New Revision: 320938 URL: https://svnweb.freebsd.org/changeset/base/320938 Log: Fix size argument to vm_pager_allocate(), it is in bytes, not in pages. It is believed to be only cosmetic. Noted by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Thu Jul 13 08:23:12 2017 (r320937) +++ head/sys/amd64/amd64/efirt.c Thu Jul 13 08:23:37 2017 (r320938) @@ -194,8 +194,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int uint64_t idx; int bits, i, mode; - obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, 1 + NPML4EPG + - NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG, + obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, ptoa(1 + + NPML4EPG + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG), VM_PROT_ALL, 0, NULL); VM_OBJECT_WLOCK(obj_1t1_pt); efi_pml4_page = efi_1t1_page(0); From owner-svn-src-all@freebsd.org Thu Jul 13 08:29:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5607D9B922; Thu, 13 Jul 2017 08:29:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 735606EBFE; Thu, 13 Jul 2017 08:29:02 +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 v6D8T1nm059786; Thu, 13 Jul 2017 08:29:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8T1Hh059784; Thu, 13 Jul 2017 08:29:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130829.v6D8T1Hh059784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:29: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: r320939 - in stable/11: share/man/man9 sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: share/man/man9 sys/sys X-SVN-Commit-Revision: 320939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:29:02 -0000 Author: kib Date: Thu Jul 13 08:29:01 2017 New Revision: 320939 URL: https://svnweb.freebsd.org/changeset/base/320939 Log: MFC r320755,r320762,r320893: BIT_FLS(9). Modified: stable/11/share/man/man9/bitset.9 stable/11/sys/sys/bitset.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/bitset.9 ============================================================================== --- stable/11/share/man/man9/bitset.9 Thu Jul 13 08:23:37 2017 (r320938) +++ stable/11/share/man/man9/bitset.9 Thu Jul 13 08:29:01 2017 (r320939) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd July 7, 2017 .Dt BITSET 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm BIT_EMPTY , .Nm BIT_ISFULLSET , .Nm BIT_FFS , +.Nm BIT_FLS , .Nm BIT_COUNT , .Nm BIT_SUBSET , .Nm BIT_OVERLAP , @@ -85,6 +86,8 @@ .Ft int .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset" .Ft int +.Fn BIT_FLS "const SETSIZE" "struct STRUCTNAME *bitset" +.Ft int .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset" .\" .Ft bool @@ -282,6 +285,23 @@ index parameter to any other macro, you must subtract one from the result. .Pp The +.Fn BIT_FLS +macro returns the 1-index of the last (highest) set bit in +.Fa bitset , +or zero if +.Fa bitset +is empty. +Like with +.Xr fls 3 , +to use the non-zero result of +.Fn BIT_FLS +as a +.Fa bit +index parameter to any other +.Nm +macro, you must subtract one from the result. +.Pp +The .Fn BIT_COUNT macro returns the total number of set bits in .Fa bitset . @@ -499,4 +519,6 @@ argument to all of these macros must match the value g .Pp Unlike every other reference to individual set members, which are zero-indexed, .Fn BIT_FFS -returns a one-indexed result (or zero if the set is empty). +and +.Fn BIT_FLS +return a one-indexed result (or zero if the set is empty). Modified: stable/11/sys/sys/bitset.h ============================================================================== --- stable/11/sys/sys/bitset.h Thu Jul 13 08:23:37 2017 (r320938) +++ stable/11/sys/sys/bitset.h Thu Jul 13 08:29:01 2017 (r320939) @@ -213,6 +213,21 @@ __bit; \ }) +#define BIT_FLS(_s, p) __extension__ ({ \ + __size_t __i; \ + int __bit; \ + \ + __bit = 0; \ + for (__i = __bitset_words((_s)); __i > 0; __i--) { \ + if ((p)->__bits[__i - 1] != 0) { \ + __bit = flsl((p)->__bits[__i - 1]); \ + __bit += (__i - 1) * _BITSET_BITS; \ + break; \ + } \ + } \ + __bit; \ +}) + #define BIT_COUNT(_s, p) __extension__ ({ \ __size_t __i; \ int __count; \ From owner-svn-src-all@freebsd.org Thu Jul 13 08:33:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15A82D9BB24; Thu, 13 Jul 2017 08:33:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D720C6EF96; Thu, 13 Jul 2017 08:33:03 +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 v6D8X2jn063555; Thu, 13 Jul 2017 08:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8X2F2063554; Thu, 13 Jul 2017 08:33:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130833.v6D8X2F2063554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:33:02 +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: r320940 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 320940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:33:04 -0000 Author: kib Date: Thu Jul 13 08:33:02 2017 New Revision: 320940 URL: https://svnweb.freebsd.org/changeset/base/320940 Log: MFC r320755,r320762,r320893: BIT_FLS(9). Modified: stable/10/sys/sys/bitset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/bitset.h ============================================================================== --- stable/10/sys/sys/bitset.h Thu Jul 13 08:29:01 2017 (r320939) +++ stable/10/sys/sys/bitset.h Thu Jul 13 08:33:02 2017 (r320940) @@ -206,6 +206,21 @@ __bit; \ }) +#define BIT_FLS(_s, p) __extension__ ({ \ + __size_t __i; \ + int __bit; \ + \ + __bit = 0; \ + for (__i = __bitset_words((_s)); __i > 0; __i--) { \ + if ((p)->__bits[__i - 1] != 0) { \ + __bit = flsl((p)->__bits[__i - 1]); \ + __bit += (__i - 1) * _BITSET_BITS; \ + break; \ + } \ + } \ + __bit; \ +}) + #define BIT_COUNT(_s, p) __extension__ ({ \ __size_t __i; \ int __count; \ From owner-svn-src-all@freebsd.org Thu Jul 13 09:01:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 452DAD9C5CF; Thu, 13 Jul 2017 09:01:23 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12BEF6FD60; Thu, 13 Jul 2017 09:01:23 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D91MQ6072462; Thu, 13 Jul 2017 09:01:22 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D91MVI072461; Thu, 13 Jul 2017 09:01:22 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201707130901.v6D91MVI072461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 13 Jul 2017 09:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320941 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 320941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 09:01:23 -0000 Author: philip Date: Thu Jul 13 09:01:22 2017 New Revision: 320941 URL: https://svnweb.freebsd.org/changeset/base/320941 Log: Fix GRE over IPv6 tunnels with IPFW Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless net.inet6.ip6.fw.deny_unknown_exthdrs was unset). PR: 220640 Submitted by: Kun Xie MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Thu Jul 13 08:33:02 2017 (r320940) +++ head/sys/netpfil/ipfw/ip_fw2.c Thu Jul 13 09:01:22 2017 (r320941) @@ -92,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* for struct grehdr */ + #include #include /* XXX for in_cksum */ @@ -1160,6 +1162,11 @@ do { \ case IPPROTO_PIM: /* XXX PIM header check? */ PULLUP_TO(hlen, ulp, struct pim); + break; + + case IPPROTO_GRE: /* RFC 1701 */ + /* XXX GRE header check? */ + PULLUP_TO(hlen, ulp, struct grehdr); break; case IPPROTO_CARP: From owner-svn-src-all@freebsd.org Thu Jul 13 09:27:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54DC9D9CF93; Thu, 13 Jul 2017 09:27:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC8870B87; Thu, 13 Jul 2017 09:27:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D9RFr1084703; Thu, 13 Jul 2017 09:27:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D9RB96084663; Thu, 13 Jul 2017 09:27:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130927.v6D9RB96084663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 09:27:11 +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: r320942 - in stable/11/lib/libc: include stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/lib/libc: include stdio X-SVN-Commit-Revision: 320942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 09:27:16 -0000 Author: kib Date: Thu Jul 13 09:27:11 2017 New Revision: 320942 URL: https://svnweb.freebsd.org/changeset/base/320942 Log: MFC r320472,r320508,r320509: Make stdio deferred cancel-safe. Modified: stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/stdio/fclose.c stable/11/lib/libc/stdio/fflush.c stable/11/lib/libc/stdio/fgetc.c stable/11/lib/libc/stdio/fgetln.c stable/11/lib/libc/stdio/fgets.c stable/11/lib/libc/stdio/fgetwc.c stable/11/lib/libc/stdio/fgetwln.c stable/11/lib/libc/stdio/fgetws.c stable/11/lib/libc/stdio/fputc.c stable/11/lib/libc/stdio/fputs.c stable/11/lib/libc/stdio/fputwc.c stable/11/lib/libc/stdio/fputws.c stable/11/lib/libc/stdio/fread.c stable/11/lib/libc/stdio/freopen.c stable/11/lib/libc/stdio/fscanf.c stable/11/lib/libc/stdio/fseek.c stable/11/lib/libc/stdio/fwrite.c stable/11/lib/libc/stdio/getc.c stable/11/lib/libc/stdio/getchar.c stable/11/lib/libc/stdio/getdelim.c stable/11/lib/libc/stdio/gets.c stable/11/lib/libc/stdio/local.h stable/11/lib/libc/stdio/perror.c stable/11/lib/libc/stdio/putc.c stable/11/lib/libc/stdio/putchar.c stable/11/lib/libc/stdio/puts.c stable/11/lib/libc/stdio/putw.c stable/11/lib/libc/stdio/refill.c stable/11/lib/libc/stdio/scanf.c stable/11/lib/libc/stdio/setvbuf.c stable/11/lib/libc/stdio/stdio.c stable/11/lib/libc/stdio/ungetc.c stable/11/lib/libc/stdio/ungetwc.c stable/11/lib/libc/stdio/vfprintf.c stable/11/lib/libc/stdio/vfscanf.c stable/11/lib/libc/stdio/vfwprintf.c stable/11/lib/libc/stdio/vfwscanf.c stable/11/lib/libc/stdio/vscanf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/include/libc_private.h Thu Jul 13 09:27:11 2017 (r320942) @@ -407,6 +407,11 @@ void __libc_map_stacks_exec(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); +struct _pthread_cleanup_info; +void ___pthread_cleanup_push_imp(void (*)(void *), void *, + struct _pthread_cleanup_info *); +void ___pthread_cleanup_pop_imp(int); + void __throw_constraint_handler_s(const char * restrict msg, int error); #endif /* _LIBC_PRIVATE_H_ */ Modified: stable/11/lib/libc/stdio/fclose.c ============================================================================== --- stable/11/lib/libc/stdio/fclose.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fclose.c Thu Jul 13 09:27:11 2017 (r320942) @@ -97,7 +97,7 @@ fdclose(FILE *fp, int *fdp) return (EOF); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); r = 0; if (fp->_close != __sclose) { r = EOF; @@ -115,7 +115,7 @@ fdclose(FILE *fp, int *fdp) *fdp = fp->_file; r = cleanfile(fp, false); } - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } @@ -130,9 +130,9 @@ fclose(FILE *fp) return (EOF); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); r = cleanfile(fp, true); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/11/lib/libc/stdio/fflush.c ============================================================================== --- stable/11/lib/libc/stdio/fflush.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fflush.c Thu Jul 13 09:27:11 2017 (r320942) @@ -56,7 +56,7 @@ fflush(FILE *fp) if (fp == NULL) return (_fwalk(sflush_locked)); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* * There is disagreement about the correct behaviour of fflush() @@ -76,7 +76,7 @@ fflush(FILE *fp) retval = 0; else retval = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } @@ -143,8 +143,8 @@ sflush_locked(FILE *fp) { int ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/fgetc.c ============================================================================== --- stable/11/lib/libc/stdio/fgetc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgetc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -46,10 +46,10 @@ int fgetc(FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(fp, -1); */ retval = __sgetc(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/fgetln.c ============================================================================== --- stable/11/lib/libc/stdio/fgetln.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgetln.c Thu Jul 13 09:27:11 2017 (r320942) @@ -85,22 +85,21 @@ char * fgetln(FILE *fp, size_t *lenp) { unsigned char *p; + char *ret; size_t len; size_t off; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* make sure there is input */ if (fp->_r <= 0 && __srefill(fp)) { *lenp = 0; - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } /* look for a newline in the input */ if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) != NULL) { - char *ret; - /* * Found one. Flag buffer as modified to keep fseek from * `optimising' a backward seek, in case the user stomps on @@ -112,8 +111,7 @@ fgetln(FILE *fp, size_t *lenp) fp->_flags |= __SMOD; fp->_r -= len; fp->_p = p; - FUNLOCKFILE(fp); - return (ret); + goto end; } /* @@ -163,12 +161,14 @@ fgetln(FILE *fp, size_t *lenp) #ifdef notdef fp->_lb._base[len] = '\0'; #endif - FUNLOCKFILE(fp); - return ((char *)fp->_lb._base); + ret = (char *)fp->_lb._base; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: *lenp = 0; /* ??? */ fp->_flags |= __SERR; - FUNLOCKFILE(fp); - return (NULL); /* ??? */ + ret = NULL; + goto end; } Modified: stable/11/lib/libc/stdio/fgets.c ============================================================================== --- stable/11/lib/libc/stdio/fgets.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgets.c Thu Jul 13 09:27:11 2017 (r320942) @@ -53,17 +53,17 @@ char * fgets(char * __restrict buf, int n, FILE * __restrict fp) { size_t len; - char *s; + char *s, *ret; unsigned char *p, *t; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); if (n <= 0) { /* sanity check */ fp->_flags |= __SERR; errno = EINVAL; - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } s = buf; @@ -76,8 +76,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict if (__srefill(fp)) { /* EOF/error: stop with partial or no line */ if (!__sfeof(fp) || s == buf) { - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } break; } @@ -100,8 +100,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict fp->_p = t; (void)memcpy((void *)s, (void *)p, len); s[len] = 0; - FUNLOCKFILE(fp); - return (buf); + ret = buf; + goto end; } fp->_r -= len; fp->_p += len; @@ -110,6 +110,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict n -= len; } *s = 0; - FUNLOCKFILE(fp); - return (buf); + ret = buf; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } Modified: stable/11/lib/libc/stdio/fgetwc.c ============================================================================== --- stable/11/lib/libc/stdio/fgetwc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgetwc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -52,10 +52,10 @@ fgetwc_l(FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __fgetwc(fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/11/lib/libc/stdio/fgetwln.c ============================================================================== --- stable/11/lib/libc/stdio/fgetwln.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgetwln.c Thu Jul 13 09:27:11 2017 (r320942) @@ -45,13 +45,14 @@ wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale wchar_t * fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t locale) { + wchar_t *ret; wint_t wc; size_t len; int savserr; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); savserr = fp->_flags & __SERR; @@ -77,14 +78,16 @@ fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t if (len == 0) goto error; - FUNLOCKFILE(fp); *lenp = len; - return ((wchar_t *)fp->_lb._base); + ret = (wchar_t *)fp->_lb._base; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: - FUNLOCKFILE(fp); *lenp = 0; - return (NULL); + ret = NULL; + goto end; } wchar_t * Modified: stable/11/lib/libc/stdio/fgetws.c ============================================================================== --- stable/11/lib/libc/stdio/fgetws.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fgetws.c Thu Jul 13 09:27:11 2017 (r320942) @@ -46,14 +46,14 @@ wchar_t * fgetws_l(wchar_t * __restrict ws, int n, FILE * __restrict fp, locale_t locale) { int sret; - wchar_t *wsp; + wchar_t *wsp, *ret; size_t nconv; const char *src; unsigned char *nl; FIX_LOCALE(locale); struct xlocale_ctype *l = XLOCALE_CTYPE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); if (n <= 0) { @@ -113,12 +113,14 @@ fgetws_l(wchar_t * __restrict ws, int n, FILE * __rest goto error; ok: *wsp = L'\0'; - FUNLOCKFILE(fp); - return (ws); + ret = ws; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } wchar_t * Modified: stable/11/lib/libc/stdio/fputc.c ============================================================================== --- stable/11/lib/libc/stdio/fputc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fputc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -46,10 +46,10 @@ int fputc(int c, FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(fp, -1); */ retval = __sputc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/fputs.c ============================================================================== --- stable/11/lib/libc/stdio/fputs.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fputs.c Thu Jul 13 09:27:11 2017 (r320942) @@ -59,10 +59,10 @@ fputs(const char * __restrict s, FILE * __restrict fp) uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); if (retval == 0) return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len); return (retval); Modified: stable/11/lib/libc/stdio/fputwc.c ============================================================================== --- stable/11/lib/libc/stdio/fputwc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fputwc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -74,10 +74,10 @@ fputwc_l(wchar_t wc, FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __fputwc(wc, fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/11/lib/libc/stdio/fputws.c ============================================================================== --- stable/11/lib/libc/stdio/fputws.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fputws.c Thu Jul 13 09:27:11 2017 (r320942) @@ -53,11 +53,13 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restr const wchar_t *wsp; FIX_LOCALE(locale); struct xlocale_ctype *l = XLOCALE_CTYPE(locale); + int ret; - FLOCKFILE(fp); + ret = -1; + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); if (prepwrite(fp) != 0) - goto error; + goto end; uio.uio_iov = &iov; uio.uio_iovcnt = 1; iov.iov_base = buf; @@ -66,17 +68,15 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restr nbytes = l->__wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1) - goto error; + goto end; uio.uio_resid = iov.iov_len = nbytes; if (__sfvwrite(fp, &uio) != 0) - goto error; + goto end; } while (wsp != NULL); - FUNLOCKFILE(fp); - return (0); - -error: - FUNLOCKFILE(fp); - return (-1); + ret = 0; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } int Modified: stable/11/lib/libc/stdio/fread.c ============================================================================== --- stable/11/lib/libc/stdio/fread.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fread.c Thu Jul 13 09:27:11 2017 (r320942) @@ -54,9 +54,9 @@ fread(void * __restrict buf, size_t size, size_t count { size_t ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __fread(buf, size, count, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/freopen.c ============================================================================== --- stable/11/lib/libc/stdio/freopen.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/freopen.c Thu Jul 13 09:27:11 2017 (r320942) @@ -68,7 +68,7 @@ freopen(const char * __restrict file, const char * __r return (NULL); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); if (!__sdidinit) __sinit(); @@ -81,24 +81,24 @@ freopen(const char * __restrict file, const char * __r if (file == NULL) { /* See comment below regarding freopen() of closed files. */ if (fp->_flags == 0) { - FUNLOCKFILE(fp); errno = EINVAL; - return (NULL); + fp = NULL; + goto end; } if ((dflags = _fcntl(fp->_file, F_GETFL)) < 0) { sverrno = errno; fclose(fp); - FUNLOCKFILE(fp); errno = sverrno; - return (NULL); + fp = NULL; + goto end; } /* Work around incorrect O_ACCMODE. */ if ((dflags & O_ACCMODE) != O_RDWR && (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); - FUNLOCKFILE(fp); errno = EBADF; - return (NULL); + fp = NULL; + goto end; } if (fp->_flags & __SWR) (void) __sflush(fp); @@ -108,9 +108,9 @@ freopen(const char * __restrict file, const char * __r if (_fcntl(fp->_file, F_SETFL, dflags) < 0) { sverrno = errno; fclose(fp); - FUNLOCKFILE(fp); errno = sverrno; - return (NULL); + fp = NULL; + goto end; } } if (oflags & O_TRUNC) @@ -193,9 +193,9 @@ finish: if (isopen) (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ - FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ - return (NULL); + fp = NULL; + goto end; } /* @@ -221,9 +221,9 @@ finish: */ if (f > SHRT_MAX) { fp->_flags = 0; /* set it free */ - FUNLOCKFILE(fp); errno = EMFILE; - return (NULL); + fp = NULL; + goto end; } fp->_flags = flags; @@ -245,6 +245,7 @@ finish: fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); } - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (fp); } Modified: stable/11/lib/libc/stdio/fscanf.c ============================================================================== --- stable/11/lib/libc/stdio/fscanf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fscanf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -56,10 +56,10 @@ fscanf(FILE * __restrict fp, char const * __restrict f va_list ap; va_start(ap, fmt); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, __get_locale(), fmt, ap); va_end(ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int @@ -70,9 +70,9 @@ fscanf_l(FILE * __restrict fp, locale_t locale, char c FIX_LOCALE(locale); va_start(ap, fmt); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, locale, fmt, ap); va_end(ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/fseek.c ============================================================================== --- stable/11/lib/libc/stdio/fseek.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fseek.c Thu Jul 13 09:27:11 2017 (r320942) @@ -60,9 +60,9 @@ fseek(FILE *fp, long offset, int whence) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = _fseeko(fp, (off_t)offset, whence, 1); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); if (ret == 0) errno = serrno; return (ret); @@ -78,9 +78,9 @@ fseeko(FILE *fp, off_t offset, int whence) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = _fseeko(fp, offset, whence, 0); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); if (ret == 0) errno = serrno; return (ret); Modified: stable/11/lib/libc/stdio/fwrite.c ============================================================================== --- stable/11/lib/libc/stdio/fwrite.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/fwrite.c Thu Jul 13 09:27:11 2017 (r320942) @@ -82,7 +82,7 @@ fwrite(const void * __restrict buf, size_t size, size_ uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* * The usual case is success (__sfvwrite returns 0); @@ -91,6 +91,6 @@ fwrite(const void * __restrict buf, size_t size, size_ */ if (__sfvwrite(fp, &uio) != 0) count = (n - uio.uio_resid) / size; - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (count); } Modified: stable/11/lib/libc/stdio/getc.c ============================================================================== --- stable/11/lib/libc/stdio/getc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/getc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -49,11 +49,11 @@ int getc(FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(fp, -1); */ retval = __sgetc(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/getchar.c ============================================================================== --- stable/11/lib/libc/stdio/getchar.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/getchar.c Thu Jul 13 09:27:11 2017 (r320942) @@ -52,11 +52,11 @@ int getchar(void) { int retval; - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(stdin, -1); */ retval = __sgetc(stdin); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/getdelim.c ============================================================================== --- stable/11/lib/libc/stdio/getdelim.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/getdelim.c Thu Jul 13 09:27:11 2017 (r320942) @@ -112,7 +112,7 @@ getdelim(char ** __restrict linep, size_t * __restrict u_char *endp; size_t linelen; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); if (linep == NULL || linecapp == NULL) { @@ -127,9 +127,9 @@ getdelim(char ** __restrict linep, size_t * __restrict /* If fp is at EOF already, we just need space for the NUL. */ if (!__sfeof(fp) || expandtofit(linep, 1, linecapp)) goto error; - FUNLOCKFILE(fp); (*linep)[0] = '\0'; - return (-1); + linelen = -1; + goto end; } linelen = 0; @@ -150,11 +150,12 @@ getdelim(char ** __restrict linep, size_t * __restrict done: /* Invariant: *linep has space for at least linelen+1 bytes. */ (*linep)[linelen] = '\0'; - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (linelen); error: fp->_flags |= __SERR; - FUNLOCKFILE(fp); - return (-1); + linelen = -1; + goto end; } Modified: stable/11/lib/libc/stdio/gets.c ============================================================================== --- stable/11/lib/libc/stdio/gets.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/gets.c Thu Jul 13 09:27:11 2017 (r320942) @@ -50,27 +50,30 @@ char * gets(char *buf) { int c; - char *s; + char *s, *ret; static int warned; static const char w[] = "warning: this program uses gets(), which is unsafe.\n"; - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ORIENT(stdin, -1); if (!warned) { (void) _write(STDERR_FILENO, w, sizeof(w) - 1); warned = 1; } - for (s = buf; (c = __sgetc(stdin)) != '\n';) + for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { if (c == EOF) if (s == buf) { - FUNLOCKFILE(stdin); - return (NULL); + ret = NULL; + goto end; } else break; else *s++ = c; + } *s = 0; - FUNLOCKFILE(stdin); - return (buf); + ret = buf; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } Modified: stable/11/lib/libc/stdio/local.h ============================================================================== --- stable/11/lib/libc/stdio/local.h Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/local.h Thu Jul 13 09:27:11 2017 (r320942) @@ -38,6 +38,9 @@ * $FreeBSD$ */ +#ifndef _STDIO_LOCAL_H +#define _STDIO_LOCAL_H + #include /* for off_t */ #include #include @@ -138,3 +141,26 @@ __fgetwc(FILE *fp, locale_t locale) if ((fp)->_orientation == 0) \ (fp)->_orientation = (o); \ } while (0) + +void __stdio_cancel_cleanup(void *); +#define FLOCKFILE_CANCELSAFE(fp) \ + { \ + struct _pthread_cleanup_info __cleanup_info__; \ + if (__isthreaded) { \ + _FLOCKFILE(fp); \ + ___pthread_cleanup_push_imp( \ + __stdio_cancel_cleanup, (fp), \ + &__cleanup_info__); \ + } else { \ + ___pthread_cleanup_push_imp( \ + __stdio_cancel_cleanup, NULL, \ + &__cleanup_info__); \ + } \ + { +#define FUNLOCKFILE_CANCELSAFE() \ + (void)0; \ + } \ + ___pthread_cleanup_pop_imp(1); \ + } + +#endif /* _STDIO_LOCAL_H */ Modified: stable/11/lib/libc/stdio/perror.c ============================================================================== --- stable/11/lib/libc/stdio/perror.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/perror.c Thu Jul 13 09:27:11 2017 (r320942) @@ -67,9 +67,9 @@ perror(const char *s) v++; v->iov_base = "\n"; v->iov_len = 1; - FLOCKFILE(stderr); + FLOCKFILE_CANCELSAFE(stderr); __sflush(stderr); (void)_writev(stderr->_file, iov, (v - iov) + 1); stderr->_flags &= ~__SOFF; - FUNLOCKFILE(stderr); + FUNLOCKFILE_CANCELSAFE(); } Modified: stable/11/lib/libc/stdio/putc.c ============================================================================== --- stable/11/lib/libc/stdio/putc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/putc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -49,11 +49,11 @@ int putc(int c, FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(fp, -1); */ retval = __sputc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/putchar.c ============================================================================== --- stable/11/lib/libc/stdio/putchar.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/putchar.c Thu Jul 13 09:27:11 2017 (r320942) @@ -54,11 +54,11 @@ putchar(int c) int retval; FILE *so = stdout; - FLOCKFILE(so); + FLOCKFILE_CANCELSAFE(so); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(so, -1); */ retval = __sputc(c, so); - FUNLOCKFILE(so); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/puts.c ============================================================================== --- stable/11/lib/libc/stdio/puts.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/puts.c Thu Jul 13 09:27:11 2017 (r320942) @@ -62,9 +62,9 @@ puts(char const *s) uio.uio_resid = c + 1; uio.uio_iov = &iov[0]; uio.uio_iovcnt = 2; - FLOCKFILE(stdout); + FLOCKFILE_CANCELSAFE(stdout); ORIENT(stdout, -1); retval = __sfvwrite(stdout, &uio) ? EOF : '\n'; - FUNLOCKFILE(stdout); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/putw.c ============================================================================== --- stable/11/lib/libc/stdio/putw.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/putw.c Thu Jul 13 09:27:11 2017 (r320942) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "fvwrite.h" #include "libc_private.h" +#include "local.h" int putw(int w, FILE *fp) @@ -53,8 +54,8 @@ putw(int w, FILE *fp) uio.uio_resid = iov.iov_len = sizeof(w); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/11/lib/libc/stdio/refill.c ============================================================================== --- stable/11/lib/libc/stdio/refill.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/refill.c Thu Jul 13 09:27:11 2017 (r320942) @@ -53,9 +53,9 @@ lflush(FILE *fp) int ret = 0; if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) { - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); } return (ret); } Modified: stable/11/lib/libc/stdio/scanf.c ============================================================================== --- stable/11/lib/libc/stdio/scanf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/scanf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -56,9 +56,9 @@ scanf(char const * __restrict fmt, ...) va_list ap; va_start(ap, fmt); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ret = __svfscanf(stdin, __get_locale(), fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); va_end(ap); return (ret); } @@ -70,9 +70,9 @@ scanf_l(locale_t locale, char const * __restrict fmt, FIX_LOCALE(locale); va_start(ap, fmt); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ret = __svfscanf(stdin, locale, fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); va_end(ap); return (ret); } Modified: stable/11/lib/libc/stdio/setvbuf.c ============================================================================== --- stable/11/lib/libc/stdio/setvbuf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/setvbuf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -63,7 +63,7 @@ setvbuf(FILE * __restrict fp, char * __restrict buf, i if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0) return (EOF); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* * Write current buffer, if any. Discard unread input (including * ungetc data), cancel line buffering, and free old buffer if @@ -115,8 +115,7 @@ nbf: fp->_w = 0; fp->_bf._base = fp->_p = fp->_nbuf; fp->_bf._size = 1; - FUNLOCKFILE(fp); - return (ret); + goto end; } flags |= __SMBF; } @@ -156,6 +155,7 @@ nbf: } __cleanup = _cleanup; - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/stdio.c ============================================================================== --- stable/11/lib/libc/stdio/stdio.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/stdio.c Thu Jul 13 09:27:11 2017 (r320942) @@ -166,3 +166,11 @@ _sseek(FILE *fp, fpos_t offset, int whence) } return (ret); } + +void +__stdio_cancel_cleanup(void * arg) +{ + + if (arg != NULL) + _funlockfile((FILE *)arg); +} Modified: stable/11/lib/libc/stdio/ungetc.c ============================================================================== --- stable/11/lib/libc/stdio/ungetc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/ungetc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -94,10 +94,10 @@ ungetc(int c, FILE *fp) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); ret = __ungetc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/ungetwc.c ============================================================================== --- stable/11/lib/libc/stdio/ungetwc.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/ungetwc.c Thu Jul 13 09:27:11 2017 (r320942) @@ -76,10 +76,10 @@ ungetwc_l(wint_t wc, FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __ungetwc(wc, fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/11/lib/libc/stdio/vfprintf.c ============================================================================== --- stable/11/lib/libc/stdio/vfprintf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/vfprintf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -274,14 +274,14 @@ vfprintf_l(FILE * __restrict fp, locale_t locale, cons int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) ret = __sbprintf(fp, locale, fmt0, ap); else ret = __vfprintf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/11/lib/libc/stdio/vfscanf.c ============================================================================== --- stable/11/lib/libc/stdio/vfscanf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/vfscanf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -443,9 +443,9 @@ __vfscanf(FILE *fp, char const *fmt0, va_list ap) { int ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, __get_locale(), fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int @@ -454,9 +454,9 @@ vfscanf_l(FILE *fp, locale_t locale, char const *fmt0, int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/11/lib/libc/stdio/vfwprintf.c ============================================================================== --- stable/11/lib/libc/stdio/vfwprintf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/vfwprintf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -356,14 +356,14 @@ vfwprintf_l(FILE * __restrict fp, locale_t locale, { int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) ret = __sbprintf(fp, locale, fmt0, ap); else ret = __vfwprintf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/11/lib/libc/stdio/vfwscanf.c ============================================================================== --- stable/11/lib/libc/stdio/vfwscanf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/vfwscanf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -428,10 +428,10 @@ vfwscanf_l(FILE * __restrict fp, locale_t locale, int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); ret = __vfwscanf(fp, locale, fmt, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/11/lib/libc/stdio/vscanf.c ============================================================================== --- stable/11/lib/libc/stdio/vscanf.c Thu Jul 13 09:01:22 2017 (r320941) +++ stable/11/lib/libc/stdio/vscanf.c Thu Jul 13 09:27:11 2017 (r320942) @@ -54,9 +54,9 @@ vscanf_l(locale_t locale, const char * __restrict fmt, int retval; FIX_LOCALE(locale); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); retval = __svfscanf(stdin, locale, fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); return (retval); } int From owner-svn-src-all@freebsd.org Thu Jul 13 10:42:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02576D9E709; Thu, 13 Jul 2017 10:42:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id A135672A7B; Thu, 13 Jul 2017 10:42:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D999D4278D6; Thu, 13 Jul 2017 20:11:18 +1000 (AEST) Date: Thu, 13 Jul 2017 20:11:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320900 - in head/sys: fs/cd9660 fs/ext2fs fs/fifofs fs/msdosfs fs/nandfs fs/nfsclient fs/smbfs fs/tmpfs ufs/ufs In-Reply-To: <2198764.5xJVkxmjDt@ralph.baldwin.cx> Message-ID: <20170713173153.B1044@besplex.bde.org> References: <201707112155.v6BLtKbZ006618@repo.freebsd.org> <20170712184348.Q1271@besplex.bde.org> <2198764.5xJVkxmjDt@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=uZvujYp8AAAA:8 a=k9UK7QmCivZeMjNWNZcA:9 a=CjuIK1q_8ugA:10 a=HSkhpV6CZ5MA:10 a=SLzB8X_8jTLwj6mN0q5r:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 10:42:39 -0000 On Wed, 12 Jul 2017, John Baldwin wrote: > On Wednesday, July 12, 2017 08:08:42 PM Bruce Evans wrote: >> On Tue, 11 Jul 2017, John Baldwin wrote: >> >>> Log: >>> Consistently use vop_stdpathconf() for default pathconf values. >> ... >> This is sort of backwards. Not many settings are the same for most >> file systems, and many that did were wrong. Now more are wrong. >> >>> Modified: head/sys/fs/cd9660/cd9660_vnops.c >>> ... >>> - case _PC_PIPE_BUF: >>> - *ap->a_retval = PIPE_BUF; >>> - return (0); >> >> PIPE_BUF isn't system wide. cd9660 does support fifos, but setting it >> for files that aren't fifos or directories is bogus. POSIX allows such >> bogus settings, and needs complicated wording to describe this. E.g., >> PIPE_BUF for a directory is not completely bogus and it means that the >> value for the directory applies to all fifos in the directory and is >> ignored for all non-fifos in the directory. It is unclear if PIPE_BUF >> must be set for a directory if there is any fifo in the directory. >> FreeBSD's man pages give no details about this. > > PIPE_BUF is system wide because all FIFOs in FreeBSD are implemented via > a common fifo implementation that has a single size. The wording about > PIPE_BUF from > http://pubs.opengroup.org/onlinepubs/009695399/functions/fpathconf.html: > > If path refers to a FIFO, or fildes refers to a pipe or FIFO, the > value returned shall apply to the referenced object. If path or fildes > refers to a directory, the value returned shall apply to any FIFO that > exists or can be created within the directory. If path or fildes refers > to any other type of file, it is unspecified whether an implementation > supports an association of the variable name with the specified file. > > This leaves the value for non-directories and non-FIFOs undefined. We > could perhaps add more complexity to fail with EINVAL for types other > than VFIFO or VDIR, and filesystems that do not support FIFOs could > fail _PC_PIPE_BUF in their fs-specific vnop, but this would not be any > more correct as both behaviors fall into "undefined", but the current > one is simpler to implement. This is what I said was unclear. It is clear to standards lawyers but not even hinted at in FreeBSD man pages. >> This is system-wide. >> >>> case _PC_NO_TRUNC: >>> *ap->a_retval = 1; >>> return (0); There is another bug with this, and a similar, larger one with CHOWN_RESTRICTED, like the one for NAME_MAX. {NAME_MAX} is variable, so defining NAME_MAX is a bug and since it varies a lot defaulting _PC_NAME_MAX is worse than useless. Similarly for NO_TRUNC and CHOWN_RESTRICTED, except they are POSIX limits and always have prefixes and there are further bugs in the defaulting: - _POSIX_NO_TRUNC is defined as 1. This means that all file systems have it. But at least shortnames for msdosfs don't have it. As previously discussed, this is not defaulted, but it is better for defaulting than _PC_NAME_MAX since 1 is correct for most file systems. - _POSIX_CHOWN_RESTRICTED is defined as 1. This means that all file systems have it. Perhaps they are actually do. It is defaulted, but its default value is spelled 1 instead of _POSIX_CHOWN_RESTRICTED. >> - NAME_MAX. This is very far from system-wide >> - PATH_MAX. This is system-wide. >> - LINK_MAX. This is very far from system-wide, especially after expansion >> of nlink_t. Most file systems get this wrong. LINK_MAX is bogusly >> defined to be the constant 32767, but the value is very variable. >> zfs_pathconf() returns INT_MAX and zfs uses something like int32_t >> internally, but zfs_getattr() clamps to LINK_MAX. ext2fs limits to >> 32000 for ext2 and 65000 for ext4 internally but ext2_pathconf() >> only returns this limit in some cases -- other cases return INT_MAX. > > In theory if a filesystem supported an infinite link count or name count > it would have no filesystem-specific limit and having LINK_MAX and > NAME_MAX provide the system limits gives a reasonable default in that case. NAME_MAX is required to give the limit for all file systems if it is defined. _POSIX_NAME_MAX is what gives a "reasonable" default (it actually gives the minimum value for a "reasonable" {NAME_MAX}). For newer POSIX limits, a macro value of 0 means that the feature might be supported (and all its headers are present). So it wouldn't be such good style to use the macro value as the default -- pathconf() must give the runtime value which is rarely 0. We only use 0 for _POSIX_IPV6 and _POSIX_PRIORITY_SCHEDULING which are not under pathconf(). > I don't know if any filesystem supports infinite limits in practice, but > it's also true that the correct behavior in each filesystem would be to > return a value like MIN(fs_limit, system_limit), not just the native > filesystem limit. Perhaps this could be implemented by a post-processing > step for VOP_PATHCONF that truncates values that exceed system limits to > system limits. The file system should limit itself to the system limit. This already happens for {LINK_MAX}. zfs does this with bugs by not limiting the link count but reporting wrong link counts when the correct link count is not representable. pathconf() is limited to LONG_MAX, so there is always a system limit of LONG_MAX. nlink_t was recently bloated to uint64_t. UINT64_MAX is not representable by pathconf() even on 64-bit systems. >> This is easy to improve: >> - NAME_MAX, LINK_MAX: move to individual fs's > > That probably is true. In this case I was just trying to reduce overrides > to the ones that were really fs-specific. The existing places that used > NAME_MAX and LINK_MAX were also likely wrong as they did not return a > filesystem-specific value. > >> - MAX_CANON, MAX_INPUT, VDISABLE: move to devfs_pathconf(). > > That is probably fine as well as it is simple and doesn't add complexity. > >> - PIPE_BUF: move to fifo_pathconf()? What about directories? > > I think this one should be standard for the reasons I gave above. If > we really wanted to, we could make it conditional on the type (VFIFO and > VDIR) without adding a lot of complexity. Special files are also very easy to classify in vop_stdpathconf(). >>> Modified: head/sys/fs/fifofs/fifo_vnops.c >>> ... >>> -static int >>> -fifo_pathconf(ap) >>> - struct vop_pathconf_args /* { >>> - struct vnode *a_vp; >>> - int a_name; >>> - int *a_retval; >>> - } */ *ap; >>> -{ >>> - >>> - switch (ap->a_name) { >>> - case _PC_LINK_MAX: >>> - *ap->a_retval = LINK_MAX; >>> - return (0); >>> - case _PC_PIPE_BUF: >>> - *ap->a_retval = PIPE_BUF; >>> - return (0); >>> - case _PC_CHOWN_RESTRICTED: >>> - *ap->a_retval = 1; >>> - return (0); >>> - default: >>> - return (EINVAL); >>> - } >>> - /* NOTREACHED */ >>> } >> >> This was small and hopefully correct. Not many settings apply to fifos. >> It seems a but too small to be correct -- why would LINK_MAX apply but >> not PATH_MAX? Using the default, a pathconf which wants to set only 3 >> value would need about 15 cases to kill all the defaults. > > This was not really correct since at least NAME_MAX was missing, but it also > should never have been used as a full VOP. The parent filesystem in which the > FIFO resides dictates values like LINK_MAX and NAME_MAX. The only safe way to It is actually correct. Name limits are properties of directories (really file systems/mount points), and NAME_MAX and PATH_MAX are explicitly unspecified for non-directories (requirement 4). LINK_MAX and CHOWN_RESTRICTED are more properties of individual files. POSIX seems to be broken since it only requires something for them for directories (requirement 1 and 7). Requirement 4 about PIPE_BUF has the complications needed to not have this bug. >* ... >> I expect that some of the other defaulted limits will become more variable >> (so unsuitable as defaults). LINK_MAX is almost there. >> >>> @@ -2505,11 +2493,6 @@ ufs_pathconf(ap) >>> case _PC_MIN_HOLE_SIZE: >>> *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; >>> break; >>> - case _PC_ASYNC_IO: >>> - /* _PC_ASYNC_IO should have been handled by upper layers. */ >>> - KASSERT(0, ("_PC_ASYNC_IO should not get here")); >>> - error = EINVAL; >>> - break; >>> case _PC_PRIO_IO: >>> *ap->a_retval = 0; >>> break; >> >> But some of the newer limits like are in vfs so should have been defaulted? > > _PC_ASYNC_IO used to be explicitly handled in the pathconf system calls as a > special case. I had moved it to vop_stdpathconf() so that it was handled in > one place (rather than 3), but had missed these specific handlers in existing > pathconf VOPs. System-wide pathconf values should really be in one place in > vop_stdpathconf(). We might want to alter the list of things in > vop_stdpathconf(), but I think all filesystems should fall through to it > and only override values that are filesystem-specific. ufs, ext2fs and zfs have many newer POSIX limits. I think it is a bug for unistd.h to not define these as 0 (supported by headers and libraries but not by all file systems), but not many of these should be defaulted. Bruce From owner-svn-src-all@freebsd.org Thu Jul 13 13:32:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D432DDA2F95; Thu, 13 Jul 2017 13:32:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F5E78113; Thu, 13 Jul 2017 13:32:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DDWNW3085121; Thu, 13 Jul 2017 13:32:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DDWN7q085120; Thu, 13 Jul 2017 13:32:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707131332.v6DDWN7q085120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 13 Jul 2017 13:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320943 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 320943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 13:32:24 -0000 Author: manu Date: Thu Jul 13 13:32:23 2017 New Revision: 320943 URL: https://svnweb.freebsd.org/changeset/base/320943 Log: Add ipfw_status command to etc/rc.d/ipfw This is helpful when using service/conf management tools. Sonsored-By: Gandi.net Modified: head/etc/rc.d/ipfw Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Thu Jul 13 09:27:11 2017 (r320942) +++ head/etc/rc.d/ipfw Thu Jul 13 13:32:23 2017 (r320943) @@ -17,7 +17,9 @@ start_cmd="ipfw_start" start_precmd="ipfw_prestart" start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" +status_cmd="ipfw_status" required_modules="ipfw" +extra_commands="status" set_rcvar_obsolete ipv6_firewall_enable @@ -107,6 +109,18 @@ ipfw_stop() ${_coscript} quietstop fi done +} + +ipfw_status() +{ + status=$(sysctl -n net.inet.ip.fw.enable) + if [ ${status} -eq 0 ]; then + echo "ipfw is not enabled" + exit 1 + else + echo "ipfw is enabled" + exit 0 + fi } load_rc_config $name From owner-svn-src-all@freebsd.org Thu Jul 13 13:40:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7247DA3106; Thu, 13 Jul 2017 13:40:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A101578393; Thu, 13 Jul 2017 13:40:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DDeIdQ086140; Thu, 13 Jul 2017 13:40:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DDeIE9086139; Thu, 13 Jul 2017 13:40:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707131340.v6DDeIE9086139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 13 Jul 2017 13:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320944 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 320944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 13:40:19 -0000 Author: manu Date: Thu Jul 13 13:40:18 2017 New Revision: 320944 URL: https://svnweb.freebsd.org/changeset/base/320944 Log: Add an rc.d script to setup a netflow export via ng_netflow The default is to export netflow data on localhost on the netflow port. ngtee is used to have the lowest overhead possible. The ipfw ng hook is the netflow port (it can only be numeric) Default is netflow version 5. Sponsored-By: Gandi.net Reviewed by: bapt (earlier version), olivier (earlier version) Added: head/etc/rc.d/ipfw_netflow (contents, props changed) Added: head/etc/rc.d/ipfw_netflow ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/ipfw_netflow Thu Jul 13 13:40:18 2017 (r320944) @@ -0,0 +1,77 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ipfw_netflow +# REQUIRE: ipfw +# KEYWORD: nojailvnet + +. /etc/rc.subr +. /etc/network.subr + +name="ipfw_netflow" +desc="firewall, ipfw, netflow" +rcvar="${name}_enable" +start_cmd="${name}_start" +stop_cmd="${name}_stop" +start_precmd="${name}_test" +status_cmd="${name}_status" +required_modules="ipfw ng_netflow ng_ipfw" +extra_commands="status" + +: ${ipfw_netflow_hook:=9995} +: ${ipfw_netflow_rule:=01000} +: ${ipfw_netflow_ip:=127.0.0.1} +: ${ipfw_netflow_port:=9995} +: ${ipfw_netflow_version:=} + +ipfw_netflow_test() +{ + if [ "${ipfw_netflow_version}" != "" ] && [ "${ipfw_netflow_version}" != 9 ]; then + err 1 "Unknown netflow version \'${ipfw_netflow_version}\'" + fi + case "${ipfw_netflow_hook}" in + [!0-9]*) + err 1 "Bad value \"${ipfw_netflow_hook}\": Hook must be numerical" + esac + case "${ipfw_netflow_rule}" in + [!0-9]*) + err 1 "Bad value \"${ipfw_netflow_rule}\": Rule number must be numerical" + esac +} + +ipfw_netflow_is_running() +{ + ngctl show netflow: > /dev/null 2>&1 && return 0 || return 1 +} + +ipfw_netflow_status() +{ + ipfw_netflow_is_running && echo "ipfw_netflow is active" || echo "ipfw_netflow is not active" +} + +ipfw_netflow_start() +{ + ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" + ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any + ngctl -f - <<-EOF + mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 + name ipfw:${ipfw_netflow_hook} netflow + mkpeer netflow: ksocket export${ipfw_netflow_version} inet/dgram/udp + msg netflow: setdlt {iface=0 dlt=12} + name netflow:export${ipfw_netflow_version} netflow_export + msg netflow:export${ipfw_netflow_version} connect inet/${ipfw_netflow_ip}:${ipfw_netflow_port} +EOF +} + +ipfw_netflow_stop() +{ + ipfw_netflow_is_running || err 1 "ipfw_netflow is not active" + ngctl shutdown netflow: + ipfw delete ${ipfw_netflow_rule} +} + +load_rc_config $name + +run_rc_command $* From owner-svn-src-all@freebsd.org Thu Jul 13 15:10:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4DD4DA4D8D; Thu, 13 Jul 2017 15:10:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B927B2C7; Thu, 13 Jul 2017 15:10:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DFA2rw023489; Thu, 13 Jul 2017 15:10:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DFA2EE023488; Thu, 13 Jul 2017 15:10:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707131510.v6DFA2EE023488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 13 Jul 2017 15:10:02 +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: r320945 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Commit-Revision: 320945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:10:03 -0000 Author: hselasky Date: Thu Jul 13 15:10:02 2017 New Revision: 320945 URL: https://svnweb.freebsd.org/changeset/base/320945 Log: MFC r320876: Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 13:40:18 2017 (r320944) +++ stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:10:02 2017 (r320945) @@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri ring->rx_mb_size = priv->rx_mb_size; ring->stride = stride; - if (ring->stride <= TXBB_SIZE) + if (ring->stride <= TXBB_SIZE) { + /* Stamp first unused send wqe */ + __be32 *ptr = (__be32 *)ring->buf; + __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); + *ptr = stamp; + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; + } ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride; From owner-svn-src-all@freebsd.org Thu Jul 13 15:12:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4517CDA4F7C; Thu, 13 Jul 2017 15:12:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135777B607; Thu, 13 Jul 2017 15:12:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DFC1Ox025928; Thu, 13 Jul 2017 15:12:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DFC13c025927; Thu, 13 Jul 2017 15:12:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707131512.v6DFC13c025927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 13 Jul 2017 15:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r320946 - stable/9/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/ofed/drivers/net/mlx4 X-SVN-Commit-Revision: 320946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:12:02 -0000 Author: hselasky Date: Thu Jul 13 15:12:01 2017 New Revision: 320946 URL: https://svnweb.freebsd.org/changeset/base/320946 Log: MFC r320876: Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:10:02 2017 (r320945) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:12:01 2017 (r320946) @@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri ring->rx_mb_size = priv->rx_mb_size; ring->stride = stride; - if (ring->stride <= TXBB_SIZE) + if (ring->stride <= TXBB_SIZE) { + /* Stamp first unused send wqe */ + __be32 *ptr = (__be32 *)ring->buf; + __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); + *ptr = stamp; + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; + } ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride; From owner-svn-src-all@freebsd.org Thu Jul 13 15:16:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F316DA61E2; Thu, 13 Jul 2017 15:16:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08FF07B957; Thu, 13 Jul 2017 15:16:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DFGkKb027526; Thu, 13 Jul 2017 15:16:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DFGkBE027525; Thu, 13 Jul 2017 15:16:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707131516.v6DFGkBE027525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 13 Jul 2017 15:16: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: r320947 - stable/11/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/net/mlx4 X-SVN-Commit-Revision: 320947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:16:47 -0000 Author: hselasky Date: Thu Jul 13 15:16:45 2017 New Revision: 320947 URL: https://svnweb.freebsd.org/changeset/base/320947 Log: MFC r320876: Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/net/mlx4/en_rx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/11/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:12:01 2017 (r320946) +++ stable/11/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:16:45 2017 (r320947) @@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri ring->rx_mb_size = priv->rx_mb_size; ring->stride = stride; - if (ring->stride <= TXBB_SIZE) + if (ring->stride <= TXBB_SIZE) { + /* Stamp first unused send wqe */ + __be32 *ptr = (__be32 *)ring->buf; + __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); + *ptr = stamp; + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; + } ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride; From owner-svn-src-all@freebsd.org Thu Jul 13 15:33:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E47DA6964; Thu, 13 Jul 2017 15:33:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D672B7C600; Thu, 13 Jul 2017 15:33:09 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DFX8Xa035985; Thu, 13 Jul 2017 15:33:08 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DFX8Sc035983; Thu, 13 Jul 2017 15:33:08 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707131533.v6DFX8Sc035983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 13 Jul 2017 15:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320948 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 320948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:33:10 -0000 Author: sbruno Date: Thu Jul 13 15:33:08 2017 New Revision: 320948 URL: https://svnweb.freebsd.org/changeset/base/320948 Log: Add 4K quirks for Samsung 750 EVO SSD Submitted by: lev Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D9478 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Jul 13 15:16:45 2017 (r320947) +++ head/sys/cam/ata/ata_da.c Thu Jul 13 15:33:08 2017 (r320948) @@ -637,6 +637,14 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* + * Samsung 750 SSDs + * 4k optimised, NCQ TRIM seems to work + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 750*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * Samsung 830 Series SSDs * 4k optimised, NCQ TRIM Broken (normal TRIM is fine) */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jul 13 15:16:45 2017 (r320947) +++ head/sys/cam/scsi/scsi_da.c Thu Jul 13 15:33:08 2017 (r320948) @@ -1260,6 +1260,14 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Samsung 750 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 750*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * Samsung 830 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@freebsd.org Thu Jul 13 15:44:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEC59DA6D58; Thu, 13 Jul 2017 15:44:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6E607CC55; Thu, 13 Jul 2017 15:44:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id j186so7385394pge.1; Thu, 13 Jul 2017 08:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JeB641YopzAINOS6HLsNCKUVv03KsymMT5RHV5Kyc3Q=; b=jUC8/usF3C+FvXwRO16mJIo3VDr8htw3AAko46qy/um6IE2Wd25TZMuU3Y3nLtqMK5 wvjPX4qk46Ceb4ozOxjZdUFCCF88+BhdDF5lULcyhpuAwojvnVPV7edtN6kYx6LTokEp SuIHzNSQ7vg8Hx64qOTquzVD0cBxW+jjuwLqQXZDG24j0o67nShHU1iHsJudcD4+PaQP X2ZHT4Xb8tReBpLRs+arzz34SsthdEgmdDaKFz0vm+iNRsFR1npq6FiV/ecKTz199BWV ZPP5FPqjP+fCLOeCAnKx/Kepl48dVd5fMkTqx6fSRay7gdHi7FprYAecNwj/ZaNuk+64 koFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JeB641YopzAINOS6HLsNCKUVv03KsymMT5RHV5Kyc3Q=; b=lYpbIpW8suulgGa4lxa+OPuTK+twJR9v+AjFgfBVTd5+KpdlIcdSeLUiQAjTvLim2C Wnxlqnny1yRrmW4u6bwU3FZkI2UAXYdcPpaDQnTN2RHrhXirhEULaHWlDcWIh+ihuIyK bVnxkfpzTMPsVkBCm51EHiy8I4AY9DaqfZa7StwL2WXomGzPCCsPl0A12mh7eZoAT61v aaNf4dNLJxyIeh+1EvwSyHeAg0T73cJx+8SzQXPcQd3Re4wmDyFBgSERtkqNnM0nlM5L VBzPARKH0ZUGbR+Nv334OqgrhE3MURhn4qTHdqENDhj65brPt6T6mqW85pc2HaIXYRt9 c9DA== X-Gm-Message-State: AIVw113DGpO/JcDp7/iiYkg8KraQBWj+dWYW79HfTRp8Ng7ZtAsVeHTd 1Vy/cXCC+8C4YrGGRdU= X-Received: by 10.98.215.23 with SMTP id b23mr209940pfh.139.1499960677891; Thu, 13 Jul 2017 08:44:37 -0700 (PDT) Received: from ?IPv6:2607:fb90:836f:1053:edf1:3446:3fc:90c9? ([2607:fb90:836f:1053:edf1:3446:3fc:90c9]) by smtp.gmail.com with ESMTPSA id w125sm12605932pfb.117.2017.07.13.08.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 08:44:37 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r320944 - head/etc/rc.d From: Ngie Cooper X-Mailer: iPhone Mail (14F89) In-Reply-To: <201707131340.v6DDeIE9086139@repo.freebsd.org> Date: Thu, 13 Jul 2017 08:44:36 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9D643ACB-FA58-499B-9783-71246C323ECC@gmail.com> References: <201707131340.v6DDeIE9086139@repo.freebsd.org> To: Emmanuel Vadot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:44:38 -0000 > On Jul 13, 2017, at 06:40, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Thu Jul 13 13:40:18 2017 > New Revision: 320944 > URL: https://svnweb.freebsd.org/changeset/base/320944 >=20 > Log: > Add an rc.d script to setup a netflow export via ng_netflow > The default is to export netflow data on localhost on the netflow port. > ngtee is used to have the lowest overhead possible. > The ipfw ng hook is the netflow port (it can only be numeric) > Default is netflow version 5. Hi Emmanuel, The script isn't being installed. Could you please integrate it in to et= c/rc.d/Makefile under a block conditional on MK_IPFW/MK_NETGRAPH? Thanks! -Ngie= From owner-svn-src-all@freebsd.org Thu Jul 13 15:54:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA248DA7460; Thu, 13 Jul 2017 15:54:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74837D4E1; Thu, 13 Jul 2017 15:54:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DFsQCN044491; Thu, 13 Jul 2017 15:54:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DFsQEF044490; Thu, 13 Jul 2017 15:54:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707131554.v6DFsQEF044490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 13 Jul 2017 15:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320949 - releng/11.1/sys/ofed/drivers/net/mlx4 X-SVN-Group: releng X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: releng/11.1/sys/ofed/drivers/net/mlx4 X-SVN-Commit-Revision: 320949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 15:54:28 -0000 Author: hselasky Date: Thu Jul 13 15:54:26 2017 New Revision: 320949 URL: https://svnweb.freebsd.org/changeset/base/320949 Log: MF11 r320947; MFC r320876: Make sure the mlx4en RX DMA ring gets stamped with software ownership in order to prevent the flow of QP to error in the firmware once UPDATE_QP is called. Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: releng/11.1/sys/ofed/drivers/net/mlx4/en_rx.c Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- releng/11.1/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:33:08 2017 (r320948) +++ releng/11.1/sys/ofed/drivers/net/mlx4/en_rx.c Thu Jul 13 15:54:26 2017 (r320949) @@ -394,8 +394,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *pri ring->rx_mb_size = priv->rx_mb_size; ring->stride = stride; - if (ring->stride <= TXBB_SIZE) + if (ring->stride <= TXBB_SIZE) { + /* Stamp first unused send wqe */ + __be32 *ptr = (__be32 *)ring->buf; + __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); + *ptr = stamp; + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; + } ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride; From owner-svn-src-all@freebsd.org Thu Jul 13 16:18:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B19B1DA7B76; Thu, 13 Jul 2017 16:18:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6CB2E7E10F; Thu, 13 Jul 2017 16:18:47 +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 v6DGIkAg053009; Thu, 13 Jul 2017 16:18:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DGIkqA053007; Thu, 13 Jul 2017 16:18:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707131618.v6DGIkqA053007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 16:18:46 +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: r320950 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 320950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:18:47 -0000 Author: gjb Date: Thu Jul 13 16:18:46 2017 New Revision: 320950 URL: https://svnweb.freebsd.org/changeset/base/320950 Log: Document SA-17:05.heimdal, EN-17:06.hyperv Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/11/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/errata.xml ============================================================================== --- stable/10/release/doc/share/xml/errata.xml Thu Jul 13 15:54:26 2017 (r320949) +++ stable/10/release/doc/share/xml/errata.xml Thu Jul 13 16:18:46 2017 (r320950) @@ -134,6 +134,14 @@ 23 February 2017 Xen migration enhancements + + + FreeBSD-EN-17:06.hyperv + 12 July 2017 + Boot compatibility improvements with + Azure virtual machines + Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Thu Jul 13 15:54:26 2017 (r320949) +++ stable/10/release/doc/share/xml/security.xml Thu Jul 13 16:18:46 2017 (r320950) @@ -206,6 +206,14 @@ 27 April 2017 Fix fragment handling panic + + + FreeBSD-SA-17:05.heimdal + 12 July 2017 + Fix KDC-REP service name validation + vulnerability + From owner-svn-src-all@freebsd.org Thu Jul 13 16:18:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E21CADA7B7C; Thu, 13 Jul 2017 16:18:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id A6D957E110; Thu, 13 Jul 2017 16:18:47 +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 v6DGIkcW053015; Thu, 13 Jul 2017 16:18:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DGIkgh053014; Thu, 13 Jul 2017 16:18:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707131618.v6DGIkgh053014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 16:18: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: r320950 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 320950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:18:48 -0000 Author: gjb Date: Thu Jul 13 16:18:46 2017 New Revision: 320950 URL: https://svnweb.freebsd.org/changeset/base/320950 Log: Document SA-17:05.heimdal, EN-17:06.hyperv Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Thu Jul 13 15:54:26 2017 (r320949) +++ stable/11/release/doc/share/xml/security.xml Thu Jul 13 16:18:46 2017 (r320950) @@ -90,6 +90,14 @@ 27 April 2017 Fix fragment handling panic + + + FreeBSD-SA-17:05.heimdal + 12 July 2017 + Fix KDC-REP service name validation + vulnerability + From owner-svn-src-all@freebsd.org Thu Jul 13 16:23:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2483FDA7E64; Thu, 13 Jul 2017 16:23:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF1527E694; Thu, 13 Jul 2017 16:23:45 +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 v6DGNj7s057103; Thu, 13 Jul 2017 16:23:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DGNjp5057102; Thu, 13 Jul 2017 16:23:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707131623.v6DGNjp5057102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 16:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320951 - releng/11.1/release/doc/share/xml X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.1/release/doc/share/xml X-SVN-Commit-Revision: 320951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:23:46 -0000 Author: gjb Date: Thu Jul 13 16:23:44 2017 New Revision: 320951 URL: https://svnweb.freebsd.org/changeset/base/320951 Log: Document SA-17:05.heimdal. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/release/doc/share/xml/security.xml Modified: releng/11.1/release/doc/share/xml/security.xml ============================================================================== --- releng/11.1/release/doc/share/xml/security.xml Thu Jul 13 16:18:46 2017 (r320950) +++ releng/11.1/release/doc/share/xml/security.xml Thu Jul 13 16:23:44 2017 (r320951) @@ -90,6 +90,14 @@ 27 April 2017 Fix fragment handling panic + + + FreeBSD-SA-17:05.heimdal + 12 July 2017 + Fix KDC-REP service name validation + vulnerability + From owner-svn-src-all@freebsd.org Thu Jul 13 16:27:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE3DDA7F5E; Thu, 13 Jul 2017 16:27:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id DE94D7E871; Thu, 13 Jul 2017 16:27:44 +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 v6DGRiRP057272; Thu, 13 Jul 2017 16:27:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DGRigZ057271; Thu, 13 Jul 2017 16:27:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707131627.v6DGRigZ057271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 16:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320952 - releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 320952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:27:45 -0000 Author: gjb Date: Thu Jul 13 16:27:43 2017 New Revision: 320952 URL: https://svnweb.freebsd.org/changeset/base/320952 Log: Document pkg(8) version 1.10.1. Prune empty sections. Remove a stale comment. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 13 16:23:44 2017 (r320951) +++ releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 13 16:27:43 2017 (r320952) @@ -22,8 +22,6 @@ $FreeBSD$ - - 2017 The &os; Documentation @@ -912,48 +910,11 @@ Collection, package infrastructure, and package maintenance and installation tools. - - Infrastructure Changes - -   - - Packaging Changes -   - - - - - Documentation - - This section covers changes to the &os; Documentation - Project sources and toolchain. - - - Documentation Source Changes - -   - - - - Documentation Toolchain Changes - -   - - - - - Release Engineering and Integration - - This section convers changes that are specific to the - &os; Release Engineering processes. - - - Integration Changes - -   + The &man.pkg.8; utility has been updated to version + 1.10.1. From owner-svn-src-all@freebsd.org Thu Jul 13 16:45:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CD5DA8590; Thu, 13 Jul 2017 16:45:14 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-yb0-f171.google.com (mail-yb0-f171.google.com [209.85.213.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4421D7F1C4; Thu, 13 Jul 2017 16:45:13 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-yb0-f171.google.com with SMTP id f194so20863764yba.3; Thu, 13 Jul 2017 09:45:13 -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=afPFASepAhrRxlEzMMJOaZXjp7I5KslEtijLzuwCfIQ=; b=XVdji+/hzlDQqLP5jK6PYfTm5eYcp8Mqp85SwV0qS93OvuzHciLV+eINpJ3Btj68lY EzDFEhuO+7+ncJi0WJjX1HLcskNrqZSbwJJdsRre6rQ9EhWbNl/88nibBu9VvXJneLKk byVft8/+9bYQf6t0vPG1qv9LrcEIXgE+itGuvzR98I4PB78F4xOIMzovbw0ufsWHTXSu l/YHIhx+PAzT9wDnSm0+qFNTich/SdjcUEdGLPeVz03EbrDGtPUR7N+UPDEnb7/1w65O 1WpXe/Fa1TcK/+iTPJY95myVGhRpmKK0vvwHnKRyzokeBiLYX0O2/rXxnsY68isIYy+U wp4A== X-Gm-Message-State: AIVw111jcg5VabQb9sKA/VcuXtNVPlG2zJDG6isDfq2bhtapam6Rld3d TfxztTfWbR6jkVpTQB2dY8guvMhqRlftbDs= X-Received: by 10.37.164.168 with SMTP id g37mr3665090ybi.177.1499964307059; Thu, 13 Jul 2017 09:45:07 -0700 (PDT) MIME-Version: 1.0 References: <201707121735.v6CHZWNY091333@repo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Thu, 13 Jul 2017 16:44:56 +0000 Message-ID: Subject: Re: svn commit: r320916 - head/sys/dev/ixgbe To: Ngie Cooper , Sean Bruno Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:45:14 -0000 Yeah -- I wanted to leave it as-is in head, but revert it to the previous name in the stable branches. On Wed, Jul 12, 2017 at 4:49 PM Ngie Cooper wrote: > On Wed, Jul 12, 2017 at 10:35 AM, Sean Bruno wrote: > > Author: sbruno > > Date: Wed Jul 12 17:35:32 2017 > > New Revision: 320916 > > URL: https://svnweb.freebsd.org/changeset/base/320916 > > > > Log: > > Reset unsupported SFP tuneable back to original entry name. > > > > Reported by: olivier@ > > The new name kinda makes more sense -- why not keep it and make a > backwards compatible OID for the old name? > Thanks, > -Ngie > > From owner-svn-src-all@freebsd.org Thu Jul 13 16:56:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85BE5DA89F9; Thu, 13 Jul 2017 16:56:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5303F7F966; Thu, 13 Jul 2017 16:56:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DGuQYM069576; Thu, 13 Jul 2017 16:56:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DGuQiD069574; Thu, 13 Jul 2017 16:56:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707131656.v6DGuQiD069574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 13 Jul 2017 16:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320953 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 320953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 16:56:27 -0000 Author: sbruno Date: Thu Jul 13 16:56:26 2017 New Revision: 320953 URL: https://svnweb.freebsd.org/changeset/base/320953 Log: Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs. Submitted by: hannula@gmail.com Differential Revision: https://reviews.freebsd.org/D7967 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Jul 13 16:27:43 2017 (r320952) +++ head/sys/cam/ata/ata_da.c Thu Jul 13 16:56:26 2017 (r320953) @@ -661,6 +661,14 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* + * Samsung 845 SSDs + * 4k optimised, NCQ TRIM Broken (normal TRIM is fine) + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 845*", "*" }, + /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN + }, + { + /* * Samsung 850 SSDs * 4k optimised, NCQ TRIM broken (normal TRIM fine) */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jul 13 16:27:43 2017 (r320952) +++ head/sys/cam/scsi/scsi_da.c Thu Jul 13 16:56:26 2017 (r320953) @@ -1284,6 +1284,14 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Samsung 845 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 845*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * Samsung 850 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@freebsd.org Thu Jul 13 17:05:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C052DDA8F7A; Thu, 13 Jul 2017 17:05:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C73C800D5; Thu, 13 Jul 2017 17:05:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DH5wBX074091; Thu, 13 Jul 2017 17:05:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DH5vqh074074; Thu, 13 Jul 2017 17:05:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707131705.v6DH5vqh074074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 13 Jul 2017 17:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320954 - in releng/11.1: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in releng/11.1: share/man/man4 share/man/man4/man4.i386 sys/dev/digi sys/dev/ie sys/dev/mcd sys/dev/scd sys/dev/si sys/dev/wl sys/i386/isa usr.sbin/sicontrol usr.sbin/wlconfig X-SVN-Commit-Revision: 320954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 17:05:59 -0000 Author: jhb Date: Thu Jul 13 17:05:57 2017 New Revision: 320954 URL: https://svnweb.freebsd.org/changeset/base/320954 Log: MFS11 320921: Add deprecation notices for various device drivers removed in 12.0. Approved by: re (kib) Modified: releng/11.1/share/man/man4/digi.4 releng/11.1/share/man/man4/man4.i386/ie.4 releng/11.1/share/man/man4/man4.i386/wl.4 releng/11.1/share/man/man4/mcd.4 releng/11.1/share/man/man4/scd.4 releng/11.1/share/man/man4/si.4 releng/11.1/share/man/man4/spic.4 releng/11.1/sys/dev/digi/digi.c releng/11.1/sys/dev/ie/if_ie.c releng/11.1/sys/dev/mcd/mcd.c releng/11.1/sys/dev/scd/scd.c releng/11.1/sys/dev/si/si.c releng/11.1/sys/dev/wl/if_wl.c releng/11.1/sys/i386/isa/spic.c releng/11.1/usr.sbin/sicontrol/sicontrol.8 releng/11.1/usr.sbin/wlconfig/wlconfig.8 Directory Properties: releng/11.1/ (props changed) Modified: releng/11.1/share/man/man4/digi.4 ============================================================================== --- releng/11.1/share/man/man4/digi.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/digi.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -33,7 +33,7 @@ .\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp .\" $FreeBSD$ .\" -.Dd December 7, 2003 +.Dd July 8, 2017 .Dt DIGI 4 .Os .Sh NAME @@ -80,6 +80,11 @@ Device numbering: \fBI\fPnitial \fBPPPPP\fPort number .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/share/man/man4/man4.i386/ie.4 ============================================================================== --- releng/11.1/share/man/man4/man4.i386/ie.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/man4.i386/ie.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 8, 2017 .Dt IE 4 i386 .Os .Sh NAME @@ -52,6 +52,11 @@ In .Cd hint.ie.0.port="0x300" .Cd hint.ie.0.irq="5" .Cd hint.ie.0.maddr="0xd0000" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh HARDWARE The .Nm Modified: releng/11.1/share/man/man4/man4.i386/wl.4 ============================================================================== --- releng/11.1/share/man/man4/man4.i386/wl.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/man4.i386/wl.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 29, 2006 +.Dd July 8, 2017 .Dt WL 4 i386 .Os .Sh NAME @@ -37,6 +37,11 @@ .Nd T1 speed ISA/radio lan card .Sh SYNOPSIS .Cd "device wl0 at isa? port 0x300 irq 5" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/share/man/man4/mcd.4 ============================================================================== --- releng/11.1/share/man/man4/mcd.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/mcd.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 1994 +.Dd July 8, 2017 .Dt MCD 4 .Os .Sh NAME @@ -40,6 +40,11 @@ In .Cd hint.mcd.0.at="isa" .Cd hint.mcd.0.port="0x300" .Cd hint.mcd.0.irq="10" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/share/man/man4/scd.4 ============================================================================== --- releng/11.1/share/man/man4/scd.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/scd.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2008 +.Dd July 8, 2017 .Dt SCD 4 .Os .Sh NAME @@ -39,6 +39,11 @@ In .Pa /boot/device.hints : .Cd hint.scd.0.at="isa" .Cd hint.scd.0.port="0x230" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/share/man/man4/si.4 ============================================================================== --- releng/11.1/share/man/man4/si.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/si.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 16, 1995 +.Dd July 8, 2017 .Dt SI 4 .Os .Sh NAME @@ -13,6 +13,11 @@ For ISA host cards put the following lines in .Cd hint.si.0.at="isa" .Cd hint.si.0.maddr="0xd0000" .Cd hint.si.0.irq="12" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The Specialix SI/XIO and SX hardware makes up an 8 to 32 port RS-232 serial multiplexor. Modified: releng/11.1/share/man/man4/spic.4 ============================================================================== --- releng/11.1/share/man/man4/spic.4 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/share/man/man4/spic.4 Thu Jul 13 17:05:57 2017 (r320954) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd July 8, 2017 .Dt SPIC 4 .Os .Sh NAME @@ -33,6 +33,11 @@ .Nd Sony Programmable I/O Controller device driver .Sh SYNOPSIS .Cd "device spic" +.Sh DEPRECATION NOTICE +The +.Nm +driver will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/sys/dev/digi/digi.c ============================================================================== --- releng/11.1/sys/dev/digi/digi.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/digi/digi.c Thu Jul 13 17:05:57 2017 (r320954) @@ -1458,6 +1458,8 @@ digi_attach(struct digi_softc *sc) digi_loadmoduledata(sc); digi_init(sc); digi_freemoduledata(sc); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/dev/ie/if_ie.c ============================================================================== --- releng/11.1/sys/dev/ie/if_ie.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/ie/if_ie.c Thu Jul 13 17:05:57 2017 (r320954) @@ -327,6 +327,8 @@ ie_attach(device_t dev) mtx_destroy(&sc->lock); return (error); } + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/dev/mcd/mcd.c ============================================================================== --- releng/11.1/sys/dev/mcd/mcd.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/mcd/mcd.c Thu Jul 13 17:05:57 2017 (r320954) @@ -209,6 +209,8 @@ mcd_attach(struct mcd_softc *sc) sc->mcd_dev_t->si_drv1 = (void *)sc; callout_init_mtx(&sc->timer, &sc->mtx, 0); + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/dev/scd/scd.c ============================================================================== --- releng/11.1/sys/dev/scd/scd.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/scd/scd.c Thu Jul 13 17:05:57 2017 (r320954) @@ -174,6 +174,8 @@ scd_attach(struct scd_softc *sc) sc->scd_dev_t = make_dev(&scd_cdevsw, 8 * unit, UID_ROOT, GID_OPERATOR, 0640, "scd%d", unit); sc->scd_dev_t->si_drv1 = (void *)sc; + device_printf(sc->dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/dev/si/si.c ============================================================================== --- releng/11.1/sys/dev/si/si.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/si/si.c Thu Jul 13 17:05:57 2017 (r320954) @@ -604,6 +604,8 @@ try_next2: if (unit == 0) make_dev(&si_Scdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "si_control"); + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/dev/wl/if_wl.c ============================================================================== --- releng/11.1/sys/dev/wl/if_wl.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/dev/wl/if_wl.c Thu Jul 13 17:05:57 2017 (r320954) @@ -564,6 +564,8 @@ wlattach(device_t device) if (bootverbose) wldump(sc); + device_printf(device, + "WARNING: This driver is deprecated and will be removed.\n"); return (0); } Modified: releng/11.1/sys/i386/isa/spic.c ============================================================================== --- releng/11.1/sys/i386/isa/spic.c Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/sys/i386/isa/spic.c Thu Jul 13 17:05:57 2017 (r320954) @@ -350,6 +350,8 @@ spic_attach(device_t dev) /* There can be only one */ sc->sc_cdev = make_dev(&spic_cdevsw, 0, 0, 0, 0600, "jogdial"); sc->sc_cdev->si_drv1 = sc; + device_printf(dev, + "WARNING: This driver is deprecated and will be removed.\n"); return 0; } Modified: releng/11.1/usr.sbin/sicontrol/sicontrol.8 ============================================================================== --- releng/11.1/usr.sbin/sicontrol/sicontrol.8 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/usr.sbin/sicontrol/sicontrol.8 Thu Jul 13 17:05:57 2017 (r320954) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd September 26, 1995 +.Dd July 8, 2017 .Dt SICONTROL 8 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm device .Ar command Op Ar param ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.1/usr.sbin/wlconfig/wlconfig.8 ============================================================================== --- releng/11.1/usr.sbin/wlconfig/wlconfig.8 Thu Jul 13 16:56:26 2017 (r320953) +++ releng/11.1/usr.sbin/wlconfig/wlconfig.8 Thu Jul 13 17:05:57 2017 (r320954) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd December 26, 1996 +.Dd July 8, 2017 .Dt WLCONFIG 8 i386 .Os .Sh NAME @@ -10,6 +10,11 @@ .Nm .Ar ifname .Op Ar param value ... +.Sh DEPRECATION NOTICE +The +.Nm +utility will be removed in +.Fx 12.0 . .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Thu Jul 13 17:37:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF9F6DA99EB; Thu, 13 Jul 2017 17:37:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id AE509812B9; Thu, 13 Jul 2017 17:37:33 +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 v6DHbWEt087003; Thu, 13 Jul 2017 17:37:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DHbWUP087002; Thu, 13 Jul 2017 17:37:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707131737.v6DHbWUP087002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 17:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320955 - releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 320955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 17:37:34 -0000 Author: gjb Date: Thu Jul 13 17:37:32 2017 New Revision: 320955 URL: https://svnweb.freebsd.org/changeset/base/320955 Log: Document r320954, deprecation of digi(4), ie(4), mcd(4), scd(4), si(4), spic(4), wl(4), sicontrol(8), and wlconfig(8). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 13 17:05:57 2017 (r320954) +++ releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jul 13 17:37:32 2017 (r320955) @@ -638,6 +638,13 @@ sponsor="&chelsio;">&man.devctl.8; now supports a "clear driver" command as a complement to "set driver". + + The &man.digi.4;, &man.ie.4;, + &man.mcd.4;, &man.scd.4;, &man.si.4;, &man.spic.4;, and + &man.wl.4; drivers have been marked as deprecated, and removed + in &os; 12.0. The associated &man.sicontrol.8; and + &man.wlconfig.8; utilities have been deprecated, as + well. From owner-svn-src-all@freebsd.org Thu Jul 13 18:27:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42A8EDAAF04; Thu, 13 Jul 2017 18:27:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0C11A84117; Thu, 13 Jul 2017 18:27:23 +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 v6DIRNSE010894; Thu, 13 Jul 2017 18:27:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DIRNpE010893; Thu, 13 Jul 2017 18:27:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707131827.v6DIRNpE010893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 13 Jul 2017 18:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320956 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 320956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 18:27:24 -0000 Author: markj Date: Thu Jul 13 18:27:22 2017 New Revision: 320956 URL: https://svnweb.freebsd.org/changeset/base/320956 Log: Add some functions to jiffies.h. Also add some checks for overflow to existing functions. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11533 Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Jul 13 17:37:32 2017 (r320955) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Jul 13 18:27:22 2017 (r320956) @@ -68,11 +68,14 @@ timespec_to_jiffies(const struct timespec *ts) } static inline int -msecs_to_jiffies(const u64 msec) +msecs_to_jiffies(uint64_t msec) { - u64 result; + uint64_t msec_max, result; - result = howmany(msec * (u64)hz, 1000ULL); + msec_max = -1ULL / (uint64_t)hz; + if (msec > msec_max) + msec = msec_max; + result = howmany(msec * (uint64_t)hz, 1000ULL); if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; @@ -80,27 +83,61 @@ msecs_to_jiffies(const u64 msec) } static inline int -usecs_to_jiffies(const u64 u) +usecs_to_jiffies(uint64_t usec) { - u64 result; + uint64_t usec_max, result; - result = howmany(u * (u64)hz, 1000000ULL); + usec_max = -1ULL / (uint64_t)hz; + if (usec > usec_max) + usec = usec_max; + result = howmany(usec * (uint64_t)hz, 1000000ULL); if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; return ((int)result); } -static inline u64 -nsecs_to_jiffies(const u64 n) +static inline uint64_t +nsecs_to_jiffies64(uint64_t nsec) { + uint64_t nsec_max, result; + + nsec_max = -1ULL / (uint64_t)hz; + if (nsec > nsec_max) + nsec = nsec_max; + result = howmany(nsec * (uint64_t)hz, 1000000000ULL); + if (result > MAX_JIFFY_OFFSET) + result = MAX_JIFFY_OFFSET; + + return (result); +} + +static inline uint64_t +nsecs_to_jiffies(uint64_t n) +{ + return (usecs_to_jiffies(howmany(n, 1000ULL))); } -static inline u64 +static inline uint64_t +jiffies_to_nsecs(int j) +{ + + return ((1000000000ULL / hz) * (uint64_t)(unsigned int)j); +} + +static inline uint64_t +jiffies_to_usecs(int j) +{ + + return ((1000000ULL / hz) * (uint64_t)(unsigned int)j); +} + +static inline uint64_t get_jiffies_64(void) { - return ((u64)(unsigned)ticks); + + return ((uint64_t)(unsigned int)ticks); } static inline int From owner-svn-src-all@freebsd.org Thu Jul 13 19:17:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B3DDABD9F; Thu, 13 Jul 2017 19:17:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA14B85DEE; Thu, 13 Jul 2017 19:17:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v6DJBVQJ090067; Thu, 13 Jul 2017 12:11:31 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v6DJBTMC090066; Thu, 13 Jul 2017 12:11:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707131911.v6DJBTMC090066@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320803 - head/sbin/mount In-Reply-To: <5242112.0aHCQARnit@ralph.baldwin.cx> To: John Baldwin Date: Thu, 13 Jul 2017 12:11:29 -0700 (PDT) CC: Ian Lepore , Edward Tomasz Napierala , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:17:44 -0000 > On Tuesday, July 11, 2017 02:35:15 PM Ian Lepore wrote: > > I think the docs on this are pretty clear... under -u it says: > > > > The set of options is determined by applying the options specified > > in the argument to -o and finally applying the -r or -w option. > > > > To me, that says that nothing in /etc/fstab is germane to mount -u > > unless one of the other args to mount -u is -o fstab. > > > > This change (r320803) seems like an acceptable workaround, but I think > > the correct long term fix would be to not even open /etc/fstab on mount > > -u without -o fstab. But that may be harder to do than to say; I still > > haven't actually looked at the code involved. > > I concur with this. I've always viewed '-u' as meaning "apply a delta > to the current configuration", not "add this delta to the fstab options > and then apply that entire set of options". In practice, it seems that > it doesn't do either of those, but instead it seems to treats the options > passed to -o as the entire list of options. This is perhaps a bit > surprising. > > For example, suppose you had this: > > /etc/fstab: > > /dev/md0 /bar ufs ro,noauto,noexec 0 0 ... To shed some light on all of this I did the dig to find the original documentaton on mount -u, which actually makes it rather clear what and how things should be happening. Somehow this has been lost over the years: csrg change to mount.c adding -u https://svnweb.freebsd.org/csrg/sbin/mount/mount.c?r1=39329&r2=39333 csrg change to mount.8 documenting -u https://svnweb.freebsd.org/csrg/sbin/mount/mount.8?r1=39328&r2=39466 This documenting of -u clearly states that /etc/fstab shall be consulted during a mount -u, some place we lost that. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B75BEDAC185; Thu, 13 Jul 2017 19:25:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03C4E393; Thu, 13 Jul 2017 19:25:23 +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 v6DJPNLu036364; Thu, 13 Jul 2017 19:25:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPJXw036330; Thu, 13 Jul 2017 19:25:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPJXw036330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320957 - in vendor/llvm/dist: . cmake/modules docs docs/CommandGuide docs/tutorial examples/Kaleidoscope/BuildingAJIT/Chapter1 examples/Kaleidoscope/BuildingAJIT/Chapter2 examples/Kale... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: . cmake/modules docs docs/CommandGuide docs/tutorial examples/Kaleidoscope/BuildingAJIT/Chapter1 examples/Kaleidoscope/BuildingAJIT/Chapter2 examples/Kaleidoscope/BuildingAJIT/Cha... X-SVN-Commit-Revision: 320957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:24 -0000 Author: dim Date: Thu Jul 13 19:25:18 2017 New Revision: 320957 URL: https://svnweb.freebsd.org/changeset/base/320957 Log: Vendor import of llvm trunk r307894: https://llvm.org/svn/llvm-project/llvm/trunk@307894 Added: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h (contents, props changed) vendor/llvm/dist/include/llvm/IR/SafepointIRVerifier.h (contents, props changed) vendor/llvm/dist/include/llvm/Support/ReverseIteration.h (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeBuiltinSymbol.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/ShrinkControlFlowSimpleTest.cpp (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/reduce_inputs.test vendor/llvm/dist/lib/IR/SafepointIRVerifier.cpp (contents, props changed) vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp (contents, props changed) vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUMacroFusion.h (contents, props changed) vendor/llvm/dist/lib/Target/Mips/MipsMTInstrFormats.td vendor/llvm/dist/lib/Target/Mips/MipsMTInstrInfo.td vendor/llvm/dist/test/Analysis/DependenceAnalysis/BasePtrBug.ll vendor/llvm/dist/test/Bitcode/Inputs/module-hash-strtab1.ll vendor/llvm/dist/test/Bitcode/Inputs/module-hash-strtab2.ll vendor/llvm/dist/test/Bitcode/atomic-no-syncscope.ll vendor/llvm/dist/test/Bitcode/atomic-no-syncscope.ll.bc (contents, props changed) vendor/llvm/dist/test/Bitcode/module-hash-strtab.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-implicit-def.mir vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-intrinsic-aarch64-sdiv.mir vendor/llvm/dist/test/CodeGen/AArch64/preferred-function-alignment.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize-elimination.ll vendor/llvm/dist/test/CodeGen/AMDGPU/global-smrd-unknown.ll vendor/llvm/dist/test/CodeGen/AMDGPU/macro-fusion-cluster-vcc-uses.mir vendor/llvm/dist/test/CodeGen/AMDGPU/regcoal-subrange-join.mir vendor/llvm/dist/test/CodeGen/AMDGPU/syncscopes.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vop-shrink-frame-index.mir vendor/llvm/dist/test/CodeGen/AMDGPU/vop-shrink-non-ssa.mir vendor/llvm/dist/test/CodeGen/ARM/ror.ll vendor/llvm/dist/test/CodeGen/ARM/scavenging.mir vendor/llvm/dist/test/CodeGen/AVR/branch-relaxation.ll vendor/llvm/dist/test/CodeGen/AVR/frmidx-iterator-bug.ll vendor/llvm/dist/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll vendor/llvm/dist/test/CodeGen/Generic/pr33094.ll vendor/llvm/dist/test/CodeGen/Hexagon/hasfp-crash1.ll vendor/llvm/dist/test/CodeGen/Hexagon/hasfp-crash2.ll vendor/llvm/dist/test/CodeGen/Hexagon/hvx-nontemporal.ll vendor/llvm/dist/test/CodeGen/Hexagon/target-flag-ext.mir vendor/llvm/dist/test/CodeGen/MIR/AArch64/invalid-target-memoperands.mir vendor/llvm/dist/test/CodeGen/MIR/AArch64/target-memoperands.mir vendor/llvm/dist/test/CodeGen/MIR/AMDGPU/syncscopes.mir vendor/llvm/dist/test/CodeGen/MIR/AMDGPU/target-flags.mir vendor/llvm/dist/test/CodeGen/MIR/Hexagon/target-flags.mir vendor/llvm/dist/test/CodeGen/MIR/X86/tied-physical-regs-match.mir vendor/llvm/dist/test/CodeGen/PowerPC/PR33636.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc-ctr-dead-code.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc-redzone-alignment-bug.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr33093.ll vendor/llvm/dist/test/CodeGen/PowerPC/select-addrRegRegOnly.ll vendor/llvm/dist/test/CodeGen/PowerPC/testBitReverse.ll vendor/llvm/dist/test/CodeGen/PowerPC/vec_extract_p9.ll vendor/llvm/dist/test/CodeGen/SystemZ/regalloc-fast-invalid-kill-flag.mir vendor/llvm/dist/test/CodeGen/WebAssembly/umulo-i64.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/GV.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-GV.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-memop-scalar.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-GV.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-unmerge-vec256.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-unmerge-vec512.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-512.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-sext.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-512.ll vendor/llvm/dist/test/CodeGen/X86/combine-rotates.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-gc-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/fastisel-softfloat.ll vendor/llvm/dist/test/CodeGen/X86/pr33715.ll vendor/llvm/dist/test/CodeGen/X86/rdrand-x86_64.ll vendor/llvm/dist/test/CodeGen/X86/rdseed-x86_64.ll vendor/llvm/dist/test/CodeGen/X86/sink-gep-before-mem-inst.ll vendor/llvm/dist/test/CodeGen/X86/soft-fp-legal-in-HW-reg.ll vendor/llvm/dist/test/CodeGen/X86/sse4a-schedule.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-combining-sse4a.ll vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-str-offsets-macho.o (contents, props changed) vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-str-offsets-macho.s (contents, props changed) vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-test3.elf-x86-64-space (contents, props changed) vendor/llvm/dist/test/DebugInfo/PDB/Inputs/every-type.cpp (contents, props changed) vendor/llvm/dist/test/DebugInfo/PDB/Inputs/every-type.pdb (contents, props changed) vendor/llvm/dist/test/DebugInfo/PDB/Inputs/every-type.yaml vendor/llvm/dist/test/DebugInfo/PDB/every-type.test vendor/llvm/dist/test/DebugInfo/invalid-relocations.test vendor/llvm/dist/test/Instrumentation/MemorySanitizer/unsized_type.ll vendor/llvm/dist/test/LTO/Resolution/X86/linker-redef-thin.ll vendor/llvm/dist/test/Linker/Inputs/syncscope-1.ll vendor/llvm/dist/test/Linker/Inputs/syncscope-2.ll vendor/llvm/dist/test/Linker/Inputs/thumb-module-inline-asm.ll vendor/llvm/dist/test/Linker/link-arm-and-thumb-module-inline-asm.ll vendor/llvm/dist/test/Linker/syncscopes.ll vendor/llvm/dist/test/MC/ARM/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/Mips/mt/ vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2-el.txt (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2.txt (contents, props changed) vendor/llvm/dist/test/MC/Mips/addend.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/ vendor/llvm/dist/test/MC/Mips/mt/abiflag.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/invalid-wrong-error.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/invalid.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-reserved-valid.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/module-directive-invalid.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/module-directive.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/set-directive.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/mt/valid.s (contents, props changed) vendor/llvm/dist/test/MC/WebAssembly/array-fill.ll vendor/llvm/dist/test/Object/Inputs/trivial-object-test.wasm (contents, props changed) vendor/llvm/dist/test/SafepointIRVerifier/ vendor/llvm/dist/test/SafepointIRVerifier/basic-use-after-reloc.ll vendor/llvm/dist/test/SafepointIRVerifier/compares.ll vendor/llvm/dist/test/SafepointIRVerifier/constant-bases.ll vendor/llvm/dist/test/SafepointIRVerifier/unrecorded-live-at-sp.ll vendor/llvm/dist/test/SafepointIRVerifier/uses-in-phi-nodes.ll vendor/llvm/dist/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/crash-on-large-allocas.ll vendor/llvm/dist/test/Transforms/ConstantHoisting/ARM/insertvalue.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/canonicalize-cmp.ll vendor/llvm/dist/test/Transforms/Inline/ARM/ vendor/llvm/dist/test/Transforms/Inline/ARM/inline-target-attr.ll vendor/llvm/dist/test/Transforms/Inline/ARM/lit.local.cfg vendor/llvm/dist/test/Transforms/InstCombine/2017-07-07-UMul-ZExt.ll vendor/llvm/dist/test/Transforms/InstCombine/cmp-intrinsic.ll vendor/llvm/dist/test/Transforms/InstCombine/pr33689_same_bitwidth.ll vendor/llvm/dist/test/Transforms/LoopRotate/pr33701.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/X86/lsr-filtering-scaledreg.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/slm-no-vectorize.ll vendor/llvm/dist/test/Transforms/LoopVectorize/pr33706.ll vendor/llvm/dist/test/Transforms/NewGVN/pr33720.ll vendor/llvm/dist/test/Transforms/PGOProfile/counter_promo_nest.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/implied-and-or.ll vendor/llvm/dist/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll vendor/llvm/dist/test/tools/llvm-cov/threads.c (contents, props changed) vendor/llvm/dist/test/tools/llvm-objdump/ARM/Inputs/reloc-half.obj.macho-arm (contents, props changed) vendor/llvm/dist/test/tools/llvm-objdump/ARM/macho-reloc-half.test vendor/llvm/dist/test/tools/llvm-objdump/Inputs/trivial.ll vendor/llvm/dist/test/tools/llvm-objdump/Inputs/trivial.obj.wasm (contents, props changed) vendor/llvm/dist/test/tools/sanstats/Inputs/ vendor/llvm/dist/tools/llvm-pdbutil/DiffPrinter.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbutil/DiffPrinter.h (contents, props changed) vendor/llvm/dist/tools/opt-viewer/ vendor/llvm/dist/tools/opt-viewer/CMakeLists.txt (contents, props changed) vendor/llvm/dist/tools/opt-viewer/opt-diff.py (contents, props changed) vendor/llvm/dist/tools/opt-viewer/opt-stats.py (contents, props changed) vendor/llvm/dist/tools/opt-viewer/opt-viewer.py (contents, props changed) vendor/llvm/dist/tools/opt-viewer/optpmap.py (contents, props changed) vendor/llvm/dist/tools/opt-viewer/optrecord.py (contents, props changed) vendor/llvm/dist/tools/opt-viewer/style.css (contents, props changed) vendor/llvm/dist/unittests/IR/PassBuilderCallbacksTest.cpp (contents, props changed) Deleted: vendor/llvm/dist/docs/Dummy.html vendor/llvm/dist/test/CodeGen/PowerPC/bitreverse.ll vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-test3.elf-x86-64 space vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate-2.ll vendor/llvm/dist/test/tools/llvm-objdump/Inputs/test.wasm vendor/llvm/dist/utils/opt-viewer/opt-diff.py vendor/llvm/dist/utils/opt-viewer/opt-stats.py vendor/llvm/dist/utils/opt-viewer/opt-viewer.py vendor/llvm/dist/utils/opt-viewer/optpmap.py vendor/llvm/dist/utils/opt-viewer/optrecord.py vendor/llvm/dist/utils/opt-viewer/style.css Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake vendor/llvm/dist/cmake/modules/LLVMExternalProjectUtils.cmake vendor/llvm/dist/docs/AMDGPUUsage.rst vendor/llvm/dist/docs/CMake.rst vendor/llvm/dist/docs/CMakePrimer.rst vendor/llvm/dist/docs/CommandGuide/lit.rst vendor/llvm/dist/docs/CommandGuide/llvm-cov.rst vendor/llvm/dist/docs/CommandGuide/llvm-profdata.rst vendor/llvm/dist/docs/Coroutines.rst vendor/llvm/dist/docs/Docker.rst vendor/llvm/dist/docs/HowToAddABuilder.rst vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/LibFuzzer.rst vendor/llvm/dist/docs/tutorial/BuildingAJIT1.rst vendor/llvm/dist/docs/tutorial/BuildingAJIT2.rst vendor/llvm/dist/docs/tutorial/LangImpl02.rst vendor/llvm/dist/docs/tutorial/LangImpl03.rst vendor/llvm/dist/docs/tutorial/LangImpl04.rst vendor/llvm/dist/docs/tutorial/LangImpl05.rst vendor/llvm/dist/docs/tutorial/LangImpl06.rst vendor/llvm/dist/docs/tutorial/OCamlLangImpl5.rst vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter4/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter5/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter6/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter7/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/include/KaleidoscopeJIT.h vendor/llvm/dist/include/llvm-c/OrcBindings.h vendor/llvm/dist/include/llvm/ADT/APInt.h vendor/llvm/dist/include/llvm/ADT/STLExtras.h vendor/llvm/dist/include/llvm/ADT/SmallPtrSet.h vendor/llvm/dist/include/llvm/Analysis/BlockFrequencyInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h vendor/llvm/dist/include/llvm/Analysis/InlineCost.h vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h vendor/llvm/dist/include/llvm/Analysis/RegionInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/BinaryFormat/Wasm.h vendor/llvm/dist/include/llvm/Bitcode/LLVMBitCodes.h vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h vendor/llvm/dist/include/llvm/CodeGen/LiveRegUnits.h vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h vendor/llvm/dist/include/llvm/CodeGen/MachineMemOperand.h vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.h vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeIndex.h vendor/llvm/dist/include/llvm/DebugInfo/DIContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeSession.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PublicsStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawTypes.h vendor/llvm/dist/include/llvm/ExecutionEngine/JITSymbol.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/GlobalMappingLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/LambdaResolver.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcError.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/RuntimeDyld.h vendor/llvm/dist/include/llvm/IR/Constants.h vendor/llvm/dist/include/llvm/IR/IRBuilder.h vendor/llvm/dist/include/llvm/IR/Instructions.h vendor/llvm/dist/include/llvm/IR/IntrinsicInst.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/LLVMContext.h vendor/llvm/dist/include/llvm/IR/Module.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/PassManager.h vendor/llvm/dist/include/llvm/IR/PatternMatch.h vendor/llvm/dist/include/llvm/IR/Type.h vendor/llvm/dist/include/llvm/InitializePasses.h vendor/llvm/dist/include/llvm/MC/MCAsmBackend.h vendor/llvm/dist/include/llvm/MC/MCDisassembler/MCDisassembler.h vendor/llvm/dist/include/llvm/MC/MCMachObjectWriter.h vendor/llvm/dist/include/llvm/MC/MCObjectWriter.h vendor/llvm/dist/include/llvm/MC/MCSymbolWasm.h vendor/llvm/dist/include/llvm/Object/COFF.h vendor/llvm/dist/include/llvm/Object/Wasm.h vendor/llvm/dist/include/llvm/ObjectYAML/WasmYAML.h vendor/llvm/dist/include/llvm/Option/OptTable.h vendor/llvm/dist/include/llvm/Passes/PassBuilder.h vendor/llvm/dist/include/llvm/ProfileData/InstrProf.h vendor/llvm/dist/include/llvm/ProfileData/InstrProfReader.h vendor/llvm/dist/include/llvm/ProfileData/InstrProfWriter.h vendor/llvm/dist/include/llvm/ProfileData/ProfileCommon.h vendor/llvm/dist/include/llvm/Support/BlockFrequency.h vendor/llvm/dist/include/llvm/Support/Compiler.h vendor/llvm/dist/include/llvm/Support/DynamicLibrary.h vendor/llvm/dist/include/llvm/Support/ErrorHandling.h vendor/llvm/dist/include/llvm/Support/GenericDomTreeConstruction.h vendor/llvm/dist/include/llvm/Support/UnicodeCharRanges.h vendor/llvm/dist/include/llvm/Target/GlobalISel/SelectionDAGCompat.td vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Transforms/Scalar/GVN.h vendor/llvm/dist/include/llvm/Transforms/Utils/LowerMemIntrinsics.h vendor/llvm/dist/include/llvm/Transforms/Utils/SSAUpdaterImpl.h vendor/llvm/dist/include/llvm/module.modulemap vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp vendor/llvm/dist/lib/Analysis/CGSCCPassManager.cpp vendor/llvm/dist/lib/Analysis/CaptureTracking.cpp vendor/llvm/dist/lib/Analysis/DemandedBits.cpp vendor/llvm/dist/lib/Analysis/DependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LazyCallGraph.cpp vendor/llvm/dist/lib/Analysis/Lint.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Analysis/VectorUtils.cpp vendor/llvm/dist/lib/AsmParser/LLLexer.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/AsmParser/LLParser.h vendor/llvm/dist/lib/AsmParser/LLToken.h vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AtomicExpandPass.cpp vendor/llvm/dist/lib/CodeGen/CodeGen.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/InstructionSelector.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp vendor/llvm/dist/lib/CodeGen/LiveRegUnits.cpp vendor/llvm/dist/lib/CodeGen/MIRParser/MILexer.cpp vendor/llvm/dist/lib/CodeGen/MIRParser/MILexer.h vendor/llvm/dist/lib/CodeGen/MIRParser/MIParser.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MachineBlockPlacement.cpp vendor/llvm/dist/lib/CodeGen/MachineFunction.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/MacroFusion.cpp vendor/llvm/dist/lib/CodeGen/PostRAHazardRecognizer.cpp vendor/llvm/dist/lib/CodeGen/RegAllocFast.cpp vendor/llvm/dist/lib/CodeGen/RegAllocGreedy.cpp vendor/llvm/dist/lib/CodeGen/RegAllocPBQP.cpp vendor/llvm/dist/lib/CodeGen/RegisterCoalescer.cpp vendor/llvm/dist/lib/CodeGen/RegisterScavenging.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAG.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAGInstrs.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/InstrEmitter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SjLjEHPrepare.cpp vendor/llvm/dist/lib/CodeGen/SplitKit.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDie.cpp vendor/llvm/dist/lib/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeSession.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFile.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBStringTable.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PublicsStream.cpp vendor/llvm/dist/lib/ExecutionEngine/MCJIT/MCJIT.cpp vendor/llvm/dist/lib/ExecutionEngine/Orc/OrcCBindings.cpp vendor/llvm/dist/lib/ExecutionEngine/Orc/OrcCBindingsStack.h vendor/llvm/dist/lib/ExecutionEngine/Orc/OrcError.cpp vendor/llvm/dist/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp vendor/llvm/dist/lib/Fuzzer/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/FuzzerCorpus.h vendor/llvm/dist/lib/Fuzzer/FuzzerDriver.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerFlags.def vendor/llvm/dist/lib/Fuzzer/FuzzerIOWindows.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerOptions.h vendor/llvm/dist/lib/Fuzzer/FuzzerUtilDarwin.cpp vendor/llvm/dist/lib/Fuzzer/test/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/test/FuzzerUnittest.cpp vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/CMakeLists.txt vendor/llvm/dist/lib/IR/ConstantFold.cpp vendor/llvm/dist/lib/IR/Constants.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/IR/Instruction.cpp vendor/llvm/dist/lib/IR/Instructions.cpp vendor/llvm/dist/lib/IR/LLVMContext.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.h vendor/llvm/dist/lib/IR/Module.cpp vendor/llvm/dist/lib/IR/Type.cpp vendor/llvm/dist/lib/IR/Verifier.cpp vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/Linker/IRMover.cpp vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp vendor/llvm/dist/lib/MC/MCAssembler.cpp vendor/llvm/dist/lib/MC/MachObjectWriter.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp vendor/llvm/dist/lib/Object/WasmObjectFile.cpp vendor/llvm/dist/lib/Object/WindowsResource.cpp vendor/llvm/dist/lib/ObjectYAML/WasmYAML.cpp vendor/llvm/dist/lib/Option/OptTable.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/ProfileData/InstrProf.cpp vendor/llvm/dist/lib/ProfileData/InstrProfReader.cpp vendor/llvm/dist/lib/ProfileData/InstrProfWriter.cpp vendor/llvm/dist/lib/Support/CommandLine.cpp vendor/llvm/dist/lib/Support/DynamicLibrary.cpp vendor/llvm/dist/lib/Support/ErrorHandling.cpp vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/Mutex.cpp vendor/llvm/dist/lib/Support/Unix/DynamicLibrary.inc vendor/llvm/dist/lib/Support/Unix/Host.inc vendor/llvm/dist/lib/Support/Unix/Program.inc vendor/llvm/dist/lib/Support/Windows/DynamicLibrary.inc vendor/llvm/dist/lib/Support/Windows/Host.inc vendor/llvm/dist/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64CondBrTuning.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.td vendor/llvm/dist/lib/Target/AArch64/AArch64InstructionSelector.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64LegalizerInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/CMakeLists.txt vendor/llvm/dist/lib/Target/AMDGPU/GCNIterativeScheduler.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNMinRegStrategy.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNRegPressure.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNSchedStrategy.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNSchedStrategy.h vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp vendor/llvm/dist/lib/Target/AMDGPU/MIMGInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/R600MachineScheduler.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIMachineScheduler.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIShrinkInstructions.cpp vendor/llvm/dist/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/VOP3PInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPInstructions.td vendor/llvm/dist/lib/Target/ARM/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.h vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h vendor/llvm/dist/lib/Target/ARM/Thumb1FrameLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRAsmPrinter.cpp vendor/llvm/dist/lib/Target/AVR/AVRDevices.td vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.cpp vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.h vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.td vendor/llvm/dist/lib/Target/AVR/AVRMCInstLower.cpp vendor/llvm/dist/lib/Target/AVR/AVRRegisterInfo.cpp vendor/llvm/dist/lib/Target/AVR/AVRRegisterInfo.td vendor/llvm/dist/lib/Target/AVR/AVRTargetMachine.cpp vendor/llvm/dist/lib/Target/AVR/AsmParser/AVRAsmParser.cpp vendor/llvm/dist/lib/Target/AVR/InstPrinter/AVRInstPrinter.cpp vendor/llvm/dist/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp vendor/llvm/dist/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonBitSimplify.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonBitTracker.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonConstPropagation.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonFrameLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonGenPredicate.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.h vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.h vendor/llvm/dist/lib/Target/Hexagon/HexagonMachineScheduler.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonPseudo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonSplitDouble.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetMachine.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp vendor/llvm/dist/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp vendor/llvm/dist/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp vendor/llvm/dist/lib/Target/Mips/AsmParser/MipsAsmParser.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp vendor/llvm/dist/lib/Target/Mips/Mips.td vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.td vendor/llvm/dist/lib/Target/Mips/MipsSchedule.td vendor/llvm/dist/lib/Target/Mips/MipsScheduleGeneric.td vendor/llvm/dist/lib/Target/Mips/MipsScheduleP5600.td vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.cpp vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/Mips/MipsTargetStreamer.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXISelLowering.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCCTRLoops.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCFrameLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCScheduleP9.td vendor/llvm/dist/lib/Target/PowerPC/PPCSubtarget.h vendor/llvm/dist/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp vendor/llvm/dist/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp vendor/llvm/dist/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp vendor/llvm/dist/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZHazardRecognizer.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.h vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZLDCleanup.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZMachineScheduler.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZOperators.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ13.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ196.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZEC12.td vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp vendor/llvm/dist/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp vendor/llvm/dist/lib/Target/X86/AsmParser/X86AsmParser.cpp vendor/llvm/dist/lib/Target/X86/InstPrinter/X86InstComments.cpp vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp vendor/llvm/dist/lib/Target/X86/Utils/X86ShuffleDecode.cpp vendor/llvm/dist/lib/Target/X86/Utils/X86ShuffleDecode.h vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86CallLowering.cpp vendor/llvm/dist/lib/Target/X86/X86CallLowering.h vendor/llvm/dist/lib/Target/X86/X86CallingConv.td vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp vendor/llvm/dist/lib/Target/X86/X86FrameLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstructionSelector.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.cpp vendor/llvm/dist/lib/Target/X86/X86MCInstLower.cpp vendor/llvm/dist/lib/Target/X86/X86SchedSandyBridge.td vendor/llvm/dist/lib/Target/X86/X86ScheduleBtVer2.td vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Transforms/IPO/ArgumentPromotion.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionImport.cpp vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/Inliner.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAddSub.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCasts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombinePHI.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSelect.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineShifts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/CFGMST.h vendor/llvm/dist/lib/Transforms/Instrumentation/InstrProfiling.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MaximumSpanningTree.h vendor/llvm/dist/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/PGOInstrumentation.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/ThreadSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/ConstantHoisting.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/InferAddressSpaces.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopDeletion.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInterchange.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopRotation.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/Reassociate.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Scalar/SROA.cpp vendor/llvm/dist/lib/Transforms/Scalar/StructurizeCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/CloneFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/CmpInstAnalysis.cpp vendor/llvm/dist/lib/Transforms/Utils/CodeExtractor.cpp vendor/llvm/dist/lib/Transforms/Utils/Evaluator.cpp vendor/llvm/dist/lib/Transforms/Utils/FunctionComparator.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollRuntime.cpp vendor/llvm/dist/lib/Transforms/Utils/LowerMemIntrinsics.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyIndVar.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/VNCoercion.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist/runtimes/CMakeLists.txt vendor/llvm/dist/runtimes/Components.cmake.in vendor/llvm/dist/test/Analysis/BasicAA/unreachable-block.ll vendor/llvm/dist/test/Analysis/CostModel/X86/slm-arith-costs.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/guards.ll vendor/llvm/dist/test/Assembler/2003-11-11-ImplicitRename.ll vendor/llvm/dist/test/Assembler/2007-11-26-AttributeOverload.ll vendor/llvm/dist/test/Assembler/atomic.ll vendor/llvm/dist/test/Bitcode/atomic.ll vendor/llvm/dist/test/Bitcode/compatibility-3.6.ll vendor/llvm/dist/test/Bitcode/compatibility-3.7.ll vendor/llvm/dist/test/Bitcode/compatibility-3.8.ll vendor/llvm/dist/test/Bitcode/compatibility-3.9.ll vendor/llvm/dist/test/Bitcode/compatibility-4.0.ll vendor/llvm/dist/test/Bitcode/compatibility.ll vendor/llvm/dist/test/Bitcode/memInstructions.3.2.ll vendor/llvm/dist/test/Bitcode/module_hash.ll vendor/llvm/dist/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll vendor/llvm/dist/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-csldst-mmo.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-forwarding-A53.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-memdep-bug.ll vendor/llvm/dist/test/CodeGen/AArch64/fence-singlethread.ll vendor/llvm/dist/test/CodeGen/AArch64/tailcall_misched_graph.ll vendor/llvm/dist/test/CodeGen/AMDGPU/add.i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/add.ll vendor/llvm/dist/test/CodeGen/AMDGPU/add.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/add_i128.ll vendor/llvm/dist/test/CodeGen/AMDGPU/add_i64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/addrspacecast.ll vendor/llvm/dist/test/CodeGen/AMDGPU/alignbit-pat.ll vendor/llvm/dist/test/CodeGen/AMDGPU/amdgpu-codegenprepare-fdiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/and-gcn.ll vendor/llvm/dist/test/CodeGen/AMDGPU/and.ll vendor/llvm/dist/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/bitreverse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/bswap.ll vendor/llvm/dist/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll vendor/llvm/dist/test/CodeGen/AMDGPU/cgp-addressing-modes.ll vendor/llvm/dist/test/CodeGen/AMDGPU/clamp-omod-special-case.mir vendor/llvm/dist/test/CodeGen/AMDGPU/coalescer_remat.ll vendor/llvm/dist/test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir vendor/llvm/dist/test/CodeGen/AMDGPU/constant-fold-mi-operands.ll vendor/llvm/dist/test/CodeGen/AMDGPU/copy-illegal-type.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ctlz.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ctlz_zero_undef.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ctpop.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ctpop64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/cttz_zero_undef.ll vendor/llvm/dist/test/CodeGen/AMDGPU/cvt_f32_ubyte.ll vendor/llvm/dist/test/CodeGen/AMDGPU/detect-dead-lanes.mir vendor/llvm/dist/test/CodeGen/AMDGPU/ds_read2.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ds_read2_superreg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ds_read2st64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/early-if-convert-cost.ll vendor/llvm/dist/test/CodeGen/AMDGPU/early-if-convert.ll vendor/llvm/dist/test/CodeGen/AMDGPU/enable-no-signed-zeros-fp-math.ll vendor/llvm/dist/test/CodeGen/AMDGPU/extractelt-to-trunc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fabs.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fadd-fma-fmul-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fadd.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fadd64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcmp.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcmp64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fconst64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcopysign.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fdiv.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fdiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fma-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fma.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fma.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmax_legacy.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmed3.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmin_legacy.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmul.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmul64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmuladd.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmuladd.f32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmuladd.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmuladd.v2f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-combines.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-fabs.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-fabs.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fold-immediate-output-mods.mir vendor/llvm/dist/test/CodeGen/AMDGPU/fold-operands-order.mir vendor/llvm/dist/test/CodeGen/AMDGPU/fp32_to_fp16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fpext.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fptosi.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fptoui.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fptrunc.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fract.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fract.ll vendor/llvm/dist/test/CodeGen/AMDGPU/frem.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsqrt.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsqrt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsub.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsub.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsub64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ftrunc.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/global-extload-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/half.ll vendor/llvm/dist/test/CodeGen/AMDGPU/imm.ll vendor/llvm/dist/test/CodeGen/AMDGPU/immv216.ll vendor/llvm/dist/test/CodeGen/AMDGPU/indirect-addressing-si.ll vendor/llvm/dist/test/CodeGen/AMDGPU/inline-asm.ll vendor/llvm/dist/test/CodeGen/AMDGPU/invariant-load-no-alias-store.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.class.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.class.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.div.fmas.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ldexp.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.sbfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.sffbh.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.trig.preop.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ubfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.ceil.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.cos.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.exp2.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.floor.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.fma.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.fmuladd.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.log2.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.maxnum.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.minnum.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.rint.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.round.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.sin.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.sqrt.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.trunc.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-f32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i8.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-weird-sizes.ll vendor/llvm/dist/test/CodeGen/AMDGPU/lower-mem-intrinsics.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mad-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/madak.ll vendor/llvm/dist/test/CodeGen/AMDGPU/madmk.ll vendor/llvm/dist/test/CodeGen/AMDGPU/max.ll vendor/llvm/dist/test/CodeGen/AMDGPU/merge-stores.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mul.ll vendor/llvm/dist/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll vendor/llvm/dist/test/CodeGen/AMDGPU/no-shrink-extloads.ll vendor/llvm/dist/test/CodeGen/AMDGPU/or.ll vendor/llvm/dist/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll vendor/llvm/dist/test/CodeGen/AMDGPU/reduce-load-width-alignment.ll vendor/llvm/dist/test/CodeGen/AMDGPU/reorder-stores.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rotl.i64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rotr.i64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rsq.ll vendor/llvm/dist/test/CodeGen/AMDGPU/s_movk_i32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sad.ll vendor/llvm/dist/test/CodeGen/AMDGPU/saddo.ll vendor/llvm/dist/test/CodeGen/AMDGPU/salu-to-valu.ll vendor/llvm/dist/test/CodeGen/AMDGPU/scalar_to_vector.ll vendor/llvm/dist/test/CodeGen/AMDGPU/schedule-global-loads.ll vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-buffer.ll vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-simple.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-peephole.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select-fabs-fneg-extract.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select-vectors.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/setcc-fneg-constant.ll vendor/llvm/dist/test/CodeGen/AMDGPU/setcc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sext-in-reg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sgpr-copy-duplicate-operand.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sgpr-copy.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shift-and-i128-ubfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shift-and-i64-ubfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shift-i64-opts.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shl.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shrink-vop3-carry-out.mir vendor/llvm/dist/test/CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sign_extend.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sitofp.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sminmax.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sminmax.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/spill-cfg-position.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sra.ll vendor/llvm/dist/test/CodeGen/AMDGPU/srem.ll vendor/llvm/dist/test/CodeGen/AMDGPU/srl.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ssubo.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/trunc-bitcast-vector.ll vendor/llvm/dist/test/CodeGen/AMDGPU/trunc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/uaddo.ll vendor/llvm/dist/test/CodeGen/AMDGPU/udiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/uitofp.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/urem.ll vendor/llvm/dist/test/CodeGen/AMDGPU/usubo.ll vendor/llvm/dist/test/CodeGen/AMDGPU/v_cndmask.ll vendor/llvm/dist/test/CodeGen/AMDGPU/v_mac.ll vendor/llvm/dist/test/CodeGen/AMDGPU/v_mac_f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vectorize-global-local.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vselect.ll vendor/llvm/dist/test/CodeGen/AMDGPU/waitcnt-permute.mir vendor/llvm/dist/test/CodeGen/AMDGPU/xor.ll vendor/llvm/dist/test/CodeGen/AMDGPU/zext-i64-bit-operand.ll vendor/llvm/dist/test/CodeGen/ARM/2012-06-12-SchedMemLatency.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-instruction-select-cmp.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel-fp.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalize-divmod.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalize-fp.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir vendor/llvm/dist/test/CodeGen/ARM/arguments-nosplit-double.ll vendor/llvm/dist/test/CodeGen/ARM/arguments-nosplit-i64.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-stm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vfma.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vstm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/fence-singlethread.ll vendor/llvm/dist/test/CodeGen/AVR/ctlz.ll vendor/llvm/dist/test/CodeGen/AVR/cttz.ll vendor/llvm/dist/test/CodeGen/AVR/pseudo/ANDIWRdK.mir vendor/llvm/dist/test/CodeGen/AVR/pseudo/COMWRd.mir vendor/llvm/dist/test/CodeGen/AVR/pseudo/ORIWRdK.mir vendor/llvm/dist/test/CodeGen/AVR/pseudo/SBCIWRdK.mir vendor/llvm/dist/test/CodeGen/AVR/pseudo/SUBIWRdK.mir vendor/llvm/dist/test/CodeGen/AVR/select-mbb-placement-bug.ll vendor/llvm/dist/test/CodeGen/BPF/undef.ll vendor/llvm/dist/test/CodeGen/Hexagon/convertdptoint.ll vendor/llvm/dist/test/CodeGen/Hexagon/convertdptoll.ll vendor/llvm/dist/test/CodeGen/Hexagon/convertsptoint.ll vendor/llvm/dist/test/CodeGen/Hexagon/convertsptoll.ll vendor/llvm/dist/test/CodeGen/Hexagon/dadd.ll vendor/llvm/dist/test/CodeGen/Hexagon/dmul.ll vendor/llvm/dist/test/CodeGen/Hexagon/doubleconvert-ieee-rnd-near.ll vendor/llvm/dist/test/CodeGen/Hexagon/dsub.ll vendor/llvm/dist/test/CodeGen/Hexagon/fadd.ll vendor/llvm/dist/test/CodeGen/Hexagon/fmul.ll vendor/llvm/dist/test/CodeGen/Hexagon/fsub.ll vendor/llvm/dist/test/CodeGen/MIR/AArch64/atomic-memoperands.mir vendor/llvm/dist/test/CodeGen/MIR/AMDGPU/fold-imm-f16-f32.mir vendor/llvm/dist/test/CodeGen/MIR/Generic/runPass.mir vendor/llvm/dist/test/CodeGen/MSP430/Inst16mm.ll vendor/llvm/dist/test/CodeGen/NVPTX/lower-aggr-copies.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-regression.ll vendor/llvm/dist/test/CodeGen/PowerPC/build-vector-tests.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64le-smallarg.ll vendor/llvm/dist/test/CodeGen/PowerPC/svr4-redzone.ll vendor/llvm/dist/test/CodeGen/PowerPC/tailcall1-64.ll vendor/llvm/dist/test/CodeGen/PowerPC/vec_int_ext.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll vendor/llvm/dist/test/CodeGen/Thumb2/ifcvt-no-branch-predictor.ll vendor/llvm/dist/test/CodeGen/X86/2012-08-16-setcc.ll vendor/llvm/dist/test/CodeGen/X86/GC/badreadproto.ll vendor/llvm/dist/test/CodeGen/X86/GC/badrootproto.ll vendor/llvm/dist/test/CodeGen/X86/GC/badwriteproto.ll vendor/llvm/dist/test/CodeGen/X86/GC/fat.ll vendor/llvm/dist/test/CodeGen/X86/GC/outside.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/add-vec.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/constant.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/ext-x86-64.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/ext.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-ext.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/memop-scalar-x32.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/memop-scalar.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-X86_64.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-constant.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-ext.mir vendor/llvm/dist/test/CodeGen/X86/avg.ll vendor/llvm/dist/test/CodeGen/X86/avx-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx-load-store.ll vendor/llvm/dist/test/CodeGen/X86/avx-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx-unpack.ll vendor/llvm/dist/test/CodeGen/X86/avx-vinsertf128.ll vendor/llvm/dist/test/CodeGen/X86/avx2-vbroadcast.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512-insert-extract.ll vendor/llvm/dist/test/CodeGen/X86/avx512-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-vec-masked-cmp.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-256.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-256.ll vendor/llvm/dist/test/CodeGen/X86/block-placement.ll vendor/llvm/dist/test/CodeGen/X86/bool-simplify.ll vendor/llvm/dist/test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll vendor/llvm/dist/test/CodeGen/X86/bswap-wide-int.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-128.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-256.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-512.ll vendor/llvm/dist/test/CodeGen/X86/cast-vsel.ll vendor/llvm/dist/test/CodeGen/X86/clear_upper_vector_element_bits.ll vendor/llvm/dist/test/CodeGen/X86/cmov.ll vendor/llvm/dist/test/CodeGen/X86/code_placement_cold_loop_blocks.ll vendor/llvm/dist/test/CodeGen/X86/combine-avx-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/combine-avx2-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/combine-sse41-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/constant-hoisting-bfi.ll vendor/llvm/dist/test/CodeGen/X86/element-wise-atomic-memory-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/extract-store.ll vendor/llvm/dist/test/CodeGen/X86/extractelement-legalization-store-ordering.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-abort-warm.ll vendor/llvm/dist/test/CodeGen/X86/fp128-i128.ll vendor/llvm/dist/test/CodeGen/X86/gather-addresses.ll vendor/llvm/dist/test/CodeGen/X86/half.ll vendor/llvm/dist/test/CodeGen/X86/illegal-bitfield-loadstore.ll vendor/llvm/dist/test/CodeGen/X86/optimize-max-1.ll vendor/llvm/dist/test/CodeGen/X86/optimize-max-2.ll vendor/llvm/dist/test/CodeGen/X86/pr15309.ll vendor/llvm/dist/test/CodeGen/X86/pr23603.ll vendor/llvm/dist/test/CodeGen/X86/rdrand.ll vendor/llvm/dist/test/CodeGen/X86/rdseed.ll vendor/llvm/dist/test/CodeGen/X86/recip-fastmath.ll vendor/llvm/dist/test/CodeGen/X86/recip-fastmath2.ll vendor/llvm/dist/test/CodeGen/X86/regalloc-reconcile-broken-hints.ll vendor/llvm/dist/test/CodeGen/X86/rotate4.ll vendor/llvm/dist/test/CodeGen/X86/sbb.ll vendor/llvm/dist/test/CodeGen/X86/select_const.ll vendor/llvm/dist/test/CodeGen/X86/shift-codegen.ll vendor/llvm/dist/test/CodeGen/X86/shift-folding.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-256.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-512.ll vendor/llvm/dist/test/CodeGen/X86/sink-blockfreq.ll vendor/llvm/dist/test/CodeGen/X86/sse-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse3-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse41-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse42-schedule.ll vendor/llvm/dist/test/CodeGen/X86/ssse3-schedule.ll vendor/llvm/dist/test/CodeGen/X86/swizzle-avx2.ll vendor/llvm/dist/test/CodeGen/X86/tbm_patterns.ll vendor/llvm/dist/test/CodeGen/X86/vec-copysign.ll vendor/llvm/dist/test/CodeGen/X86/vec_return.ll vendor/llvm/dist/test/CodeGen/X86/vec_shift6.ll vendor/llvm/dist/test/CodeGen/X86/vec_unsafe-fp-math.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-sse4a.ll vendor/llvm/dist/test/CodeGen/X86/vector-truncate-combine.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-512.ll vendor/llvm/dist/test/CodeGen/X86/wide-integer-cmp.ll vendor/llvm/dist/test/CodeGen/X86/x32-lea-1.ll vendor/llvm/dist/test/CodeGen/X86/x86-interleaved-access.ll vendor/llvm/dist/test/CodeGen/X86/zext-shl.ll vendor/llvm/dist/test/CodeGen/X86/zext-trunc.ll vendor/llvm/dist/test/DebugInfo/COFF/asm.ll vendor/llvm/dist/test/DebugInfo/COFF/cpp-mangling.ll vendor/llvm/dist/test/DebugInfo/COFF/fp-stack.ll vendor/llvm/dist/test/DebugInfo/COFF/globals.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-files.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-header.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-levels.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-same-name.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining.ll vendor/llvm/dist/test/DebugInfo/COFF/int8-char-type.ll vendor/llvm/dist/test/DebugInfo/COFF/local-constant.ll vendor/llvm/dist/test/DebugInfo/COFF/local-variable-gap.ll vendor/llvm/dist/test/DebugInfo/COFF/local-variables.ll vendor/llvm/dist/test/DebugInfo/COFF/long-name.ll vendor/llvm/dist/test/DebugInfo/COFF/multifile.ll vendor/llvm/dist/test/DebugInfo/COFF/multifunction.ll vendor/llvm/dist/test/DebugInfo/COFF/pieces.ll vendor/llvm/dist/test/DebugInfo/COFF/register-variables.ll vendor/llvm/dist/test/DebugInfo/COFF/simple.ll vendor/llvm/dist/test/DebugInfo/COFF/typedef.ll vendor/llvm/dist/test/DebugInfo/COFF/types-array.ll vendor/llvm/dist/test/DebugInfo/COFF/types-basic.ll vendor/llvm/dist/test/DebugInfo/COFF/udts.ll vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-headers.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-merge-ids-and-types.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-mergetypes.test vendor/llvm/dist/test/DebugInfo/X86/dbg-declare-inalloca.ll vendor/llvm/dist/test/DebugInfo/dwarfdump-str-offsets.test vendor/llvm/dist/test/DebugInfo/llvm-symbolizer.test vendor/llvm/dist/test/Instrumentation/ThreadSanitizer/atomic.ll vendor/llvm/dist/test/MC/AArch64/label-arithmetic-diags-elf.s vendor/llvm/dist/test/MC/AMDGPU/gfx9_asm_all.s vendor/llvm/dist/test/MC/AMDGPU/vop3p-err.s vendor/llvm/dist/test/MC/AMDGPU/vop3p.s vendor/llvm/dist/test/MC/ARM/elf-movt.s vendor/llvm/dist/test/MC/ARM/ldr-pseudo-unpredictable.s vendor/llvm/dist/test/MC/COFF/bad-expr.s vendor/llvm/dist/test/MC/COFF/cv-def-range-gap.s vendor/llvm/dist/test/MC/COFF/cv-def-range.s vendor/llvm/dist/test/MC/COFF/cv-inline-linetable-infloop.s vendor/llvm/dist/test/MC/COFF/cv-inline-linetable-unlikely.s vendor/llvm/dist/test/MC/COFF/cv-inline-linetable-unreachable.s vendor/llvm/dist/test/MC/COFF/cv-inline-linetable.s vendor/llvm/dist/test/MC/ELF/bad-expr3.s vendor/llvm/dist/test/MC/WebAssembly/external-data.ll vendor/llvm/dist/test/MC/WebAssembly/external-func-address.ll vendor/llvm/dist/test/MC/WebAssembly/unnamed-data.ll vendor/llvm/dist/test/MC/WebAssembly/weak-alias.ll vendor/llvm/dist/test/Object/Inputs/trivial.ll vendor/llvm/dist/test/Object/nm-trivial-object.test vendor/llvm/dist/test/Object/obj2yaml.test vendor/llvm/dist/test/Object/objdump-relocations.test vendor/llvm/dist/test/ObjectYAML/wasm/data_section.yaml vendor/llvm/dist/test/Other/2002-01-31-CallGraph.ll vendor/llvm/dist/test/Other/new-pm-defaults.ll vendor/llvm/dist/test/Other/new-pm-lto-defaults.ll vendor/llvm/dist/test/Other/pass-pipelines.ll vendor/llvm/dist/test/TableGen/AsmVariant.td vendor/llvm/dist/test/TableGen/GlobalISelEmitter.td vendor/llvm/dist/test/TableGen/UnterminatedComment.td vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/memcmp.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll vendor/llvm/dist/test/Transforms/ConstantHoisting/ARM/bad-cases.ll vendor/llvm/dist/test/Transforms/ConstantHoisting/X86/ehpad.ll vendor/llvm/dist/test/Transforms/GVN/PRE/atomic.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-gep-load.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-load.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/eliminate-comparison.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/strengthen-overflow.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/widen-loop-comp.ll vendor/llvm/dist/test/Transforms/InferAddressSpaces/AMDGPU/basic.ll vendor/llvm/dist/test/Transforms/Inline/cgscc-incremental-invalidate.ll vendor/llvm/dist/test/Transforms/InstCombine/and-or-not.ll vendor/llvm/dist/test/Transforms/InstCombine/bswap-fold.ll vendor/llvm/dist/test/Transforms/InstCombine/consecutive-fences.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp.ll vendor/llvm/dist/test/Transforms/InstCombine/intrinsics.ll vendor/llvm/dist/test/Transforms/InstCombine/or-xor.ll vendor/llvm/dist/test/Transforms/InstCombine/select-implied.ll vendor/llvm/dist/test/Transforms/InstCombine/select.ll vendor/llvm/dist/test/Transforms/InterleavedAccess/ARM/interleaved-accesses.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-loop.ll vendor/llvm/dist/test/Transforms/LoopVectorize/if-conversion-nest.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/import-icall.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/import-icall.ll vendor/llvm/dist/test/Transforms/PGOProfile/counter_promo_exit_merge.ll vendor/llvm/dist/test/Transforms/PGOProfile/counter_promo_mexits.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/sink-common-code.ll vendor/llvm/dist/test/Transforms/Sink/fence.ll vendor/llvm/dist/test/Unit/lit.cfg vendor/llvm/dist/test/Verifier/2004-05-21-SwitchConstantMismatch.ll vendor/llvm/dist/test/Verifier/2007-12-21-InvokeParamAttrs.ll vendor/llvm/dist/test/Verifier/2008-01-11-VarargAttrs.ll vendor/llvm/dist/test/Verifier/2009-05-29-InvokeResult1.ll vendor/llvm/dist/test/Verifier/2009-05-29-InvokeResult2.ll vendor/llvm/dist/test/Verifier/2009-05-29-InvokeResult3.ll vendor/llvm/dist/test/Verifier/byval-1.ll vendor/llvm/dist/test/Verifier/element-wise-atomic-memory-intrinsics.ll vendor/llvm/dist/test/Verifier/gcread-ptrptr.ll vendor/llvm/dist/test/Verifier/gcroot-alloca.ll vendor/llvm/dist/test/Verifier/gcroot-meta.ll vendor/llvm/dist/test/Verifier/gcroot-ptrptr.ll vendor/llvm/dist/test/Verifier/gcwrite-ptrptr.ll vendor/llvm/dist/test/lit.cfg vendor/llvm/dist/test/tools/llvm-cov/zeroFunctionFile.c vendor/llvm/dist/test/tools/llvm-objdump/WebAssembly/symbol-table.test vendor/llvm/dist/test/tools/llvm-objdump/wasm.txt vendor/llvm/dist/test/tools/llvm-pdbdump/partial-type-stream.test vendor/llvm/dist/test/tools/llvm-profdata/c-general.test vendor/llvm/dist/test/tools/llvm-readobj/Inputs/trivial.ll vendor/llvm/dist/test/tools/llvm-readobj/Inputs/trivial.obj.wasm vendor/llvm/dist/test/tools/llvm-readobj/codeview-linetables.test vendor/llvm/dist/test/tools/llvm-readobj/file-headers.test vendor/llvm/dist/test/tools/llvm-readobj/relocations.test vendor/llvm/dist/test/tools/llvm-readobj/sections.test vendor/llvm/dist/test/tools/llvm-readobj/symbols.test vendor/llvm/dist/tools/gold/gold-plugin.cpp vendor/llvm/dist/tools/lli/OrcLazyJIT.cpp vendor/llvm/dist/tools/lli/OrcLazyJIT.h vendor/llvm/dist/tools/lli/RemoteJITUtils.h vendor/llvm/dist/tools/lli/lli.cpp vendor/llvm/dist/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp vendor/llvm/dist/tools/llvm-c-test/echo.cpp vendor/llvm/dist/tools/llvm-cov/CodeCoverage.cpp vendor/llvm/dist/tools/llvm-lto/llvm-lto.cpp vendor/llvm/dist/tools/llvm-objdump/llvm-objdump.cpp vendor/llvm/dist/tools/llvm-pdbutil/CMakeLists.txt vendor/llvm/dist/tools/llvm-pdbutil/Diff.cpp vendor/llvm/dist/tools/llvm-pdbutil/DumpOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbutil/FormatUtil.cpp vendor/llvm/dist/tools/llvm-pdbutil/FormatUtil.h vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/StreamUtil.cpp vendor/llvm/dist/tools/llvm-pdbutil/StreamUtil.h vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.cpp vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.h vendor/llvm/dist/tools/llvm-profdata/llvm-profdata.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/WasmDumper.cpp vendor/llvm/dist/tools/llvm-shlib/CMakeLists.txt vendor/llvm/dist/tools/llvm-stress/llvm-stress.cpp vendor/llvm/dist/tools/obj2yaml/wasm2yaml.cpp vendor/llvm/dist/tools/opt/NewPMDriver.cpp vendor/llvm/dist/tools/sanstats/sanstats.cpp vendor/llvm/dist/tools/yaml2obj/yaml2wasm.cpp vendor/llvm/dist/unittests/ADT/APFloatTest.cpp vendor/llvm/dist/unittests/ADT/FunctionRefTest.cpp vendor/llvm/dist/unittests/Analysis/AliasAnalysisTest.cpp vendor/llvm/dist/unittests/Analysis/CGSCCPassManagerTest.cpp vendor/llvm/dist/unittests/Analysis/LazyCallGraphTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/GlobalMappingLayerTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/OrcTestCommon.h vendor/llvm/dist/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp vendor/llvm/dist/unittests/IR/CMakeLists.txt vendor/llvm/dist/unittests/IR/ModuleTest.cpp vendor/llvm/dist/unittests/IR/PassManagerTest.cpp vendor/llvm/dist/unittests/ProfileData/CMakeLists.txt vendor/llvm/dist/unittests/ProfileData/CoverageMappingTest.cpp vendor/llvm/dist/unittests/ProfileData/InstrProfTest.cpp vendor/llvm/dist/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp vendor/llvm/dist/unittests/Support/ErrorTest.cpp vendor/llvm/dist/unittests/Support/Host.cpp vendor/llvm/dist/unittests/Support/MathExtrasTest.cpp vendor/llvm/dist/unittests/Transforms/Utils/Cloning.cpp vendor/llvm/dist/utils/TableGen/AsmMatcherEmitter.cpp vendor/llvm/dist/utils/TableGen/AsmWriterEmitter.cpp vendor/llvm/dist/utils/TableGen/CodeEmitterGen.cpp vendor/llvm/dist/utils/TableGen/CodeGenInstruction.h vendor/llvm/dist/utils/TableGen/CodeGenMapTable.cpp vendor/llvm/dist/utils/TableGen/CodeGenTarget.cpp vendor/llvm/dist/utils/TableGen/CodeGenTarget.h vendor/llvm/dist/utils/TableGen/DAGISelMatcherGen.cpp vendor/llvm/dist/utils/TableGen/FastISelEmitter.cpp vendor/llvm/dist/utils/TableGen/FixedLenDecoderEmitter.cpp vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/InstrInfoEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterBankEmitter.cpp vendor/llvm/dist/utils/TableGen/SearchableTableEmitter.cpp vendor/llvm/dist/utils/TableGen/SubtargetEmitter.cpp vendor/llvm/dist/utils/TableGen/X86DisassemblerTables.cpp vendor/llvm/dist/utils/TableGen/X86DisassemblerTables.h vendor/llvm/dist/utils/TableGen/X86ModRMFilters.h vendor/llvm/dist/utils/TableGen/X86RecognizableInstr.cpp vendor/llvm/dist/utils/TableGen/X86RecognizableInstr.h vendor/llvm/dist/utils/docker/build_docker_image.sh vendor/llvm/dist/utils/docker/scripts/build_install_llvm.sh vendor/llvm/dist/utils/lit/lit/TestRunner.py vendor/llvm/dist/utils/lit/lit/formats/googletest.py vendor/llvm/dist/utils/lit/lit/main.py vendor/llvm/dist/utils/lit/tests/selecting.py vendor/llvm/dist/utils/vim/syntax/llvm.vim Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/CMakeLists.txt Thu Jul 13 19:25:18 2017 (r320957) @@ -288,6 +288,10 @@ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) +set(LLVM_UTILS_INSTALL_DIR "bin" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") +mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Thu Jul 13 19:25:18 2017 (r320957) @@ -91,7 +91,7 @@ function(add_llvm_symbol_exports target_name export_fi DEPENDS ${export_file} VERBATIM COMMENT "Creating export file for ${target_name}") - if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + if (${LLVM_LINKER_IS_SOLARISLD}) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") else() @@ -148,13 +148,28 @@ function(add_llvm_symbol_exports target_name export_fi endfunction(add_llvm_symbol_exports) if(NOT WIN32 AND NOT APPLE) + # Detect what linker we have here execute_process( COMMAND ${CMAKE_C_COMPILER} -Wl,--version OUTPUT_VARIABLE stdout - ERROR_QUIET + ERROR_VARIABLE stderr ) + set(LLVM_LINKER_DETECTED ON) if("${stdout}" MATCHES "GNU gold") set(LLVM_LINKER_IS_GOLD ON) + message(STATUS "Linker detection: GNU Gold") + elseif("${stdout}" MATCHES "^LLD") + set(LLVM_LINKER_IS_LLD ON) + message(STATUS "Linker detection: LLD") + elseif("${stdout}" MATCHES "GNU ld") + set(LLVM_LINKER_IS_GNULD ON) + message(STATUS "Linker detection: GNU ld") + elseif("${stderr}" MATCHES "Solaris Link Editors") + set(LLVM_LINKER_IS_SOLARISLD ON) + message(STATUS "Linker detection: Solaris ld") + else() + set(LLVM_LINKER_DETECTED OFF) + message(STATUS "Linker detection: unknown") endif() endif() @@ -865,7 +880,7 @@ macro(add_llvm_utility name) set_target_properties(${name} PROPERTIES FOLDER "Utils") if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS ) install (TARGETS ${name} - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} COMPONENT ${name}) if (NOT CMAKE_CONFIGURATION_TYPES) add_custom_target(install-${name} @@ -1159,11 +1174,6 @@ function(add_lit_target target comment) list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR}) endif () if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) - # reset cache after erraneous r283029 - # TODO: remove this once all buildbots run - if (LIT_COMMAND STREQUAL "${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py") - unset(LIT_COMMAND CACHE) - endif() set (LIT_COMMAND "${PYTHON_EXECUTABLE};${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py" CACHE STRING "Command used to spawn llvm-lit") else() Modified: vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Thu Jul 13 19:25:18 2017 (r320957) @@ -686,8 +686,8 @@ endif() # lld doesn't print colored diagnostics when invoked from Ninja if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") include(CheckLinkerFlag) - check_linker_flag("-Wl,-color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) - append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,-color-diagnostics" + check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) + append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) endif() Modified: vendor/llvm/dist/cmake/modules/LLVMExternalProjectUtils.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/LLVMExternalProjectUtils.cmake Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/cmake/modules/LLVMExternalProjectUtils.cmake Thu Jul 13 19:25:18 2017 (r320957) @@ -195,8 +195,16 @@ function(llvm_ExternalProject_Add name source_dir) # Add top-level targets foreach(target ${ARG_EXTRA_TARGETS}) + string(REPLACE ":" ";" target_list ${target}) + list(GET target_list 0 target) + list(LENGTH target_list target_list_len) + if(${target_list_len} GREATER 1) + list(GET target_list 1 target_name) + else() + set(target_name "${target}") + endif() llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target} ${BINARY_DIR}) - add_custom_target(${target} + add_custom_target(${target_name} COMMAND ${build_runtime_cmd} DEPENDS ${name}-configure WORKING_DIRECTORY ${BINARY_DIR} Modified: vendor/llvm/dist/docs/AMDGPUUsage.rst ============================================================================== --- vendor/llvm/dist/docs/AMDGPUUsage.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/AMDGPUUsage.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -190,9 +190,7 @@ names from both the *Processor* and *Alternative Proce gfx810 - stoney amdgcn APU **GCN GFX9** -------------------------------------------------------------------- - gfx900 amdgcn dGPU - FirePro W9500 - - FirePro S9500 - - FirePro S9500x2 + gfx900 amdgcn dGPU - Radeon Vega Frontier Edition gfx901 amdgcn dGPU ROCm Same as gfx900 except XNACK is enabled Modified: vendor/llvm/dist/docs/CMake.rst ============================================================================== --- vendor/llvm/dist/docs/CMake.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/CMake.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -536,6 +536,11 @@ LLVM-specific variables during the build. Enabling this option can significantly speed up build times especially when building LLVM in Debug configurations. +**LLVM_REVERSE_ITERATION**:BOOL + If enabled, all supported unordered llvm containers would be iterated in + reverse order. This is useful for uncovering non-determinism caused by + iteration of unordered containers. + CMake Caches ============ Modified: vendor/llvm/dist/docs/CMakePrimer.rst ============================================================================== --- vendor/llvm/dist/docs/CMakePrimer.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/CMakePrimer.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -112,33 +112,6 @@ In this example the ``extra_sources`` variable is only targeting an Apple platform. For all other targets the ``extra_sources`` will be evaluated as empty before add_executable is given its arguments. -One big "Gotcha" with variable dereferencing is that ``if`` commands implicitly -dereference values. This has some unexpected results. For example: - -.. code-block:: cmake - - if("${SOME_VAR}" STREQUAL "MSVC") - -In this code sample MSVC will be implicitly dereferenced, which will result in -the if command comparing the value of the dereferenced variables ``SOME_VAR`` -and ``MSVC``. A common workaround to this solution is to prepend strings being -compared with an ``x``. - -.. code-block:: cmake - - if("x${SOME_VAR}" STREQUAL "xMSVC") - -This works because while ``MSVC`` is a defined variable, ``xMSVC`` is not. This -pattern is uncommon, but it does occur in LLVM's CMake scripts. - -.. note:: - - Once the LLVM project upgrades its minimum CMake version to 3.1 or later we - can prevent this behavior by setting CMP0054 to new. For more information on - CMake policies please see the cmake-policies manpage or the `cmake-policies - online documentation - `_. - Lists ----- Modified: vendor/llvm/dist/docs/CommandGuide/lit.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/lit.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/CommandGuide/lit.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -169,6 +169,13 @@ SELECTION OPTIONS must be in the range ``1..M``. The environment variable ``LIT_RUN_SHARD`` can also be used in place of this option. +.. option:: --filter=REGEXP + + Run only those tests whose name matches the regular expression specified in + ``REGEXP``. The environment variable ``LIT_FILTER`` can be also used in place + of this option, which is especially useful in environments where the call + to ``lit`` is issued indirectly. + ADDITIONAL OPTIONS ------------------ Modified: vendor/llvm/dist/docs/CommandGuide/llvm-cov.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/llvm-cov.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/CommandGuide/llvm-cov.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -262,6 +262,12 @@ OPTIONS The demangler is expected to read a newline-separated list of symbols from stdin and write a newline-separated list of the same length to stdout. +.. option:: -num-threads=N, -j=N + + Use N threads to write file reports (only applicable when -output-dir is + specified). When N=0, llvm-cov auto-detects an appropriate number of threads to + use. This is the default. + .. option:: -line-coverage-gt= Show code coverage only for functions with line coverage greater than the Modified: vendor/llvm/dist/docs/CommandGuide/llvm-profdata.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/llvm-profdata.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/CommandGuide/llvm-profdata.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -192,6 +192,12 @@ OPTIONS information is dumped in a more human readable form (also in text) with annotations. +.. option:: -topn=n + + Instruct the profile dumper to show the top ``n`` functions with the + hottest basic blocks in the summary section. By default, the topn functions + are not dumped. + .. option:: -sample Specify that the input profile is a sample-based profile. Modified: vendor/llvm/dist/docs/Coroutines.rst ============================================================================== --- vendor/llvm/dist/docs/Coroutines.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/Coroutines.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -846,7 +846,7 @@ Overview: """"""""" The '``llvm.coro.alloc``' intrinsic returns `true` if dynamic allocation is -required to obtain a memory for the corutine frame and `false` otherwise. +required to obtain a memory for the coroutine frame and `false` otherwise. Arguments: """""""""" Modified: vendor/llvm/dist/docs/Docker.rst ============================================================================== --- vendor/llvm/dist/docs/Docker.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/Docker.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -88,15 +88,11 @@ compiled by the system compiler in the debian8 image: ./llvm/utils/docker/build_docker_image.sh \ --source debian8 \ --docker-repository clang-debian8 --docker-tag "staging" \ - -- \ -p clang -i install-clang -i install-clang-headers \ -- \ -DCMAKE_BUILD_TYPE=Release -Note there are two levels of ``--`` indirection. First one separates -``build_docker_image.sh`` arguments from ``llvm/utils/build_install_llvm.sh`` -arguments. Second one separates CMake arguments from ``build_install_llvm.sh`` -arguments. Note that build like that doesn't use a 2-stage build process that +Note that a build like that doesn't use a 2-stage build process that you probably want for clang. Running a 2-stage build is a little more intricate, this command will do that: @@ -108,7 +104,6 @@ this command will do that: ./build_docker_image.sh \ --source debian8 \ --docker-repository clang-debian8 --docker-tag "staging" \ - -- \ -p clang -i stage2-install-clang -i stage2-install-clang-headers \ -- \ -DLLVM_TARGETS_TO_BUILD=Native -DCMAKE_BUILD_TYPE=Release \ @@ -178,7 +173,6 @@ debian8-based image using the latest ``google/stable`` ./llvm/utils/docker/build_docker_image.sh \ -s debian8 --d clang-debian8 -t "staging" \ - -- \ --branch branches/google/stable \ -p clang -i install-clang -i install-clang-headers \ -- \ Modified: vendor/llvm/dist/docs/HowToAddABuilder.rst ============================================================================== --- vendor/llvm/dist/docs/HowToAddABuilder.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/HowToAddABuilder.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -62,6 +62,9 @@ Here are the steps you can follow to do so: lab.llvm.org:9990 \ + To point a slave to silent master please use lab.llvm.org:9994 instead + of lab.llvm.org:9990. + #. Fill the buildslave description and admin name/e-mail. Here is an example of the buildslave description:: Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/LangRef.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -2209,13 +2209,22 @@ For a simpler introduction to the ordering constraints same address in this global order. This corresponds to the C++0x/C1x ``memory_order_seq_cst`` and Java volatile. -.. _singlethread: +.. _syncscope: -If an atomic operation is marked ``singlethread``, it only *synchronizes -with* or participates in modification and seq\_cst total orderings with -other operations running in the same thread (for example, in signal -handlers). +If an atomic operation is marked ``syncscope("singlethread")``, it only +*synchronizes with* and only participates in the seq\_cst total orderings of +other operations running in the same thread (for example, in signal handlers). +If an atomic operation is marked ``syncscope("")``, where +```` is a target specific synchronization scope, then it is target +dependent if it *synchronizes with* and participates in the seq\_cst total +orderings of other operations. + +Otherwise, an atomic operation that is not marked ``syncscope("singlethread")`` +or ``syncscope("")`` *synchronizes with* and participates in the +seq\_cst total orderings of other operations that are not marked +``syncscope("singlethread")`` or ``syncscope("")``. + .. _fastmath: Fast-Math Flags @@ -5034,7 +5043,7 @@ which is the string ``llvm.loop.licm_versioning.disabl Loop distribution allows splitting a loop into multiple loops. Currently, this is only performed if the entire loop cannot be vectorized due to unsafe -memory dependencies. The transformation will atempt to isolate the unsafe +memory dependencies. The transformation will attempt to isolate the unsafe dependencies into their own loop. This metadata can be used to selectively enable or disable distribution of the @@ -7380,7 +7389,7 @@ Syntax: :: = load [volatile] , * [, align ][, !nontemporal !][, !invariant.load !][, !invariant.group !][, !nonnull !][, !dereferenceable !][, !dereferenceable_or_null !][, !align !] - = load atomic [volatile] , * [singlethread] , align [, !invariant.group !] + = load atomic [volatile] , * [syncscope("")] , align [, !invariant.group !] ! = !{ i32 1 } ! = !{i64 } ! = !{ i64 } @@ -7401,14 +7410,14 @@ modify the number or order of execution of this ``load :ref:`volatile operations `. If the ``load`` is marked as ``atomic``, it takes an extra :ref:`ordering -` and optional ``singlethread`` argument. The ``release`` and -``acq_rel`` orderings are not valid on ``load`` instructions. Atomic loads -produce :ref:`defined ` results when they may see multiple atomic -stores. The type of the pointee must be an integer, pointer, or floating-point -type whose bit width is a power of two greater than or equal to eight and less -than or equal to a target-specific size limit. ``align`` must be explicitly -specified on atomic loads, and the load has undefined behavior if the alignment -is not set to a value which is at least the size in bytes of the +` and optional ``syncscope("")`` argument. The +``release`` and ``acq_rel`` orderings are not valid on ``load`` instructions. +Atomic loads produce :ref:`defined ` results when they may see +multiple atomic stores. The type of the pointee must be an integer, pointer, or +floating-point type whose bit width is a power of two greater than or equal to +eight and less than or equal to a target-specific size limit. ``align`` must be +explicitly specified on atomic loads, and the load has undefined behavior if the +alignment is not set to a value which is at least the size in bytes of the pointee. ``!nontemporal`` does not have any defined semantics for atomic loads. The optional constant ``align`` argument specifies the alignment of the @@ -7509,7 +7518,7 @@ Syntax: :: store [volatile] , * [, align ][, !nontemporal !][, !invariant.group !] ; yields void - store atomic [volatile] , * [singlethread] , align [, !invariant.group !] ; yields void + store atomic [volatile] , * [syncscope("")] , align [, !invariant.group !] ; yields void Overview: """"""""" @@ -7529,14 +7538,14 @@ allowed to modify the number or order of execution of structural type `) can be stored. If the ``store`` is marked as ``atomic``, it takes an extra :ref:`ordering -` and optional ``singlethread`` argument. The ``acquire`` and -``acq_rel`` orderings aren't valid on ``store`` instructions. Atomic loads -produce :ref:`defined ` results when they may see multiple atomic -stores. The type of the pointee must be an integer, pointer, or floating-point -type whose bit width is a power of two greater than or equal to eight and less -than or equal to a target-specific size limit. ``align`` must be explicitly -specified on atomic stores, and the store has undefined behavior if the -alignment is not set to a value which is at least the size in bytes of the +` and optional ``syncscope("")`` argument. The +``acquire`` and ``acq_rel`` orderings aren't valid on ``store`` instructions. +Atomic loads produce :ref:`defined ` results when they may see +multiple atomic stores. The type of the pointee must be an integer, pointer, or +floating-point type whose bit width is a power of two greater than or equal to +eight and less than or equal to a target-specific size limit. ``align`` must be +explicitly specified on atomic stores, and the store has undefined behavior if +the alignment is not set to a value which is at least the size in bytes of the pointee. ``!nontemporal`` does not have any defined semantics for atomic stores. The optional constant ``align`` argument specifies the alignment of the @@ -7597,7 +7606,7 @@ Syntax: :: - fence [singlethread] ; yields void + fence [syncscope("")] ; yields void Overview: """"""""" @@ -7631,17 +7640,17 @@ A ``fence`` which has ``seq_cst`` ordering, in additio ``acquire`` and ``release`` semantics specified above, participates in the global program order of other ``seq_cst`` operations and/or fences. -The optional ":ref:`singlethread `" argument specifies -that the fence only synchronizes with other fences in the same thread. -(This is useful for interacting with signal handlers.) +A ``fence`` instruction can also take an optional +":ref:`syncscope `" argument. Example: """""""" .. code-block:: llvm - fence acquire ; yields void - fence singlethread seq_cst ; yields void + fence acquire ; yields void + fence syncscope("singlethread") seq_cst ; yields void + fence syncscope("agent") seq_cst ; yields void .. _i_cmpxchg: @@ -7653,7 +7662,7 @@ Syntax: :: - cmpxchg [weak] [volatile] * , , [singlethread] ; yields { ty, i1 } + cmpxchg [weak] [volatile] * , , [syncscope("")] ; yields { ty, i1 } Overview: """"""""" @@ -7682,10 +7691,8 @@ must be at least ``monotonic``, the ordering constrain stronger than that on success, and the failure ordering cannot be either ``release`` or ``acq_rel``. -The optional "``singlethread``" argument declares that the ``cmpxchg`` -is only atomic with respect to code (usually signal handlers) running in -the same thread as the ``cmpxchg``. Otherwise the cmpxchg is atomic with -respect to all other code in the system. +A ``cmpxchg`` instruction can also take an optional +":ref:`syncscope `" argument. The pointer passed into cmpxchg must have alignment greater than or equal to the size in memory of the operand. @@ -7739,7 +7746,7 @@ Syntax: :: - atomicrmw [volatile] * , [singlethread] ; yields ty + atomicrmw [volatile] * , [syncscope("")] ; yields ty Overview: """"""""" @@ -7773,6 +7780,9 @@ be a pointer to that type. If the ``atomicrmw`` is mar order of execution of this ``atomicrmw`` with other :ref:`volatile operations `. +A ``atomicrmw`` instruction can also take an optional +":ref:`syncscope `" argument. + Semantics: """""""""" @@ -10272,6 +10282,8 @@ overlap. It copies "len" bytes of memory over. If the to be aligned to some boundary, this can be specified as the fourth argument, otherwise it should be set to 0 or 1 (both meaning no alignment). +.. _int_memmove: + '``llvm.memmove``' Intrinsic ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -10327,6 +10339,8 @@ copies "len" bytes of memory over. If the argument is aligned to some boundary, this can be specified as the fourth argument, otherwise it should be set to 0 or 1 (both meaning no alignment). +.. _int_memset: + '``llvm.memset.*``' Intrinsics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14168,4 +14182,154 @@ In the most general case call to the '``llvm.memcpy.el lowered to a call to the symbol ``__llvm_memcpy_element_unordered_atomic_*``. Where '*' is replaced with an actual element size. +Optimizer is allowed to inline memory copy when it's profitable to do so. + +'``llvm.memmove.element.unordered.atomic``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +This is an overloaded intrinsic. You can use +``llvm.memmove.element.unordered.atomic`` on any integer bit width and for +different address spaces. Not all targets support all bit widths however. + +:: + + declare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* , + i8* , + i32 , + i32 ) + declare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* , + i8* , + i64 , + i32 ) + +Overview: +""""""""" + +The '``llvm.memmove.element.unordered.atomic.*``' intrinsic is a specialization +of the '``llvm.memmove.*``' intrinsic. It differs in that the ``dest`` and +``src`` are treated as arrays with elements that are exactly ``element_size`` +bytes, and the copy between buffers uses a sequence of +:ref:`unordered atomic ` load/store operations that are a positive +integer multiple of the ``element_size`` in size. + +Arguments: +"""""""""" + +The first three arguments are the same as they are in the +:ref:`@llvm.memmove ` intrinsic, with the added constraint that +``len`` is required to be a positive integer multiple of the ``element_size``. +If ``len`` is not a positive integer multiple of ``element_size``, then the +behaviour of the intrinsic is undefined. + +``element_size`` must be a compile-time constant positive power of two no +greater than a target-specific atomic access size limit. + +For each of the input pointers the ``align`` parameter attribute must be +specified. It must be a power of two no less than the ``element_size``. Caller +guarantees that both the source and destination pointers are aligned to that +boundary. + +Semantics: +"""""""""" + +The '``llvm.memmove.element.unordered.atomic.*``' intrinsic copies ``len`` bytes +of memory from the source location to the destination location. These locations +are allowed to overlap. The memory copy is performed as a sequence of load/store +operations where each access is guaranteed to be a multiple of ``element_size`` +bytes wide and aligned at an ``element_size`` boundary. + +The order of the copy is unspecified. The same value may be read from the source +buffer many times, but only one write is issued to the destination buffer per +element. It is well defined to have concurrent reads and writes to both source +and destination provided those reads and writes are unordered atomic when +specified. + +This intrinsic does not provide any additional ordering guarantees over those +provided by a set of unordered loads from the source location and stores to the +destination. + +Lowering: +""""""""" + +In the most general case call to the +'``llvm.memmove.element.unordered.atomic.*``' is lowered to a call to the symbol +``__llvm_memmove_element_unordered_atomic_*``. Where '*' is replaced with an +actual element size. + The optimizer is allowed to inline the memory copy when it's profitable to do so. + +.. _int_memset_element_unordered_atomic: + +'``llvm.memset.element.unordered.atomic``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +This is an overloaded intrinsic. You can use ``llvm.memset.element.unordered.atomic`` on +any integer bit width and for different address spaces. Not all targets +support all bit widths however. + +:: + + declare void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* , + i8 , + i32 , + i32 ) + declare void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* , + i8 , + i64 , + i32 ) + +Overview: +""""""""" + +The '``llvm.memset.element.unordered.atomic.*``' intrinsic is a specialization of the +'``llvm.memset.*``' intrinsic. It differs in that the ``dest`` is treated as an array +with elements that are exactly ``element_size`` bytes, and the assignment to that array +uses uses a sequence of :ref:`unordered atomic ` store operations +that are a positive integer multiple of the ``element_size`` in size. + +Arguments: +"""""""""" + +The first three arguments are the same as they are in the :ref:`@llvm.memset ` +intrinsic, with the added constraint that ``len`` is required to be a positive integer +multiple of the ``element_size``. If ``len`` is not a positive integer multiple of +``element_size``, then the behaviour of the intrinsic is undefined. + +``element_size`` must be a compile-time constant positive power of two no greater than +target-specific atomic access size limit. + +The ``dest`` input pointer must have the ``align`` parameter attribute specified. It +must be a power of two no less than the ``element_size``. Caller guarantees that +the destination pointer is aligned to that boundary. + +Semantics: +"""""""""" + +The '``llvm.memset.element.unordered.atomic.*``' intrinsic sets the ``len`` bytes of +memory starting at the destination location to the given ``value``. The memory is +set with a sequence of store operations where each access is guaranteed to be a +multiple of ``element_size`` bytes wide and aligned at an ``element_size`` boundary. + +The order of the assignment is unspecified. Only one write is issued to the +destination buffer per element. It is well defined to have concurrent reads and +writes to the destination provided those reads and writes are unordered atomic +when specified. + +This intrinsic does not provide any additional ordering guarantees over those +provided by a set of unordered stores to the destination. + +Lowering: +""""""""" + +In the most general case call to the '``llvm.memset.element.unordered.atomic.*``' is +lowered to a call to the symbol ``__llvm_memset_element_unordered_atomic_*``. Where '*' +is replaced with an actual element size. + +The optimizer is allowed to inline the memory assignment when it's profitable to do so. + Modified: vendor/llvm/dist/docs/LibFuzzer.rst ============================================================================== --- vendor/llvm/dist/docs/LibFuzzer.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/LibFuzzer.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -587,7 +587,7 @@ The simplest way is to have a statically initialized g Alternatively, you may define an optional init function and it will receive the program arguments that you can read and modify. Do this **only** if you -realy need to access ``argv``/``argc``. +really need to access ``argv``/``argc``. .. code-block:: c++ Modified: vendor/llvm/dist/docs/tutorial/BuildingAJIT1.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/BuildingAJIT1.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/BuildingAJIT1.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -12,7 +12,7 @@ Welcome to Chapter 1 of the "Building an ORC-based JIT tutorial runs through the implementation of a JIT compiler using LLVM's On-Request-Compilation (ORC) APIs. It begins with a simplified version of the KaleidoscopeJIT class used in the -`Implementing a language with LLVM `_ tutorials and then +`Implementing a language with LLVM `_ tutorials and then introduces new features like optimization, lazy compilation and remote execution. @@ -41,7 +41,7 @@ The structure of the tutorial is: a remote process with reduced privileges using the JIT Remote APIs. To provide input for our JIT we will use the Kaleidoscope REPL from -`Chapter 7 `_ of the "Implementing a language in LLVM tutorial", +`Chapter 7 `_ of the "Implementing a language in LLVM tutorial", with one minor modification: We will remove the FunctionPassManager from the code for that chapter and replace it with optimization support in our JIT class in Chapter #2. @@ -91,8 +91,8 @@ KaleidoscopeJIT In the previous section we described our API, now we examine a simple implementation of it: The KaleidoscopeJIT class [1]_ that was used in the -`Implementing a language with LLVM `_ tutorials. We will use -the REPL code from `Chapter 7 `_ of that tutorial to supply the +`Implementing a language with LLVM `_ tutorials. We will use +the REPL code from `Chapter 7 `_ of that tutorial to supply the input for our JIT: Each time the user enters an expression the REPL will add a new IR module containing the code for that expression to the JIT. If the expression is a top-level expression like '1+1' or 'sin(x)', the REPL will also Modified: vendor/llvm/dist/docs/tutorial/BuildingAJIT2.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/BuildingAJIT2.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/BuildingAJIT2.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -25,7 +25,7 @@ IRTransformLayer, to add IR optimization support to Ka Optimizing Modules using the IRTransformLayer ============================================= -In `Chapter 4 `_ of the "Implementing a language with LLVM" +In `Chapter 4 `_ of the "Implementing a language with LLVM" tutorial series the llvm *FunctionPassManager* is introduced as a means for optimizing LLVM IR. Interested readers may read that chapter for details, but in short: to optimize a Module we create an llvm::FunctionPassManager @@ -148,7 +148,7 @@ At the bottom of our JIT we add a private method to do *optimizeModule*. This function sets up a FunctionPassManager, adds some passes to it, runs it over every function in the module, and then returns the mutated module. The specific optimizations are the same ones used in -`Chapter 4 `_ of the "Implementing a language with LLVM" +`Chapter 4 `_ of the "Implementing a language with LLVM" tutorial series. Readers may visit that chapter for a more in-depth discussion of these, and of IR optimization in general. Modified: vendor/llvm/dist/docs/tutorial/LangImpl02.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl02.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/LangImpl02.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -10,7 +10,7 @@ Chapter 2 Introduction Welcome to Chapter 2 of the "`Implementing a language with LLVM `_" tutorial. This chapter shows you how to use the -lexer, built in `Chapter 1 `_, to build a full +lexer, built in `Chapter 1 `_, to build a full `parser `_ for our Kaleidoscope language. Once we have a parser, we'll define and build an `Abstract Syntax Tree `_ (AST). Modified: vendor/llvm/dist/docs/tutorial/LangImpl03.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl03.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/LangImpl03.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -10,7 +10,7 @@ Chapter 3 Introduction Welcome to Chapter 3 of the "`Implementing a language with LLVM `_" tutorial. This chapter shows you how to transform -the `Abstract Syntax Tree `_, built in Chapter 2, into +the `Abstract Syntax Tree `_, built in Chapter 2, into LLVM IR. This will teach you a little bit about how LLVM does things, as well as demonstrate how easy it is to use. It's much more work to build a lexer and parser than it is to generate LLVM IR code. :) @@ -362,7 +362,7 @@ end of the new basic block. Basic blocks in LLVM are a of functions that define the `Control Flow Graph `_. Since we don't have any control flow, our functions will only contain one block -at this point. We'll fix this in `Chapter 5 `_ :). +at this point. We'll fix this in `Chapter 5 `_ :). Next we add the function arguments to the NamedValues map (after first clearing it out) so that they're accessible to ``VariableExprAST`` nodes. @@ -540,7 +540,7 @@ functions referencing each other. This wraps up the third chapter of the Kaleidoscope tutorial. Up next, we'll describe how to `add JIT codegen and optimizer -support `_ to this so we can actually start running +support `_ to this so we can actually start running code! Full Code Listing Modified: vendor/llvm/dist/docs/tutorial/LangImpl04.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl04.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/LangImpl04.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -622,7 +622,7 @@ This completes the JIT and optimizer chapter of the Ka tutorial. At this point, we can compile a non-Turing-complete programming language, optimize and JIT compile it in a user-driven way. Next up we'll look into `extending the language with control flow -constructs `_, tackling some interesting LLVM IR issues +constructs `_, tackling some interesting LLVM IR issues along the way. Full Code Listing Modified: vendor/llvm/dist/docs/tutorial/LangImpl05.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl05.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/LangImpl05.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -269,7 +269,7 @@ Phi nodes: #. Values that are implicit in the structure of your AST, such as the Phi node in this case. -In `Chapter 7 `_ of this tutorial ("mutable variables"), +In `Chapter 7 `_ of this tutorial ("mutable variables"), we'll talk about #1 in depth. For now, just believe me that you don't need SSA construction to handle this case. For #2, you have the choice of using the techniques that we will describe for #1, or you can insert @@ -790,7 +790,7 @@ of the tutorial. In this chapter we added two control and used them to motivate a couple of aspects of the LLVM IR that are important for front-end implementors to know. In the next chapter of our saga, we will get a bit crazier and add `user-defined -operators `_ to our poor innocent language. +operators `_ to our poor innocent language. Full Code Listing ================= Modified: vendor/llvm/dist/docs/tutorial/LangImpl06.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl06.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/LangImpl06.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -41,7 +41,7 @@ The point of going into user-defined operators in a tu is to show the power and flexibility of using a hand-written parser. Thus far, the parser we have been implementing uses recursive descent for most parts of the grammar and operator precedence parsing for the -expressions. See `Chapter 2 `_ for details. By +expressions. See `Chapter 2 `_ for details. By using operator precedence parsing, it is very easy to allow the programmer to introduce new operators into the grammar: the grammar is dynamically extensible as the JIT runs. @@ -734,7 +734,7 @@ side-effects, but it can't actually define and mutate Strikingly, variable mutation is an important feature of some languages, and it is not at all obvious how to `add support for mutable -variables `_ without having to add an "SSA construction" +variables `_ without having to add an "SSA construction" phase to your front-end. In the next chapter, we will describe how you can add variable mutation without building SSA in your front-end. Modified: vendor/llvm/dist/docs/tutorial/OCamlLangImpl5.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/OCamlLangImpl5.rst Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/docs/tutorial/OCamlLangImpl5.rst Thu Jul 13 19:25:18 2017 (r320957) @@ -258,7 +258,7 @@ a truth value as a 1-bit (bool) value. let then_bb = append_block context "then" the_function in position_at_end then_bb builder; -As opposed to the `C++ tutorial `_, we have to build our +As opposed to the `C++ tutorial `_, we have to build our basic blocks bottom up since we can't have dangling BasicBlocks. We start off by saving a pointer to the first block (which might not be the entry block), which we'll need to build a conditional branch later. We Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h Thu Jul 13 19:25:18 2017 (r320957) @@ -48,6 +48,7 @@ class KaleidoscopeJIT { (public) KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), + ObjectLayer([]() { return std::make_shared(); }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)) { llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr); } @@ -74,9 +75,8 @@ class KaleidoscopeJIT { (public) // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. - return CompileLayer.addModule(std::move(M), - make_unique(), - std::move(Resolver)); + return cantFail(CompileLayer.addModule(std::move(M), + std::move(Resolver))); } JITSymbol findSymbol(const std::string Name) { @@ -87,7 +87,7 @@ class KaleidoscopeJIT { (public) } void removeModule(ModuleHandle H) { - CompileLayer.removeModule(H); + cantFail(CompileLayer.removeModule(H)); } }; Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Thu Jul 13 19:25:18 2017 (r320957) @@ -1150,7 +1150,7 @@ static void HandleTopLevelExpression() { // Get the symbol's address and cast it to the right type (takes no // arguments, returns a double) so we can call it as a native function. - double (*FP)() = (double (*)())(intptr_t)ExprSymbol.getAddress(); + double (*FP)() = (double (*)())(intptr_t)cantFail(ExprSymbol.getAddress()); fprintf(stderr, "Evaluated to %f\n", FP()); // Delete the anonymous expression module from the JIT. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h Thu Jul 13 19:25:18 2017 (r320957) @@ -57,6 +57,7 @@ class KaleidoscopeJIT { (public) KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), + ObjectLayer([]() { return std::make_shared(); }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, [this](std::shared_ptr M) { @@ -87,9 +88,8 @@ class KaleidoscopeJIT { (public) // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. - return OptimizeLayer.addModule(std::move(M), - make_unique(), - std::move(Resolver)); + return cantFail(OptimizeLayer.addModule(std::move(M), + std::move(Resolver))); } JITSymbol findSymbol(const std::string Name) { @@ -100,7 +100,7 @@ class KaleidoscopeJIT { (public) } void removeModule(ModuleHandle H) { - OptimizeLayer.removeModule(H); + cantFail(OptimizeLayer.removeModule(H)); } private: Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Thu Jul 13 19:25:18 2017 (r320957) @@ -1150,7 +1150,7 @@ static void HandleTopLevelExpression() { // Get the symbol's address and cast it to the right type (takes no // arguments, returns a double) so we can call it as a native function. - double (*FP)() = (double (*)())(intptr_t)ExprSymbol.getAddress(); + double (*FP)() = (double (*)())(intptr_t)cantFail(ExprSymbol.getAddress()); fprintf(stderr, "Evaluated to %f\n", FP()); // Delete the anonymous expression module from the JIT. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h Thu Jul 13 19:25:18 2017 (r320957) @@ -63,6 +63,7 @@ class KaleidoscopeJIT { (public) KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), + ObjectLayer([]() { return std::make_shared(); }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, [this](std::shared_ptr M) { @@ -100,9 +101,7 @@ class KaleidoscopeJIT { (public) // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. - return CODLayer.addModule(std::move(M), - make_unique(), - std::move(Resolver)); + return cantFail(CODLayer.addModule(std::move(M), std::move(Resolver))); } JITSymbol findSymbol(const std::string Name) { @@ -113,7 +112,7 @@ class KaleidoscopeJIT { (public) } void removeModule(ModuleHandle H) { - CODLayer.removeModule(H); + cantFail(CODLayer.removeModule(H)); } private: Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp Thu Jul 13 19:25:18 2017 (r320957) @@ -1150,7 +1150,7 @@ static void HandleTopLevelExpression() { // Get the symbol's address and cast it to the right type (takes no // arguments, returns a double) so we can call it as a native function. - double (*FP)() = (double (*)())(intptr_t)ExprSymbol.getAddress(); + double (*FP)() = (double (*)())(intptr_t)cantFail(ExprSymbol.getAddress()); fprintf(stderr, "Evaluated to %f\n", FP()); // Delete the anonymous expression module from the JIT. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h Thu Jul 13 19:25:18 2017 (r320957) @@ -90,6 +90,7 @@ class KaleidoscopeJIT { (public) KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), + ObjectLayer([]() { return std::make_shared(); }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, [this](std::shared_ptr M) { @@ -127,9 +128,8 @@ class KaleidoscopeJIT { (public) // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. - return OptimizeLayer.addModule(std::move(M), - make_unique(), - std::move(Resolver)); + return cantFail(OptimizeLayer.addModule(std::move(M), + std::move(Resolver))); } Error addFunctionAST(std::unique_ptr FnAST) { @@ -175,7 +175,7 @@ class KaleidoscopeJIT { (public) addModule(std::move(M)); auto Sym = findSymbol(SharedFnAST->getName() + "$impl"); assert(Sym && "Couldn't find compiled function?"); - JITTargetAddress SymAddr = Sym.getAddress(); + JITTargetAddress SymAddr = cantFail(Sym.getAddress()); if (auto Err = IndirectStubsMgr->updatePointer(mangle(SharedFnAST->getName()), SymAddr)) { @@ -195,7 +195,7 @@ class KaleidoscopeJIT { (public) } void removeModule(ModuleHandle H) { - OptimizeLayer.removeModule(H); + cantFail(OptimizeLayer.removeModule(H)); } private: Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp Thu Jul 13 19:25:18 2017 (r320957) @@ -1153,7 +1153,7 @@ static void HandleTopLevelExpression() { // Get the symbol's address and cast it to the right type (takes no // arguments, returns a double) so we can call it as a native function. - double (*FP)() = (double (*)())(intptr_t)ExprSymbol.getAddress(); + double (*FP)() = (double (*)())(intptr_t)cantFail(ExprSymbol.getAddress()); fprintf(stderr, "Evaluated to %f\n", FP()); // Delete the anonymous expression module from the JIT. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h Thu Jul 13 18:27:22 2017 (r320956) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h Thu Jul 13 19:25:18 2017 (r320957) @@ -97,6 +97,15 @@ class KaleidoscopeJIT { (public) : TM(EngineBuilder().selectTarget(Triple(Remote.getTargetTriple()), "", "", SmallVector())), DL(TM->createDataLayout()), + ObjectLayer([&Remote]() { + std::unique_ptr MemMgr; + if (auto Err = Remote.createRemoteMemoryManager(MemMgr)) { + logAllUnhandledErrors(std::move(Err), errs(), + "Error creating remote memory manager:"); + exit(1); + } + return MemMgr; + }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, [this](std::shared_ptr M) { @@ -146,18 +155,10 @@ class KaleidoscopeJIT { (public) return JITSymbol(nullptr); }); - std::unique_ptr MemMgr; - if (auto Err = Remote.createRemoteMemoryManager(MemMgr)) { - logAllUnhandledErrors(std::move(Err), errs(), - "Error creating remote memory manager:"); - exit(1); - } - // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. - return OptimizeLayer.addModule(std::move(M), - std::move(MemMgr), - std::move(Resolver)); + return cantFail(OptimizeLayer.addModule(std::move(M), + std::move(Resolver))); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A817DAC18A; Thu, 13 Jul 2017 19:25:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id 104DE399; Thu, 13 Jul 2017 19:25:28 +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 v6DJPSgd036411; Thu, 13 Jul 2017 19:25:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPSti036410; Thu, 13 Jul 2017 19:25:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPSti036410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320958 - vendor/llvm/llvm-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r307894 X-SVN-Commit-Revision: 320958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:29 -0000 Author: dim Date: Thu Jul 13 19:25:27 2017 New Revision: 320958 URL: https://svnweb.freebsd.org/changeset/base/320958 Log: Tag llvm trunk r307894. Added: vendor/llvm/llvm-trunk-r307894/ - copied from r320957, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B36ACDAC1DD; Thu, 13 Jul 2017 19:25:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3D8FD676; Thu, 13 Jul 2017 19:25:42 +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 v6DJPfNL036483; Thu, 13 Jul 2017 19:25:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPdUg036459; Thu, 13 Jul 2017 19:25:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPdUg036459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320959 - in vendor/clang/dist: bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/ASTMatchers include/clang/Analysis include/clang/... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/ASTMatchers include/clang/Analysis include/clang/Basic include/clang/CodeG... X-SVN-Commit-Revision: 320959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:42 -0000 Author: dim Date: Thu Jul 13 19:25:38 2017 New Revision: 320959 URL: https://svnweb.freebsd.org/changeset/base/320959 Log: Vendor import of clang trunk r307894: https://llvm.org/svn/llvm-project/cfe/trunk@307894 Added: vendor/clang/dist/test/Analysis/lifetime-cfg-output.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/module.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/module.cppm vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/other.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/dcl.dcl/dcl.module/p5.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/dllimport-memptr-global.cpp (contents, props changed) vendor/clang/dist/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl vendor/clang/dist/test/Driver/crash-report-spaces.c (contents, props changed) vendor/clang/dist/test/Driver/darwin-sdk-vs-os-version.c (contents, props changed) vendor/clang/dist/test/FixIt/fixit-add-synthesize-to-property.m vendor/clang/dist/test/Import/direct/ vendor/clang/dist/test/Import/direct/Inputs/ vendor/clang/dist/test/Import/direct/Inputs/S.c (contents, props changed) vendor/clang/dist/test/Import/direct/test.c (contents, props changed) vendor/clang/dist/test/Import/enum/ vendor/clang/dist/test/Import/enum/Inputs/ vendor/clang/dist/test/Import/enum/Inputs/S.cpp (contents, props changed) vendor/clang/dist/test/Import/enum/test.cpp (contents, props changed) vendor/clang/dist/test/Import/import-overrides/ vendor/clang/dist/test/Import/import-overrides/Inputs/ vendor/clang/dist/test/Import/import-overrides/Inputs/Hierarchy.cpp (contents, props changed) vendor/clang/dist/test/Import/import-overrides/test.cpp (contents, props changed) vendor/clang/dist/test/Index/Core/index-source-invalid-name.cpp (contents, props changed) vendor/clang/dist/test/Index/Inputs/empty.dia vendor/clang/dist/test/Index/read-empty-diags.test vendor/clang/dist/test/Misc/find-diagnostic-id.c (contents, props changed) vendor/clang/dist/test/Modules/missing-flag.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_simd_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/Rewriter/objc-modern-metadata-visibility2.mm vendor/clang/dist/test/SemaCXX/amdgpu-sizeof-alignof.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/dllimport-memptr.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/warn-cast-qual.cpp (contents, props changed) vendor/clang/dist/tools/diagtool/FindDiagnosticID.cpp (contents, props changed) vendor/clang/dist/unittests/Format/FormatTestTextProto.cpp (contents, props changed) Deleted: vendor/clang/dist/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c vendor/clang/dist/test/Driver/crash report spaces.c Modified: vendor/clang/dist/bindings/python/clang/cindex.py vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst vendor/clang/dist/docs/LibASTMatchersReference.html vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/AST/ExternalASTMerger.h vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h vendor/clang/dist/include/clang/Analysis/AnalysisContext.h vendor/clang/dist/include/clang/Analysis/CFG.h vendor/clang/dist/include/clang/Analysis/CloneDetection.h vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/Linkage.h vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Basic/arm_neon.td vendor/clang/dist/include/clang/CodeGen/CodeGenABITypes.h vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Driver/ToolChain.h vendor/clang/dist/include/clang/Format/Format.h vendor/clang/dist/include/clang/Frontend/FrontendActions.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/DelayedDiagnostic.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Sema/TemplateDeduction.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/CheckerManager.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h vendor/clang/dist/include/clang/Tooling/ArgumentsAdjusters.h vendor/clang/dist/include/clang/Tooling/Core/Diagnostic.h vendor/clang/dist/include/clang/Tooling/Tooling.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ExternalASTMerger.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/Analysis/AnalysisDeclContext.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/CloneDetection.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGClass.cpp vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenABITypes.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/CodeGenTypeCache.h vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.h vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChain.cpp vendor/clang/dist/lib/Driver/ToolChains/Arch/ARM.cpp vendor/clang/dist/lib/Driver/ToolChains/Arch/Mips.cpp vendor/clang/dist/lib/Driver/ToolChains/BareMetal.cpp vendor/clang/dist/lib/Driver/ToolChains/BareMetal.h vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/CommonArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Cuda.cpp vendor/clang/dist/lib/Driver/ToolChains/Cuda.h vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.h vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.cpp vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.h vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.h vendor/clang/dist/lib/Driver/ToolChains/Hexagon.cpp vendor/clang/dist/lib/Driver/ToolChains/Hexagon.h vendor/clang/dist/lib/Driver/ToolChains/NetBSD.cpp vendor/clang/dist/lib/Driver/ToolChains/NetBSD.h vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.cpp vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.h vendor/clang/dist/lib/Driver/ToolChains/XCore.cpp vendor/clang/dist/lib/Driver/ToolChains/XCore.h vendor/clang/dist/lib/Format/ContinuationIndenter.cpp vendor/clang/dist/lib/Format/Format.cpp vendor/clang/dist/lib/Format/FormatToken.h vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/Frontend/SerializedDiagnosticReader.cpp vendor/clang/dist/lib/Frontend/TextDiagnostic.cpp vendor/clang/dist/lib/Headers/bmiintrin.h vendor/clang/dist/lib/Headers/cpuid.h vendor/clang/dist/lib/Headers/immintrin.h vendor/clang/dist/lib/Headers/mmintrin.h vendor/clang/dist/lib/Index/IndexBody.cpp vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Sema/AnalysisBasedWarnings.cpp vendor/clang/dist/lib/Sema/DelayedDiagnostic.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaCast.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaObjCProperty.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaPseudoObject.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/Serialization/ASTWriterDecl.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalysisManager.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PathDiagnostic.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp vendor/clang/dist/lib/Tooling/ArgumentsAdjusters.cpp vendor/clang/dist/lib/Tooling/Core/Diagnostic.cpp vendor/clang/dist/lib/Tooling/Tooling.cpp vendor/clang/dist/test/Analysis/analyzer-config.c vendor/clang/dist/test/Analysis/analyzer-config.cpp vendor/clang/dist/test/Analysis/enum.cpp vendor/clang/dist/test/CXX/except/except.spec/p11.cpp vendor/clang/dist/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.import/p1.cpp vendor/clang/dist/test/CodeGen/aarch64-neon-intrinsics.c vendor/clang/dist/test/CodeGen/aarch64-neon-ldst-one.c vendor/clang/dist/test/CodeGen/address-space.c vendor/clang/dist/test/CodeGen/arm_neon_intrinsics.c vendor/clang/dist/test/CodeGen/bitscan-builtins.c vendor/clang/dist/test/CodeGen/default-address-space.c vendor/clang/dist/test/CodeGen/mcount.c vendor/clang/dist/test/CodeGen/ms-barriers-intrinsics.c vendor/clang/dist/test/CodeGen/no-devirt.cpp vendor/clang/dist/test/CodeGen/pgo-sample-thinlto-summary.c vendor/clang/dist/test/CodeGenCXX/amdgcn-automatic-variable.cpp vendor/clang/dist/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp vendor/clang/dist/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp vendor/clang/dist/test/CodeGenCXX/vtable-available-externally.cpp vendor/clang/dist/test/CodeGenCXX/windows-itanium-type-info.cpp vendor/clang/dist/test/CodeGenOpenCL/address-spaces.cl vendor/clang/dist/test/CodeGenOpenCL/amdgcn-automatic-variable.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-nullptr.cl vendor/clang/dist/test/Driver/autocomplete.c vendor/clang/dist/test/Driver/clang_f_opts.c vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/fuchsia.cpp vendor/clang/dist/test/Driver/mips-features.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/pipe-size.cl vendor/clang/dist/test/Index/print-type-declaration.cpp vendor/clang/dist/test/Index/usrs.m vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Modules/preprocess-build.cpp vendor/clang/dist/test/Modules/relative-dep-gen.cpp vendor/clang/dist/test/OpenMP/taskloop_ast_print.cpp vendor/clang/dist/test/OpenMP/taskloop_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_ast_print.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_codegen.cpp vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Sema/address-packed.c vendor/clang/dist/test/Sema/attr-availability.c vendor/clang/dist/test/Sema/attr-deprecated.c vendor/clang/dist/test/Sema/attr-unavailable-message.c vendor/clang/dist/test/Sema/loop-control.c vendor/clang/dist/test/Sema/warn-cast-qual.c vendor/clang/dist/test/Sema/warn-documentation.cpp vendor/clang/dist/test/SemaCXX/attr-deprecated.cpp vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaCXX/modules-ts.cppm vendor/clang/dist/test/SemaCXX/warn-loop-analysis.cpp vendor/clang/dist/test/SemaCXX/warn-throw-out-noexcept-func.cpp vendor/clang/dist/test/SemaObjC/attr-availability.m vendor/clang/dist/test/SemaObjC/default-synthesize-3.m vendor/clang/dist/test/SemaObjC/default-synthesize.m vendor/clang/dist/test/SemaObjC/forward-protocol-incomplete-impl-warn.m vendor/clang/dist/test/SemaObjC/objc-container-subscripting-1.m vendor/clang/dist/test/SemaObjC/objc-container-subscripting-2.m vendor/clang/dist/test/SemaObjC/unguarded-availability-new.m vendor/clang/dist/test/SemaObjC/unguarded-availability.m vendor/clang/dist/test/SemaOpenCL/cl20-device-side-enqueue.cl vendor/clang/dist/test/SemaOpenCL/images.cl vendor/clang/dist/test/SemaTemplate/constexpr-instantiate.cpp vendor/clang/dist/test/SemaTemplate/overload-candidates.cpp vendor/clang/dist/test/Unit/lit.cfg vendor/clang/dist/test/lit.cfg vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/clang-import-test/clang-import-test.cpp vendor/clang/dist/tools/diagtool/CMakeLists.txt vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXIndexDataConsumer.cpp vendor/clang/dist/tools/libclang/libclang.exports vendor/clang/dist/unittests/ASTMatchers/ASTMatchersNodeTest.cpp vendor/clang/dist/unittests/Format/CMakeLists.txt vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestComments.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/FormatTestProto.cpp vendor/clang/dist/unittests/Tooling/RecursiveASTVisitorTest.cpp vendor/clang/dist/utils/TableGen/NeonEmitter.cpp vendor/clang/dist/utils/bash-autocomplete.sh vendor/clang/dist/utils/perf-training/lit.cfg vendor/clang/dist/utils/perf-training/order-files.lit.cfg vendor/clang/dist/www/analyzer/checker_dev_manual.html vendor/clang/dist/www/analyzer/scripts/expandcollapse.js vendor/clang/dist/www/cxx_status.html Modified: vendor/clang/dist/bindings/python/clang/cindex.py ============================================================================== --- vendor/clang/dist/bindings/python/clang/cindex.py Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/bindings/python/clang/cindex.py Thu Jul 13 19:25:38 2017 (r320959) @@ -782,7 +782,7 @@ CursorKind.CONVERSION_FUNCTION = CursorKind(26) # A C++ template type parameter CursorKind.TEMPLATE_TYPE_PARAMETER = CursorKind(27) -# A C++ non-type template paramater. +# A C++ non-type template parameter. CursorKind.TEMPLATE_NON_TYPE_PARAMETER = CursorKind(28) # A C++ template template parameter. @@ -1478,6 +1478,11 @@ class Cursor(Structure): """ return conf.lib.clang_CXXMethod_isVirtual(self) + def is_scoped_enum(self): + """Returns True if the cursor refers to a scoped enum declaration. + """ + return conf.lib.clang_EnumDecl_isScoped(self) + def get_definition(self): """ If the cursor is a reference to a declaration or a declaration of @@ -3311,6 +3316,10 @@ functionList = [ bool), ("clang_CXXMethod_isVirtual", + [Cursor], + bool), + + ("clang_EnumDecl_isScoped", [Cursor], bool), Modified: vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py ============================================================================== --- vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py Thu Jul 13 19:25:38 2017 (r320959) @@ -255,6 +255,22 @@ def test_is_virtual_method(): assert foo.is_virtual_method() assert not bar.is_virtual_method() +def test_is_scoped_enum(): + """Ensure Cursor.is_scoped_enum works.""" + source = 'class X {}; enum RegularEnum {}; enum class ScopedEnum {};' + tu = get_tu(source, lang='cpp') + + cls = get_cursor(tu, 'X') + regular_enum = get_cursor(tu, 'RegularEnum') + scoped_enum = get_cursor(tu, 'ScopedEnum') + assert cls is not None + assert regular_enum is not None + assert scoped_enum is not None + + assert not cls.is_scoped_enum() + assert not regular_enum.is_scoped_enum() + assert scoped_enum.is_scoped_enum() + def test_underlying_type(): tu = get_tu('typedef int foo;') typedef = get_cursor(tu, 'foo') Modified: vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst ============================================================================== --- vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -437,12 +437,17 @@ export this information, every DSO implements .. code-block:: none - void __cfi_check(uint64 CallSiteTypeId, void *TargetAddr) + void __cfi_check(uint64 CallSiteTypeId, void *TargetAddr, void *DiagData) -This function provides external modules with access to CFI checks for the -targets inside this DSO. For each known ``CallSiteTypeId``, this function -performs an ``llvm.type.test`` with the corresponding type identifier. It -aborts if the type is unknown, or if the check fails. +This function provides external modules with access to CFI checks for +the targets inside this DSO. For each known ``CallSiteTypeId``, this +function performs an ``llvm.type.test`` with the corresponding type +identifier. It reports an error if the type is unknown, or if the +check fails. Depending on the values of compiler flags +``-fsanitize-trap`` and ``-fsanitize-recover``, this function may +print an error, abort and/or return to the caller. ``DiagData`` is an +opaque pointer to the diagnostic information about the error, or +``null`` if the caller does not provide this information. The basic implementation is a large switch statement over all values of CallSiteTypeId supported by this DSO, and each case is similar to @@ -452,11 +457,10 @@ CFI Shadow ---------- To route CFI checks to the target DSO's __cfi_check function, a -mapping from possible virtual / indirect call targets to -the corresponding __cfi_check functions is maintained. This mapping is +mapping from possible virtual / indirect call targets to the +corresponding __cfi_check functions is maintained. This mapping is implemented as a sparse array of 2 bytes for every possible page (4096 -bytes) of memory. The table is kept readonly (FIXME: not yet) most of -the time. +bytes) of memory. The table is kept readonly most of the time. There are 3 types of shadow values: @@ -481,14 +485,24 @@ them. CFI_SlowPath ------------ -The slow path check is implemented in compiler-rt library as +The slow path check is implemented in a runtime support library as .. code-block:: none void __cfi_slowpath(uint64 CallSiteTypeId, void *TargetAddr) + void __cfi_slowpath_diag(uint64 CallSiteTypeId, void *TargetAddr, void *DiagData) -This functions loads a shadow value for ``TargetAddr``, finds the -address of __cfi_check as described above and calls that. +These functions loads a shadow value for ``TargetAddr``, finds the +address of ``__cfi_check`` as described above and calls +that. ``DiagData`` is an opaque pointer to diagnostic data which is +passed verbatim to ``__cfi_check``, and ``__cfi_slowpath`` passes +``nullptr`` instead. + +Compiler-RT library contains reference implementations of slowpath +functions, but they have unresolvable issues with correctness and +performance in the handling of dlopen(). It is recommended that +platforms provide their own implementations, usually as part of libc +or libdl. Position-independent executable requirement ------------------------------------------- Modified: vendor/clang/dist/docs/LibASTMatchersReference.html ============================================================================== --- vendor/clang/dist/docs/LibASTMatchersReference.html Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/LibASTMatchersReference.html Thu Jul 13 19:25:38 2017 (r320959) @@ -1872,6 +1872,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2327,6 +2335,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2583,6 +2599,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2865,6 +2889,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 match 3.14 integerLiteral(equals(42)) matches 42 + +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/ReleaseNotes.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -52,6 +52,9 @@ Major New Features Improvements to Clang's diagnostics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- -Wcast-qual was implemented for C++. C-style casts are now properly + diagnosed. + - -Wunused-lambda-capture warns when a variable explicitly captured by a lambda is not used in the body of the lambda. @@ -59,6 +62,16 @@ New Compiler Flags ------------------ The option .... + +Deprecated Compiler Flags +------------------------- + +The following options are deprecated and ignored. They will be removed in +future versions of Clang. + +- -fslp-vectorize-aggressive used to enable the BB vectorizing pass. They have been superseeded + by the normal SLP vectorizer. +- -fno-slp-vectorize-aggressive used to be the default behavior of clang. New Pragmas in Clang ----------------------- Modified: vendor/clang/dist/docs/UsersManual.rst ============================================================================== --- vendor/clang/dist/docs/UsersManual.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/UsersManual.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -332,6 +332,19 @@ output format of the diagnostics that it generates. using a structured YAML format, users can parse or sort the remarks in a convenient way. +.. _opt_foptimization-record-file: + +**-foptimization-record-file** + Control the file to which optimization reports are written. + + When optimization reports are being output (see + :ref:`-fsave-optimization-record `), this + option controls the file to which those reports are written. + + If this option is not used, optimization records are output to a file named + after the primary file being compiled. If that's "foo.c", for example, + optimization records are output to "foo.opt.yaml". + .. _opt_fdiagnostics-show-hotness: **-f[no-]diagnostics-show-hotness** Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang-c/Index.h Thu Jul 13 19:25:38 2017 (r320959) @@ -4417,6 +4417,11 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCur CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); /** + * \brief Determine if an enum declaration refers to a scoped enum. + */ +CINDEX_LINKAGE unsigned clang_EnumDecl_isScoped(CXCursor C); + +/** * \brief Determine if a C++ member function or member function template is * declared 'const'. */ Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 13 19:25:38 2017 (r320959) @@ -749,7 +749,7 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu /// Set that this declaration is globally visible, even if it came from a /// module that is not visible. void setVisibleDespiteOwningModule() { - if (hasOwningModule()) + if (isHidden()) setModuleOwnershipKind(ModuleOwnershipKind::Visible); } Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Thu Jul 13 19:25:38 2017 (r320959) @@ -1886,6 +1886,19 @@ class CXXMethodDecl : public FunctionDecl { (public) return (CD->begin_overridden_methods() != CD->end_overridden_methods()); } + /// If it's possible to devirtualize a call to this method, return the called + /// function. Otherwise, return null. + + /// \param Base The object on which this virtual function is called. + /// \param IsAppleKext True if we are compiling for Apple kext. + CXXMethodDecl *getDevirtualizedMethod(const Expr *Base, bool IsAppleKext); + + const CXXMethodDecl *getDevirtualizedMethod(const Expr *Base, + bool IsAppleKext) const { + return const_cast(this)->getDevirtualizedMethod( + Base, IsAppleKext); + } + /// \brief Determine whether this is a usual deallocation function /// (C++ [basic.stc.dynamic.deallocation]p2), which is an overloaded /// delete or delete[] operator with a particular signature. Modified: vendor/clang/dist/include/clang/AST/ExternalASTMerger.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Thu Jul 13 19:25:38 2017 (r320959) @@ -44,10 +44,6 @@ class ExternalASTMerger : public ExternalASTSource { ( FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref IsKindWeWant, SmallVectorImpl &Result) override; - - using ExternalASTSource::CompleteType; - - void CompleteType(TagDecl *Tag) override; }; } // end namespace clang Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Thu Jul 13 19:25:38 2017 (r320959) @@ -1799,6 +1799,7 @@ DEF_TRAVERSE_DECL(CXXRecordDecl, { TRY_TO(TraverseCXXR if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \ TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \ \ + TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \ if (!getDerived().shouldVisitTemplateInstantiations() && \ D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization) \ /* Returning from here skips traversing the \ Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h ============================================================================== --- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Thu Jul 13 19:25:38 2017 (r320959) @@ -3821,6 +3821,14 @@ AST_MATCHER_P(CompoundStmt, statementCountIs, unsigned /// integerLiteral(equals(42)) /// matches 42 /// +/// Note that you cannot directly match a negative numeric literal because the +/// minus sign is not part of the literal: It is a unary operator whose operand +/// is the positive numeric literal. Instead, you must use a unaryOperator() +/// matcher to match the minus sign: +/// +/// unaryOperator(hasOperatorName("-"), +/// hasUnaryOperand(integerLiteral(equals(13)))) +/// /// Usable as: Matcher, Matcher, /// Matcher, Matcher template Modified: vendor/clang/dist/include/clang/Analysis/AnalysisContext.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/AnalysisContext.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/AnalysisContext.h Thu Jul 13 19:25:38 2017 (r320959) @@ -426,6 +426,7 @@ class AnalysisDeclContextManager { (public) bool addImplicitDtors = false, bool addInitializers = false, bool addTemporaryDtors = false, + bool addLifetime = false, bool synthesizeBodies = false, bool addStaticInitBranches = false, bool addCXXNewAllocator = true, Modified: vendor/clang/dist/include/clang/Analysis/CFG.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/CFG.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/CFG.h Thu Jul 13 19:25:38 2017 (r320959) @@ -58,6 +58,7 @@ class CFGElement { (public) Statement, Initializer, NewAllocator, + LifetimeEnds, // dtor kind AutomaticObjectDtor, DeleteDtor, @@ -167,6 +168,28 @@ class CFGNewAllocator : public CFGElement { (private) } }; +/// Represents the point where the lifetime of an automatic object ends +class CFGLifetimeEnds : public CFGElement { +public: + explicit CFGLifetimeEnds(const VarDecl *var, const Stmt *stmt) + : CFGElement(LifetimeEnds, var, stmt) {} + + const VarDecl *getVarDecl() const { + return static_cast(Data1.getPointer()); + } + + const Stmt *getTriggerStmt() const { + return static_cast(Data2.getPointer()); + } + +private: + friend class CFGElement; + CFGLifetimeEnds() {} + static bool isKind(const CFGElement &elem) { + return elem.getKind() == LifetimeEnds; + } +}; + /// CFGImplicitDtor - Represents C++ object destructor implicitly generated /// by compiler on various occasions. class CFGImplicitDtor : public CFGElement { @@ -701,6 +724,10 @@ class CFGBlock { (public) Elements.push_back(CFGAutomaticObjDtor(VD, S), C); } + void appendLifetimeEnds(VarDecl *VD, Stmt *S, BumpVectorContext &C) { + Elements.push_back(CFGLifetimeEnds(VD, S), C); + } + void appendDeleteDtor(CXXRecordDecl *RD, CXXDeleteExpr *DE, BumpVectorContext &C) { Elements.push_back(CFGDeleteDtor(RD, DE), C); } @@ -717,6 +744,19 @@ class CFGBlock { (public) *I = CFGAutomaticObjDtor(VD, S); return ++I; } + + // Scope leaving must be performed in reversed order. So insertion is in two + // steps. First we prepare space for some number of elements, then we insert + // the elements beginning at the last position in prepared space. + iterator beginLifetimeEndsInsert(iterator I, size_t Cnt, + BumpVectorContext &C) { + return iterator( + Elements.insert(I.base(), Cnt, CFGLifetimeEnds(nullptr, nullptr), C)); + } + iterator insertLifetimeEnds(iterator I, VarDecl *VD, Stmt *S) { + *I = CFGLifetimeEnds(VD, S); + return ++I; + } }; /// \brief CFGCallback defines methods that should be called when a logical @@ -753,6 +793,7 @@ class CFG { (public) bool AddEHEdges; bool AddInitializers; bool AddImplicitDtors; + bool AddLifetime; bool AddTemporaryDtors; bool AddStaticInitBranches; bool AddCXXNewAllocator; @@ -774,8 +815,10 @@ class CFG { (public) BuildOptions() : forcedBlkExprs(nullptr), Observer(nullptr), - PruneTriviallyFalseEdges(true), AddEHEdges(false), + PruneTriviallyFalseEdges(true), + AddEHEdges(false), AddInitializers(false), AddImplicitDtors(false), + AddLifetime(false), AddTemporaryDtors(false), AddStaticInitBranches(false), AddCXXNewAllocator(false), AddCXXDefaultInitExprInCtors(false) {} }; Modified: vendor/clang/dist/include/clang/Analysis/CloneDetection.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/CloneDetection.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/CloneDetection.h Thu Jul 13 19:25:38 2017 (r320959) @@ -15,6 +15,8 @@ #ifndef LLVM_CLANG_AST_CLONEDETECTION_H #define LLVM_CLANG_AST_CLONEDETECTION_H +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/StmtVisitor.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -28,6 +30,192 @@ class Decl; class VarDecl; class ASTContext; class CompoundStmt; + +namespace clone_detection { + +/// Returns a string that represents all macro expansions that expanded into the +/// given SourceLocation. +/// +/// If 'getMacroStack(A) == getMacroStack(B)' is true, then the SourceLocations +/// A and B are expanded from the same macros in the same order. +std::string getMacroStack(SourceLocation Loc, ASTContext &Context); + +/// Collects the data of a single Stmt. +/// +/// This class defines what a code clone is: If it collects for two statements +/// the same data, then those two statements are considered to be clones of each +/// other. +/// +/// All collected data is forwarded to the given data consumer of the type T. +/// The data consumer class needs to provide a member method with the signature: +/// update(StringRef Str) +template +class StmtDataCollector : public ConstStmtVisitor> { + + ASTContext &Context; + /// The data sink to which all data is forwarded. + T &DataConsumer; + +public: + /// Collects data of the given Stmt. + /// \param S The given statement. + /// \param Context The ASTContext of S. + /// \param DataConsumer The data sink to which all data is forwarded. + StmtDataCollector(const Stmt *S, ASTContext &Context, T &DataConsumer) + : Context(Context), DataConsumer(DataConsumer) { + this->Visit(S); + } + + typedef unsigned DataPiece; + + // Below are utility methods for appending different data to the vector. + + void addData(DataPiece Integer) { + DataConsumer.update( + StringRef(reinterpret_cast(&Integer), sizeof(Integer))); + } + + void addData(llvm::StringRef Str) { DataConsumer.update(Str); } + + void addData(const QualType &QT) { addData(QT.getAsString()); } + +// The functions below collect the class specific data of each Stmt subclass. + +// Utility macro for defining a visit method for a given class. This method +// calls back to the ConstStmtVisitor to visit all parent classes. +#define DEF_ADD_DATA(CLASS, CODE) \ + void Visit##CLASS(const CLASS *S) { \ + CODE; \ + ConstStmtVisitor::Visit##CLASS(S); \ + } + + DEF_ADD_DATA(Stmt, { + addData(S->getStmtClass()); + // This ensures that macro generated code isn't identical to macro-generated + // code. + addData(getMacroStack(S->getLocStart(), Context)); + addData(getMacroStack(S->getLocEnd(), Context)); + }) + DEF_ADD_DATA(Expr, { addData(S->getType()); }) + + //--- Builtin functionality ----------------------------------------------// + DEF_ADD_DATA(ArrayTypeTraitExpr, { addData(S->getTrait()); }) + DEF_ADD_DATA(ExpressionTraitExpr, { addData(S->getTrait()); }) + DEF_ADD_DATA(PredefinedExpr, { addData(S->getIdentType()); }) + DEF_ADD_DATA(TypeTraitExpr, { + addData(S->getTrait()); + for (unsigned i = 0; i < S->getNumArgs(); ++i) + addData(S->getArg(i)->getType()); + }) + + //--- Calls --------------------------------------------------------------// + DEF_ADD_DATA(CallExpr, { + // Function pointers don't have a callee and we just skip hashing it. + if (const FunctionDecl *D = S->getDirectCallee()) { + // If the function is a template specialization, we also need to handle + // the template arguments as they are not included in the qualified name. + if (auto Args = D->getTemplateSpecializationArgs()) { + std::string ArgString; + + // Print all template arguments into ArgString + llvm::raw_string_ostream OS(ArgString); + for (unsigned i = 0; i < Args->size(); ++i) { + Args->get(i).print(Context.getLangOpts(), OS); + // Add a padding character so that 'foo()' != 'foo()'. + OS << '\n'; + } + OS.flush(); + + addData(ArgString); + } + addData(D->getQualifiedNameAsString()); + } + }) + + //--- Exceptions ---------------------------------------------------------// + DEF_ADD_DATA(CXXCatchStmt, { addData(S->getCaughtType()); }) + + //--- C++ OOP Stmts ------------------------------------------------------// + DEF_ADD_DATA(CXXDeleteExpr, { + addData(S->isArrayFormAsWritten()); + addData(S->isGlobalDelete()); + }) + + //--- Casts --------------------------------------------------------------// + DEF_ADD_DATA(ObjCBridgedCastExpr, { addData(S->getBridgeKind()); }) + + //--- Miscellaneous Exprs ------------------------------------------------// + DEF_ADD_DATA(BinaryOperator, { addData(S->getOpcode()); }) + DEF_ADD_DATA(UnaryOperator, { addData(S->getOpcode()); }) + + //--- Control flow -------------------------------------------------------// + DEF_ADD_DATA(GotoStmt, { addData(S->getLabel()->getName()); }) + DEF_ADD_DATA(IndirectGotoStmt, { + if (S->getConstantTarget()) + addData(S->getConstantTarget()->getName()); + }) + DEF_ADD_DATA(LabelStmt, { addData(S->getDecl()->getName()); }) + DEF_ADD_DATA(MSDependentExistsStmt, { addData(S->isIfExists()); }) + DEF_ADD_DATA(AddrLabelExpr, { addData(S->getLabel()->getName()); }) + + //--- Objective-C --------------------------------------------------------// + DEF_ADD_DATA(ObjCIndirectCopyRestoreExpr, { addData(S->shouldCopy()); }) + DEF_ADD_DATA(ObjCPropertyRefExpr, { + addData(S->isSuperReceiver()); + addData(S->isImplicitProperty()); + }) + DEF_ADD_DATA(ObjCAtCatchStmt, { addData(S->hasEllipsis()); }) + + //--- Miscellaneous Stmts ------------------------------------------------// + DEF_ADD_DATA(CXXFoldExpr, { + addData(S->isRightFold()); + addData(S->getOperator()); + }) + DEF_ADD_DATA(GenericSelectionExpr, { + for (unsigned i = 0; i < S->getNumAssocs(); ++i) { + addData(S->getAssocType(i)); + } + }) + DEF_ADD_DATA(LambdaExpr, { + for (const LambdaCapture &C : S->captures()) { + addData(C.isPackExpansion()); + addData(C.getCaptureKind()); + if (C.capturesVariable()) + addData(C.getCapturedVar()->getType()); + } + addData(S->isGenericLambda()); + addData(S->isMutable()); + }) + DEF_ADD_DATA(DeclStmt, { + auto numDecls = std::distance(S->decl_begin(), S->decl_end()); + addData(static_cast(numDecls)); + for (const Decl *D : S->decls()) { + if (const VarDecl *VD = dyn_cast(D)) { + addData(VD->getType()); + } + } + }) + DEF_ADD_DATA(AsmStmt, { + addData(S->isSimple()); + addData(S->isVolatile()); + addData(S->generateAsmString(Context)); + for (unsigned i = 0; i < S->getNumInputs(); ++i) { + addData(S->getInputConstraint(i)); + } + for (unsigned i = 0; i < S->getNumOutputs(); ++i) { + addData(S->getOutputConstraint(i)); + } + for (unsigned i = 0; i < S->getNumClobbers(); ++i) { + addData(S->getClobber(i)); + } + }) + DEF_ADD_DATA(AttributedStmt, { + for (const Attr *A : S->getAttrs()) { + addData(std::string(A->getSpelling())); + } + }) +}; +} // namespace clone_detection /// Identifies a list of statements. /// Modified: vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -178,6 +178,8 @@ def warn_drv_optimization_value : Warning<"optimizatio InGroup; def warn_ignored_gcc_optimization : Warning<"optimization flag '%0' is not supported">, InGroup; +def warn_ignored_clang_option : Warning<"the flag '%0' has been deprecated and will be ignored">, + InGroup; def warn_drv_unsupported_opt_for_target : Warning< "optimization flag '%0' is not supported for target '%1'">, InGroup; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -179,6 +179,8 @@ def warn_incompatible_analyzer_plugin_api : Warning< def note_incompatible_analyzer_plugin_api : Note< "current API version is '%0', but plugin was compiled with version '%1'">; +def err_module_build_requires_fmodules : Error< + "module compilation requires '-fmodules'">; def err_module_interface_requires_modules_ts : Error< "module interface compilation requires '-fmodules-ts'">; def warn_module_config_mismatch : Warning< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -1029,6 +1029,8 @@ def warn_auto_synthesizing_protocol_property :Warning< "auto property synthesis will not synthesize property %0" " declared in protocol %1">, InGroup>; +def note_add_synthesize_directive : Note< + "add a '@synthesize' directive">; def warn_no_autosynthesis_shared_ivar_property : Warning < "auto property synthesis will not synthesize property " "%0 because it cannot share an ivar with another synthesized property">, @@ -2878,7 +2880,7 @@ def warn_partial_availability : Warning<"%0 is only av def warn_partial_availability_new : Warning, InGroup; def note_partial_availability_silence : Note< - "explicitly redeclare %0 to silence this warning">; + "annotate %select{%1|anonymous %1}0 with an availability attribute to silence">; def note_unguarded_available_silence : Note< "enclose %0 in %select{an @available|a __builtin_available}1 check to silence" " this warning">; @@ -3516,6 +3518,8 @@ def note_ovl_candidate_substitution_failure : Note< "candidate template ignored: substitution failure%0%1">; def note_ovl_candidate_disabled_by_enable_if : Note< "candidate template ignored: disabled by %0%1">; +def note_ovl_candidate_disabled_by_requirement : Note< + "candidate template ignored: requirement '%0' was not satisfied%1">; def note_ovl_candidate_has_pass_object_size_params: Note< "candidate address cannot be taken because parameter %0 has " "pass_object_size attribute">; @@ -4429,6 +4433,9 @@ def err_typename_nested_not_found : Error<"no type nam def err_typename_nested_not_found_enable_if : Error< "no type named 'type' in %0; 'enable_if' cannot be used to disable " "this declaration">; +def err_typename_nested_not_found_requirement : Error< + "failed requirement '%0'; 'enable_if' cannot be used to disable this " + "declaration">; def err_typename_nested_not_type : Error< "typename specifier refers to non-type member %0 in %1">; def note_typename_refers_here : Note< @@ -6353,15 +6360,13 @@ def err_exceptions_disabled : Error< "cannot use '%0' with exceptions disabled">; def err_objc_exceptions_disabled : Error< "cannot use '%0' with Objective-C exceptions disabled">; -def warn_throw_in_noexcept_func - : Warning<"%0 has a non-throwing exception specification but can still " - "throw, resulting in unexpected program termination">, - InGroup; -def note_throw_in_dtor - : Note<"destructor or deallocator has a (possibly implicit) non-throwing " - "excepton specification">; -def note_throw_in_function - : Note<"non-throwing function declare here">; +def warn_throw_in_noexcept_func : Warning< + "%0 has a non-throwing exception specification but can still throw">, + InGroup; +def note_throw_in_dtor : Note< + "%select{destructor|deallocator}0 has a %select{non-throwing|implicit " + "non-throwing}1 exception specification">; +def note_throw_in_function : Note<"function declared non-throwing here">; def err_seh_try_outside_functions : Error< "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">; def err_mixing_cxx_try_seh_try : Error< @@ -8455,8 +8460,6 @@ def err_opencl_builtin_to_addr_invalid_arg : Error< // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. def err_opencl_enqueue_kernel_incorrect_args : Error< "illegal call to enqueue_kernel, incorrect argument types">; -def err_opencl_enqueue_kernel_expected_type : Error< - "illegal call to enqueue_kernel, expected %0 argument type">; def err_opencl_enqueue_kernel_local_size_args : Error< "mismatch in number of block parameters and local size arguments passed">; def err_opencl_enqueue_kernel_invalid_local_size_type : Error< @@ -8466,6 +8469,9 @@ def err_opencl_enqueue_kernel_blocks_non_local_void_ar def err_opencl_enqueue_kernel_blocks_no_args : Error< "blocks with parameters are not accepted in this prototype of enqueue_kernel call">; +def err_opencl_builtin_expected_type : Error< + "illegal call to %0, expected %1 argument type">; + // OpenCL v2.2 s2.1.2.3 - Vector Component Access def ext_opencl_ext_vector_type_rgba_selector: ExtWarn< "vector component name '%0' is an OpenCL version 2.2 feature">, @@ -8854,6 +8860,10 @@ def warn_omp_nesting_simd : Warning< def err_omp_orphaned_device_directive : Error< "orphaned 'omp %0' directives are prohibited" "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">; +def err_omp_reduction_non_addressable_expression : Error< + "expected addressable reduction item for the task-based directives">; +def err_omp_reduction_with_nogroup : Error< + "'reduction' clause cannot be used with 'nogroup' clause">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -127,11 +127,11 @@ def err_module_odr_violation_mismatch_decl : Error< "%select{definition in module '%2'|defined here}1 found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member}3">; + "data member|friend declaration}3">; def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member}1">; + "data member|friend declaration}1">; def err_module_odr_violation_mismatch_decl_diff : Error< "%q0 has different definitions in different modules; first difference is " @@ -166,6 +166,9 @@ def err_module_odr_violation_mismatch_decl_diff : Erro "data member %4 with%select{out|}5 an initializer|" "data member %4 with an initializer|" "data member %4 %select{is constexpr|is not constexpr}5|" + "friend %select{class|function}4|" + "friend %4|" + "friend function %4|" "}3">; def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " @@ -199,18 +202,21 @@ def note_module_odr_violation_mismatch_decl_diff : Not "data member %2 with%select{out|}3 an initializer|" "data member %2 with a different initializer|" "data member %2 %select{is constexpr|is not constexpr}3|" + "friend %select{class|function}2|" + "friend %2|" + "friend function %2|" "}1">; def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " "%select{||||static assert|field|method|type alias|typedef|data member|" - "unexpected decl}3">; + "friend declaration|unexpected decl}3">; def note_module_odr_violation_mismatch_decl_unknown : Note< "but in '%0' found " "%select{||||different static assert|different field|different method|" "different type alias|different typedef|different data member|" - "another unexpected decl}1">; + "different friend declaration|another unexpected decl}1">; def warn_duplicate_module_file_extension : Warning< "duplicate module file extension block name '%0'">, Modified: vendor/clang/dist/include/clang/Basic/Linkage.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/Linkage.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/Linkage.h Thu Jul 13 19:25:38 2017 (r320959) @@ -45,6 +45,17 @@ enum Linkage : unsigned char { /// translation units because of types defined in a inline function. VisibleNoLinkage, + /// \brief Internal linkage according to the Modules TS, but can be referred + /// to from other translation units indirectly through inline functions and + /// templates in the module interface. + ModuleInternalLinkage, + + /// \brief Module linkage, which indicates that the entity can be referred + /// to from other translation units within the same module, and indirectly + /// from arbitrary other translation units through inline functions and + /// templates in the module interface. + ModuleLinkage, + /// \brief External linkage, which indicates that the entity can /// be referred to from other translation units. ExternalLinkage @@ -74,15 +85,20 @@ inline bool isDiscardableGVALinkage(GVALinkage L) { } inline bool isExternallyVisible(Linkage L) { - return L == ExternalLinkage || L == VisibleNoLinkage; + return L >= VisibleNoLinkage; } inline Linkage getFormalLinkage(Linkage L) { - if (L == UniqueExternalLinkage) + switch (L) { + case UniqueExternalLinkage: return ExternalLinkage; - if (L == VisibleNoLinkage) + case VisibleNoLinkage: return NoLinkage; - return L; + case ModuleInternalLinkage: + return InternalLinkage; + default: + return L; + } } inline bool isExternalFormalLinkage(Linkage L) { Modified: vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h Thu Jul 13 19:25:38 2017 (r320959) @@ -329,6 +329,15 @@ class PartialDiagnostic { (public) bool hasStorage() const { return DiagStorage != nullptr; } + /// Retrieve the string argument at the given index. + StringRef getStringArg(unsigned I) { + assert(DiagStorage && "No diagnostic storage?"); + assert(I < DiagStorage->NumDiagArgs && "Not enough diagnostic args"); + assert(DiagStorage->DiagArgumentsKind[I] + == DiagnosticsEngine::ak_std_string && "Not a string arg"); + return DiagStorage->DiagArgumentsStr[I]; + } + friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, unsigned I) { PD.AddTaggedVal(I, DiagnosticsEngine::ak_uint); Modified: vendor/clang/dist/include/clang/Basic/TargetInfo.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 13 19:25:38 2017 (r320959) @@ -23,6 +23,7 @@ #include "clang/Basic/VersionTuple.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" @@ -952,6 +953,14 @@ class TargetInfo : public RefCountedBase { const LangAS::Map &getAddressSpaceMap() const { return *AddrSpaceMap; + } + + /// \brief Return an AST address space which can be used opportunistically + /// for constant global memory. It must be possible to convert pointers into + /// this address space to LangAS::Default. If no such address space exists, + /// this may return None, and such optimizations will be disabled. + virtual llvm::Optional getConstantAddressSpace() const { + return LangAS::Default; } /// \brief Retrieve the name of the platform as it is used in the Modified: vendor/clang/dist/include/clang/Basic/arm_neon.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/arm_neon.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/arm_neon.td Thu Jul 13 19:25:38 2017 (r320959) @@ -227,7 +227,6 @@ def OP_UNAVAILABLE : Operation { // u: unsigned integer (int/float args) // f: float (int args) // F: double (int args) -// H: half (int args) // d: default // g: default, ignore 'Q' size modifier. // j: default, force 'Q' size modifier. @@ -346,7 +345,6 @@ def OP_MLSLHi : Op<(call "vmlsl", $p0, (call "vget_h (call "vget_high", $p2))>; def OP_MLSLHi_N : Op<(call "vmlsl_n", $p0, (call "vget_high", $p1), $p2)>; def OP_MUL_N : Op<(op "*", $p0, (dup $p1))>; -def OP_MULX_N : Op<(call "vmulx", $p0, (dup $p1))>; def OP_MLA_N : Op<(op "+", $p0, (op "*", $p1, (dup $p2)))>; def OP_MLS_N : Op<(op "-", $p0, (op "*", $p1, (dup $p2)))>; def OP_FMLA_N : Op<(call "vfma", $p0, $p1, (dup $p2))>; @@ -1662,187 +1660,4 @@ def SCALAR_SQRDMLSH_LANEQ : SOpInst<"vqrdmlsh_laneq", def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; -} - -// ARMv8.2-A FP16 intrinsics. -let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)" in { - - // ARMv8.2-A FP16 one-operand vector intrinsics. - - // Comparison - def CMEQH : SInst<"vceqz", "ud", "hQh">; - def CMGEH : SInst<"vcgez", "ud", "hQh">; - def CMGTH : SInst<"vcgtz", "ud", "hQh">; - def CMLEH : SInst<"vclez", "ud", "hQh">; - def CMLTH : SInst<"vcltz", "ud", "hQh">; - - // Vector conversion - def VCVT_F16 : SInst<"vcvt_f16", "Hd", "sUsQsQUs">; - def VCVT_S16 : SInst<"vcvt_s16", "xd", "hQh">; - def VCVT_U16 : SInst<"vcvt_u16", "ud", "hQh">; - def VCVTA_S16 : SInst<"vcvta_s16", "xd", "hQh">; - def VCVTA_U16 : SInst<"vcvta_u16", "ud", "hQh">; - def VCVTM_S16 : SInst<"vcvtm_s16", "xd", "hQh">; - def VCVTM_U16 : SInst<"vcvtm_u16", "ud", "hQh">; - def VCVTN_S16 : SInst<"vcvtn_s16", "xd", "hQh">; - def VCVTN_U16 : SInst<"vcvtn_u16", "ud", "hQh">; - def VCVTP_S16 : SInst<"vcvtp_s16", "xd", "hQh">; - def VCVTP_U16 : SInst<"vcvtp_u16", "ud", "hQh">; - - // Vector rounding - def FRINTZH : SInst<"vrnd", "dd", "hQh">; - def FRINTNH : SInst<"vrndn", "dd", "hQh">; - def FRINTAH : SInst<"vrnda", "dd", "hQh">; - def FRINTPH : SInst<"vrndp", "dd", "hQh">; - def FRINTMH : SInst<"vrndm", "dd", "hQh">; - def FRINTXH : SInst<"vrndx", "dd", "hQh">; - def FRINTIH : SInst<"vrndi", "dd", "hQh">; - - // Misc. - def VABSH : SInst<"vabs", "dd", "hQh">; - def VNEGH : SOpInst<"vneg", "dd", "hQh", OP_NEG>; - def VRECPEH : SInst<"vrecpe", "dd", "hQh">; - def FRSQRTEH : SInst<"vrsqrte", "dd", "hQh">; - def FSQRTH : SInst<"vsqrt", "dd", "hQh">; - - // ARMv8.2-A FP16 two-operands vector intrinsics. - - // Misc. - def VADDH : SOpInst<"vadd", "ddd", "hQh", OP_ADD>; - def VABDH : SInst<"vabd", "ddd", "hQh">; - def VSUBH : SOpInst<"vsub", "ddd", "hQh", OP_SUB>; - - // Comparison - let InstName = "vacge" in { - def VCAGEH : SInst<"vcage", "udd", "hQh">; - def VCALEH : SInst<"vcale", "udd", "hQh">; - } - let InstName = "vacgt" in { - def VCAGTH : SInst<"vcagt", "udd", "hQh">; - def VCALTH : SInst<"vcalt", "udd", "hQh">; - } - def VCEQH : SOpInst<"vceq", "udd", "hQh", OP_EQ>; - def VCGEH : SOpInst<"vcge", "udd", "hQh", OP_GE>; - def VCGTH : SOpInst<"vcgt", "udd", "hQh", OP_GT>; - let InstName = "vcge" in - def VCLEH : SOpInst<"vcle", "udd", "hQh", OP_LE>; - let InstName = "vcgt" in - def VCLTH : SOpInst<"vclt", "udd", "hQh", OP_LT>; - - // Vector conversion - let isVCVT_N = 1 in { - def VCVT_N_F16 : SInst<"vcvt_n_f16", "Hdi", "sUsQsQUs">; - def VCVT_N_S16 : SInst<"vcvt_n_s16", "xdi", "hQh">; - def VCVT_N_U16 : SInst<"vcvt_n_u16", "udi", "hQh">; - } - - // Max/Min - def VMAXH : SInst<"vmax", "ddd", "hQh">; - def VMINH : SInst<"vmin", "ddd", "hQh">; - def FMAXNMH : SInst<"vmaxnm", "ddd", "hQh">; - def FMINNMH : SInst<"vminnm", "ddd", "hQh">; - - // Multiplication/Division - def VMULH : SOpInst<"vmul", "ddd", "hQh", OP_MUL>; - def MULXH : SInst<"vmulx", "ddd", "hQh">; - def FDIVH : IOpInst<"vdiv", "ddd", "hQh", OP_DIV>; - - // Pairwise addition - def VPADDH : SInst<"vpadd", "ddd", "hQh">; - - // Pairwise Max/Min - def VPMAXH : SInst<"vpmax", "ddd", "hQh">; - def VPMINH : SInst<"vpmin", "ddd", "hQh">; - // Pairwise MaxNum/MinNum - def FMAXNMPH : SInst<"vpmaxnm", "ddd", "hQh">; - def FMINNMPH : SInst<"vpminnm", "ddd", "hQh">; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89BD2DAC1EE; Thu, 13 Jul 2017 19:25:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3E31A6BF; Thu, 13 Jul 2017 19:25:46 +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 v6DJPjjj036530; Thu, 13 Jul 2017 19:25:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPjIl036529; Thu, 13 Jul 2017 19:25:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPjIl036529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320960 - vendor/clang/clang-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r307894 X-SVN-Commit-Revision: 320960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:46 -0000 Author: dim Date: Thu Jul 13 19:25:45 2017 New Revision: 320960 URL: https://svnweb.freebsd.org/changeset/base/320960 Log: Tag clang trunk r307894. Added: vendor/clang/clang-trunk-r307894/ - copied from r320959, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8AFCDAC227; Thu, 13 Jul 2017 19:25:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5A86F775; Thu, 13 Jul 2017 19:25:51 +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 v6DJPoGh036594; Thu, 13 Jul 2017 19:25:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPnsB036576; Thu, 13 Jul 2017 19:25:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPnsB036576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320961 - in vendor/compiler-rt/dist: . cmake cmake/Modules lib/asan lib/asan/scripts lib/builtins lib/esan lib/lsan lib/msan lib/sanitizer_common lib/scudo lib/tsan lib/tsan/dd lib/tsa... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: . cmake cmake/Modules lib/asan lib/asan/scripts lib/builtins lib/esan lib/lsan lib/msan lib/sanitizer_common lib/scudo lib/tsan lib/tsan/dd lib/tsan/go lib/tsan/rtl lib/tsa... X-SVN-Commit-Revision: 320961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:51 -0000 Author: dim Date: Thu Jul 13 19:25:48 2017 New Revision: 320961 URL: https://svnweb.freebsd.org/changeset/base/320961 Log: Vendor import of compiler-rt trunk r307894: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307894 Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno_codes.h (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac_libcdep.cc (contents, props changed) vendor/compiler-rt/dist/test/profile/Linux/counter_promo_nest.c (contents, props changed) vendor/compiler-rt/dist/test/tsan/Darwin/signals-blocked.cc (contents, props changed) vendor/compiler-rt/dist/test/tsan/java_find.cc (contents, props changed) Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake vendor/compiler-rt/dist/cmake/config-ix.cmake vendor/compiler-rt/dist/lib/asan/asan_errors.cc vendor/compiler-rt/dist/lib/asan/asan_internal.h vendor/compiler-rt/dist/lib/asan/asan_linux.cc vendor/compiler-rt/dist/lib/asan/asan_mac.cc vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc vendor/compiler-rt/dist/lib/asan/asan_posix.cc vendor/compiler-rt/dist/lib/asan/asan_rtl.cc vendor/compiler-rt/dist/lib/asan/asan_thread.cc vendor/compiler-rt/dist/lib/asan/asan_win.cc vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt vendor/compiler-rt/dist/lib/builtins/cpu_model.c vendor/compiler-rt/dist/lib/builtins/int_util.c vendor/compiler-rt/dist/lib/esan/working_set.cpp vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.h vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps_common.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps_freebsd.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp vendor/compiler-rt/dist/lib/scudo/scudo_tls.h vendor/compiler-rt/dist/lib/scudo/scudo_utils.cpp vendor/compiler-rt/dist/lib/scudo/scudo_utils.h vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/check_analyze.sh vendor/compiler-rt/dist/lib/tsan/dd/dd_interceptors.cc vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_dense_alloc.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors_mac.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_atomic.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_posix.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_aarch64.S vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_amd64.S vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_mutex.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.cc vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_clock_test.cc vendor/compiler-rt/dist/test/asan/CMakeLists.txt vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc vendor/compiler-rt/dist/test/sanitizer_common/ios_commands/iossim_run.py vendor/compiler-rt/dist/test/tsan/CMakeLists.txt vendor/compiler-rt/dist/test/tsan/Darwin/dlopen.cc vendor/compiler-rt/dist/test/tsan/Darwin/ignore-noninstrumented.mm vendor/compiler-rt/dist/test/tsan/Darwin/ignored-interceptors.mm vendor/compiler-rt/dist/test/tsan/Darwin/osspinlock-norace.cc vendor/compiler-rt/dist/test/tsan/Darwin/xpc-cancel.mm vendor/compiler-rt/dist/test/tsan/Darwin/xpc-race.mm vendor/compiler-rt/dist/test/tsan/Darwin/xpc.mm vendor/compiler-rt/dist/test/tsan/deep_stack1.cc vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc vendor/compiler-rt/dist/test/tsan/lit.cfg vendor/compiler-rt/dist/test/tsan/lit.site.cfg.in Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/CMakeLists.txt Thu Jul 13 19:25:48 2017 (r320961) @@ -80,7 +80,7 @@ pythonize_bool(COMPILER_RT_DEBUG) include(config-ix) -if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") +if(APPLE AND SANITIZER_MIN_OSX_VERSION AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") # Mac OS X prior to 10.9 had problems with exporting symbols from # libc++/libc++abi. set(use_cxxabi_default OFF) Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTDarwinUtils.cmake Thu Jul 13 19:25:48 2017 (r320961) @@ -4,14 +4,23 @@ include(CMakeParseArguments) # set the default Xcode to use. This function finds the SDKs that are present in # the current Xcode. function(find_darwin_sdk_dir var sdk_name) - # Let's first try the internal SDK, otherwise use the public SDK. - execute_process( - COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path - RESULT_VARIABLE result_process - OUTPUT_VARIABLE var_internal - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_FILE /dev/null - ) + set(DARWIN_${sdk_name}_CACHED_SYSROOT "" CACHE STRING "Darwin SDK path for SDK ${sdk_name}.") + set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.") + + if(DARWIN_${sdk_name}_CACHED_SYSROOT) + set(${var} ${DARWIN_${sdk_name}_CACHED_SYSROOT} PARENT_SCOPE) + return() + endif() + if(NOT DARWIN_PREFER_PUBLIC_SDK) + # Let's first try the internal SDK, otherwise use the public SDK. + execute_process( + COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path + RESULT_VARIABLE result_process + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + endif() if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}") execute_process( COMMAND xcodebuild -version -sdk ${sdk_name} Path @@ -26,6 +35,7 @@ function(find_darwin_sdk_dir var sdk_name) if(result_process EQUAL 0) set(${var} ${var_internal} PARENT_SCOPE) endif() + set(DARWIN_${sdk_name}_CACHED_SYSROOT ${var_internal} CACHE STRING "Darwin SDK path for SDK ${sdk_name}." FORCE) endfunction() # There isn't a clear mapping of what architectures are supported with a given Modified: vendor/compiler-rt/dist/cmake/config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/config-ix.cmake Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/cmake/config-ix.cmake Thu Jul 13 19:25:48 2017 (r320961) @@ -303,9 +303,7 @@ if(APPLE) if(DARWIN_${platform}sim_ARCHS) list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}sim) list(APPEND PROFILE_SUPPORTED_OS ${platform}sim) - if(DARWIN_${platform}_SYSROOT_INTERNAL) - list(APPEND TSAN_SUPPORTED_OS ${platform}sim) - endif() + list(APPEND TSAN_SUPPORTED_OS ${platform}sim) endif() foreach(arch ${DARWIN_${platform}sim_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) @@ -330,6 +328,7 @@ if(APPLE) if(DARWIN_${platform}_ARCHS) list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}) list(APPEND PROFILE_SUPPORTED_OS ${platform}) + list(APPEND TSAN_SUPPORTED_OS ${platform}) endif() foreach(arch ${DARWIN_${platform}_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) Modified: vendor/compiler-rt/dist/lib/asan/asan_errors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_errors.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_errors.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -61,10 +61,9 @@ static void MaybeDumpRegisters(void *context) { static void MaybeReportNonExecRegion(uptr pc) { #if SANITIZER_FREEBSD || SANITIZER_LINUX MemoryMappingLayout proc_maps(/*cache_enabled*/ true); - uptr start, end, protection; - while (proc_maps.Next(&start, &end, nullptr, nullptr, 0, &protection)) { - if (pc >= start && pc < end && - !(protection & MemoryMappingLayout::kProtectionExecute)) + MemoryMappedSegment segment; + while (proc_maps.Next(&segment)) { + if (pc >= segment.start && pc < segment.end && !segment.IsExecutable()) Report("Hint: PC is at a non-executable region. Maybe a wild jump?\n"); } #endif Modified: vendor/compiler-rt/dist/lib/asan/asan_internal.h ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_internal.h Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_internal.h Thu Jul 13 19:25:48 2017 (r320961) @@ -75,6 +75,7 @@ void NORETURN ShowStatsAndAbort(); void ReplaceSystemMalloc(); // asan_linux.cc / asan_mac.cc / asan_win.cc +uptr FindDynamicShadowStart(); void *AsanDoesNotSupportStaticLinkage(); void AsanCheckDynamicRTPrereqs(); void AsanCheckIncompatibleRT(); Modified: vendor/compiler-rt/dist/lib/asan/asan_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_linux.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_linux.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -77,6 +77,11 @@ void *AsanDoesNotSupportStaticLinkage() { return &_DYNAMIC; // defined in link.h } +uptr FindDynamicShadowStart() { + UNREACHABLE("FindDynamicShadowStart is not available"); + return 0; +} + void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { UNIMPLEMENTED(); } @@ -140,9 +145,9 @@ void AsanCheckIncompatibleRT() { // system libraries, causing crashes later in ASan initialization. MemoryMappingLayout proc_maps(/*cache_enabled*/true); char filename[128]; - while (proc_maps.Next(nullptr, nullptr, nullptr, filename, - sizeof(filename), nullptr)) { - if (IsDynamicRTName(filename)) { + MemoryMappedSegment segment(filename, sizeof(filename)); + while (proc_maps.Next(&segment)) { + if (IsDynamicRTName(segment.filename)) { Report("Your application is linked against " "incompatible ASan runtimes.\n"); Die(); Modified: vendor/compiler-rt/dist/lib/asan/asan_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_mac.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_mac.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -55,6 +55,29 @@ void *AsanDoesNotSupportStaticLinkage() { return 0; } +uptr FindDynamicShadowStart() { + uptr granularity = GetMmapGranularity(); + uptr alignment = 8 * granularity; + uptr left_padding = granularity; + uptr space_size = kHighShadowEnd + left_padding; + + uptr largest_gap_found = 0; + uptr shadow_start = FindAvailableMemoryRange(space_size, alignment, + granularity, &largest_gap_found); + // If the shadow doesn't fit, restrict the address space to make it fit. + if (shadow_start == 0) { + uptr new_max_vm = RoundDownTo(largest_gap_found << SHADOW_SCALE, alignment); + RestrictMemoryToMaxAddress(new_max_vm); + kHighMemEnd = new_max_vm - 1; + space_size = kHighShadowEnd + left_padding; + shadow_start = + FindAvailableMemoryRange(space_size, alignment, granularity, nullptr); + } + CHECK_NE((uptr)0, shadow_start); + CHECK(IsAligned(shadow_start, alignment)); + return shadow_start; +} + // No-op. Mac does not support static linkage anyway. void AsanCheckDynamicRTPrereqs() {} Modified: vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -26,7 +26,7 @@ // VS2015 dynamic CRT (MD) work. #if SANITIZER_WINDOWS #define CXX_OPERATOR_ATTRIBUTE -#define COMMENT_EXPORT(sym) __pragma(comment(linker, "/export:"##sym)) +#define COMMENT_EXPORT(sym) __pragma(comment(linker, "/export:" sym)) #ifdef _WIN64 COMMENT_EXPORT("??2@YAPEAX_K@Z") // operator new COMMENT_EXPORT("??2@YAPEAX_KAEBUnothrow_t@std@@@Z") // operator new nothrow Modified: vendor/compiler-rt/dist/lib/asan/asan_posix.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_posix.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_posix.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -59,7 +59,7 @@ void AsanOnDeadlySignal(int signo, void *siginfo, void // lis r0,-10000 // stdux r1,r1,r0 # store sp to [sp-10000] and update sp by -10000 // If the store faults then sp will not have been updated, so test above - // will not work, becase the fault address will be more than just "slightly" + // will not work, because the fault address will be more than just "slightly" // below sp. if (!IsStackAccess && IsAccessibleMemoryRange(sig.pc, 4)) { u32 inst = *(unsigned *)sig.pc; Modified: vendor/compiler-rt/dist/lib/asan/asan_rtl.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_rtl.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_rtl.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -438,15 +438,7 @@ static void InitializeShadowMemory() { if (shadow_start == kDefaultShadowSentinel) { __asan_shadow_memory_dynamic_address = 0; CHECK_EQ(0, kLowShadowBeg); - - uptr granularity = GetMmapGranularity(); - uptr alignment = 8 * granularity; - uptr left_padding = granularity; - uptr space_size = kHighShadowEnd + left_padding; - - shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity); - CHECK_NE((uptr)0, shadow_start); - CHECK(IsAligned(shadow_start, alignment)); + shadow_start = FindDynamicShadowStart(); } // Update the shadow memory address (potentially) used by instrumentation. __asan_shadow_memory_dynamic_address = shadow_start; Modified: vendor/compiler-rt/dist/lib/asan/asan_thread.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_thread.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_thread.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -200,7 +200,6 @@ FakeStack *AsanThread::AsyncSignalSafeLazyInitFakeStac uptr stack_size = this->stack_size(); if (stack_size == 0) // stack_size is not yet available, don't use FakeStack. return nullptr; - CHECK_LE(stack_size, 0x10000000); uptr old_val = 0; // fake_stack_ has 3 states: // 0 -- not initialized Modified: vendor/compiler-rt/dist/lib/asan/asan_win.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_win.cc Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/asan_win.cc Thu Jul 13 19:25:48 2017 (r320961) @@ -217,6 +217,18 @@ void *AsanDoesNotSupportStaticLinkage() { return 0; } +uptr FindDynamicShadowStart() { + uptr granularity = GetMmapGranularity(); + uptr alignment = 8 * granularity; + uptr left_padding = granularity; + uptr space_size = kHighShadowEnd + left_padding; + uptr shadow_start = + FindAvailableMemoryRange(space_size, alignment, granularity, nullptr); + CHECK_NE((uptr)0, shadow_start); + CHECK(IsAligned(shadow_start, alignment)); + return shadow_start; +} + void AsanCheckDynamicRTPrereqs() {} void AsanCheckIncompatibleRT() {} Modified: vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup ============================================================================== --- vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup Thu Jul 13 19:25:48 2017 (r320961) @@ -52,7 +52,7 @@ function adb_remount { local STORAGE=`$ADB shell mount | grep /system | cut -d ' ' -f1` if [ "$STORAGE" != "" ]; then echo Remounting $STORAGE at /system - $ADB shell su -c "mount -o remount,rw $STORAGE /system" + $ADB shell su -c "mount -o rw,remount $STORAGE /system" else echo Failed to get storage device name for "/system" mount point fi Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Thu Jul 13 19:25:48 2017 (r320961) @@ -44,7 +44,6 @@ set(GENERIC_SOURCES ashrti3.c bswapdi2.c bswapsi2.c - clear_cache.c clzdi2.c clzsi2.c clzti2.c @@ -68,7 +67,6 @@ set(GENERIC_SOURCES divti3.c divtf3.c divxc3.c - eprintf.c extendsfdf2.c extendhfsf2.c ffsdi2.c @@ -191,11 +189,12 @@ option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN "Skip the atomic builtin (this may be needed if system headers are unavailable)" Off) -if(NOT COMPILER_RT_BAREMETAL_BUILD) +if(NOT FUCHSIA AND NOT COMPILER_RT_BAREMETAL_BUILD) set(GENERIC_SOURCES ${GENERIC_SOURCES} emutls.c - enable_execute_stack.c) + enable_execute_stack.c + eprintf.c) endif() if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN) @@ -220,6 +219,12 @@ if (HAVE_UNWIND_H) ${GENERIC_SOURCES} gcc_personality_v0.c) endif () + +if (NOT FUCHSIA) + set(GENERIC_SOURCES + ${GENERIC_SOURCES} + clear_cache.c) +endif() if (NOT MSVC) set(x86_64_SOURCES Modified: vendor/compiler-rt/dist/lib/builtins/cpu_model.c ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/cpu_model.c Thu Jul 13 19:25:45 2017 (r320960) +++ vendor/compiler-rt/dist/lib/builtins/cpu_model.c Thu Jul 13 19:25:48 2017 (r320961) @@ -44,29 +44,16 @@ enum ProcessorVendors { }; enum ProcessorTypes { - INTEL_ATOM = 1, + INTEL_BONNELL = 1, INTEL_CORE2, INTEL_COREI7, AMDFAM10H, AMDFAM15H, - INTEL_i386, - INTEL_i486, - INTEL_PENTIUM, - INTEL_PENTIUM_PRO, - INTEL_PENTIUM_II, - INTEL_PENTIUM_III, - INTEL_PENTIUM_IV, - INTEL_PENTIUM_M, - INTEL_CORE_DUO, - INTEL_XEONPHI, - INTEL_X86_64, - INTEL_NOCONA, - INTEL_PRESCOTT, - AMD_i486, - AMDPENTIUM, - AMDATHLON, - AMDFAM14H, - AMDFAM16H, + INTEL_SILVERMONT, + INTEL_KNL, + AMD_BTVER1, + AMD_BTVER2, + AMDFAM17H, CPU_TYPE_MAX }; @@ -79,32 +66,14 @@ enum ProcessorSubtypes { AMDFAM10H_ISTANBUL, AMDFAM15H_BDVER1, AMDFAM15H_BDVER2, - INTEL_PENTIUM_MMX, - INTEL_CORE2_65, - INTEL_CORE2_45, + AMDFAM15H_BDVER3, + AMDFAM15H_BDVER4, + AMDFAM17H_ZNVER1, INTEL_COREI7_IVYBRIDGE, INTEL_COREI7_HASWELL, INTEL_COREI7_BROADWELL, INTEL_COREI7_SKYLAKE, INTEL_COREI7_SKYLAKE_AVX512, - INTEL_ATOM_BONNELL, - INTEL_ATOM_SILVERMONT, - INTEL_KNIGHTS_LANDING, - AMDPENTIUM_K6, - AMDPENTIUM_K62, - AMDPENTIUM_K63, - AMDPENTIUM_GEODE, - AMDATHLON_TBIRD, - AMDATHLON_MP, - AMDATHLON_XP, - AMDATHLON_K8SSE3, - AMDATHLON_OPTERON, - AMDATHLON_FX, - AMDATHLON_64, - AMD_BTVER1, - AMD_BTVER2, - AMDFAM15H_BDVER3, - AMDFAM15H_BDVER4, CPU_SUBTYPE_MAX }; @@ -120,11 +89,26 @@ enum ProcessorFeatures { FEATURE_SSE4_2, FEATURE_AVX, FEATURE_AVX2, - FEATURE_AVX512, - FEATURE_AVX512SAVE, - FEATURE_MOVBE, - FEATURE_ADX, - FEATURE_EM64T + FEATURE_SSE4_A, + FEATURE_FMA4, + FEATURE_XOP, + FEATURE_FMA, + FEATURE_AVX512F, + FEATURE_BMI, + FEATURE_BMI2, + FEATURE_AES, + FEATURE_PCLMUL, + FEATURE_AVX512VL, + FEATURE_AVX512BW, + FEATURE_AVX512DQ, + FEATURE_AVX512CD, + FEATURE_AVX512ER, + FEATURE_AVX512PF, + FEATURE_AVX512VBMI, + FEATURE_AVX512IFMA, + FEATURE_AVX5124VNNIW, + FEATURE_AVX5124FMAPS, + FEATURE_AVX512VPOPCNTDQ }; // The check below for i386 was copied from clang's cpuid.h (__get_cpuid_max). @@ -164,26 +148,27 @@ static bool isCpuIdSupported() { /// getX86CpuIDAndInfo - Execute the specified cpuid and return the 4 values in /// the specified arguments. If we can't run cpuid on the host, return true. -static void getX86CpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX, +static bool getX86CpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX, unsigned *rECX, unsigned *rEDX) { #if defined(__GNUC__) || defined(__clang__) #if defined(__x86_64__) - // gcc doesn't know cpuid would clobber ebx/rbx. Preseve it manually. + // gcc doesn't know cpuid would clobber ebx/rbx. Preserve it manually. + // FIXME: should we save this for Clang? __asm__("movq\t%%rbx, %%rsi\n\t" "cpuid\n\t" "xchgq\t%%rbx, %%rsi\n\t" : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value)); + return false; #elif defined(__i386__) __asm__("movl\t%%ebx, %%esi\n\t" "cpuid\n\t" "xchgl\t%%ebx, %%esi\n\t" : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value)); -// pedantic #else returns to appease -Wunreachable-code (so we don't generate -// postprocessed code that looks like "return true; return false;") + return false; #else - assert(0 && "This method is defined only for x86."); + return true; #endif #elif defined(_MSC_VER) // The MSVC intrinsic is portable across x86 and x64. @@ -193,15 +178,16 @@ static void getX86CpuIDAndInfo(unsigned value, unsigne *rEBX = registers[1]; *rECX = registers[2]; *rEDX = registers[3]; + return false; #else - assert(0 && "This method is defined only for GNUC, Clang or MSVC."); + return true; #endif } /// getX86CpuIDAndInfoEx - Execute the specified cpuid with subleaf and return /// the 4 values in the specified arguments. If we can't run cpuid on the host, /// return true. -static void getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf, +static bool getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf, unsigned *rEAX, unsigned *rEBX, unsigned *rECX, unsigned *rEDX) { #if defined(__x86_64__) || defined(_M_X64) @@ -213,6 +199,7 @@ static void getX86CpuIDAndInfoEx(unsigned value, unsig "xchgq\t%%rbx, %%rsi\n\t" : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value), "c"(subleaf)); + return false; #elif defined(_MSC_VER) int registers[4]; __cpuidex(registers, value, subleaf); @@ -220,8 +207,9 @@ static void getX86CpuIDAndInfoEx(unsigned value, unsig *rEBX = registers[1]; *rECX = registers[2]; *rEDX = registers[3]; + return false; #else - assert(0 && "This method is defined only for GNUC, Clang or MSVC."); + return true; #endif #elif defined(__i386__) || defined(_M_IX86) #if defined(__GNUC__) || defined(__clang__) @@ -230,6 +218,7 @@ static void getX86CpuIDAndInfoEx(unsigned value, unsig "xchgl\t%%ebx, %%esi\n\t" : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value), "c"(subleaf)); + return false; #elif defined(_MSC_VER) __asm { mov eax,value @@ -244,11 +233,12 @@ static void getX86CpuIDAndInfoEx(unsigned value, unsig mov esi,rEDX mov dword ptr [esi],edx } + return false; #else - assert(0 && "This method is defined only for GNUC, Clang or MSVC."); + return true; #endif #else - assert(0 && "This method is defined only for x86."); + return true; #endif } @@ -283,84 +273,15 @@ static void detectX86FamilyModel(unsigned EAX, unsigne } } -static void getIntelProcessorTypeAndSubtype(unsigned int Family, - unsigned int Model, - unsigned int Brand_id, - unsigned int Features, - unsigned *Type, unsigned *Subtype) { +static void +getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model, + unsigned Brand_id, unsigned Features, + unsigned *Type, unsigned *Subtype) { if (Brand_id != 0) return; switch (Family) { - case 3: - *Type = INTEL_i386; - break; - case 4: - switch (Model) { - case 0: // Intel486 DX processors - case 1: // Intel486 DX processors - case 2: // Intel486 SX processors - case 3: // Intel487 processors, IntelDX2 OverDrive processors, - // IntelDX2 processors - case 4: // Intel486 SL processor - case 5: // IntelSX2 processors - case 7: // Write-Back Enhanced IntelDX2 processors - case 8: // IntelDX4 OverDrive processors, IntelDX4 processors - default: - *Type = INTEL_i486; - break; - } - case 5: - switch (Model) { - case 1: // Pentium OverDrive processor for Pentium processor (60, 66), - // Pentium processors (60, 66) - case 2: // Pentium OverDrive processor for Pentium processor (75, 90, - // 100, 120, 133), Pentium processors (75, 90, 100, 120, 133, - // 150, 166, 200) - case 3: // Pentium OverDrive processors for Intel486 processor-based - // systems - *Type = INTEL_PENTIUM; - break; - case 4: // Pentium OverDrive processor with MMX technology for Pentium - // processor (75, 90, 100, 120, 133), Pentium processor with - // MMX technology (166, 200) - *Type = INTEL_PENTIUM; - *Subtype = INTEL_PENTIUM_MMX; - break; - default: - *Type = INTEL_PENTIUM; - break; - } case 6: switch (Model) { - case 0x01: // Pentium Pro processor - *Type = INTEL_PENTIUM_PRO; - break; - case 0x03: // Intel Pentium II OverDrive processor, Pentium II processor, - // model 03 - case 0x05: // Pentium II processor, model 05, Pentium II Xeon processor, - // model 05, and Intel Celeron processor, model 05 - case 0x06: // Celeron processor, model 06 - *Type = INTEL_PENTIUM_II; - break; - case 0x07: // Pentium III processor, model 07, and Pentium III Xeon - // processor, model 07 - case 0x08: // Pentium III processor, model 08, Pentium III Xeon processor, - // model 08, and Celeron processor, model 08 - case 0x0a: // Pentium III Xeon processor, model 0Ah - case 0x0b: // Pentium III processor, model 0Bh - *Type = INTEL_PENTIUM_III; - break; - case 0x09: // Intel Pentium M processor, Intel Celeron M processor model 09. - case 0x0d: // Intel Pentium M processor, Intel Celeron M processor, model - // 0Dh. All processors are manufactured using the 90 nm process. - case 0x15: // Intel EP80579 Integrated Processor and Intel EP80579 - // Integrated Processor with Intel QuickAssist Technology - *Type = INTEL_PENTIUM_M; - break; - case 0x0e: // Intel Core Duo processor, Intel Core Solo processor, model - // 0Eh. All processors are manufactured using the 65 nm process. - *Type = INTEL_CORE_DUO; - break; // yonah case 0x0f: // Intel Core 2 Duo processor, Intel Core 2 Duo mobile // processor, Intel Core 2 Quad processor, Intel Core 2 Quad // mobile processor, Intel Core 2 Extreme processor, Intel @@ -368,9 +289,6 @@ static void getIntelProcessorTypeAndSubtype(unsigned i // 0Fh. All processors are manufactured using the 65 nm process. case 0x16: // Intel Celeron processor model 16h. All processors are // manufactured using the 65 nm process - *Type = INTEL_CORE2; // "core2" - *Subtype = INTEL_CORE2_65; - break; case 0x17: // Intel Core 2 Extreme processor, Intel Xeon processor, model // 17h. All processors are manufactured using the 45 nm process. // @@ -378,14 +296,13 @@ static void getIntelProcessorTypeAndSubtype(unsigned i case 0x1d: // Intel Xeon processor MP. All processors are manufactured using // the 45 nm process. *Type = INTEL_CORE2; // "penryn" - *Subtype = INTEL_CORE2_45; break; case 0x1a: // Intel Core i7 processor and Intel Xeon processor. All // processors are manufactured using the 45 nm process. case 0x1e: // Intel(R) Core(TM) i7 CPU 870 @ 2.93GHz. // As found in a Summer 2010 model iMac. case 0x1f: - case 0x2e: // Nehalem EX + case 0x2e: // Nehalem EX *Type = INTEL_COREI7; // "nehalem" *Subtype = INTEL_COREI7_NEHALEM; break; @@ -403,7 +320,7 @@ static void getIntelProcessorTypeAndSubtype(unsigned i *Subtype = INTEL_COREI7_SANDYBRIDGE; break; case 0x3a: - case 0x3e: // Ivy Bridge EP + case 0x3e: // Ivy Bridge EP *Type = INTEL_COREI7; // "ivybridge" *Subtype = INTEL_COREI7_IVYBRIDGE; break; @@ -427,22 +344,26 @@ static void getIntelProcessorTypeAndSubtype(unsigned i break; // Skylake: - case 0x4e: - *Type = INTEL_COREI7; // "skylake-avx512" - *Subtype = INTEL_COREI7_SKYLAKE_AVX512; - break; - case 0x5e: + case 0x4e: // Skylake mobile + case 0x5e: // Skylake desktop + case 0x8e: // Kaby Lake mobile + case 0x9e: // Kaby Lake desktop *Type = INTEL_COREI7; // "skylake" *Subtype = INTEL_COREI7_SKYLAKE; break; + // Skylake Xeon: + case 0x55: + *Type = INTEL_COREI7; + *Subtype = INTEL_COREI7_SKYLAKE_AVX512; // "skylake-avx512" + break; + case 0x1c: // Most 45 nm Intel Atom processors case 0x26: // 45 nm Atom Lincroft case 0x27: // 32 nm Atom Medfield case 0x35: // 32 nm Atom Midview case 0x36: // 32 nm Atom Midview - *Type = INTEL_ATOM; - *Subtype = INTEL_ATOM_BONNELL; + *Type = INTEL_BONNELL; break; // "bonnell" // Atom Silvermont codes from the Intel software optimization guide. @@ -452,185 +373,29 @@ static void getIntelProcessorTypeAndSubtype(unsigned i case 0x5a: case 0x5d: case 0x4c: // really airmont - *Type = INTEL_ATOM; - *Subtype = INTEL_ATOM_SILVERMONT; + *Type = INTEL_SILVERMONT; break; // "silvermont" case 0x57: - *Type = INTEL_XEONPHI; // knl - *Subtype = INTEL_KNIGHTS_LANDING; + *Type = INTEL_KNL; // knl break; - default: // Unknown family 6 CPU, try to guess. - if (Features & (1 << FEATURE_AVX512)) { - *Type = INTEL_XEONPHI; // knl - *Subtype = INTEL_KNIGHTS_LANDING; - break; - } - if (Features & (1 << FEATURE_ADX)) { - *Type = INTEL_COREI7; - *Subtype = INTEL_COREI7_BROADWELL; - break; - } - if (Features & (1 << FEATURE_AVX2)) { - *Type = INTEL_COREI7; - *Subtype = INTEL_COREI7_HASWELL; - break; - } - if (Features & (1 << FEATURE_AVX)) { - *Type = INTEL_COREI7; - *Subtype = INTEL_COREI7_SANDYBRIDGE; - break; - } - if (Features & (1 << FEATURE_SSE4_2)) { - if (Features & (1 << FEATURE_MOVBE)) { - *Type = INTEL_ATOM; - *Subtype = INTEL_ATOM_SILVERMONT; - } else { - *Type = INTEL_COREI7; - *Subtype = INTEL_COREI7_NEHALEM; - } - break; - } - if (Features & (1 << FEATURE_SSE4_1)) { - *Type = INTEL_CORE2; // "penryn" - *Subtype = INTEL_CORE2_45; - break; - } - if (Features & (1 << FEATURE_SSSE3)) { - if (Features & (1 << FEATURE_MOVBE)) { - *Type = INTEL_ATOM; - *Subtype = INTEL_ATOM_BONNELL; // "bonnell" - } else { - *Type = INTEL_CORE2; // "core2" - *Subtype = INTEL_CORE2_65; - } - break; - } - if (Features & (1 << FEATURE_EM64T)) { - *Type = INTEL_X86_64; - break; // x86-64 - } - if (Features & (1 << FEATURE_SSE2)) { - *Type = INTEL_PENTIUM_M; - break; - } - if (Features & (1 << FEATURE_SSE)) { - *Type = INTEL_PENTIUM_III; - break; - } - if (Features & (1 << FEATURE_MMX)) { - *Type = INTEL_PENTIUM_II; - break; - } - *Type = INTEL_PENTIUM_PRO; + default: // Unknown family 6 CPU. break; + break; } - case 15: { - switch (Model) { - case 0: // Pentium 4 processor, Intel Xeon processor. All processors are - // model 00h and manufactured using the 0.18 micron process. - case 1: // Pentium 4 processor, Intel Xeon processor, Intel Xeon - // processor MP, and Intel Celeron processor. All processors are - // model 01h and manufactured using the 0.18 micron process. - case 2: // Pentium 4 processor, Mobile Intel Pentium 4 processor - M, - // Intel Xeon processor, Intel Xeon processor MP, Intel Celeron - // processor, and Mobile Intel Celeron processor. All processors - // are model 02h and manufactured using the 0.13 micron process. - *Type = - ((Features & (1 << FEATURE_EM64T)) ? INTEL_X86_64 : INTEL_PENTIUM_IV); - break; - - case 3: // Pentium 4 processor, Intel Xeon processor, Intel Celeron D - // processor. All processors are model 03h and manufactured using - // the 90 nm process. - case 4: // Pentium 4 processor, Pentium 4 processor Extreme Edition, - // Pentium D processor, Intel Xeon processor, Intel Xeon - // processor MP, Intel Celeron D processor. All processors are - // model 04h and manufactured using the 90 nm process. - case 6: // Pentium 4 processor, Pentium D processor, Pentium processor - // Extreme Edition, Intel Xeon processor, Intel Xeon processor - // MP, Intel Celeron D processor. All processors are model 06h - // and manufactured using the 65 nm process. - *Type = - ((Features & (1 << FEATURE_EM64T)) ? INTEL_NOCONA : INTEL_PRESCOTT); - break; - - default: - *Type = - ((Features & (1 << FEATURE_EM64T)) ? INTEL_X86_64 : INTEL_PENTIUM_IV); - break; - } - } default: - break; /*"generic"*/ + break; // Unknown. } } -static void getAMDProcessorTypeAndSubtype(unsigned int Family, - unsigned int Model, - unsigned int Features, unsigned *Type, +static void getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model, + unsigned Features, unsigned *Type, unsigned *Subtype) { // FIXME: this poorly matches the generated SubtargetFeatureKV table. There // appears to be no way to generate the wide variety of AMD-specific targets // from the information returned from CPUID. switch (Family) { - case 4: - *Type = AMD_i486; - case 5: - *Type = AMDPENTIUM; - switch (Model) { - case 6: - case 7: - *Subtype = AMDPENTIUM_K6; - break; // "k6" - case 8: - *Subtype = AMDPENTIUM_K62; - break; // "k6-2" - case 9: - case 13: - *Subtype = AMDPENTIUM_K63; - break; // "k6-3" - case 10: - *Subtype = AMDPENTIUM_GEODE; - break; // "geode" - default: - break; - } - case 6: - *Type = AMDATHLON; - switch (Model) { - case 4: - *Subtype = AMDATHLON_TBIRD; - break; // "athlon-tbird" - case 6: - case 7: - case 8: - *Subtype = AMDATHLON_MP; - break; // "athlon-mp" - case 10: - *Subtype = AMDATHLON_XP; - break; // "athlon-xp" - default: - break; - } - case 15: - *Type = AMDATHLON; - if (Features & (1 << FEATURE_SSE3)) { - *Subtype = AMDATHLON_K8SSE3; - break; // "k8-sse3" - } - switch (Model) { - case 1: - *Subtype = AMDATHLON_OPTERON; - break; // "opteron" - case 5: - *Subtype = AMDATHLON_FX; - break; // "athlon-fx"; also opteron - default: - *Subtype = AMDATHLON_64; - break; // "athlon64" - } case 16: *Type = AMDFAM10H; // "amdfam10" switch (Model) { @@ -643,23 +408,16 @@ static void getAMDProcessorTypeAndSubtype(unsigned int case 8: *Subtype = AMDFAM10H_ISTANBUL; break; - default: - break; } + break; case 20: - *Type = AMDFAM14H; - *Subtype = AMD_BTVER1; + *Type = AMD_BTVER1; break; // "btver1"; case 21: *Type = AMDFAM15H; - if (!(Features & - (1 << FEATURE_AVX))) { // If no AVX support, provide a sane fallback. - *Subtype = AMD_BTVER1; - break; // "btver1" - } - if (Model >= 0x50 && Model <= 0x6f) { + if (Model >= 0x60 && Model <= 0x7f) { *Subtype = AMDFAM15H_BDVER4; - break; // "bdver4"; 50h-6Fh: Excavator + break; // "bdver4"; 60h-7Fh: Excavator } if (Model >= 0x30 && Model <= 0x3f) { *Subtype = AMDFAM15H_BDVER3; @@ -675,32 +433,48 @@ static void getAMDProcessorTypeAndSubtype(unsigned int } break; case 22: - *Type = AMDFAM16H; - if (!(Features & - (1 << FEATURE_AVX))) { // If no AVX support provide a sane fallback. - *Subtype = AMD_BTVER1; - break; // "btver1"; - } - *Subtype = AMD_BTVER2; + *Type = AMD_BTVER2; break; // "btver2" + case 23: + *Type = AMDFAM17H; + *Subtype = AMDFAM17H_ZNVER1; + break; default: break; // "generic" } } -static unsigned getAvailableFeatures(unsigned int ECX, unsigned int EDX, - unsigned MaxLeaf) { +static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, + unsigned *FeaturesOut) { unsigned Features = 0; - unsigned int EAX, EBX; - Features |= (((EDX >> 23) & 1) << FEATURE_MMX); - Features |= (((EDX >> 25) & 1) << FEATURE_SSE); - Features |= (((EDX >> 26) & 1) << FEATURE_SSE2); - Features |= (((ECX >> 0) & 1) << FEATURE_SSE3); - Features |= (((ECX >> 9) & 1) << FEATURE_SSSE3); - Features |= (((ECX >> 19) & 1) << FEATURE_SSE4_1); - Features |= (((ECX >> 20) & 1) << FEATURE_SSE4_2); - Features |= (((ECX >> 22) & 1) << FEATURE_MOVBE); + unsigned EAX, EBX; + if ((EDX >> 15) & 1) + Features |= 1 << FEATURE_CMOV; + if ((EDX >> 23) & 1) + Features |= 1 << FEATURE_MMX; + if ((EDX >> 25) & 1) + Features |= 1 << FEATURE_SSE; + if ((EDX >> 26) & 1) + Features |= 1 << FEATURE_SSE2; + + if ((ECX >> 0) & 1) + Features |= 1 << FEATURE_SSE3; + if ((ECX >> 1) & 1) + Features |= 1 << FEATURE_PCLMUL; + if ((ECX >> 9) & 1) + Features |= 1 << FEATURE_SSSE3; + if ((ECX >> 12) & 1) + Features |= 1 << FEATURE_FMA; + if ((ECX >> 19) & 1) + Features |= 1 << FEATURE_SSE4_1; + if ((ECX >> 20) & 1) + Features |= 1 << FEATURE_SSE4_2; + if ((ECX >> 23) & 1) + Features |= 1 << FEATURE_POPCNT; + if ((ECX >> 25) & 1) + Features |= 1 << FEATURE_AES; + // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV // indicates that the AVX registers will be saved and restored on context // switch, then we have full AVX support. @@ -708,20 +482,59 @@ static unsigned getAvailableFeatures(unsigned int ECX, bool HasAVX = ((ECX & AVXBits) == AVXBits) && !getX86XCR0(&EAX, &EDX) && ((EAX & 0x6) == 0x6); bool HasAVX512Save = HasAVX && ((EAX & 0xe0) == 0xe0); - bool HasLeaf7 = MaxLeaf >= 0x7; - getX86CpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX); - bool HasADX = HasLeaf7 && ((EBX >> 19) & 1); - bool HasAVX2 = HasAVX && HasLeaf7 && (EBX & 0x20); - bool HasAVX512 = HasLeaf7 && HasAVX512Save && ((EBX >> 16) & 1); - Features |= (HasAVX << FEATURE_AVX); - Features |= (HasAVX2 << FEATURE_AVX2); - Features |= (HasAVX512 << FEATURE_AVX512); - Features |= (HasAVX512Save << FEATURE_AVX512SAVE); - Features |= (HasADX << FEATURE_ADX); - getX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); - Features |= (((EDX >> 29) & 0x1) << FEATURE_EM64T); - return Features; + if (HasAVX) + Features |= 1 << FEATURE_AVX; + + bool HasLeaf7 = + MaxLeaf >= 0x7 && !getX86CpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX); + + if (HasLeaf7 && ((EBX >> 3) & 1)) + Features |= 1 << FEATURE_BMI; + if (HasLeaf7 && ((EBX >> 5) & 1) && HasAVX) + Features |= 1 << FEATURE_AVX2; + if (HasLeaf7 && ((EBX >> 9) & 1)) + Features |= 1 << FEATURE_BMI2; + if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512F; + if (HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512DQ; + if (HasLeaf7 && ((EBX >> 21) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512IFMA; + if (HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512PF; + if (HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512ER; + if (HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512CD; + if (HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512BW; + if (HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512VL; + + if (HasLeaf7 && ((ECX >> 1) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512VBMI; + if (HasLeaf7 && ((ECX >> 14) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX512VPOPCNTDQ; + + if (HasLeaf7 && ((EDX >> 2) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX5124VNNIW; + if (HasLeaf7 && ((EDX >> 3) & 1) && HasAVX512Save) + Features |= 1 << FEATURE_AVX5124FMAPS; + + unsigned MaxExtLevel; + getX86CpuIDAndInfo(0x80000000, &MaxExtLevel, &EBX, &ECX, &EDX); + + bool HasExtLeaf1 = MaxExtLevel >= 0x80000001 && + !getX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); + if (HasExtLeaf1 && ((ECX >> 6) & 1)) + Features |= 1 << FEATURE_SSE4_A; + if (HasExtLeaf1 && ((ECX >> 11) & 1)) + Features |= 1 << FEATURE_XOP; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8BEDAC23D; Thu, 13 Jul 2017 19:25:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 77DEB800; Thu, 13 Jul 2017 19:25:55 +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 v6DJPsT6036640; Thu, 13 Jul 2017 19:25:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPsQL036639; Thu, 13 Jul 2017 19:25:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPsQL036639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320962 - vendor/compiler-rt/compiler-rt-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r307894 X-SVN-Commit-Revision: 320962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:56 -0000 Author: dim Date: Thu Jul 13 19:25:54 2017 New Revision: 320962 URL: https://svnweb.freebsd.org/changeset/base/320962 Log: Tag compiler-rt trunk r307894. Added: vendor/compiler-rt/compiler-rt-trunk-r307894/ - copied from r320961, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B9BDAC276; Thu, 13 Jul 2017 19:26:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id B5633869; Thu, 13 Jul 2017 19:25:59 +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 v6DJPwuv036702; Thu, 13 Jul 2017 19:25:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPvt7036688; Thu, 13 Jul 2017 19:25:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPvt7036688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320963 - in vendor/libc++/dist: . cmake/Modules docs include lib src src/experimental/filesystem src/include test test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons t... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist: . cmake/Modules docs include lib src src/experimental/filesystem src/include test test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons test/libcxx/experimental/f... X-SVN-Commit-Revision: 320963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:00 -0000 Author: dim Date: Thu Jul 13 19:25:57 2017 New Revision: 320963 URL: https://svnweb.freebsd.org/changeset/base/320963 Log: Vendor import of libc++ trunk r307894: https://llvm.org/svn/llvm-project/libcxx/trunk@307894 Added: vendor/libc++/dist/src/experimental/filesystem/filesystem_time_helper.h (contents, props changed) vendor/libc++/dist/src/include/refstring.h (contents, props changed) vendor/libc++/dist/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp (contents, props changed) Deleted: vendor/libc++/dist/include/__refstring vendor/libc++/dist/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp Modified: vendor/libc++/dist/CMakeLists.txt vendor/libc++/dist/cmake/Modules/HandleLibCXXABI.cmake vendor/libc++/dist/docs/BuildingLibcxx.rst vendor/libc++/dist/include/CMakeLists.txt vendor/libc++/dist/include/cmath vendor/libc++/dist/include/complex vendor/libc++/dist/include/optional vendor/libc++/dist/include/regex vendor/libc++/dist/include/string vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/src/experimental/filesystem/operations.cpp vendor/libc++/dist/src/stdexcept.cpp vendor/libc++/dist/test/CMakeLists.txt vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp vendor/libc++/dist/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp vendor/libc++/dist/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp vendor/libc++/dist/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp vendor/libc++/dist/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp vendor/libc++/dist/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/special_member_gen.pass.cpp vendor/libc++/dist/utils/libcxx/test/config.py vendor/libc++/dist/utils/libcxx/test/target_info.py vendor/libc++/dist/www/upcoming_meeting.html Modified: vendor/libc++/dist/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/CMakeLists.txt Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/CMakeLists.txt Thu Jul 13 19:25:57 2017 (r320963) @@ -352,6 +352,13 @@ else() endif() file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") +set(LIBCXX_INSTALL_PREFIX "" CACHE STRING + "Define libc++ destination prefix.") + +if (NOT LIBCXX_INSTALL_PREFIX MATCHES "^$|.*/") + message(FATAL_ERROR "LIBCXX_INSTALL_PREFIX has to end with \"/\".") +endif() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) Modified: vendor/libc++/dist/cmake/Modules/HandleLibCXXABI.cmake ============================================================================== --- vendor/libc++/dist/cmake/Modules/HandleLibCXXABI.cmake Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/cmake/Modules/HandleLibCXXABI.cmake Thu Jul 13 19:25:57 2017 (r320963) @@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs ) if (LIBCXX_INSTALL_HEADERS) install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" - DESTINATION include/c++/v1/${dstdir} + DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir} COMPONENT libcxx PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) Modified: vendor/libc++/dist/docs/BuildingLibcxx.rst ============================================================================== --- vendor/libc++/dist/docs/BuildingLibcxx.rst Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/docs/BuildingLibcxx.rst Thu Jul 13 19:25:57 2017 (r320963) @@ -216,6 +216,11 @@ libc++ specific options Extra suffix to append to the directory where libraries are to be installed. This option overrides `LLVM_LIBDIR_SUFFIX`. +.. option:: LIBCXX_INSTALL_PREFIX:STRING + + **Default**: ``""`` + + Define libc++ destination prefix. .. _libc++experimental options: Modified: vendor/libc++/dist/include/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/include/CMakeLists.txt Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/CMakeLists.txt Thu Jul 13 19:25:57 2017 (r320963) @@ -20,7 +20,7 @@ endif() if (LIBCXX_INSTALL_HEADERS) install(DIRECTORY . - DESTINATION include/c++/v1 + DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 COMPONENT cxx-headers FILES_MATCHING ${LIBCXX_HEADER_PATTERN} @@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS) set(generated_config_deps generate_config_header) # Install the generated header as __config. install(FILES ${LIBCXX_BINARY_DIR}/__generated_config - DESTINATION include/c++/v1 + DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ RENAME __config COMPONENT cxx-headers) Modified: vendor/libc++/dist/include/cmath ============================================================================== --- vendor/libc++/dist/include/cmath Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/cmath Thu Jul 13 19:25:57 2017 (r320963) @@ -549,7 +549,7 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXC template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_isnan) return __builtin_isnan(__lcpp_x); @@ -561,7 +561,7 @@ __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT { return isnan(__lcpp_x); } @@ -569,7 +569,7 @@ __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_isinf) return __builtin_isinf(__lcpp_x); @@ -581,7 +581,7 @@ __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT { return isinf(__lcpp_x); } @@ -589,7 +589,7 @@ __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT { #if __has_builtin(__builtin_isfinite) return __builtin_isfinite(__lcpp_x); @@ -601,7 +601,7 @@ __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT template _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR typename enable_if::value, bool>::type -__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT +__libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT { return isfinite(__lcpp_x); } Modified: vendor/libc++/dist/include/complex ============================================================================== --- vendor/libc++/dist/include/complex Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/complex Thu Jul 13 19:25:57 2017 (r320963) @@ -599,39 +599,39 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& _Tp __bc = __b * __c; _Tp __x = __ac - __bd; _Tp __y = __ad + __bc; - if (__libcpp_isnan(__x) && __libcpp_isnan(__y)) + if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y)) { bool __recalc = false; - if (__libcpp_isinf(__a) || __libcpp_isinf(__b)) + if (__libcpp_isinf_or_builtin(__a) || __libcpp_isinf_or_builtin(__b)) { - __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a); - __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b); - if (__libcpp_isnan(__c)) + __a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a); + __b = copysign(__libcpp_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b); + if (__libcpp_isnan_or_builtin(__c)) __c = copysign(_Tp(0), __c); - if (__libcpp_isnan(__d)) + if (__libcpp_isnan_or_builtin(__d)) __d = copysign(_Tp(0), __d); __recalc = true; } - if (__libcpp_isinf(__c) || __libcpp_isinf(__d)) + if (__libcpp_isinf_or_builtin(__c) || __libcpp_isinf_or_builtin(__d)) { - __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c); - __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d); - if (__libcpp_isnan(__a)) + __c = copysign(__libcpp_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c); + __d = copysign(__libcpp_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d); + if (__libcpp_isnan_or_builtin(__a)) __a = copysign(_Tp(0), __a); - if (__libcpp_isnan(__b)) + if (__libcpp_isnan_or_builtin(__b)) __b = copysign(_Tp(0), __b); __recalc = true; } - if (!__recalc && (__libcpp_isinf(__ac) || __libcpp_isinf(__bd) || - __libcpp_isinf(__ad) || __libcpp_isinf(__bc))) + if (!__recalc && (__libcpp_isinf_or_builtin(__ac) || __libcpp_isinf_or_builtin(__bd) || + __libcpp_isinf_or_builtin(__ad) || __libcpp_isinf_or_builtin(__bc))) { - if (__libcpp_isnan(__a)) + if (__libcpp_isnan_or_builtin(__a)) __a = copysign(_Tp(0), __a); - if (__libcpp_isnan(__b)) + if (__libcpp_isnan_or_builtin(__b)) __b = copysign(_Tp(0), __b); - if (__libcpp_isnan(__c)) + if (__libcpp_isnan_or_builtin(__c)) __c = copysign(_Tp(0), __c); - if (__libcpp_isnan(__d)) + if (__libcpp_isnan_or_builtin(__d)) __d = copysign(_Tp(0), __d); __recalc = true; } @@ -674,7 +674,7 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& _Tp __c = __w.real(); _Tp __d = __w.imag(); _Tp __logbw = logb(fmax(fabs(__c), fabs(__d))); - if (__libcpp_isfinite(__logbw)) + if (__libcpp_isfinite_or_builtin(__logbw)) { __ilogbw = static_cast(__logbw); __c = scalbn(__c, -__ilogbw); @@ -683,24 +683,24 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& _Tp __denom = __c * __c + __d * __d; _Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw); _Tp __y = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw); - if (__libcpp_isnan(__x) && __libcpp_isnan(__y)) + if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y)) { - if ((__denom == _Tp(0)) && (!__libcpp_isnan(__a) || !__libcpp_isnan(__b))) + if ((__denom == _Tp(0)) && (!__libcpp_isnan_or_builtin(__a) || !__libcpp_isnan_or_builtin(__b))) { __x = copysign(_Tp(INFINITY), __c) * __a; __y = copysign(_Tp(INFINITY), __c) * __b; } - else if ((__libcpp_isinf(__a) || __libcpp_isinf(__b)) && __libcpp_isfinite(__c) && __libcpp_isfinite(__d)) + else if ((__libcpp_isinf_or_builtin(__a) || __libcpp_isinf_or_builtin(__b)) && __libcpp_isfinite_or_builtin(__c) && __libcpp_isfinite_or_builtin(__d)) { - __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a); - __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b); + __a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a); + __b = copysign(__libcpp_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b); __x = _Tp(INFINITY) * (__a * __c + __b * __d); __y = _Tp(INFINITY) * (__b * __c - __a * __d); } - else if (__libcpp_isinf(__logbw) && __logbw > _Tp(0) && __libcpp_isfinite(__a) && __libcpp_isfinite(__b)) + else if (__libcpp_isinf_or_builtin(__logbw) && __logbw > _Tp(0) && __libcpp_isfinite_or_builtin(__a) && __libcpp_isfinite_or_builtin(__b)) { - __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c); - __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d); + __c = copysign(__libcpp_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c); + __d = copysign(__libcpp_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d); __x = _Tp(0) * (__a * __c + __b * __d); __y = _Tp(0) * (__b * __c - __a * __d); } @@ -910,9 +910,9 @@ inline _LIBCPP_INLINE_VISIBILITY _Tp norm(const complex<_Tp>& __c) { - if (__libcpp_isinf(__c.real())) + if (__libcpp_isinf_or_builtin(__c.real())) return abs(__c.real()); - if (__libcpp_isinf(__c.imag())) + if (__libcpp_isinf_or_builtin(__c.imag())) return abs(__c.imag()); return __c.real() * __c.real() + __c.imag() * __c.imag(); } @@ -955,7 +955,7 @@ complex<_Tp> proj(const complex<_Tp>& __c) { std::complex<_Tp> __r = __c; - if (__libcpp_isinf(__c.real()) || __libcpp_isinf(__c.imag())) + if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag())) __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag())); return __r; } @@ -969,7 +969,7 @@ typename enable_if >::type proj(_Tp __re) { - if (__libcpp_isinf(__re)) + if (__libcpp_isinf_or_builtin(__re)) __re = abs(__re); return complex<_Tp>(__re); } @@ -993,25 +993,25 @@ template complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta = _Tp(0)) { - if (__libcpp_isnan(__rho) || signbit(__rho)) + if (__libcpp_isnan_or_builtin(__rho) || signbit(__rho)) return complex<_Tp>(_Tp(NAN), _Tp(NAN)); - if (__libcpp_isnan(__theta)) + if (__libcpp_isnan_or_builtin(__theta)) { - if (__libcpp_isinf(__rho)) + if (__libcpp_isinf_or_builtin(__rho)) return complex<_Tp>(__rho, __theta); return complex<_Tp>(__theta, __theta); } - if (__libcpp_isinf(__theta)) + if (__libcpp_isinf_or_builtin(__theta)) { - if (__libcpp_isinf(__rho)) + if (__libcpp_isinf_or_builtin(__rho)) return complex<_Tp>(__rho, _Tp(NAN)); return complex<_Tp>(_Tp(NAN), _Tp(NAN)); } _Tp __x = __rho * cos(__theta); - if (__libcpp_isnan(__x)) + if (__libcpp_isnan_or_builtin(__x)) __x = 0; _Tp __y = __rho * sin(__theta); - if (__libcpp_isnan(__y)) + if (__libcpp_isnan_or_builtin(__y)) __y = 0; return complex<_Tp>(__x, __y); } @@ -1042,13 +1042,13 @@ template complex<_Tp> sqrt(const complex<_Tp>& __x) { - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(_Tp(INFINITY), __x.imag()); - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { if (__x.real() > _Tp(0)) - return complex<_Tp>(__x.real(), __libcpp_isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag())); - return complex<_Tp>(__libcpp_isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag())); + return complex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag())); + return complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag())); } return polar(sqrt(abs(__x)), arg(__x) / _Tp(2)); } @@ -1060,21 +1060,21 @@ complex<_Tp> exp(const complex<_Tp>& __x) { _Tp __i = __x.imag(); - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { if (__x.real() < _Tp(0)) { - if (!__libcpp_isfinite(__i)) + if (!__libcpp_isfinite_or_builtin(__i)) __i = _Tp(1); } - else if (__i == 0 || !__libcpp_isfinite(__i)) + else if (__i == 0 || !__libcpp_isfinite_or_builtin(__i)) { - if (__libcpp_isinf(__i)) + if (__libcpp_isinf_or_builtin(__i)) __i = _Tp(NAN); return complex<_Tp>(__x.real(), __i); } } - else if (__libcpp_isnan(__x.real()) && __x.imag() == 0) + else if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0) return __x; _Tp __e = exp(__x.real()); return complex<_Tp>(__e * cos(__i), __e * sin(__i)); @@ -1132,23 +1132,23 @@ complex<_Tp> asinh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { - if (__libcpp_isnan(__x.imag())) + if (__libcpp_isnan_or_builtin(__x.imag())) return __x; - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag())); return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag())); } - if (__libcpp_isnan(__x.real())) + if (__libcpp_isnan_or_builtin(__x.real())) { - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(__x.imag(), __x.real()); if (__x.imag() == 0) return __x; return complex<_Tp>(__x.real(), __x.real()); } - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag())); complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) + _Tp(1))); return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag())); @@ -1161,11 +1161,11 @@ complex<_Tp> acosh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { - if (__libcpp_isnan(__x.imag())) + if (__libcpp_isnan_or_builtin(__x.imag())) return complex<_Tp>(abs(__x.real()), __x.imag()); - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) { if (__x.real() > 0) return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag())); @@ -1176,13 +1176,13 @@ acosh(const complex<_Tp>& __x) return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag())); return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag())); } - if (__libcpp_isnan(__x.real())) + if (__libcpp_isnan_or_builtin(__x.real())) { - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(abs(__x.imag()), __x.real()); return complex<_Tp>(__x.real(), __x.real()); } - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag())); complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1))); return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag())); @@ -1195,21 +1195,21 @@ complex<_Tp> atanh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) { return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag())); } - if (__libcpp_isnan(__x.imag())) + if (__libcpp_isnan_or_builtin(__x.imag())) { - if (__libcpp_isinf(__x.real()) || __x.real() == 0) + if (__libcpp_isinf_or_builtin(__x.real()) || __x.real() == 0) return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag()); return complex<_Tp>(__x.imag(), __x.imag()); } - if (__libcpp_isnan(__x.real())) + if (__libcpp_isnan_or_builtin(__x.real())) { return complex<_Tp>(__x.real(), __x.real()); } - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag())); } @@ -1227,11 +1227,11 @@ template complex<_Tp> sinh(const complex<_Tp>& __x) { - if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag())) return complex<_Tp>(__x.real(), _Tp(NAN)); - if (__x.real() == 0 && !__libcpp_isfinite(__x.imag())) + if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag())) return complex<_Tp>(__x.real(), _Tp(NAN)); - if (__x.imag() == 0 && !__libcpp_isfinite(__x.real())) + if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real())) return __x; return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag())); } @@ -1242,13 +1242,13 @@ template complex<_Tp> cosh(const complex<_Tp>& __x) { - if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag())) return complex<_Tp>(abs(__x.real()), _Tp(NAN)); - if (__x.real() == 0 && !__libcpp_isfinite(__x.imag())) + if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag())) return complex<_Tp>(_Tp(NAN), __x.real()); if (__x.real() == 0 && __x.imag() == 0) return complex<_Tp>(_Tp(1), __x.imag()); - if (__x.imag() == 0 && !__libcpp_isfinite(__x.real())) + if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real())) return complex<_Tp>(abs(__x.real()), __x.imag()); return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag())); } @@ -1259,19 +1259,19 @@ template complex<_Tp> tanh(const complex<_Tp>& __x) { - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { - if (!__libcpp_isfinite(__x.imag())) + if (!__libcpp_isfinite_or_builtin(__x.imag())) return complex<_Tp>(_Tp(1), _Tp(0)); return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag()))); } - if (__libcpp_isnan(__x.real()) && __x.imag() == 0) + if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0) return __x; _Tp __2r(_Tp(2) * __x.real()); _Tp __2i(_Tp(2) * __x.imag()); _Tp __d(cosh(__2r) + cos(__2i)); _Tp __2rsh(sinh(__2r)); - if (__libcpp_isinf(__2rsh) && __libcpp_isinf(__d)) + if (__libcpp_isinf_or_builtin(__2rsh) && __libcpp_isinf_or_builtin(__d)) return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1), __2i > _Tp(0) ? _Tp(0) : _Tp(-0.)); return complex<_Tp>(__2rsh/__d, sin(__2i)/__d); @@ -1294,11 +1294,11 @@ complex<_Tp> acos(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); - if (__libcpp_isinf(__x.real())) + if (__libcpp_isinf_or_builtin(__x.real())) { - if (__libcpp_isnan(__x.imag())) + if (__libcpp_isnan_or_builtin(__x.imag())) return complex<_Tp>(__x.imag(), __x.real()); - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) { if (__x.real() < _Tp(0)) return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag()); @@ -1308,13 +1308,13 @@ acos(const complex<_Tp>& __x) return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real()); return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real()); } - if (__libcpp_isnan(__x.real())) + if (__libcpp_isnan_or_builtin(__x.real())) { - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(__x.real(), -__x.imag()); return complex<_Tp>(__x.real(), __x.real()); } - if (__libcpp_isinf(__x.imag())) + if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(__pi/_Tp(2), -__x.imag()); if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag()))) return complex<_Tp>(__pi/_Tp(2), -__x.imag()); Modified: vendor/libc++/dist/include/optional ============================================================================== --- vendor/libc++/dist/include/optional Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/optional Thu Jul 13 19:25:57 2017 (r320963) @@ -439,46 +439,122 @@ struct __optional_storage_base<_Tp, true> } }; -template ::value> -struct __optional_storage; - -template -struct __optional_storage<_Tp, true> : __optional_storage_base<_Tp> +template ::value> +struct __optional_copy_base : __optional_storage_base<_Tp> { using __optional_storage_base<_Tp>::__optional_storage_base; }; template -struct __optional_storage<_Tp, false> : __optional_storage_base<_Tp> +struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp> { - using value_type = _Tp; using __optional_storage_base<_Tp>::__optional_storage_base; _LIBCPP_INLINE_VISIBILITY - __optional_storage() = default; + __optional_copy_base() = default; _LIBCPP_INLINE_VISIBILITY - __optional_storage(const __optional_storage& __opt) + __optional_copy_base(const __optional_copy_base& __opt) { this->__construct_from(__opt); } _LIBCPP_INLINE_VISIBILITY - __optional_storage(__optional_storage&& __opt) + __optional_copy_base(__optional_copy_base&&) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_copy_base& operator=(const __optional_copy_base&) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_copy_base& operator=(__optional_copy_base&&) = default; +}; + +template ::value> +struct __optional_move_base : __optional_copy_base<_Tp> +{ + using __optional_copy_base<_Tp>::__optional_copy_base; +}; + +template +struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp> +{ + using value_type = _Tp; + using __optional_copy_base<_Tp>::__optional_copy_base; + + _LIBCPP_INLINE_VISIBILITY + __optional_move_base() = default; + _LIBCPP_INLINE_VISIBILITY + __optional_move_base(const __optional_move_base&) = default; + + _LIBCPP_INLINE_VISIBILITY + __optional_move_base(__optional_move_base&& __opt) noexcept(is_nothrow_move_constructible_v) { this->__construct_from(_VSTD::move(__opt)); } _LIBCPP_INLINE_VISIBILITY - __optional_storage& operator=(const __optional_storage& __opt) + __optional_move_base& operator=(const __optional_move_base&) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_move_base& operator=(__optional_move_base&&) = default; +}; + +template ::value && + is_trivially_copy_constructible<_Tp>::value && + is_trivially_copy_assignable<_Tp>::value> +struct __optional_copy_assign_base : __optional_move_base<_Tp> +{ + using __optional_move_base<_Tp>::__optional_move_base; +}; + +template +struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp> +{ + using __optional_move_base<_Tp>::__optional_move_base; + + _LIBCPP_INLINE_VISIBILITY + __optional_copy_assign_base() = default; + _LIBCPP_INLINE_VISIBILITY + __optional_copy_assign_base(const __optional_copy_assign_base&) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_copy_assign_base(__optional_copy_assign_base&&) = default; + + _LIBCPP_INLINE_VISIBILITY + __optional_copy_assign_base& operator=(const __optional_copy_assign_base& __opt) { this->__assign_from(__opt); return *this; } _LIBCPP_INLINE_VISIBILITY - __optional_storage& operator=(__optional_storage&& __opt) + __optional_copy_assign_base& operator=(__optional_copy_assign_base&&) = default; +}; + +template ::value && + is_trivially_move_constructible<_Tp>::value && + is_trivially_move_assignable<_Tp>::value> +struct __optional_move_assign_base : __optional_copy_assign_base<_Tp> +{ + using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base; +}; + +template +struct __optional_move_assign_base<_Tp, false> : __optional_copy_assign_base<_Tp> +{ + using value_type = _Tp; + using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base; + + _LIBCPP_INLINE_VISIBILITY + __optional_move_assign_base() = default; + _LIBCPP_INLINE_VISIBILITY + __optional_move_assign_base(const __optional_move_assign_base& __opt) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_move_assign_base(__optional_move_assign_base&&) = default; + _LIBCPP_INLINE_VISIBILITY + __optional_move_assign_base& operator=(const __optional_move_assign_base&) = default; + + _LIBCPP_INLINE_VISIBILITY + __optional_move_assign_base& operator=(__optional_move_assign_base&& __opt) noexcept(is_nothrow_move_assignable_v && is_nothrow_move_constructible_v) { @@ -501,11 +577,11 @@ using __optional_sfinae_assign_base_t = __sfinae_assig template class optional - : private __optional_storage<_Tp> + : private __optional_move_assign_base<_Tp> , private __optional_sfinae_ctor_base_t<_Tp> , private __optional_sfinae_assign_base_t<_Tp> { - using __base = __optional_storage<_Tp>; + using __base = __optional_move_assign_base<_Tp>; public: using value_type = _Tp; Modified: vendor/libc++/dist/include/regex ============================================================================== --- vendor/libc++/dist/include/regex Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/regex Thu Jul 13 19:25:57 2017 (r320963) @@ -6142,7 +6142,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits { __flags_ |= regex_constants::__no_update_pos; _BidirectionalIterator __start = __match_[0].second; - if (__match_.empty()) + if (__match_[0].first == __match_[0].second) { if (__start == __end_) { Modified: vendor/libc++/dist/include/string ============================================================================== --- vendor/libc++/dist/include/string Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/include/string Thu Jul 13 19:25:57 2017 (r320963) @@ -676,11 +676,11 @@ class _LIBCPP_TEMPLATE_VIS basic_string (private) }; #if _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x01}; - enum {__long_mask = 0x1ul}; + static const size_type __short_mask = 0x01; + static const size_type __long_mask = 0x1ul; #else // _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + static const size_type __short_mask = 0x80; + static const size_type __long_mask = ~(size_type(~0) >> 1); #endif // _LIBCPP_BIG_ENDIAN enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? @@ -706,11 +706,11 @@ class _LIBCPP_TEMPLATE_VIS basic_string (private) }; #if _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + static const size_type __short_mask = 0x80; + static const size_type __long_mask = ~(size_type(~0) >> 1); #else // _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x01}; - enum {__long_mask = 0x1ul}; + static const size_type __short_mask = 0x01; + static const size_type __long_mask = 0x1ul; #endif // _LIBCPP_BIG_ENDIAN enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? Modified: vendor/libc++/dist/lib/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/lib/CMakeLists.txt Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/lib/CMakeLists.txt Thu Jul 13 19:25:57 2017 (r320963) @@ -355,8 +355,8 @@ if (LIBCXX_INSTALL_LIBRARY) set(experimental_lib cxx_experimental) endif() install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib} - LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx - ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ) # NOTE: This install command must go after the cxx install command otherwise # it will not be executed after the library symlinks are installed. @@ -364,7 +364,7 @@ if (LIBCXX_INSTALL_LIBRARY) # Replace the libc++ filename with $ # after we required CMake 3.0. install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" - DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} + DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx) endif() endif() Added: vendor/libc++/dist/src/experimental/filesystem/filesystem_time_helper.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/src/experimental/filesystem/filesystem_time_helper.h Thu Jul 13 19:25:57 2017 (r320963) @@ -0,0 +1,173 @@ +//===----------------------------------------------------------------------===//// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===//// + +#ifndef FILESYSTEM_TIME_HELPER_H +#define FILESYSTEM_TIME_HELPER_H + +#include "experimental/__config" +#include "chrono" +#include "cstdlib" +#include "climits" + +#include +#include +#if !defined(UTIME_OMIT) +#include // for ::utimes as used in __last_write_time +#endif + +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM + +namespace time_detail { namespace { + +using namespace chrono; + +template ::value> +struct fs_time_util_base { + static constexpr auto max_seconds = + duration_cast(FileTimeT::duration::max()).count(); + + static constexpr auto max_nsec = + duration_cast(FileTimeT::duration::max() - + seconds(max_seconds)) + .count(); + + static constexpr auto min_seconds = + duration_cast(FileTimeT::duration::min()).count(); + + static constexpr auto min_nsec_timespec = + duration_cast( + (FileTimeT::duration::min() - seconds(min_seconds)) + seconds(1)) + .count(); + + // Static assert that these values properly round trip. + static_assert((seconds(min_seconds) + + duration_cast(nanoseconds(min_nsec_timespec))) - + duration_cast(seconds(1)) == + FileTimeT::duration::min(), + ""); +}; + +template +struct fs_time_util_base { + static const long long max_seconds; + static const long long max_nsec; + static const long long min_seconds; + static const long long min_nsec_timespec; +}; + +template +const long long fs_time_util_base::max_seconds = + duration_cast(FileTimeT::duration::max()).count(); + +template +const long long fs_time_util_base::max_nsec = + duration_cast(FileTimeT::duration::max() - + seconds(max_seconds)) + .count(); + +template +const long long fs_time_util_base::min_seconds = + duration_cast(FileTimeT::duration::min()).count(); + +template +const long long fs_time_util_base::min_nsec_timespec = + duration_cast((FileTimeT::duration::min() - + seconds(min_seconds)) + + seconds(1)) + .count(); + +template +struct fs_time_util : fs_time_util_base { + using Base = fs_time_util_base; + using Base::max_nsec; + using Base::max_seconds; + using Base::min_nsec_timespec; + using Base::min_seconds; + +public: + template + static bool checked_set(CType* out, ChronoType time) { + using Lim = numeric_limits; + if (time > Lim::max() || time < Lim::min()) + return false; + *out = static_cast(time); + return true; + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(TimeSpecT tm) { + if (tm.tv_sec >= 0) { + return (tm.tv_sec < max_seconds) || + (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec); + } else if (tm.tv_sec == (min_seconds - 1)) { + return tm.tv_nsec >= min_nsec_timespec; + } else { + return (tm.tv_sec >= min_seconds); + } + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(FileTimeT tm) { + auto secs = duration_cast(tm.time_since_epoch()); + auto nsecs = duration_cast(tm.time_since_epoch() - secs); + if (nsecs.count() < 0) { + secs = secs + seconds(1); + nsecs = nsecs + seconds(1); + } + using TLim = numeric_limits; + if (secs.count() >= 0) + return secs.count() <= TLim::max(); + return secs.count() >= TLim::min(); + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 FileTimeT + convert_timespec(TimeSpecT tm) { + auto adj_msec = duration_cast(nanoseconds(tm.tv_nsec)); + if (tm.tv_sec >= 0) { + auto Dur = seconds(tm.tv_sec) + microseconds(adj_msec); + return FileTimeT(Dur); + } else if (duration_cast(nanoseconds(tm.tv_nsec)).count() == + 0) { + return FileTimeT(seconds(tm.tv_sec)); + } else { // tm.tv_sec < 0 + auto adj_subsec = + duration_cast(seconds(1) - nanoseconds(tm.tv_nsec)); + auto Dur = seconds(tm.tv_sec + 1) - adj_subsec; + return FileTimeT(Dur); + } + } + + template + static bool set_times_checked(TimeT* sec_out, SubSecT* subsec_out, + FileTimeT tp) { + using namespace chrono; + auto dur = tp.time_since_epoch(); + auto sec_dur = duration_cast(dur); + auto subsec_dur = duration_cast(dur - sec_dur); + // The tv_nsec and tv_usec fields must not be negative so adjust accordingly + if (subsec_dur.count() < 0) { + if (sec_dur.count() > min_seconds) { + sec_dur -= seconds(1); + subsec_dur += seconds(1); + } else { + subsec_dur = SubSecDurT::zero(); + } + } + return checked_set(sec_out, sec_dur.count()) && + checked_set(subsec_out, subsec_dur.count()); + } +}; + +} // end namespace +} // end namespace time_detail + +using time_detail::fs_time_util; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM + +#endif // FILESYSTEM_TIME_HELPER_H Modified: vendor/libc++/dist/src/experimental/filesystem/operations.cpp ============================================================================== --- vendor/libc++/dist/src/experimental/filesystem/operations.cpp Thu Jul 13 19:25:54 2017 (r320962) +++ vendor/libc++/dist/src/experimental/filesystem/operations.cpp Thu Jul 13 19:25:57 2017 (r320963) @@ -15,6 +15,8 @@ #include "cstdlib" #include "climits" +#include "filesystem_time_helper.h" + #include #include #include @@ -426,17 +428,20 @@ void __current_path(const path& p, std::error_code *ec bool __equivalent(const path& p1, const path& p2, std::error_code *ec) { + auto make_unsupported_error = [&]() { + set_or_throw(make_error_code(errc::not_supported), ec, + "equivalent", p1, p2); + return false; + }; std::error_code ec1, ec2; struct ::stat st1 = {}; struct ::stat st2 = {}; auto s1 = detail::posix_stat(p1.native(), st1, &ec1); + if (!exists(s1)) + return make_unsupported_error(); auto s2 = detail::posix_stat(p2.native(), st2, &ec2); - - if ((!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2))) { - set_or_throw(make_error_code(errc::not_supported), ec, - "equivalent", p1, p2); - return false; - } + if (!exists(s2)) + return make_unsupported_error(); if (ec) ec->clear(); return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino); } @@ -502,17 +507,6 @@ bool __fs_is_empty(const path& p, std::error_code *ec) namespace detail { namespace { -using namespace std::chrono; - -template -bool checked_set(CType* out, ChronoType time) { - using Lim = numeric_limits; - if (time > Lim::max() || time < Lim::min()) - return false; - *out = static_cast(time); - return true; -} - using TimeSpec = struct timespec; using StatT = struct stat; @@ -525,137 +519,10 @@ __attribute__((unused)) // Suppress warning TimeSpec extract_atime(StatT const& st) { return st.st_atim; } #endif -constexpr auto max_seconds = duration_cast( - file_time_type::duration::max()).count(); - -constexpr auto max_nsec = duration_cast( - file_time_type::duration::max() - seconds(max_seconds)).count(); - -constexpr auto min_seconds = duration_cast( - file_time_type::duration::min()).count(); - -constexpr auto min_nsec_timespec = duration_cast( - (file_time_type::duration::min() - seconds(min_seconds)) + seconds(1)).count(); - -// Static assert that these values properly round trip. -static_assert((seconds(min_seconds) + duration_cast(nanoseconds(min_nsec_timespec))) - - duration_cast(seconds(1)) - == file_time_type::duration::min(), ""); - -constexpr auto max_time_t = numeric_limits::max(); -constexpr auto min_time_t = numeric_limits::min(); - -#if !defined(__LP64__) && defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" -#endif - -_LIBCPP_CONSTEXPR_AFTER_CXX11 -bool is_representable(TimeSpec const& tm) { - if (tm.tv_sec >= 0) { - return (tm.tv_sec < max_seconds) || - (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec); - } else if (tm.tv_sec == (min_seconds - 1)) { - return tm.tv_nsec >= min_nsec_timespec; - } else { - return (tm.tv_sec >= min_seconds); - } -} -#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR -#if defined(__LP64__) -static_assert(is_representable({max_seconds, max_nsec}), ""); -static_assert(!is_representable({max_seconds + 1, 0}), ""); -static_assert(!is_representable({max_seconds, max_nsec + 1}), ""); -static_assert(!is_representable({max_time_t, 0}), ""); -static_assert(is_representable({min_seconds, 0}), ""); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA42CDAC340; Thu, 13 Jul 2017 19:26:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7BB9B9F3; Thu, 13 Jul 2017 19:26:14 +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 v6DJQD2v036870; Thu, 13 Jul 2017 19:26:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJQDsL036869; Thu, 13 Jul 2017 19:26:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131926.v6DJQDsL036869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320966 - vendor/lld/lld-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r307894 X-SVN-Commit-Revision: 320966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:14 -0000 Author: dim Date: Thu Jul 13 19:26:13 2017 New Revision: 320966 URL: https://svnweb.freebsd.org/changeset/base/320966 Log: Tag lld trunk r307894. Added: vendor/lld/lld-trunk-r307894/ - copied from r320965, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10817DAC3A9; Thu, 13 Jul 2017 19:26:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id B747BB03; Thu, 13 Jul 2017 19:26:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DJQN0a036993; Thu, 13 Jul 2017 19:26:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJQNqR036992; Thu, 13 Jul 2017 19:26:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131926.v6DJQNqR036992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320968 - vendor/lldb/lldb-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r307894 X-SVN-Commit-Revision: 320968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:25 -0000 Author: dim Date: Thu Jul 13 19:26:23 2017 New Revision: 320968 URL: https://svnweb.freebsd.org/changeset/base/320968 Log: Tag lldb trunk r307894. Added: vendor/lldb/lldb-trunk-r307894/ - copied from r320967, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F152DAC2A0; Thu, 13 Jul 2017 19:26:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id F323A8E8; Thu, 13 Jul 2017 19:26:03 +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 v6DJQ3C1036752; Thu, 13 Jul 2017 19:26:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJQ3HM036751; Thu, 13 Jul 2017 19:26:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131926.v6DJQ3HM036751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320964 - vendor/libc++/libc++-trunk-r307894 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r307894 X-SVN-Commit-Revision: 320964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:04 -0000 Author: dim Date: Thu Jul 13 19:26:02 2017 New Revision: 320964 URL: https://svnweb.freebsd.org/changeset/base/320964 Log: Tag libc++ trunk r307894. Added: vendor/libc++/libc++-trunk-r307894/ - copied from r320963, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93595DAC328; Thu, 13 Jul 2017 19:26:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 30282987; Thu, 13 Jul 2017 19:26:10 +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 v6DJQ9EA036823; Thu, 13 Jul 2017 19:26:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJQ7U5036801; Thu, 13 Jul 2017 19:26:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131926.v6DJQ7U5036801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320965 - in vendor/lld/dist: COFF ELF lib/ReaderWriter/MachO test test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/invalid/Inputs test/ELF/linkerscript tes... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: COFF ELF lib/ReaderWriter/MachO test test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/invalid/Inputs test/ELF/linkerscript test/ELF/lto X-SVN-Commit-Revision: 320965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:10 -0000 Author: dim Date: Thu Jul 13 19:26:06 2017 New Revision: 320965 URL: https://svnweb.freebsd.org/changeset/base/320965 Log: Vendor import of lld trunk r307894: https://llvm.org/svn/llvm-project/lld/trunk@307894 Added: vendor/lld/dist/test/COFF/Inputs/library-arm64.lib (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-diff-cl.pdb (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-diff.cpp (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-diff.obj (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-scopes-a.yaml vendor/lld/dist/test/COFF/Inputs/pdb-scopes-b.yaml vendor/lld/dist/test/COFF/arm64-magic.yaml vendor/lld/dist/test/COFF/arm64-relocs-imports.test vendor/lld/dist/test/COFF/pdb-diff.test vendor/lld/dist/test/COFF/pdb-invalid-func-type.yaml vendor/lld/dist/test/COFF/pdb-linker-module.test vendor/lld/dist/test/COFF/pdb-scopes.test vendor/lld/dist/test/ELF/Inputs/gnu-ifunc-dso.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/symver-archive1.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/symver-archive2.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/version-script-no-warn2.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/version-script-weak.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/wrap-dynamic-undef.s (contents, props changed) vendor/lld/dist/test/ELF/duplicated-synthetic-sym.s (contents, props changed) vendor/lld/dist/test/ELF/gnu-ifunc-dso.s (contents, props changed) vendor/lld/dist/test/ELF/invalid/invalid-debug-relocations.test vendor/lld/dist/test/ELF/linkerscript/non-alloc-segment.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/unused-synthetic.s (contents, props changed) vendor/lld/dist/test/ELF/symver-archive.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-no-warn2.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-symver2.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-undef-version.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-weak.s (contents, props changed) vendor/lld/dist/test/ELF/wrap-dynamic-undef.s (contents, props changed) Deleted: vendor/lld/dist/test/ELF/invalid/Inputs/invalid-relocation-x64.elf Modified: vendor/lld/dist/COFF/Chunks.cpp vendor/lld/dist/COFF/Chunks.h vendor/lld/dist/COFF/Config.h vendor/lld/dist/COFF/Driver.cpp vendor/lld/dist/COFF/DriverUtils.cpp vendor/lld/dist/COFF/Error.cpp vendor/lld/dist/COFF/Error.h vendor/lld/dist/COFF/InputFiles.cpp vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/COFF/PDB.h vendor/lld/dist/COFF/Symbols.cpp vendor/lld/dist/COFF/Writer.cpp vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/Error.cpp vendor/lld/dist/ELF/Error.h vendor/lld/dist/ELF/Filesystem.cpp vendor/lld/dist/ELF/GdbIndex.h vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/Relocations.h vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/Symbols.h vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/SyntheticSections.h vendor/lld/dist/ELF/Thunks.cpp vendor/lld/dist/ELF/Thunks.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp vendor/lld/dist/test/COFF/combined-resources.test vendor/lld/dist/test/COFF/pdb-comdat.test vendor/lld/dist/test/COFF/pdb-lib.s vendor/lld/dist/test/COFF/pdb-none.test vendor/lld/dist/test/COFF/pdb-source-lines.test vendor/lld/dist/test/COFF/pdb-symbol-types.yaml vendor/lld/dist/test/COFF/pdb.test vendor/lld/dist/test/ELF/arm-mov-relocs.s vendor/lld/dist/test/ELF/copy-in-shared.s vendor/lld/dist/test/ELF/defsym.s vendor/lld/dist/test/ELF/invalid/invalid-relocation-x64.test vendor/lld/dist/test/ELF/linkerscript/locationcountererr2.s vendor/lld/dist/test/ELF/linkerscript/out-of-order.s vendor/lld/dist/test/ELF/lto/defsym.ll vendor/lld/dist/test/ELF/lto/wrap-1.ll vendor/lld/dist/test/ELF/lto/wrap-2.ll vendor/lld/dist/test/ELF/version-script-symver.s vendor/lld/dist/test/ELF/wrap.s vendor/lld/dist/test/lit.cfg Modified: vendor/lld/dist/COFF/Chunks.cpp ============================================================================== --- vendor/lld/dist/COFF/Chunks.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Chunks.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -52,6 +52,7 @@ static void add16(uint8_t *P, int16_t V) { write16le(P static void add32(uint8_t *P, int32_t V) { write32le(P, read32le(P) + V); } static void add64(uint8_t *P, int64_t V) { write64le(P, read64le(P) + V); } static void or16(uint8_t *P, uint16_t V) { write16le(P, read16le(P) | V); } +static void or32(uint8_t *P, uint32_t V) { write32le(P, read32le(P) | V); } static void applySecRel(const SectionChunk *Sec, uint8_t *Off, OutputSection *OS, uint64_t S) { @@ -166,6 +167,41 @@ void SectionChunk::applyRelARM(uint8_t *Off, uint16_t } } +static void applyArm64Addr(uint8_t *Off, uint64_t Imm) { + uint32_t ImmLo = (Imm & 0x3) << 29; + uint32_t ImmHi = (Imm & 0x1FFFFC) << 3; + uint64_t Mask = (0x3 << 29) | (0x1FFFFC << 3); + write32le(Off, (read32le(Off) & ~Mask) | ImmLo | ImmHi); +} + +// Update the immediate field in a AARCH64 ldr, str, and add instruction. +static void applyArm64Imm(uint8_t *Off, uint64_t Imm) { + uint32_t Orig = read32le(Off); + Imm += (Orig >> 10) & 0xFFF; + Orig &= ~(0xFFF << 10); + write32le(Off, Orig | ((Imm & 0xFFF) << 10)); +} + +static void applyArm64Ldr(uint8_t *Off, uint64_t Imm) { + int Size = read32le(Off) >> 30; + Imm >>= Size; + applyArm64Imm(Off, Imm); +} + +void SectionChunk::applyRelARM64(uint8_t *Off, uint16_t Type, OutputSection *OS, + uint64_t S, uint64_t P) const { + switch (Type) { + case IMAGE_REL_ARM64_PAGEBASE_REL21: applyArm64Addr(Off, (S >> 12) - (P >> 12)); break; + case IMAGE_REL_ARM64_PAGEOFFSET_12A: applyArm64Imm(Off, S & 0xfff); break; + case IMAGE_REL_ARM64_PAGEOFFSET_12L: applyArm64Ldr(Off, S & 0xfff); break; + case IMAGE_REL_ARM64_BRANCH26: or32(Off, ((S - P) & 0x0FFFFFFC) >> 2); break; + case IMAGE_REL_ARM64_ADDR32: add32(Off, S + Config->ImageBase); break; + case IMAGE_REL_ARM64_ADDR64: add64(Off, S + Config->ImageBase); break; + default: + fatal("unsupported relocation type 0x" + Twine::utohexstr(Type)); + } +} + void SectionChunk::writeTo(uint8_t *Buf) const { if (!hasData()) return; @@ -210,6 +246,9 @@ void SectionChunk::writeTo(uint8_t *Buf) const { case ARMNT: applyRelARM(Off, Rel.Type, OS, S, P); break; + case ARM64: + applyRelARM64(Off, Rel.Type, OS, S, P); + break; default: llvm_unreachable("unknown machine type"); } @@ -236,6 +275,10 @@ static uint8_t getBaserelType(const coff_relocation &R if (Rel.Type == IMAGE_REL_ARM_MOV32T) return IMAGE_REL_BASED_ARM_MOV32T; return IMAGE_REL_BASED_ABSOLUTE; + case ARM64: + if (Rel.Type == IMAGE_REL_ARM64_ADDR64) + return IMAGE_REL_BASED_DIR64; + return IMAGE_REL_BASED_ABSOLUTE; default: llvm_unreachable("unknown machine type"); } @@ -343,6 +386,14 @@ void ImportThunkChunkARM::writeTo(uint8_t *Buf) const memcpy(Buf + OutputSectionOff, ImportThunkARM, sizeof(ImportThunkARM)); // Fix mov.w and mov.t operands. applyMOV32T(Buf + OutputSectionOff, ImpSymbol->getRVA() + Config->ImageBase); +} + +void ImportThunkChunkARM64::writeTo(uint8_t *Buf) const { + int64_t PageOff = (ImpSymbol->getRVA() >> 12) - (RVA >> 12); + int64_t Off = ImpSymbol->getRVA() & 0xfff; + memcpy(Buf + OutputSectionOff, ImportThunkARM64, sizeof(ImportThunkARM64)); + applyArm64Addr(Buf + OutputSectionOff, PageOff); + applyArm64Ldr(Buf + OutputSectionOff + 4, Off); } void LocalImportChunk::getBaserels(std::vector *Res) { Modified: vendor/lld/dist/COFF/Chunks.h ============================================================================== --- vendor/lld/dist/COFF/Chunks.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Chunks.h Thu Jul 13 19:26:06 2017 (r320965) @@ -151,6 +151,8 @@ class SectionChunk : public Chunk { (public) uint64_t P) const; void applyRelARM(uint8_t *Off, uint16_t Type, OutputSection *OS, uint64_t S, uint64_t P) const; + void applyRelARM64(uint8_t *Off, uint16_t Type, OutputSection *OS, uint64_t S, + uint64_t P) const; // Called if the garbage collector decides to not include this chunk // in a final output. It's supposed to print out a log message to stdout. @@ -264,6 +266,12 @@ static const uint8_t ImportThunkARM[] = { 0xdc, 0xf8, 0x00, 0xf0, // ldr.w pc, [ip] }; +static const uint8_t ImportThunkARM64[] = { + 0x10, 0x00, 0x00, 0x90, // adrp x16, #0 + 0x10, 0x02, 0x40, 0xf9, // ldr x16, [x16] + 0x00, 0x02, 0x1f, 0xd6, // br x16 +}; + // Windows-specific. // A chunk for DLL import jump table entry. In a final output, it's // contents will be a JMP instruction to some __imp_ symbol. @@ -293,6 +301,16 @@ class ImportThunkChunkARM : public Chunk { (public) explicit ImportThunkChunkARM(Defined *S) : ImpSymbol(S) {} size_t getSize() const override { return sizeof(ImportThunkARM); } void getBaserels(std::vector *Res) override; + void writeTo(uint8_t *Buf) const override; + +private: + Defined *ImpSymbol; +}; + +class ImportThunkChunkARM64 : public Chunk { +public: + explicit ImportThunkChunkARM64(Defined *S) : ImpSymbol(S) {} + size_t getSize() const override { return sizeof(ImportThunkARM64); } void writeTo(uint8_t *Buf) const override; private: Modified: vendor/lld/dist/COFF/Config.h ============================================================================== --- vendor/lld/dist/COFF/Config.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Config.h Thu Jul 13 19:26:06 2017 (r320965) @@ -31,6 +31,7 @@ class SymbolBody; // Short aliases. static const auto AMD64 = llvm::COFF::IMAGE_FILE_MACHINE_AMD64; +static const auto ARM64 = llvm::COFF::IMAGE_FILE_MACHINE_ARM64; static const auto ARMNT = llvm::COFF::IMAGE_FILE_MACHINE_ARMNT; static const auto I386 = llvm::COFF::IMAGE_FILE_MACHINE_I386; @@ -73,7 +74,7 @@ enum class DebugType { // Global configuration. struct Configuration { enum ManifestKind { SideBySide, Embed, No }; - bool is64() { return Machine == AMD64; } + bool is64() { return Machine == AMD64 || Machine == ARM64; } llvm::COFF::MachineTypes Machine = IMAGE_FILE_MACHINE_UNKNOWN; bool Verbose = false; @@ -91,6 +92,7 @@ struct Configuration { bool WriteSymtab = true; unsigned DebugTypes = static_cast(DebugType::None); llvm::SmallString<128> PDBPath; + std::vector Argv; // Symbols in this set are considered as live by the garbage collector. std::set GCRoot; Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Driver.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -55,8 +55,8 @@ std::vector SpecificAllocBase::In bool link(ArrayRef Args, raw_ostream &Diag) { ErrorCount = 0; ErrorOS = &Diag; - Argv0 = Args[0]; Config = make(); + Config->Argv = {Args.begin(), Args.end()}; Config->ColorDiagnostics = (ErrorOS == &llvm::errs() && Process::StandardErrHasColors()); Driver = make(); Modified: vendor/lld/dist/COFF/DriverUtils.cpp ============================================================================== --- vendor/lld/dist/COFF/DriverUtils.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/DriverUtils.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -85,6 +85,7 @@ MachineTypes getMachineType(StringRef S) { .Cases("x64", "amd64", AMD64) .Cases("x86", "i386", I386) .Case("arm", ARMNT) + .Case("arm64", ARM64) .Default(IMAGE_FILE_MACHINE_UNKNOWN); if (MT != IMAGE_FILE_MACHINE_UNKNOWN) return MT; @@ -95,6 +96,8 @@ StringRef machineToStr(MachineTypes MT) { switch (MT) { case ARMNT: return "arm"; + case ARM64: + return "arm64"; case AMD64: return "x64"; case I386: @@ -378,13 +381,11 @@ static std::string createManifestXml() { static std::unique_ptr createMemoryBufferForManifestRes(size_t ManifestSize) { - size_t ResSize = alignTo(object::WIN_RES_MAGIC_SIZE + - object::WIN_RES_NULL_ENTRY_SIZE + - sizeof(object::WinResHeaderPrefix) + - sizeof(object::WinResIDs) + - sizeof(object::WinResHeaderSuffix) + - ManifestSize, - object::WIN_RES_DATA_ALIGNMENT); + size_t ResSize = alignTo( + object::WIN_RES_MAGIC_SIZE + object::WIN_RES_NULL_ENTRY_SIZE + + sizeof(object::WinResHeaderPrefix) + sizeof(object::WinResIDs) + + sizeof(object::WinResHeaderSuffix) + ManifestSize, + object::WIN_RES_DATA_ALIGNMENT); return MemoryBuffer::getNewMemBuffer(ResSize); } Modified: vendor/lld/dist/COFF/Error.cpp ============================================================================== --- vendor/lld/dist/COFF/Error.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Error.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -29,7 +29,6 @@ namespace lld { static std::mutex Mu; namespace coff { -StringRef Argv0; uint64_t ErrorCount; raw_ostream *ErrorOS; @@ -45,7 +44,7 @@ static LLVM_ATTRIBUTE_NORETURN void exitLld(int Val) { } static void print(StringRef S, raw_ostream::Colors C) { - *ErrorOS << Argv0 + ": "; + *ErrorOS << Config->Argv[0] << ": "; if (Config->ColorDiagnostics) { ErrorOS->changeColor(C, true); *ErrorOS << S; @@ -58,7 +57,7 @@ static void print(StringRef S, raw_ostream::Colors C) void log(const Twine &Msg) { if (Config->Verbose) { std::lock_guard Lock(Mu); - outs() << Argv0 << ": " << Msg << "\n"; + outs() << Config->Argv[0] << ": " << Msg << "\n"; outs().flush(); } } Modified: vendor/lld/dist/COFF/Error.h ============================================================================== --- vendor/lld/dist/COFF/Error.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Error.h Thu Jul 13 19:26:06 2017 (r320965) @@ -18,7 +18,6 @@ namespace coff { extern uint64_t ErrorCount; extern llvm::raw_ostream *ErrorOS; -extern llvm::StringRef Argv0; void log(const Twine &Msg); void message(const Twine &Msg); Modified: vendor/lld/dist/COFF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/COFF/InputFiles.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/InputFiles.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -380,6 +380,8 @@ MachineTypes BitcodeFile::getMachineType() { return I386; case Triple::arm: return ARMNT; + case Triple::aarch64: + return ARM64; default: return IMAGE_FILE_MACHINE_UNKNOWN; } Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/PDB.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -18,19 +18,20 @@ #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h" #include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h" #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" +#include "llvm/DebugInfo/CodeView/SymbolSerializer.h" #include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h" #include "llvm/DebugInfo/CodeView/TypeIndexDiscovery.h" #include "llvm/DebugInfo/CodeView/TypeStreamMerger.h" #include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/DebugInfo/MSF/MSFBuilder.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h" #include "llvm/DebugInfo/PDB/Native/DbiStream.h" #include "llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h" #include "llvm/DebugInfo/PDB/Native/InfoStream.h" #include "llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/Native/PDBFileBuilder.h" -#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h" #include "llvm/DebugInfo/PDB/Native/TpiStream.h" @@ -124,26 +125,25 @@ static bool remapTypeIndex(TypeIndex &TI, ArrayRef Contents, ArrayRef TypeIndexMap, ArrayRef TypeRefs) { for (const TiReference &Ref : TypeRefs) { unsigned ByteSize = Ref.Count * sizeof(TypeIndex); - if (Contents.size() < Ref.Offset + ByteSize) { - log("ignoring short symbol record"); - return false; - } + if (Contents.size() < Ref.Offset + ByteSize) + fatal("symbol record too short"); MutableArrayRef TIs( reinterpret_cast(Contents.data() + Ref.Offset), Ref.Count); - for (TypeIndex &TI : TIs) + for (TypeIndex &TI : TIs) { if (!remapTypeIndex(TI, TypeIndexMap)) { + TI = TypeIndex(SimpleTypeKind::NotTranslated); log("ignoring symbol record in " + File->getName() + " with bad type index 0x" + utohexstr(TI.getIndex())); - return false; + continue; } + } } - return true; } /// MSVC translates S_PROC_ID_END to S_END. @@ -176,6 +176,70 @@ static MutableArrayRef copySymbolForPdb(const return NewData; } +/// Return true if this symbol opens a scope. This implies that the symbol has +/// "parent" and "end" fields, which contain the offset of the S_END or +/// S_INLINESITE_END record. +static bool symbolOpensScope(SymbolKind Kind) { + switch (Kind) { + case SymbolKind::S_GPROC32: + case SymbolKind::S_LPROC32: + case SymbolKind::S_LPROC32_ID: + case SymbolKind::S_GPROC32_ID: + case SymbolKind::S_BLOCK32: + case SymbolKind::S_SEPCODE: + case SymbolKind::S_THUNK32: + case SymbolKind::S_INLINESITE: + case SymbolKind::S_INLINESITE2: + return true; + default: + break; + } + return false; +} + +static bool symbolEndsScope(SymbolKind Kind) { + switch (Kind) { + case SymbolKind::S_END: + case SymbolKind::S_PROC_ID_END: + case SymbolKind::S_INLINESITE_END: + return true; + default: + break; + } + return false; +} + +struct ScopeRecord { + ulittle32_t PtrParent; + ulittle32_t PtrEnd; +}; + +struct SymbolScope { + ScopeRecord *OpeningRecord; + uint32_t ScopeOffset; +}; + +static void scopeStackOpen(SmallVectorImpl &Stack, + uint32_t CurOffset, CVSymbol &Sym) { + assert(symbolOpensScope(Sym.kind())); + SymbolScope S; + S.ScopeOffset = CurOffset; + S.OpeningRecord = const_cast( + reinterpret_cast(Sym.content().data())); + S.OpeningRecord->PtrParent = Stack.empty() ? 0 : Stack.back().ScopeOffset; + Stack.push_back(S); +} + +static void scopeStackClose(SmallVectorImpl &Stack, + uint32_t CurOffset, ObjectFile *File) { + if (Stack.empty()) { + warn("symbol scopes are not balanced in " + File->getName()); + return; + } + SymbolScope S = Stack.pop_back_val(); + S.OpeningRecord->PtrEnd = CurOffset; +} + static void mergeSymbolRecords(BumpPtrAllocator &Alloc, ObjectFile *File, ArrayRef TypeIndexMap, BinaryStreamRef SymData) { @@ -184,6 +248,7 @@ static void mergeSymbolRecords(BumpPtrAllocator &Alloc CVSymbolArray Syms; BinaryStreamReader Reader(SymData); ExitOnErr(Reader.readArray(Syms, Reader.getLength())); + SmallVector Scopes; for (const CVSymbol &Sym : Syms) { // Discover type index references in the record. Skip it if we don't know // where they are. @@ -199,14 +264,17 @@ static void mergeSymbolRecords(BumpPtrAllocator &Alloc // Re-map all the type index references. MutableArrayRef Contents = NewData.drop_front(sizeof(RecordPrefix)); - if (!remapTypesInSymbolRecord(File, Contents, TypeIndexMap, TypeRefs)) - continue; + remapTypesInSymbolRecord(File, Contents, TypeIndexMap, TypeRefs); - // FIXME: Fill in "Parent" and "End" fields by maintaining a stack of - // scopes. + // Fill in "Parent" and "End" fields by maintaining a stack of scopes. + CVSymbol NewSym(Sym.kind(), NewData); + if (symbolOpensScope(Sym.kind())) + scopeStackOpen(Scopes, File->ModuleDBI->getNextSymbolOffset(), NewSym); + else if (symbolEndsScope(Sym.kind())) + scopeStackClose(Scopes, File->ModuleDBI->getNextSymbolOffset(), File); // Add the symbol to the module. - File->ModuleDBI->addSymbol(CVSymbol(Sym.kind(), NewData)); + File->ModuleDBI->addSymbol(NewSym); } } @@ -246,7 +314,9 @@ static void addObjectsToPDB(BumpPtrAllocator &Alloc, S bool InArchive = !File->ParentName.empty(); SmallString<128> Path = InArchive ? File->ParentName : File->getName(); sys::fs::make_absolute(Path); + sys::path::native(Path, llvm::sys::path::Style::windows); StringRef Name = InArchive ? File->getName() : StringRef(Path); + File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); File->ModuleDBI->setObjFileName(Path); @@ -325,9 +395,52 @@ static void addObjectsToPDB(BumpPtrAllocator &Alloc, S addTypeInfo(Builder.getIpiBuilder(), IDTable); } +static void addLinkerModuleSymbols(StringRef Path, + pdb::DbiModuleDescriptorBuilder &Mod, + BumpPtrAllocator &Allocator) { + codeview::SymbolSerializer Serializer(Allocator, CodeViewContainer::Pdb); + codeview::ObjNameSym ONS(SymbolRecordKind::ObjNameSym); + codeview::Compile3Sym CS(SymbolRecordKind::Compile3Sym); + codeview::EnvBlockSym EBS(SymbolRecordKind::EnvBlockSym); + + ONS.Name = "* Linker *"; + ONS.Signature = 0; + + CS.Machine = Config->is64() ? CPUType::X64 : CPUType::Intel80386; + CS.Flags = CompileSym3Flags::None; + CS.VersionBackendBuild = 0; + CS.VersionBackendMajor = 0; + CS.VersionBackendMinor = 0; + CS.VersionBackendQFE = 0; + CS.VersionFrontendBuild = 0; + CS.VersionFrontendMajor = 0; + CS.VersionFrontendMinor = 0; + CS.VersionFrontendQFE = 0; + CS.Version = "LLVM Linker"; + CS.setLanguage(SourceLanguage::Link); + + ArrayRef Args = makeArrayRef(Config->Argv).drop_front(); + std::string ArgStr = llvm::join(Args, " "); + EBS.Fields.push_back("cwd"); + SmallString<64> cwd; + llvm::sys::fs::current_path(cwd); + EBS.Fields.push_back(cwd); + EBS.Fields.push_back("exe"); + EBS.Fields.push_back(Config->Argv[0]); + EBS.Fields.push_back("pdb"); + EBS.Fields.push_back(Path); + EBS.Fields.push_back("cmd"); + EBS.Fields.push_back(ArgStr); + Mod.addSymbol(codeview::SymbolSerializer::writeOneSymbol( + ONS, Allocator, CodeViewContainer::Pdb)); + Mod.addSymbol(codeview::SymbolSerializer::writeOneSymbol( + CS, Allocator, CodeViewContainer::Pdb)); + Mod.addSymbol(codeview::SymbolSerializer::writeOneSymbol( + EBS, Allocator, CodeViewContainer::Pdb)); +} + // Creates a PDB file. -void coff::createPDB(StringRef Path, SymbolTable *Symtab, - ArrayRef SectionTable, +void coff::createPDB(SymbolTable *Symtab, ArrayRef SectionTable, const llvm::codeview::DebugInfo *DI) { BumpPtrAllocator Alloc; pdb::PDBFileBuilder Builder(Alloc); @@ -342,22 +455,37 @@ void coff::createPDB(StringRef Path, SymbolTable *Symt auto &InfoBuilder = Builder.getInfoBuilder(); InfoBuilder.setAge(DI ? DI->PDB70.Age : 0); + llvm::SmallString<128> NativePath(Config->PDBPath.begin(), + Config->PDBPath.end()); + llvm::sys::fs::make_absolute(NativePath); + llvm::sys::path::native(NativePath, llvm::sys::path::Style::windows); + pdb::PDB_UniqueId uuid{}; if (DI) memcpy(&uuid, &DI->PDB70.Signature, sizeof(uuid)); InfoBuilder.setGuid(uuid); - // Should be the current time, but set 0 for reproducibilty. - InfoBuilder.setSignature(0); + InfoBuilder.setSignature(time(nullptr)); InfoBuilder.setVersion(pdb::PdbRaw_ImplVer::PdbImplVC70); - // Add an empty DPI stream. + // Add an empty DBI stream. pdb::DbiStreamBuilder &DbiBuilder = Builder.getDbiBuilder(); - DbiBuilder.setVersionHeader(pdb::PdbDbiV110); + DbiBuilder.setVersionHeader(pdb::PdbDbiV70); + ExitOnErr(DbiBuilder.addDbgStream(pdb::DbgHeaderType::NewFPO, {})); + // It's not entirely clear what this is, but the * Linker * module uses it. + uint32_t PdbFilePathNI = DbiBuilder.addECName(NativePath); + TypeTableBuilder TypeTable(BAlloc); TypeTableBuilder IDTable(BAlloc); addObjectsToPDB(Alloc, Symtab, Builder, TypeTable, IDTable); + // Add public and symbol records stream. + + // For now we don't actually write any thing useful to the publics stream, but + // the act of "getting" it also creates it lazily so that we write an empty + // stream. + (void)Builder.getPublicsBuilder(); + // Add Section Contributions. addSectionContribs(Symtab, DbiBuilder); @@ -369,12 +497,14 @@ void coff::createPDB(StringRef Path, SymbolTable *Symt pdb::DbiStreamBuilder::createSectionMap(Sections); DbiBuilder.setSectionMap(SectionMap); - ExitOnErr(DbiBuilder.addModuleInfo("* Linker *")); + auto &LinkerModule = ExitOnErr(DbiBuilder.addModuleInfo("* Linker *")); + LinkerModule.setPdbFilePathNI(PdbFilePathNI); + addLinkerModuleSymbols(NativePath, LinkerModule, Alloc); // Add COFF section header stream. ExitOnErr( DbiBuilder.addDbgStream(pdb::DbgHeaderType::SectionHdr, SectionTable)); // Write to a file. - ExitOnErr(Builder.commit(Path)); + ExitOnErr(Builder.commit(Config->PDBPath)); } Modified: vendor/lld/dist/COFF/PDB.h ============================================================================== --- vendor/lld/dist/COFF/PDB.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/PDB.h Thu Jul 13 19:26:06 2017 (r320965) @@ -23,8 +23,7 @@ namespace lld { namespace coff { class SymbolTable; -void createPDB(llvm::StringRef Path, SymbolTable *Symtab, - llvm::ArrayRef SectionTable, +void createPDB(SymbolTable *Symtab, llvm::ArrayRef SectionTable, const llvm::codeview::DebugInfo *DI); } } Modified: vendor/lld/dist/COFF/Symbols.cpp ============================================================================== --- vendor/lld/dist/COFF/Symbols.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Symbols.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -68,6 +68,8 @@ static Chunk *makeImportThunk(DefinedImportData *S, ui return make(S); if (Machine == I386) return make(S); + if (Machine == ARM64) + return make(S); assert(Machine == ARMNT); return make(S); } Modified: vendor/lld/dist/COFF/Writer.cpp ============================================================================== --- vendor/lld/dist/COFF/Writer.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/COFF/Writer.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -239,7 +239,7 @@ void Writer::run() { const llvm::codeview::DebugInfo *DI = nullptr; if (Config->DebugTypes & static_cast(coff::DebugType::CV)) DI = BuildId->DI; - createPDB(Config->PDBPath, Symtab, SectionTable, DI); + createPDB(Symtab, SectionTable, DI); } writeMapFile(OutputSections); Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/Config.h Thu Jul 13 19:26:06 2017 (r320965) @@ -97,6 +97,7 @@ struct Configuration { llvm::StringRef ThinLTOCacheDir; std::string Rpath; std::vector VersionDefinitions; + std::vector Argv; std::vector AuxiliaryList; std::vector SearchPaths; std::vector SymbolOrderingFile; Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/Driver.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -74,13 +74,13 @@ bool elf::link(ArrayRef Args, bool CanEx raw_ostream &Error) { ErrorCount = 0; ErrorOS = &Error; - Argv0 = Args[0]; InputSections.clear(); Tar = nullptr; Config = make(); Driver = make(); Script = make(); + Config->Argv = {Args.begin(), Args.end()}; Driver->main(Args, CanExitEarly); freeArena(); Modified: vendor/lld/dist/ELF/Error.cpp ============================================================================== --- vendor/lld/dist/ELF/Error.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/Error.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -27,7 +27,6 @@ using namespace lld::elf; uint64_t elf::ErrorCount; raw_ostream *elf::ErrorOS; -StringRef elf::Argv0; // The functions defined in this file can be called from multiple threads, // but outs() or errs() are not thread-safe. We protect them using a mutex. @@ -46,7 +45,7 @@ static void newline(const Twine &Msg) { } static void print(StringRef S, raw_ostream::Colors C) { - *ErrorOS << Argv0 + ": "; + *ErrorOS << Config->Argv[0] << ": "; if (Config->ColorDiagnostics) { ErrorOS->changeColor(C, true); *ErrorOS << S; @@ -59,7 +58,7 @@ static void print(StringRef S, raw_ostream::Colors C) void elf::log(const Twine &Msg) { if (Config->Verbose) { std::lock_guard Lock(Mu); - outs() << Argv0 << ": " << Msg << "\n"; + outs() << Config->Argv[0] << ": " << Msg << "\n"; outs().flush(); } } Modified: vendor/lld/dist/ELF/Error.h ============================================================================== --- vendor/lld/dist/ELF/Error.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/Error.h Thu Jul 13 19:26:06 2017 (r320965) @@ -37,7 +37,6 @@ namespace elf { extern uint64_t ErrorCount; extern llvm::raw_ostream *ErrorOS; -extern llvm::StringRef Argv0; void log(const Twine &Msg); void message(const Twine &Msg); Modified: vendor/lld/dist/ELF/Filesystem.cpp ============================================================================== --- vendor/lld/dist/ELF/Filesystem.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/Filesystem.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -38,7 +38,8 @@ using namespace lld::elf; // This function spawns a background thread to call unlink. // The calling thread returns almost immediately. void elf::unlinkAsync(StringRef Path) { - if (!Config->Threads || !sys::fs::exists(Config->OutputFile)) + if (!Config->Threads || !sys::fs::exists(Config->OutputFile) || + !sys::fs::is_regular_file(Config->OutputFile)) return; // First, rename Path to avoid race condition. We cannot remove Modified: vendor/lld/dist/ELF/GdbIndex.h ============================================================================== --- vendor/lld/dist/ELF/GdbIndex.h Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/GdbIndex.h Thu Jul 13 19:26:06 2017 (r320965) @@ -45,6 +45,7 @@ struct NameTypeEntry { // debug information performed. That information futher used // for filling gdb index section areas. struct GdbIndexChunk { + InputSection *DebugInfoSec; std::vector AddressArea; std::vector CompilationUnits; std::vector NamesAndTypes; Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/InputFiles.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -45,13 +45,10 @@ namespace { // LLVM DWARF parser will not be able to parse .debug_line correctly, unless // we assign each section some unique address. This callback method assigns // each section an address equal to its offset in ELF object file. -class ObjectInfo : public LoadedObjectInfo { +class ObjectInfo : public LoadedObjectInfoHelper { public: uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const override { return static_cast(Sec).getOffset(); - } - std::unique_ptr clone() const override { - return std::unique_ptr(); } }; } Modified: vendor/lld/dist/ELF/InputSection.cpp ============================================================================== --- vendor/lld/dist/ELF/InputSection.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/InputSection.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -276,7 +276,9 @@ template std::string InputSectionBase::ge template std::string InputSectionBase::getObjMsg(uint64_t Off) { // Synthetic sections don't have input files. elf::ObjectFile *File = getFile(); - std::string Filename = File ? File->getName() : "(internal)"; + if (!File) + return ("(internal):(" + Name + "+0x" + utohexstr(Off) + ")").str(); + std::string Filename = File->getName(); std::string Archive; if (!File->ArchiveName.empty()) @@ -466,7 +468,7 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint static uint64_t getARMStaticBase(const SymbolBody &Body) { OutputSection *OS = Body.getOutputSection(); if (!OS || !OS->FirstInPtLoad) - fatal("SBREL relocation to " + Body.getName() + " without static base\n"); + fatal("SBREL relocation to " + Body.getName() + " without static base"); return OS->FirstInPtLoad->Addr; } Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Thu Jul 13 19:26:02 2017 (r320964) +++ vendor/lld/dist/ELF/LinkerScript.cpp Thu Jul 13 19:26:06 2017 (r320965) @@ -111,17 +111,13 @@ LinkerScript::getOrCreateOutputSectionCommand(StringRe void LinkerScript::setDot(Expr E, const Twine &Loc, bool InSec) { uint64_t Val = E().getValue(); - if (Val < Dot) { - if (InSec) - error(Loc + ": unable to move location counter backward for: " + - CurOutSec->Name); - else - error(Loc + ": unable to move location counter backward"); - } + if (Val < Dot && InSec) + error(Loc + ": unable to move location counter backward for: " + + CurAddressState->OutSec->Name); Dot = Val; // Update to location counter means update to section size. if (InSec) - CurOutSec->Size = Dot - CurOutSec->Addr; + CurAddressState->OutSec->Size = Dot - CurAddressState->OutSec->Addr; } // Sets value of a symbol. Two kinds of symbols are processed: synthetic @@ -373,7 +369,13 @@ void LinkerScript::processCommands(OutputSectionFactor // which will map to whatever the first actual section is. Aether = make("", 0, SHF_ALLOC); Aether->SectionIndex = 1; - CurOutSec = Aether; + auto State = make_unique(Opt); + // CurAddressState captures the local AddressState and makes it accessible + // deliberately. This is needed as there are some cases where we cannot just + // thread the current state through to a lambda function created by the + // script parser. + CurAddressState = State.get(); + CurAddressState->OutSec = Aether; Dot = 0; for (size_t I = 0; I < Opt.Commands.size(); ++I) { @@ -435,7 +437,7 @@ void LinkerScript::processCommands(OutputSectionFactor } } } - CurOutSec = nullptr; + CurAddressState = nullptr; } void LinkerScript::fabricateDefaultCommands() { @@ -481,20 +483,31 @@ void LinkerScript::fabricateDefaultCommands() { // Add sections that didn't match any sections command. void LinkerScript::addOrphanSections(OutputSectionFactory &Factory) { + unsigned NumCommands = Opt.Commands.size(); for (InputSectionBase *S : InputSections) { if (!S->Live || S->Parent) continue; StringRef Name = getOutputSectionName(S->Name); - auto I = std::find_if( - Opt.Commands.begin(), Opt.Commands.end(), [&](BaseCommand *Base) { - if (auto *Cmd = dyn_cast(Base)) - return Cmd->Name == Name; - return false; - }); - if (I == Opt.Commands.end()) { + auto End = Opt.Commands.begin() + NumCommands; + auto I = std::find_if(Opt.Commands.begin(), End, [&](BaseCommand *Base) { + if (auto *Cmd = dyn_cast(Base)) + return Cmd->Name == Name; + return false; + }); + OutputSectionCommand *Cmd; + if (I == End) { Factory.addInputSec(S, Name); + OutputSection *Sec = S->getOutputSection(); + assert(Sec->SectionIndex == INT_MAX); + OutputSectionCommand *&CmdRef = SecToCommand[Sec]; + if (!CmdRef) { + CmdRef = createOutputSectionCommand(Sec->Name, ""); + CmdRef->Sec = Sec; + Opt.Commands.push_back(CmdRef); + } + Cmd = CmdRef; } else { - auto *Cmd = cast(*I); + Cmd = cast(*I); Factory.addInputSec(S, Name, Cmd->Sec); if (OutputSection *Sec = Cmd->Sec) { SecToCommand[Sec] = Cmd; @@ -502,21 +515,22 @@ void LinkerScript::addOrphanSections(OutputSectionFact assert(Sec->SectionIndex == INT_MAX || Sec->SectionIndex == Index); Sec->SectionIndex = Index; } - auto *ISD = make(""); - ISD->Sections.push_back(cast(S)); - Cmd->Commands.push_back(ISD); } + auto *ISD = make(""); + ISD->Sections.push_back(cast(S)); + Cmd->Commands.push_back(ISD); } } uint64_t LinkerScript::advance(uint64_t Size, unsigned Align) { - bool IsTbss = (CurOutSec->Flags & SHF_TLS) && CurOutSec->Type == SHT_NOBITS; - uint64_t Start = IsTbss ? Dot + ThreadBssOffset : Dot; + bool IsTbss = (CurAddressState->OutSec->Flags & SHF_TLS) && + CurAddressState->OutSec->Type == SHT_NOBITS; + uint64_t Start = IsTbss ? Dot + CurAddressState->ThreadBssOffset : Dot; Start = alignTo(Start, Align); uint64_t End = Start + Size; if (IsTbss) - ThreadBssOffset = End - Dot; + CurAddressState->ThreadBssOffset = End - Dot; else Dot = End; return End; @@ -524,40 +538,43 @@ uint64_t LinkerScript::advance(uint64_t Size, unsigned void LinkerScript::output(InputSection *S) { uint64_t Pos = advance(S->getSize(), S->Alignment); - S->OutSecOff = Pos - S->getSize() - CurOutSec->Addr; + S->OutSecOff = Pos - S->getSize() - CurAddressState->OutSec->Addr; // Update output section size after adding each section. This is so that // SIZEOF works correctly in the case below: // .foo { *(.aaa) a = SIZEOF(.foo); *(.bbb) } - CurOutSec->Size = Pos - CurOutSec->Addr; + CurAddressState->OutSec->Size = Pos - CurAddressState->OutSec->Addr; // If there is a memory region associated with this input section, then // place the section in that region and update the region index. - if (CurMemRegion) { - CurMemRegion->Offset += CurOutSec->Size; - uint64_t CurSize = CurMemRegion->Offset - CurMemRegion->Origin; - if (CurSize > CurMemRegion->Length) { - uint64_t OverflowAmt = CurSize - CurMemRegion->Length; - error("section '" + CurOutSec->Name + "' will not fit in region '" + - CurMemRegion->Name + "': overflowed by " + Twine(OverflowAmt) + - " bytes"); + if (CurAddressState->MemRegion) { + uint64_t &CurOffset = + CurAddressState->MemRegionOffset[CurAddressState->MemRegion]; + CurOffset += CurAddressState->OutSec->Size; + uint64_t CurSize = CurOffset - CurAddressState->MemRegion->Origin; + if (CurSize > CurAddressState->MemRegion->Length) { + uint64_t OverflowAmt = CurSize - CurAddressState->MemRegion->Length; + error("section '" + CurAddressState->OutSec->Name + + "' will not fit in region '" + CurAddressState->MemRegion->Name + + "': overflowed by " + Twine(OverflowAmt) + " bytes"); } } } void LinkerScript::switchTo(OutputSection *Sec) { - if (CurOutSec == Sec) + if (CurAddressState->OutSec == Sec) return; - CurOutSec = Sec; - CurOutSec->Addr = advance(0, CurOutSec->Alignment); + CurAddressState->OutSec = Sec; + CurAddressState->OutSec->Addr = + advance(0, CurAddressState->OutSec->Alignment); // If neither AT nor AT> is specified for an allocatable section, the linker // will set the LMA such that the difference between VMA and LMA for the // section is the same as the preceding output section in the same region // https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html - if (LMAOffset) - CurOutSec->LMAOffset = LMAOffset(); + if (CurAddressState->LMAOffset) + CurAddressState->OutSec->LMAOffset = CurAddressState->LMAOffset(); } void LinkerScript::process(BaseCommand &Base) { @@ -569,9 +586,9 @@ void LinkerScript::process(BaseCommand &Base) { // Handle BYTE(), SHORT(), LONG(), or QUAD(). if (auto *Cmd = dyn_cast(&Base)) { - Cmd->Offset = Dot - CurOutSec->Addr; + Cmd->Offset = Dot - CurAddressState->OutSec->Addr; Dot += Cmd->Size; - CurOutSec->Size = Dot - CurOutSec->Addr; + CurAddressState->OutSec->Size = Dot - CurAddressState->OutSec->Addr; return; } @@ -596,7 +613,7 @@ void LinkerScript::process(BaseCommand &Base) { if (!Sec->Live) continue; - assert(CurOutSec == Sec->getParent()); + assert(CurAddressState->OutSec == Sec->getParent()); output(Sec); } } @@ -649,17 +666,17 @@ void LinkerScript::assignOffsets(OutputSectionCommand if (Cmd->LMAExpr) { uint64_t D = Dot; - LMAOffset = [=] { return Cmd->LMAExpr().getValue() - D; }; + CurAddressState->LMAOffset = [=] { return Cmd->LMAExpr().getValue() - D; }; } - CurMemRegion = Cmd->MemRegion; - if (CurMemRegion) - Dot = CurMemRegion->Offset; + CurAddressState->MemRegion = Cmd->MemRegion; + if (CurAddressState->MemRegion) + Dot = CurAddressState->MemRegionOffset[CurAddressState->MemRegion]; switchTo(Sec); // We do not support custom layout for compressed debug sectons. // At this point we already know their size and have compressed content. - if (CurOutSec->Flags & SHF_COMPRESSED) + if (CurAddressState->OutSec->Flags & SHF_COMPRESSED) return; for (BaseCommand *C : Cmd->Commands) @@ -746,30 +763,20 @@ void LinkerScript::adjustSectionsAfterSorting() { if (!Cmd) continue; - if (Cmd->Phdrs.empty()) - Cmd->Phdrs = DefPhdrs; - else + if (Cmd->Phdrs.empty()) { + OutputSection *Sec = Cmd->Sec; + // To match the bfd linker script behaviour, only propagate program + // headers to sections that are allocated. + if (Sec && (Sec->Flags & SHF_ALLOC)) + Cmd->Phdrs = DefPhdrs; + } else { DefPhdrs = Cmd->Phdrs; + } } removeEmptyCommands(); } -void LinkerScript::createOrphanCommands() { - for (OutputSection *Sec : OutputSections) { - if (Sec->SectionIndex != INT_MAX) - continue; - OutputSectionCommand *Cmd = - createOutputSectionCommand(Sec->Name, ""); - Cmd->Sec = Sec; - SecToCommand[Sec] = Cmd; - auto *ISD = make(""); - ISD->Sections = Sec->Sections; - Cmd->Commands.push_back(ISD); - Opt.Commands.push_back(Cmd); - } -} - void LinkerScript::processNonSectionCommands() { for (BaseCommand *Base : Opt.Commands) { if (auto *Cmd = dyn_cast(Base)) @@ -779,22 +786,25 @@ void LinkerScript::processNonSectionCommands() { } } -static bool -allocateHeaders(std::vector &Phdrs, - ArrayRef OutputSectionCommands, - uint64_t Min) { - auto FirstPTLoad = - std::find_if(Phdrs.begin(), Phdrs.end(), - [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); +void LinkerScript::allocateHeaders(std::vector &Phdrs) { + uint64_t Min = std::numeric_limits::max(); + for (OutputSectionCommand *Cmd : OutputSectionCommands) { + OutputSection *Sec = Cmd->Sec; + if (Sec->Flags & SHF_ALLOC) + Min = std::min(Min, Sec->Addr); + } + + auto FirstPTLoad = llvm::find_if( + Phdrs, [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); if (FirstPTLoad == Phdrs.end()) - return false; + return; uint64_t HeaderSize = getHeaderSize(); if (HeaderSize <= Min || Script->hasPhdrsCommands()) { Min = alignDown(Min - HeaderSize, Config->MaxPageSize); Out::ElfHeader->Addr = Min; Out::ProgramHeaders->Addr = Min + Out::ElfHeader->Size; - return true; + return; } assert(FirstPTLoad->First == Out::ElfHeader); @@ -817,17 +827,28 @@ allocateHeaders(std::vector &Phdrs, Phdrs.erase(FirstPTLoad); } - auto PhdrI = std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry &E) { - return E.p_type == PT_PHDR; - }); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 19:26:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C449DAC38E; Thu, 13 Jul 2017 19:26:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id D5A87A95; Thu, 13 Jul 2017 19:26:20 +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 v6DJQKmp036944; Thu, 13 Jul 2017 19:26:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJQH6W036918; Thu, 13 Jul 2017 19:26:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131926.v6DJQH6W036918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320967 - in vendor/lldb/dist: docs include/lldb/Host include/lldb/Host/common lit lldb.xcodeproj packages/Python/lldbsuite/test packages/Python/lldbsuite/test/expression_command/call-r... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist: docs include/lldb/Host include/lldb/Host/common lit lldb.xcodeproj packages/Python/lldbsuite/test packages/Python/lldbsuite/test/expression_command/call-restarts packages/Python/l... X-SVN-Commit-Revision: 320967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:26:21 -0000 Author: dim Date: Thu Jul 13 19:26:17 2017 New Revision: 320967 URL: https://svnweb.freebsd.org/changeset/base/320967 Log: Vendor import of lldb trunk r307894: https://llvm.org/svn/llvm-project/lldb/trunk@307894 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c (contents, props changed) Deleted: vendor/lldb/dist/www/architecture.html Modified: vendor/lldb/dist/docs/lldb-gdb-remote.txt vendor/lldb/dist/include/lldb/Host/Host.h vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h vendor/lldb/dist/lit/lit.cfg vendor/lldb/dist/lldb.xcodeproj/project.pbxproj vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py vendor/lldb/dist/packages/Python/lldbsuite/test/lldbutil.py vendor/lldb/dist/packages/Python/lldbsuite/test/make/Android.rules vendor/lldb/dist/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py vendor/lldb/dist/source/Commands/CommandObjectThread.cpp vendor/lldb/dist/source/Core/DumpDataExtractor.cpp vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Host/common/MainLoop.cpp vendor/lldb/dist/source/Host/common/NativeProcessProtocol.cpp vendor/lldb/dist/source/Host/common/SocketAddress.cpp vendor/lldb/dist/source/Host/macosx/Host.mm vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp vendor/lldb/dist/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp vendor/lldb/dist/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp vendor/lldb/dist/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp vendor/lldb/dist/source/Plugins/Language/ObjC/Cocoa.cpp vendor/lldb/dist/source/Plugins/Platform/Android/PlatformAndroid.cpp vendor/lldb/dist/source/Plugins/Platform/Android/PlatformAndroid.h vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.h vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/ProcessorTrace.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/CMakeLists.txt vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.h vendor/lldb/dist/tools/lldb-server/CMakeLists.txt vendor/lldb/dist/tools/lldb-server/lldb-gdbserver.cpp vendor/lldb/dist/tools/lldb-server/lldb-platform.cpp vendor/lldb/dist/unittests/Process/Linux/ProcessorTraceTest.cpp vendor/lldb/dist/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp vendor/lldb/dist/www/architecture/index.html vendor/lldb/dist/www/sidebar.incl Modified: vendor/lldb/dist/docs/lldb-gdb-remote.txt ============================================================================== --- vendor/lldb/dist/docs/lldb-gdb-remote.txt Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/docs/lldb-gdb-remote.txt Thu Jul 13 19:26:17 2017 (r320967) @@ -126,6 +126,32 @@ read packet: $OK#00 This packet can be sent one or more times _prior_ to sending a "A" packet. //---------------------------------------------------------------------- +// "QEnableErrorStrings" +// +// BRIEF +// This packet enables reporting of Error strings in remote packet +// replies from the server to client. If the server supports this +// feature, it should send an OK response. The client can expect the +// following error replies if this feature is enabled in the server -> +// +// EXX;AAAAAAAAA +// +// where AAAAAAAAA will be a hex encoded ASCII string. +// XX is hex encoded byte number. +// +// It must be noted that even if the client has enabled reporting +// strings in error replies, it must not expect error strings to all +// error replies. +// +// PRIORITY TO IMPLEMENT +// Low. Only needed if the remote target wants to provide strings that +// are human readable along with an error code. +//---------------------------------------------------------------------- + +send packet: $QErrorStringInPacketSupported +read packet: $OK#00 + +//---------------------------------------------------------------------- // "QSetSTDIN:" // "QSetSTDOUT:" // "QSetSTDERR:" @@ -250,11 +276,12 @@ read packet: OK // // Each tracing instance is identified by a trace id which is returned // as the reply to this packet. In case the tracing failed to begin an -// error code is returned instead. +// error code along with a hex encoded ASCII message is returned +// instead. //---------------------------------------------------------------------- send packet: jTraceStart:{"type":,"buffersize":}] -read packet: /E +read packet: /E;AAAAAAAAA //---------------------------------------------------------------------- // jTraceStop: @@ -283,12 +310,12 @@ read packet: /E // to stop tracing on that thread. // ========== ==================================================== // -// An OK response is sent in case of success else an error code is -// returned. +// An OK response is sent in case of success else an error code along +// with a hex encoded ASCII message is returned. //---------------------------------------------------------------------- send packet: jTraceStop:{"traceid":}] -read packet: /E +read packet: /E;AAAAAAAAA //---------------------------------------------------------------------- // jTraceBufferRead: @@ -317,11 +344,11 @@ read packet: /E // ========== ==================================================== // // The trace data is sent as raw binary data if the read was successful -// else an error code is sent. +// else an error code along with a hex encoded ASCII message is sent. //---------------------------------------------------------------------- send packet: jTraceBufferRead:{"traceid":,"offset":,"buffersize":}] -read packet: /E +read packet: /E;AAAAAAAAA //---------------------------------------------------------------------- // jTraceMetaRead: @@ -359,11 +386,11 @@ read packet: /E // gdb-remote protocol has certain limitations, binary escaping // convention is used. // In case the trace instance with the was not found, an -// error code is returned. +// error code along with a hex encoded ASCII message is returned. //---------------------------------------------------------------------- send packet: jTraceConfigRead:{"traceid":} -read packet: {"conf1":,"conf2":,"params":{"paramName":paramValue}]}];/E +read packet: {"conf1":,"conf2":,"params":{"paramName":paramValue}]}];/E;AAAAAAAAA //---------------------------------------------------------------------- // "qRegisterInfo" Modified: vendor/lldb/dist/include/lldb/Host/Host.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/Host.h Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/include/lldb/Host/Host.h Thu Jul 13 19:26:17 2017 (r320967) @@ -7,21 +7,20 @@ // //===----------------------------------------------------------------------===// -#ifndef liblldb_Host_h_ -#define liblldb_Host_h_ -#if defined(__cplusplus) +#ifndef LLDB_HOST_HOST_H +#define LLDB_HOST_HOST_H -#include - -#include -#include - #include "lldb/Host/File.h" #include "lldb/Host/HostThread.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/StringList.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-private.h" +#include +#include +#include +#include +#include namespace lldb_private { @@ -254,5 +253,4 @@ template <> struct format_provider @@ -244,68 +245,57 @@ class NativeProcessProtocol (public) virtual Status GetFileLoadAddress(const llvm::StringRef &file_name, lldb::addr_t &load_addr) = 0; - //------------------------------------------------------------------ - /// Launch a process for debugging. This method will create an concrete - /// instance of NativeProcessProtocol, based on the host platform. - /// (e.g. NativeProcessLinux on linux, etc.) - /// - /// @param[in] launch_info - /// Information required to launch the process. - /// - /// @param[in] native_delegate - /// The delegate that will receive messages regarding the - /// inferior. Must outlive the NativeProcessProtocol - /// instance. - /// - /// @param[in] mainloop - /// The mainloop instance with which the process can register - /// callbacks. Must outlive the NativeProcessProtocol - /// instance. - /// - /// @param[out] process_sp - /// On successful return from the method, this parameter - /// contains the shared pointer to the - /// NativeProcessProtocol that can be used to manipulate - /// the native process. - /// - /// @return - /// An error object indicating if the operation succeeded, - /// and if not, what error occurred. - //------------------------------------------------------------------ - static Status Launch(ProcessLaunchInfo &launch_info, - NativeDelegate &native_delegate, MainLoop &mainloop, - NativeProcessProtocolSP &process_sp); + class Factory { + public: + virtual ~Factory(); + //------------------------------------------------------------------ + /// Launch a process for debugging. + /// + /// @param[in] launch_info + /// Information required to launch the process. + /// + /// @param[in] native_delegate + /// The delegate that will receive messages regarding the + /// inferior. Must outlive the NativeProcessProtocol + /// instance. + /// + /// @param[in] mainloop + /// The mainloop instance with which the process can register + /// callbacks. Must outlive the NativeProcessProtocol + /// instance. + /// + /// @return + /// A NativeProcessProtocol shared pointer if the operation succeeded or + /// an error object if it failed. + //------------------------------------------------------------------ + virtual llvm::Expected + Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, + MainLoop &mainloop) const = 0; - //------------------------------------------------------------------ - /// Attach to an existing process. This method will create an concrete - /// instance of NativeProcessProtocol, based on the host platform. - /// (e.g. NativeProcessLinux on linux, etc.) - /// - /// @param[in] pid - /// pid of the process locatable - /// - /// @param[in] native_delegate - /// The delegate that will receive messages regarding the - /// inferior. Must outlive the NativeProcessProtocol - /// instance. - /// - /// @param[in] mainloop - /// The mainloop instance with which the process can register - /// callbacks. Must outlive the NativeProcessProtocol - /// instance. - /// - /// @param[out] process_sp - /// On successful return from the method, this parameter - /// contains the shared pointer to the - /// NativeProcessProtocol that can be used to manipulate - /// the native process. - /// - /// @return - /// An error object indicating if the operation succeeded, - /// and if not, what error occurred. - //------------------------------------------------------------------ - static Status Attach(lldb::pid_t pid, NativeDelegate &native_delegate, - MainLoop &mainloop, NativeProcessProtocolSP &process_sp); + //------------------------------------------------------------------ + /// Attach to an existing process. + /// + /// @param[in] pid + /// pid of the process locatable + /// + /// @param[in] native_delegate + /// The delegate that will receive messages regarding the + /// inferior. Must outlive the NativeProcessProtocol + /// instance. + /// + /// @param[in] mainloop + /// The mainloop instance with which the process can register + /// callbacks. Must outlive the NativeProcessProtocol + /// instance. + /// + /// @return + /// A NativeProcessProtocol shared pointer if the operation succeeded or + /// an error object if it failed. + //------------------------------------------------------------------ + virtual llvm::Expected + Attach(lldb::pid_t pid, NativeDelegate &native_delegate, + MainLoop &mainloop) const = 0; + }; //------------------------------------------------------------------ /// StartTracing API for starting a tracing instance with the @@ -413,10 +403,10 @@ class NativeProcessProtocol (public) lldb::pid_t m_pid; std::vector m_threads; - lldb::tid_t m_current_thread_id; + lldb::tid_t m_current_thread_id = LLDB_INVALID_THREAD_ID; mutable std::recursive_mutex m_threads_mutex; - lldb::StateType m_state; + lldb::StateType m_state = lldb::eStateInvalid; mutable std::recursive_mutex m_state_mutex; llvm::Optional m_exit_status; @@ -427,7 +417,7 @@ class NativeProcessProtocol (public) NativeWatchpointList m_watchpoint_list; HardwareBreakpointMap m_hw_breakpoints_map; int m_terminal_fd; - uint32_t m_stop_id; + uint32_t m_stop_id = 0; // Set of signal numbers that LLDB directly injects back to inferior // without stopping it. @@ -438,7 +428,8 @@ class NativeProcessProtocol (public) // then the process should be attached to. When attaching to a process // lldb_private::Host calls should be used to locate the process to attach to, // and then this function should be called. - NativeProcessProtocol(lldb::pid_t pid); + NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, + NativeDelegate &delegate); // ----------------------------------------------------------- // Internal interface for state handling Modified: vendor/lldb/dist/lit/lit.cfg ============================================================================== --- vendor/lldb/dist/lit/lit.cfg Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/lit/lit.cfg Thu Jul 13 19:26:17 2017 (r320967) @@ -95,8 +95,8 @@ if config.test_exec_root is None: lit_config.fatal('No site specific configuration available!') # Get the source and object roots. - llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() - llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() + llvm_src_root = subprocess.check_output(['llvm-config', '--src-root']).strip() + llvm_obj_root = subprocess.check_output(['llvm-config', '--obj-root']).strip() lldb_src_root = os.path.join(llvm_src_root, "tools", "lldb") lldb_obj_root = os.path.join(llvm_obj_root, "tools", "lldb") @@ -132,7 +132,7 @@ if not os.path.exists(config.cxx): if platform.system() in ['Darwin']: try: - out = lit.util.capture(['xcrun', '--show-sdk-path']).strip() + out = subprocess.check_output(['xcrun', '--show-sdk-path']).strip() res = 0 except OSError: res = -1 Modified: vendor/lldb/dist/lldb.xcodeproj/project.pbxproj ============================================================================== --- vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Jul 13 19:26:17 2017 (r320967) @@ -868,6 +868,8 @@ 966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; }; 9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */; }; 9A0FDEA71E8EF5110086B2F5 /* RegisterContextLinux_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */; }; + 9A1542F91F0EE48600DEA1D8 /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */; }; + 9A1542FA1F0EE48600DEA1D8 /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */; }; 9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; }; 9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; }; @@ -2815,6 +2817,11 @@ 9A0FDE991E8EF5010086B2F5 /* RegisterInfos_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm.h; path = Utility/RegisterInfos_arm.h; sourceTree = ""; }; 9A0FDE9A1E8EF5010086B2F5 /* RegisterInfos_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm64.h; path = Utility/RegisterInfos_arm64.h; sourceTree = ""; }; 9A0FDE9B1E8EF5010086B2F5 /* RegisterInfos_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips.h; path = Utility/RegisterInfos_mips.h; sourceTree = ""; }; + 9A1542F41F0EE44000DEA1D8 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; + 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockTildeExpressionResolver.cpp; sourceTree = ""; }; + 9A1542F61F0EE44000DEA1D8 /* MockTildeExpressionResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockTildeExpressionResolver.h; sourceTree = ""; }; + 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestUtilities.cpp; sourceTree = ""; }; + 9A1542F81F0EE44000DEA1D8 /* TestUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestUtilities.h; sourceTree = ""; }; 9A19A6A51163BB7E00E0D453 /* SBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValue.h; path = include/lldb/API/SBValue.h; sourceTree = ""; }; 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValue.cpp; path = source/API/SBValue.cpp; sourceTree = ""; }; 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTrace.cpp; path = source/API/SBTrace.cpp; sourceTree = ""; }; @@ -3305,6 +3312,7 @@ 2321F9421BDD343A00BA9A93 /* Utility */ = { isa = PBXGroup; children = ( + 9A1542F31F0EE44000DEA1D8 /* Helpers */, 2321F9431BDD346100BA9A93 /* CMakeLists.txt */, 23CB15041D66CD9200EDDDE1 /* Inputs */, 2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */, @@ -6216,6 +6224,18 @@ name = "SysV-mips"; sourceTree = ""; }; + 9A1542F31F0EE44000DEA1D8 /* Helpers */ = { + isa = PBXGroup; + children = ( + 9A1542F41F0EE44000DEA1D8 /* CMakeLists.txt */, + 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */, + 9A1542F61F0EE44000DEA1D8 /* MockTildeExpressionResolver.h */, + 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */, + 9A1542F81F0EE44000DEA1D8 /* TestUtilities.h */, + ); + path = Helpers; + sourceTree = ""; + }; AE44FB371BB35A2E0033EB62 /* Go */ = { isa = PBXGroup; children = ( @@ -7003,12 +7023,14 @@ 23CB15371D66DA9300EDDDE1 /* PythonTestSuite.cpp in Sources */, 23E2E5321D903832006F38BB /* BreakpointIDTest.cpp in Sources */, 23CB15381D66DA9300EDDDE1 /* PythonExceptionStateTests.cpp in Sources */, + 9A1542F91F0EE48600DEA1D8 /* MockTildeExpressionResolver.cpp in Sources */, 23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */, 23CB153A1D66DA9300EDDDE1 /* GDBRemoteClientBaseTest.cpp in Sources */, 23CB153B1D66DA9300EDDDE1 /* SocketTest.cpp in Sources */, 23CB153C1D66DA9300EDDDE1 /* TestArgs.cpp in Sources */, 23CB153D1D66DA9300EDDDE1 /* GDBRemoteCommunicationClientTest.cpp in Sources */, 23CB153E1D66DA9300EDDDE1 /* PythonDataObjectsTests.cpp in Sources */, + 9A1542FA1F0EE48600DEA1D8 /* TestUtilities.cpp in Sources */, 23CB153F1D66DA9300EDDDE1 /* SymbolsTest.cpp in Sources */, AFEC5FD81D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp in Sources */, 23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources */, @@ -8256,7 +8278,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8298,7 +8320,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8340,7 +8362,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8382,7 +8404,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8424,7 +8446,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8466,7 +8488,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8508,7 +8530,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", @@ -8550,7 +8572,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); - LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; + LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)"; OTHER_CFLAGS = ( "-fno-rtti", Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py Thu Jul 13 19:26:17 2017 (r320967) @@ -48,28 +48,8 @@ class ExprCommandThatRestartsTestCase(TestBase): "Restored the zeroth frame correctly") def call_function(self): - exe_name = "a.out" - exe = os.path.join(os.getcwd(), exe_name) - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - empty = lldb.SBFileSpec() - breakpoint = target.BreakpointCreateBySourceRegex( - 'Stop here in main.', self.main_source_spec) - self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - self.assertTrue(process, PROCESS_IS_VALID) - - # Frame #0 should be at our breakpoint. - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - - self.assertTrue(len(threads) == 1) - self.thread = threads[0] + (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + 'Stop here in main.', self.main_source_spec) # Make sure the SIGCHLD behavior is pass/no-stop/no-notify: return_obj = lldb.SBCommandReturnObject() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py Thu Jul 13 19:26:17 2017 (r320967) @@ -37,28 +37,8 @@ class ExprCommandWithThrowTestCase(TestBase): def call_function(self): """Test calling function that throws.""" - exe_name = "a.out" - exe = os.path.join(os.getcwd(), exe_name) - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - breakpoint = target.BreakpointCreateBySourceRegex( - 'I am about to throw.', self.main_source_spec) - self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - self.assertTrue(process, PROCESS_IS_VALID) - - # Frame #0 should be at our breakpoint. - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - - self.assertTrue(len(threads) == 1) - self.thread = threads[0] + (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + 'I am about to throw.', self.main_source_spec) options = lldb.SBExpressionOptions() options.SetUnwindOnError(True) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Thu Jul 13 19:26:17 2017 (r320967) @@ -17,29 +17,14 @@ class ExprCharTestCase(TestBase): self.main_source = "main.cpp" self.main_source_spec = lldb.SBFileSpec(self.main_source) - self.exe = os.path.join(os.getcwd(), "a.out") def do_test(self, dictionary=None): """These basic expression commands should work as expected.""" self.build(dictionary=dictionary) - target = self.dbg.CreateTarget(self.exe) - self.assertTrue(target) - - breakpoint = target.BreakpointCreateBySourceRegex( - '// Break here', self.main_source_spec) - self.assertTrue(breakpoint) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertTrue(process) - - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - self.assertEqual(len(threads), 1) - - frame = threads[0].GetFrameAtIndex(0) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + '// Break here', self.main_source_spec) + frame = thread.GetFrameAtIndex(0) value = frame.EvaluateExpression("foo(c)") self.assertTrue(value.IsValid()) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py Thu Jul 13 19:26:17 2017 (r320967) @@ -37,28 +37,8 @@ class ExprCommandWithFixits(TestBase): def try_expressions(self): """Test calling expressions with errors that can be fixed by the FixIts.""" - exe_name = "a.out" - exe = os.path.join(os.getcwd(), exe_name) - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - breakpoint = target.BreakpointCreateBySourceRegex( - 'Stop here to evaluate expressions', self.main_source_spec) - self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - self.assertTrue(process, PROCESS_IS_VALID) - - # Frame #0 should be at our breakpoint. - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - - self.assertTrue(len(threads) == 1) - self.thread = threads[0] + (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + 'Stop here to evaluate expressions', self.main_source_spec) options = lldb.SBExpressionOptions() options.SetAutoApplyFixIts(True) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py Thu Jul 13 19:26:17 2017 (r320967) @@ -32,26 +32,9 @@ class Issue11581TestCase(TestBase): """valobj.AddressOf() should return correct values.""" self.build() - exe = os.path.join(os.getcwd(), "a.out") - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - breakpoint = target.BreakpointCreateBySourceRegex( - 'Set breakpoint here.', lldb.SBFileSpec("main.cpp", False)) - - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertTrue(process, "Created a process.") - self.assertTrue( - process.GetState() == lldb.eStateStopped, - "Stopped it too.") - - thread_list = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - self.assertTrue(len(thread_list) == 1) - thread = thread_list[0] - + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + 'Set breakpoint here.', + lldb.SBFileSpec("main.cpp", False)) self.runCmd("command script import --allow-reload s11588.py") self.runCmd( "type synthetic add --python-class s11588.Issue11581SyntheticProvider StgClosure") Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py Thu Jul 13 19:26:17 2017 (r320967) @@ -30,32 +30,8 @@ class TestMacros(TestBase): src_file_spec = lldb.SBFileSpec(src_file) self.assertTrue(src_file_spec.IsValid(), "Main source file") - # Get the path of the executable - cwd = os.getcwd() - exe_file = "a.out" - exe_path = os.path.join(cwd, exe_file) - - # Load the executable - target = self.dbg.CreateTarget(exe_path) - self.assertTrue(target.IsValid(), VALID_TARGET) - - # Set breakpoints - bp1 = target.BreakpointCreateBySourceRegex("Break here", src_file_spec) - self.assertTrue( - bp1.IsValid() and bp1.GetNumLocations() >= 1, - VALID_BREAKPOINT) - - # Launch the process - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertTrue(process.IsValid(), PROCESS_IS_VALID) - - # Get the thread of the process - self.assertTrue( - process.GetState() == lldb.eStateStopped, - PROCESS_STOPPED) - thread = lldbutil.get_stopped_thread( - process, lldb.eStopReasonBreakpoint) + (target, process, thread, bp1) = lldbutil.run_to_source_breakpoint( + self, "Break here", src_file_spec) # Get frame for current thread frame = thread.GetSelectedFrame() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Thu Jul 13 19:26:17 2017 (r320967) @@ -37,25 +37,10 @@ class ExprOptionsTestCase(TestBase): # Set debugger into synchronous mode self.dbg.SetAsync(False) - # Create a target by the debugger. - target = self.dbg.CreateTarget(self.exe) - self.assertTrue(target, VALID_TARGET) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, '// breakpoint_in_main', self.main_source_spec) - # Set breakpoints inside main. - breakpoint = target.BreakpointCreateBySourceRegex( - '// breakpoint_in_main', self.main_source_spec) - self.assertTrue(breakpoint) - - # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertTrue(process, PROCESS_IS_VALID) - - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - self.assertEqual(len(threads), 1) - - frame = threads[0].GetFrameAtIndex(0) + frame = thread.GetFrameAtIndex(0) options = lldb.SBExpressionOptions() # test --language on C++ expression using the SB API's Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py Thu Jul 13 19:26:17 2017 (r320967) @@ -31,17 +31,10 @@ class SaveJITObjectsTestCase(TestBase): src_file = "main.c" src_file_spec = lldb.SBFileSpec(src_file) - exe_path = os.path.join(os.getcwd(), "a.out") - target = self.dbg.CreateTarget(exe_path) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, "break", src_file_spec) - breakpoint = target.BreakpointCreateBySourceRegex( - "break", src_file_spec) - - process = target.LaunchSimple(None, None, - self.get_process_working_directory()) - - thread = process.GetSelectedThread() - frame = thread.GetSelectedFrame() + frame = thread.frames[0] cleanJITFiles() frame.EvaluateExpression("(void*)malloc(0x1)") Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Thu Jul 13 19:26:17 2017 (r320967) @@ -25,36 +25,14 @@ class ExprCommandWithTimeoutsTestCase(TestBase): @expectedFlakeyFreeBSD("llvm.org/pr19605") @expectedFailureAll( oslist=[ - "windows", - "macosx"], + "windows"], bugnumber="llvm.org/pr21765") def test(self): """Test calling std::String member function.""" self.build() - exe_name = "a.out" - exe = os.path.join(os.getcwd(), exe_name) - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - breakpoint = target.BreakpointCreateBySourceRegex( - 'stop here in main.', self.main_source_spec) - self.assertTrue(breakpoint, VALID_BREAKPOINT) - self.runCmd("breakpoint list") - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - self.assertTrue(process, PROCESS_IS_VALID) - - # Frame #0 should be on self.step_out_of_malloc. - threads = lldbutil.get_threads_stopped_at_breakpoint( - process, breakpoint) - - self.assertTrue(len(threads) == 1) - thread = threads[0] + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, 'stop here in main.', self.main_source_spec) # First set the timeout too short, and make sure we fail. options = lldb.SBExpressionOptions() Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +OBJC_SOURCES := main.m +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation -framework AppKit + +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,57 @@ +""" +Tests basic Main Thread Checker support (detecting a main-thread-only violation). +""" + +import os +import time +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbplatformutil import * +import json + + +class MTCSimpleTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + def test(self): + self.mtc_dylib_path = findMainThreadCheckerDylib() + if self.mtc_dylib_path == "": + self.skipTest("This test requires libMainThreadChecker.dylib.") + + self.build() + self.mtc_tests() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + def mtc_tests(self): + # Load the test + exe = os.path.join(os.getcwd(), "a.out") + self.expect("file " + exe, patterns=["Current executable set to .*a.out"]) + + self.runCmd("env DYLD_INSERT_LIBRARIES=%s" % self.mtc_dylib_path) + self.runCmd("run") + + process = self.dbg.GetSelectedTarget().process + thread = process.GetSelectedThread() + frame = thread.GetSelectedFrame() + + self.expect("thread info", substrs=['stop reason = -[NSView superview] must be used from main thread only']) + + self.expect( + "thread info -s", + substrs=["instrumentation_class", "api_name", "class_name", "selector", "description"]) + self.assertEqual(thread.GetStopReason(), lldb.eStopReasonInstrumentation) + output_lines = self.res.GetOutput().split('\n') + json_line = '\n'.join(output_lines[2:]) + data = json.loads(json_line) + self.assertEqual(data["instrumentation_class"], "MainThreadChecker") + self.assertEqual(data["api_name"], "-[NSView superview]") + self.assertEqual(data["class_name"], "NSView") + self.assertEqual(data["selector"], "superview") + self.assertEqual(data["description"], "-[NSView superview] must be used from main thread only") Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,15 @@ +#import +#import + +int main() { + NSView *view = [[NSView alloc] init]; + dispatch_group_t g = dispatch_group_create(); + dispatch_group_enter(g); + [NSThread detachNewThreadWithBlock:^{ + @autoreleasepool { + [view superview]; + } + dispatch_group_leave(g); + }]; + dispatch_group_wait(g, DISPATCH_TIME_FOREVER); +} Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Thu Jul 13 19:26:17 2017 (r320967) @@ -31,8 +31,6 @@ class ReturnValueTestCase(TestBase): "<=", "3.6"], archs=["i386"]) - @expectedFailureAll(compiler="clang", compiler_version=["<=", "5.0.300080"], - triple='.*-android', archs=["i386"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") @add_test_categories(['pyapi']) def test_with_python(self): Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py Thu Jul 13 19:26:17 2017 (r320967) @@ -16,6 +16,7 @@ from lldbsuite.test import lldbutil class RaiseTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True def test_sigstop(self): self.build() @@ -28,6 +29,10 @@ class RaiseTestCase(TestBase): def test_sigsigrtmin(self): self.build() self.signal_test('SIGRTMIN', True) + + def test_sigtrap(self): + self.build() + self.signal_test('SIGTRAP', True) def launch(self, target, signal): # launch the process, do not stop at entry point. Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c Thu Jul 13 19:26:17 2017 (r320967) @@ -10,6 +10,11 @@ void handler(int signo) int main (int argc, char *argv[]) { + if (signal(SIGTRAP, handler) == SIG_ERR) + { + perror("signal(SIGTRAP)"); + return 1; + } #ifndef __APPLE__ // Real time signals not supported on apple platforms. if (signal(SIGRTMIN, handler) == SIG_ERR) @@ -27,6 +32,8 @@ int main (int argc, char *argv[]) if (strcmp(argv[1], "SIGSTOP") == 0) raise(SIGSTOP); + else if (strcmp(argv[1], "SIGTRAP") == 0) + raise(SIGTRAP); #ifndef __APPLE__ else if (strcmp(argv[1], "SIGRTMIN") == 0) raise(SIGRTMIN); Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c +CFLAGS_EXTRAS := -fsanitize=undefined -g + +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,49 @@ +""" +Test that hitting a UBSan issue while running user expression doesn't break the evaluation. +""" + +import os +import time +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * +import lldbsuite.test.lldbutil as lldbutil +import json + + +class UbsanUserExpressionTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessUndefinedBehaviorSanitizer + def test(self): + self.build() + self.ubsan_tests() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + self.line_breakpoint = line_number('main.c', '// breakpoint line') + + def ubsan_tests(self): + # Load the test + exe = os.path.join(os.getcwd(), "a.out") + self.expect( + "file " + exe, + patterns=["Current executable set to .*a.out"]) + + self.runCmd("breakpoint set -f main.c -l %d" % self.line_breakpoint) + + self.runCmd("run") + + process = self.dbg.GetSelectedTarget().process + thread = process.GetSelectedThread() + frame = thread.GetSelectedFrame() + + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs=['stopped', 'stop reason = breakpoint']) + + self.expect("p foo()", substrs=["(int) $0 = 42"]) + + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs=['stopped', 'stop reason = breakpoint']) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c Thu Jul 13 19:26:17 2017 (r320967) @@ -0,0 +1,9 @@ +int foo() { + int data[4]; + int x = *(int *)(((char *)&data[0]) + 2); + return 42; +} + +int main() { + return 0; // breakpoint line +} Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py Thu Jul 13 19:26:17 2017 (r320967) @@ -20,6 +20,7 @@ class TestGoASTContext(TestBase): @skipIfRemote # Not remote test suit ready @no_debug_info_test @skipUnlessGoInstalled + @expectedFailureAll(bugnumber="llvm.org/pr33643") def test_with_dsym_and_python_api(self): """Test GoASTContext dwarf parsing.""" self.buildGo() Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py Thu Jul 13 19:26:13 2017 (r320966) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py Thu Jul 13 19:26:17 2017 (r320967) @@ -8,6 +8,7 @@ import itertools import re import subprocess import sys +import os # Third-party modules import six @@ -138,6 +139,19 @@ def getPlatform(): def platformIsDarwin(): """Returns true if the OS triple for the selected platform is any valid apple OS""" return getPlatform() in getDarwinOSTriples() + + +def findMainThreadCheckerDylib(): + if not platformIsDarwin(): + return "" + + with os.popen('xcode-select -p') as output: + xcode_developer_path = output.read().strip() + mtc_dylib_path = '%s/usr/lib/libMainThreadChecker.dylib' % xcode_developer_path + if os.path.isfile(mtc_dylib_path): *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jul 13 20:04:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AA20DACDE3; Thu, 13 Jul 2017 20:04:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id C07DC2546; Thu, 13 Jul 2017 20:04:43 +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 v6DK4gTm053539; Thu, 13 Jul 2017 20:04:42 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DK4gDU053538; Thu, 13 Jul 2017 20:04:42 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707132004.v6DK4gDU053538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 20:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320969 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 320969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 20:04:44 -0000 Author: gjb Date: Thu Jul 13 20:04:42 2017 New Revision: 320969 URL: https://svnweb.freebsd.org/changeset/base/320969 Log: Fix a missing comment marker. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jul 13 19:26:23 2017 (r320968) +++ head/sys/conf/NOTES Thu Jul 13 20:04:42 2017 (r320969) @@ -302,7 +302,7 @@ options SX_NOINLINE # TURNSTILE_PROFILING enables rudimentary profiling of the hash table # used to hold active lock queues. # UMTX_PROFILING enables rudimentary profiling of the hash table used - to hold active lock queues. +# to hold active lock queues. # WITNESS enables the witness code which detects deadlocks and cycles # during locking operations. # WITNESS_KDB causes the witness code to drop into the kernel debugger if From owner-svn-src-all@freebsd.org Thu Jul 13 22:12:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7FAADAF079; Thu, 13 Jul 2017 22:12:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 84A74663E2; Thu, 13 Jul 2017 22:12:42 +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 v6DMCfCF007005; Thu, 13 Jul 2017 22:12:41 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DMCfrC007004; Thu, 13 Jul 2017 22:12:41 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201707132212.v6DMCfrC007004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 13 Jul 2017 22:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320972 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 320972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 22:12:42 -0000 Author: erj Date: Thu Jul 13 22:12:41 2017 New Revision: 320972 URL: https://svnweb.freebsd.org/changeset/base/320972 Log: ixl(4)/ixlv(4): Stop leaking every busdma entry in receive path From Brett: In short, busdma maps for received packets were not being unloaded in the interrupt handler before the packets were passed up the network stack. The fix was to add a busdma sync and unload for the two receive maps. This bug is significant for certain busdma providers, for example IOMMUs, where not unloading the maps means that 1) the IOMMU mappings that allow the NIC to DMA the received packets into host memory stay open indefinitely, potentially violating a desired security policy, and 2) resources such as device address space addresses and host memory for bookkeeping are never freed. Without an IOMMU or bounce buffering enabled for the ixl device, I don't think adding these calls will have any significant performance impact. With the IOMMU enabled, I have noticed a performance impact on the receive side, which is expected. Submitted by: Brett Gutstein Reviewed by: erj@ MFC after: 1 week Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu Jul 13 22:01:38 2017 (r320971) +++ head/sys/dev/ixl/ixl_txrx.c Thu Jul 13 22:12:41 2017 (r320972) @@ -1578,6 +1578,18 @@ ixl_rxeof(struct ixl_queue *que, int count) else vtag = 0; + /* Remove device access to the rx buffers. */ + if (rbuf->m_head != NULL) { + bus_dmamap_sync(rxr->htag, rbuf->hmap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(rxr->htag, rbuf->hmap); + } + if (rbuf->m_pack != NULL) { + bus_dmamap_sync(rxr->ptag, rbuf->pmap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(rxr->ptag, rbuf->pmap); + } + /* ** Make sure bad packets are discarded, ** note that only EOP descriptor has valid From owner-svn-src-all@freebsd.org Thu Jul 13 22:45:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19250DAF75E; Thu, 13 Jul 2017 22:45:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA600670D3; Thu, 13 Jul 2017 22:45:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DMjO25019263; Thu, 13 Jul 2017 22:45:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DMjNPN019262; Thu, 13 Jul 2017 22:45:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707132245.v6DMjNPN019262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Jul 2017 22:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320973 - in head/sys: conf modules/ixl X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/sys: conf modules/ixl X-SVN-Commit-Revision: 320973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 22:45:25 -0000 Author: bdrewery Date: Thu Jul 13 22:45:23 2017 New Revision: 320973 URL: https://svnweb.freebsd.org/changeset/base/320973 Log: Fix kldload of if_ixl without PCI_IOV kernel option. This also avoids compiling in pci_iov support into the kernel if_ixoif the PCI_IOV option is disabled. Reviewed by: rstone Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11573 Modified: head/sys/conf/files.amd64 head/sys/modules/ixl/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Jul 13 22:12:41 2017 (r320972) +++ head/sys/conf/files.amd64 Thu Jul 13 22:45:23 2017 (r320973) @@ -253,7 +253,7 @@ dev/ixl/ixl_pf_main.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_qmgr.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixl_pf_iov.c optional ixl pci \ +dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_i2c.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" Modified: head/sys/modules/ixl/Makefile ============================================================================== --- head/sys/modules/ixl/Makefile Thu Jul 13 22:12:41 2017 (r320972) +++ head/sys/modules/ixl/Makefile Thu Jul 13 22:45:23 2017 (r320973) @@ -3,10 +3,11 @@ .PATH: ${SRCTOP}/sys/dev/ixl KMOD = if_ixl -SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h +SRCS = device_if.h bus_if.h pci_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_ixl.h SRCS += if_ixl.c ixl_pf_main.c ixl_pf_qmgr.c ixl_txrx.c ixl_pf_i2c.c i40e_osdep.c -SRCS += ixl_pf_iov.c ixl_iw.c +SRCS += ixl_iw.c +SRCS.PCI_IOV= pci_iov_if.h ixl_pf_iov.c # Shared source SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c From owner-svn-src-all@freebsd.org Thu Jul 13 22:49:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D11DAF8C9; Thu, 13 Jul 2017 22:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7125667350; Thu, 13 Jul 2017 22:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DMntWi019461; Thu, 13 Jul 2017 22:49:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DMntQa019459; Thu, 13 Jul 2017 22:49:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707132249.v6DMntQa019459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 13 Jul 2017 22:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320974 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 320974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 22:49:56 -0000 Author: asomers Date: Thu Jul 13 22:49:55 2017 New Revision: 320974 URL: https://svnweb.freebsd.org/changeset/base/320974 Log: Use ATF cleanup routines in aio_test.c Remove aio_test's legacy timeout handling and cleanup routines. Instead, use ATF's builtin capabilities. ATF automatically cleans up newly created files, too, so we don't have to explicitly unlink them. The only tests than need a cleanup routine are the md(4) tests, which must destroy their md device. Reviewed by: jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 Modified: head/tests/sys/aio/Makefile head/tests/sys/aio/aio_test.c Modified: head/tests/sys/aio/Makefile ============================================================================== --- head/tests/sys/aio/Makefile Thu Jul 13 22:45:23 2017 (r320973) +++ head/tests/sys/aio/Makefile Thu Jul 13 22:49:55 2017 (r320974) @@ -3,11 +3,12 @@ TESTSDIR= ${TESTSBASE}/sys/aio ATF_TESTS_C+= aio_test +TEST_METADATA.aio_test+= timeout="30" PLAIN_TESTS_C+= aio_kqueue_test PLAIN_TESTS_C+= lio_kqueue_test -LIBADD.aio_test+= util +LIBADD.aio_test+= util rt CFLAGS+= -I${.CURDIR:H:H} Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Thu Jul 13 22:45:23 2017 (r320973) +++ head/tests/sys/aio/aio_test.c Thu Jul 13 22:49:55 2017 (r320974) @@ -32,10 +32,11 @@ * size buffer with pseudo-random data, writing it to one fd using AIO, then * reading it from a second descriptor using AIO. For some targets, the same * fd is used for write and read (i.e., file, md device), but for others the - * operation is performed on a peer (pty, socket, fifo, etc). A timeout is - * initiated to detect undue blocking. This test does not attempt to exercise - * error cases or more subtle asynchronous behavior, just make sure that the - * basic operations work on some basic object types. + * operation is performed on a peer (pty, socket, fifo, etc). For each file + * descriptor type, several completion methods are tested. This test program + * does not attempt to exercise error cases or more subtle asynchronous + * behavior, just make sure that the basic operations work on some basic object + * types. */ #include @@ -85,43 +86,10 @@ struct aio_context { char ac_buffer[GLOBAL_MAX]; int ac_buflen; int ac_seconds; - void (*ac_cleanup)(void *arg); - void *ac_cleanup_arg; }; -static int aio_timedout; /* - * Each test run specifies a timeout in seconds. Use the somewhat obsoleted - * signal(3) and alarm(3) APIs to set this up. - */ -static void -aio_timeout_signal(int sig __unused) -{ - - aio_timedout = 1; -} - -static void -aio_timeout_start(int seconds) -{ - - aio_timedout = 0; - ATF_REQUIRE_MSG(signal(SIGALRM, aio_timeout_signal) != SIG_ERR, - "failed to set SIGALRM handler: %s", strerror(errno)); - alarm(seconds); -} - -static void -aio_timeout_stop(void) -{ - - ATF_REQUIRE_MSG(signal(SIGALRM, NULL) != SIG_ERR, - "failed to reset SIGALRM handler to default: %s", strerror(errno)); - alarm(0); -} - -/* * Fill a buffer given a seed that can be fed into srandom() to initialize * the PRNG in a repeatable manner. */ @@ -163,8 +131,7 @@ aio_test_buffer(char *buffer, int len, long seed) */ static void aio_context_init(struct aio_context *ac, int read_fd, - int write_fd, int buflen, int seconds, void (*cleanup)(void *), - void *cleanup_arg) + int write_fd, int buflen) { ATF_REQUIRE_MSG(buflen <= BUFFER_MAX, @@ -179,9 +146,6 @@ aio_context_init(struct aio_context *ac, int read_fd, aio_fill_buffer(ac->ac_buffer, buflen, ac->ac_seed); ATF_REQUIRE_MSG(aio_test_buffer(ac->ac_buffer, buflen, ac->ac_seed) != 0, "aio_test_buffer: internal error"); - ac->ac_seconds = seconds; - ac->ac_cleanup = cleanup; - ac->ac_cleanup_arg = cleanup_arg; } static ssize_t @@ -189,7 +153,7 @@ poll(struct aiocb *aio) { int error; - while ((error = aio_error(aio)) == EINPROGRESS && !aio_timedout) + while ((error = aio_error(aio)) == EINPROGRESS) usleep(25000); switch (error) { case EINPROGRESS: @@ -227,23 +191,6 @@ waitcomplete(struct aiocb *aio) } /* - * Each tester can register a callback to clean up in the event the test - * fails. Preserve the value of errno so that subsequent calls to errx() - * work properly. - */ -static void -aio_cleanup(struct aio_context *ac) -{ - int error; - - if (ac->ac_cleanup == NULL) - return; - error = errno; - (ac->ac_cleanup)(ac->ac_cleanup_arg); - errno = error; -} - -/* * Perform a simple write test of our initialized data buffer to the provided * file descriptor. */ @@ -259,37 +206,15 @@ aio_write_test(struct aio_context *ac, completion comp aio.aio_fildes = ac->ac_write_fd; aio.aio_offset = 0; - aio_timeout_start(ac->ac_seconds); - - if (aio_write(&aio) < 0) { - if (errno == EINTR) { - if (aio_timedout) { - aio_cleanup(ac); - atf_tc_fail("aio_write timed out"); - } - } - aio_cleanup(ac); + if (aio_write(&aio) < 0) atf_tc_fail("aio_write failed: %s", strerror(errno)); - } len = comp(&aio); - if (len < 0) { - if (errno == EINTR) { - if (aio_timedout) { - aio_cleanup(ac); - atf_tc_fail("aio timed out"); - } - } - aio_cleanup(ac); + if (len < 0) atf_tc_fail("aio failed: %s", strerror(errno)); - } - aio_timeout_stop(); - - if (len != ac->ac_buflen) { - aio_cleanup(ac); + if (len != ac->ac_buflen) atf_tc_fail("aio short write (%jd)", (intmax_t)len); - } } /* @@ -309,43 +234,18 @@ aio_read_test(struct aio_context *ac, completion comp) aio.aio_fildes = ac->ac_read_fd; aio.aio_offset = 0; - aio_timeout_start(ac->ac_seconds); - - if (aio_read(&aio) < 0) { - if (errno == EINTR) { - if (aio_timedout) { - aio_cleanup(ac); - atf_tc_fail("aio_read timed out"); - } - } - aio_cleanup(ac); + if (aio_read(&aio) < 0) atf_tc_fail("aio_read failed: %s", strerror(errno)); - } len = comp(&aio); - if (len < 0) { - if (errno == EINTR) { - if (aio_timedout) { - aio_cleanup(ac); - atf_tc_fail("aio timed out"); - } - } - aio_cleanup(ac); + if (len < 0) atf_tc_fail("aio failed: %s", strerror(errno)); - } - aio_timeout_stop(); + ATF_REQUIRE_EQ_MSG(len, ac->ac_buflen, + "aio short read (%jd)", (intmax_t)len); - if (len != ac->ac_buflen) { - aio_cleanup(ac); - atf_tc_fail("aio short read (%jd)", - (intmax_t)len); - } - - if (aio_test_buffer(ac->ac_buffer, ac->ac_buflen, ac->ac_seed) == 0) { - aio_cleanup(ac); + if (aio_test_buffer(ac->ac_buffer, ac->ac_buflen, ac->ac_seed) == 0) atf_tc_fail("buffer mismatched"); - } } /* @@ -360,25 +260,10 @@ aio_read_test(struct aio_context *ac, completion comp) */ #define FILE_LEN GLOBAL_MAX #define FILE_PATHNAME "testfile" -#define FILE_TIMEOUT 30 -struct aio_file_arg { - int afa_fd; -}; static void -aio_file_cleanup(void *arg) -{ - struct aio_file_arg *afa; - - afa = arg; - close(afa->afa_fd); - unlink(FILE_PATHNAME); -} - -static void aio_file_test(completion comp) { - struct aio_file_arg arg; struct aio_context ac; int fd; @@ -388,14 +273,10 @@ aio_file_test(completion comp) fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); - arg.afa_fd = fd; - - aio_context_init(&ac, fd, fd, FILE_LEN, - FILE_TIMEOUT, aio_file_cleanup, &arg); + aio_context_init(&ac, fd, fd, FILE_LEN); aio_write_test(&ac, comp); aio_read_test(&ac, comp); - - aio_file_cleanup(&arg); + close(fd); } ATF_TC_WITHOUT_HEAD(file_poll); @@ -418,30 +299,11 @@ ATF_TC_BODY(file_waitcomplete, tc) #define FIFO_LEN 256 #define FIFO_PATHNAME "testfifo" -#define FIFO_TIMEOUT 30 -struct aio_fifo_arg { - int afa_read_fd; - int afa_write_fd; -}; static void -aio_fifo_cleanup(void *arg) -{ - struct aio_fifo_arg *afa; - - afa = arg; - if (afa->afa_read_fd != -1) - close(afa->afa_read_fd); - if (afa->afa_write_fd != -1) - close(afa->afa_write_fd); - unlink(FIFO_PATHNAME); -} - -static void aio_fifo_test(completion comp) { int error, read_fd = -1, write_fd = -1; - struct aio_fifo_arg arg; struct aio_context ac; ATF_REQUIRE_KERNEL_MODULE("aio"); @@ -449,35 +311,29 @@ aio_fifo_test(completion comp) ATF_REQUIRE_MSG(mkfifo(FIFO_PATHNAME, 0600) != -1, "mkfifo failed: %s", strerror(errno)); - arg.afa_read_fd = -1; - arg.afa_write_fd = -1; read_fd = open(FIFO_PATHNAME, O_RDONLY | O_NONBLOCK); if (read_fd == -1) { error = errno; - aio_fifo_cleanup(&arg); errno = error; atf_tc_fail("read_fd open failed: %s", strerror(errno)); } - arg.afa_read_fd = read_fd; write_fd = open(FIFO_PATHNAME, O_WRONLY); if (write_fd == -1) { error = errno; - aio_fifo_cleanup(&arg); errno = error; atf_tc_fail("write_fd open failed: %s", strerror(errno)); } - arg.afa_write_fd = write_fd; - aio_context_init(&ac, read_fd, write_fd, FIFO_LEN, - FIFO_TIMEOUT, aio_fifo_cleanup, &arg); + aio_context_init(&ac, read_fd, write_fd, FIFO_LEN); aio_write_test(&ac, comp); aio_read_test(&ac, comp); - aio_fifo_cleanup(&arg); + close(read_fd); + close(write_fd); } ATF_TC_WITHOUT_HEAD(fifo_poll); @@ -489,7 +345,7 @@ ATF_TC_BODY(fifo_poll, tc) ATF_TC_WITHOUT_HEAD(fifo_suspend); ATF_TC_BODY(fifo_suspend, tc) { - aio_fifo_test(waitcomplete); + aio_fifo_test(suspend); } ATF_TC_WITHOUT_HEAD(fifo_waitcomplete); @@ -498,26 +354,10 @@ ATF_TC_BODY(fifo_waitcomplete, tc) aio_fifo_test(waitcomplete); } -struct aio_unix_socketpair_arg { - int asa_sockets[2]; -}; - -static void -aio_unix_socketpair_cleanup(void *arg) -{ - struct aio_unix_socketpair_arg *asa; - - asa = arg; - close(asa->asa_sockets[0]); - close(asa->asa_sockets[1]); -} - #define UNIX_SOCKETPAIR_LEN 256 -#define UNIX_SOCKETPAIR_TIMEOUT 30 static void aio_unix_socketpair_test(completion comp) { - struct aio_unix_socketpair_arg arg; struct aio_context ac; struct rusage ru_before, ru_after; int sockets[2]; @@ -527,11 +367,7 @@ aio_unix_socketpair_test(completion comp) ATF_REQUIRE_MSG(socketpair(PF_UNIX, SOCK_STREAM, 0, sockets) != -1, "socketpair failed: %s", strerror(errno)); - arg.asa_sockets[0] = sockets[0]; - arg.asa_sockets[1] = sockets[1]; - aio_context_init(&ac, sockets[0], - sockets[1], UNIX_SOCKETPAIR_LEN, UNIX_SOCKETPAIR_TIMEOUT, - aio_unix_socketpair_cleanup, &arg); + aio_context_init(&ac, sockets[0], sockets[1], UNIX_SOCKETPAIR_LEN); ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_before) != -1, "getrusage failed: %s", strerror(errno)); aio_write_test(&ac, comp); @@ -544,7 +380,8 @@ aio_unix_socketpair_test(completion comp) "getrusage failed: %s", strerror(errno)); ATF_REQUIRE(ru_after.ru_msgrcv == ru_before.ru_msgrcv + 1); - aio_unix_socketpair_cleanup(&arg); + close(sockets[0]); + close(sockets[1]); } ATF_TC_WITHOUT_HEAD(socket_poll); @@ -570,22 +407,10 @@ struct aio_pty_arg { int apa_write_fd; }; -static void -aio_pty_cleanup(void *arg) -{ - struct aio_pty_arg *apa; - - apa = arg; - close(apa->apa_read_fd); - close(apa->apa_write_fd); -}; - #define PTY_LEN 256 -#define PTY_TIMEOUT 30 static void aio_pty_test(completion comp) { - struct aio_pty_arg arg; struct aio_context ac; int read_fd, write_fd; struct termios ts; @@ -597,29 +422,25 @@ aio_pty_test(completion comp) ATF_REQUIRE_MSG(openpty(&read_fd, &write_fd, NULL, NULL, NULL) == 0, "openpty failed: %s", strerror(errno)); - arg.apa_read_fd = read_fd; - arg.apa_write_fd = write_fd; if (tcgetattr(write_fd, &ts) < 0) { error = errno; - aio_pty_cleanup(&arg); errno = error; atf_tc_fail("tcgetattr failed: %s", strerror(errno)); } cfmakeraw(&ts); if (tcsetattr(write_fd, TCSANOW, &ts) < 0) { error = errno; - aio_pty_cleanup(&arg); errno = error; atf_tc_fail("tcsetattr failed: %s", strerror(errno)); } - aio_context_init(&ac, read_fd, write_fd, PTY_LEN, - PTY_TIMEOUT, aio_pty_cleanup, &arg); + aio_context_init(&ac, read_fd, write_fd, PTY_LEN); aio_write_test(&ac, comp); aio_read_test(&ac, comp); - aio_pty_cleanup(&arg); + close(read_fd); + close(write_fd); } ATF_TC_WITHOUT_HEAD(pty_poll); @@ -640,17 +461,7 @@ ATF_TC_BODY(pty_waitcomplete, tc) aio_pty_test(waitcomplete); } -static void -aio_pipe_cleanup(void *arg) -{ - int *pipes = arg; - - close(pipes[0]); - close(pipes[1]); -} - #define PIPE_LEN 256 -#define PIPE_TIMEOUT 30 static void aio_pipe_test(completion comp) { @@ -663,12 +474,12 @@ aio_pipe_test(completion comp) ATF_REQUIRE_MSG(pipe(pipes) != -1, "pipe failed: %s", strerror(errno)); - aio_context_init(&ac, pipes[0], pipes[1], PIPE_LEN, - PIPE_TIMEOUT, aio_pipe_cleanup, pipes); + aio_context_init(&ac, pipes[0], pipes[1], PIPE_LEN); aio_write_test(&ac, comp); aio_read_test(&ac, comp); - aio_pipe_cleanup(pipes); + close(pipes[0]); + close(pipes[1]); } ATF_TC_WITHOUT_HEAD(pipe_poll); @@ -689,50 +500,45 @@ ATF_TC_BODY(pipe_waitcomplete, tc) aio_pipe_test(waitcomplete); } -struct aio_md_arg { - int ama_mdctl_fd; - int ama_unit; - int ama_fd; -}; +#define MD_LEN GLOBAL_MAX +#define MDUNIT_LINK "mdunit_link" static void -aio_md_cleanup(void *arg) +aio_md_cleanup(void) { - struct aio_md_arg *ama; struct md_ioctl mdio; - int error; + int mdctl_fd, error, n, unit; + char buf[80]; - ama = arg; - - if (ama->ama_fd != -1) - close(ama->ama_fd); - - if (ama->ama_unit != -1) { - bzero(&mdio, sizeof(mdio)); - mdio.md_version = MDIOVERSION; - mdio.md_unit = ama->ama_unit; - if (ioctl(ama->ama_mdctl_fd, MDIOCDETACH, &mdio) == -1) { - error = errno; - close(ama->ama_mdctl_fd); - errno = error; - atf_tc_fail("ioctl MDIOCDETACH failed: %s", - strerror(errno)); + mdctl_fd = open("/dev/" MDCTL_NAME, O_RDWR, 0); + ATF_REQUIRE(mdctl_fd >= 0); + n = readlink(MDUNIT_LINK, buf, sizeof(buf)); + if (n > 0) { + if (sscanf(buf, "%d", &unit) == 1 && unit >= 0) { + bzero(&mdio, sizeof(mdio)); + mdio.md_version = MDIOVERSION; + mdio.md_unit = unit; + if (ioctl(mdctl_fd, MDIOCDETACH, &mdio) == -1) { + error = errno; + close(mdctl_fd); + errno = error; + atf_tc_fail("ioctl MDIOCDETACH failed: %s", + strerror(errno)); + } } } - - close(ama->ama_mdctl_fd); + + close(mdctl_fd); } -#define MD_LEN GLOBAL_MAX -#define MD_TIMEOUT 30 static void aio_md_test(completion comp) { int error, fd, mdctl_fd, unit; char pathname[PATH_MAX]; - struct aio_md_arg arg; struct aio_context ac; struct md_ioctl mdio; + char buf[80]; ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); @@ -748,32 +554,30 @@ aio_md_test(completion comp) mdio.md_mediasize = GLOBAL_MAX; mdio.md_sectorsize = 512; - arg.ama_mdctl_fd = mdctl_fd; - arg.ama_unit = -1; - arg.ama_fd = -1; if (ioctl(mdctl_fd, MDIOCATTACH, &mdio) < 0) { error = errno; - aio_md_cleanup(&arg); errno = error; atf_tc_fail("ioctl MDIOCATTACH failed: %s", strerror(errno)); } + close(mdctl_fd); - arg.ama_unit = unit = mdio.md_unit; + /* Store the md unit number in a symlink for future cleanup */ + unit = mdio.md_unit; + snprintf(buf, sizeof(buf), "%d", unit); + ATF_REQUIRE_EQ(0, symlink(buf, MDUNIT_LINK)); snprintf(pathname, PATH_MAX, "/dev/md%d", unit); fd = open(pathname, O_RDWR); ATF_REQUIRE_MSG(fd != -1, "opening %s failed: %s", pathname, strerror(errno)); - arg.ama_fd = fd; - aio_context_init(&ac, fd, fd, MD_LEN, MD_TIMEOUT, - aio_md_cleanup, &arg); + aio_context_init(&ac, fd, fd, MD_LEN); aio_write_test(&ac, comp); aio_read_test(&ac, comp); - - aio_md_cleanup(&arg); + + close(fd); } -ATF_TC(md_poll); +ATF_TC_WITH_CLEANUP(md_poll); ATF_TC_HEAD(md_poll, tc) { @@ -783,8 +587,12 @@ ATF_TC_BODY(md_poll, tc) { aio_md_test(poll); } +ATF_TC_CLEANUP(md_poll, tc) +{ + aio_md_cleanup(); +} -ATF_TC(md_suspend); +ATF_TC_WITH_CLEANUP(md_suspend); ATF_TC_HEAD(md_suspend, tc) { @@ -794,8 +602,12 @@ ATF_TC_BODY(md_suspend, tc) { aio_md_test(suspend); } +ATF_TC_CLEANUP(md_suspend, tc) +{ + aio_md_cleanup(); +} -ATF_TC(md_waitcomplete); +ATF_TC_WITH_CLEANUP(md_waitcomplete); ATF_TC_HEAD(md_waitcomplete, tc) { @@ -804,6 +616,10 @@ ATF_TC_HEAD(md_waitcomplete, tc) ATF_TC_BODY(md_waitcomplete, tc) { aio_md_test(waitcomplete); +} +ATF_TC_CLEANUP(md_waitcomplete, tc) +{ + aio_md_cleanup(); } ATF_TC_WITHOUT_HEAD(aio_large_read_test); From owner-svn-src-all@freebsd.org Thu Jul 13 22:53:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E13EDAFAE2; Thu, 13 Jul 2017 22:53:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D318C67862; Thu, 13 Jul 2017 22:53:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DMrDHj023464; Thu, 13 Jul 2017 22:53:13 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DMrDDG023463; Thu, 13 Jul 2017 22:53:13 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707132253.v6DMrDDG023463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 13 Jul 2017 22:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320975 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 320975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 22:53:15 -0000 Author: asomers Date: Thu Jul 13 22:53:13 2017 New Revision: 320975 URL: https://svnweb.freebsd.org/changeset/base/320975 Log: Add tests for aio(4) completion notification via signals and threads Reviewed by: jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 Modified: head/tests/sys/aio/aio_test.c Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Thu Jul 13 22:49:55 2017 (r320974) +++ head/tests/sys/aio/aio_test.c Thu Jul 13 22:53:13 2017 (r320975) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -88,7 +89,9 @@ struct aio_context { int ac_seconds; }; +static sem_t completions; + /* * Fill a buffer given a seed that can be fed into srandom() to initialize * the PRNG in a repeatable manner. @@ -166,7 +169,71 @@ poll(struct aiocb *aio) } } +static void +sigusr1_handler(int sig __unused) +{ + ATF_REQUIRE_EQ(0, sem_post(&completions)); +} + +static void +thr_handler(union sigval sv __unused) +{ + ATF_REQUIRE_EQ(0, sem_post(&completions)); +} + static ssize_t +poll_signaled(struct aiocb *aio) +{ + int error; + + ATF_REQUIRE_EQ(0, sem_wait(&completions)); + error = aio_error(aio); + switch (error) { + case EINPROGRESS: + errno = EINTR; + return (-1); + case 0: + return (aio_return(aio)); + default: + return (error); + } +} + +/* + * Setup a signal handler for signal delivery tests + * This isn't thread safe, but it's ok since ATF runs each testcase in a + * separate process + */ +static struct sigevent* +setup_signal(void) +{ + static struct sigevent sev; + + ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIGUSR1; + ATF_REQUIRE(SIG_ERR != signal(SIGUSR1, sigusr1_handler)); + return (&sev); +} + +/* + * Setup a thread for thread delivery tests + * This isn't thread safe, but it's ok since ATF runs each testcase in a + * separate process + */ +static struct sigevent* +setup_thread() +{ + static struct sigevent sev; + + ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); + sev.sigev_notify = SIGEV_THREAD; + sev.sigev_notify_function = thr_handler; + sev.sigev_notify_attributes = NULL; + return (&sev); +} + +static ssize_t suspend(struct aiocb *aio) { const struct aiocb *const iocbs[] = {aio}; @@ -195,7 +262,7 @@ waitcomplete(struct aiocb *aio) * file descriptor. */ static void -aio_write_test(struct aio_context *ac, completion comp) +aio_write_test(struct aio_context *ac, completion comp, struct sigevent *sev) { struct aiocb aio; ssize_t len; @@ -205,6 +272,8 @@ aio_write_test(struct aio_context *ac, completion comp aio.aio_nbytes = ac->ac_buflen; aio.aio_fildes = ac->ac_write_fd; aio.aio_offset = 0; + if (sev) + aio.aio_sigevent = *sev; if (aio_write(&aio) < 0) atf_tc_fail("aio_write failed: %s", strerror(errno)); @@ -222,7 +291,7 @@ aio_write_test(struct aio_context *ac, completion comp * provided file descriptor. */ static void -aio_read_test(struct aio_context *ac, completion comp) +aio_read_test(struct aio_context *ac, completion comp, struct sigevent *sev) { struct aiocb aio; ssize_t len; @@ -233,6 +302,8 @@ aio_read_test(struct aio_context *ac, completion comp) aio.aio_nbytes = ac->ac_buflen; aio.aio_fildes = ac->ac_read_fd; aio.aio_offset = 0; + if (sev) + aio.aio_sigevent = *sev; if (aio_read(&aio) < 0) atf_tc_fail("aio_read failed: %s", strerror(errno)); @@ -262,7 +333,7 @@ aio_read_test(struct aio_context *ac, completion comp) #define FILE_PATHNAME "testfile" static void -aio_file_test(completion comp) +aio_file_test(completion comp, struct sigevent *sev) { struct aio_context ac; int fd; @@ -274,34 +345,46 @@ aio_file_test(completion comp) ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); aio_context_init(&ac, fd, fd, FILE_LEN); - aio_write_test(&ac, comp); - aio_read_test(&ac, comp); + aio_write_test(&ac, comp, sev); + aio_read_test(&ac, comp, sev); close(fd); } ATF_TC_WITHOUT_HEAD(file_poll); ATF_TC_BODY(file_poll, tc) { - aio_file_test(poll); + aio_file_test(poll, NULL); } +ATF_TC_WITHOUT_HEAD(file_signal); +ATF_TC_BODY(file_signal, tc) +{ + aio_file_test(poll_signaled, setup_signal()); +} + ATF_TC_WITHOUT_HEAD(file_suspend); ATF_TC_BODY(file_suspend, tc) { - aio_file_test(suspend); + aio_file_test(suspend, NULL); } +ATF_TC_WITHOUT_HEAD(file_thread); +ATF_TC_BODY(file_thread, tc) +{ + aio_file_test(poll_signaled, setup_thread()); +} + ATF_TC_WITHOUT_HEAD(file_waitcomplete); ATF_TC_BODY(file_waitcomplete, tc) { - aio_file_test(waitcomplete); + aio_file_test(waitcomplete, NULL); } #define FIFO_LEN 256 #define FIFO_PATHNAME "testfifo" static void -aio_fifo_test(completion comp) +aio_fifo_test(completion comp, struct sigevent *sev) { int error, read_fd = -1, write_fd = -1; struct aio_context ac; @@ -329,8 +412,8 @@ aio_fifo_test(completion comp) } aio_context_init(&ac, read_fd, write_fd, FIFO_LEN); - aio_write_test(&ac, comp); - aio_read_test(&ac, comp); + aio_write_test(&ac, comp, sev); + aio_read_test(&ac, comp, sev); close(read_fd); close(write_fd); @@ -339,24 +422,36 @@ aio_fifo_test(completion comp) ATF_TC_WITHOUT_HEAD(fifo_poll); ATF_TC_BODY(fifo_poll, tc) { - aio_fifo_test(poll); + aio_fifo_test(poll, NULL); } +ATF_TC_WITHOUT_HEAD(fifo_signal); +ATF_TC_BODY(fifo_signal, tc) +{ + aio_fifo_test(poll_signaled, setup_signal()); +} + ATF_TC_WITHOUT_HEAD(fifo_suspend); ATF_TC_BODY(fifo_suspend, tc) { - aio_fifo_test(suspend); + aio_fifo_test(suspend, NULL); } +ATF_TC_WITHOUT_HEAD(fifo_thread); +ATF_TC_BODY(fifo_thread, tc) +{ + aio_fifo_test(poll_signaled, setup_thread()); +} + ATF_TC_WITHOUT_HEAD(fifo_waitcomplete); ATF_TC_BODY(fifo_waitcomplete, tc) { - aio_fifo_test(waitcomplete); + aio_fifo_test(waitcomplete, NULL); } #define UNIX_SOCKETPAIR_LEN 256 static void -aio_unix_socketpair_test(completion comp) +aio_unix_socketpair_test(completion comp, struct sigevent *sev) { struct aio_context ac; struct rusage ru_before, ru_after; @@ -370,12 +465,12 @@ aio_unix_socketpair_test(completion comp) aio_context_init(&ac, sockets[0], sockets[1], UNIX_SOCKETPAIR_LEN); ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_before) != -1, "getrusage failed: %s", strerror(errno)); - aio_write_test(&ac, comp); + aio_write_test(&ac, comp, sev); ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_after) != -1, "getrusage failed: %s", strerror(errno)); ATF_REQUIRE(ru_after.ru_msgsnd == ru_before.ru_msgsnd + 1); ru_before = ru_after; - aio_read_test(&ac, comp); + aio_read_test(&ac, comp, sev); ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_after) != -1, "getrusage failed: %s", strerror(errno)); ATF_REQUIRE(ru_after.ru_msgrcv == ru_before.ru_msgrcv + 1); @@ -387,19 +482,31 @@ aio_unix_socketpair_test(completion comp) ATF_TC_WITHOUT_HEAD(socket_poll); ATF_TC_BODY(socket_poll, tc) { - aio_unix_socketpair_test(poll); + aio_unix_socketpair_test(poll, NULL); } +ATF_TC_WITHOUT_HEAD(socket_signal); +ATF_TC_BODY(socket_signal, tc) +{ + aio_unix_socketpair_test(poll_signaled, setup_signal()); +} + ATF_TC_WITHOUT_HEAD(socket_suspend); ATF_TC_BODY(socket_suspend, tc) { - aio_unix_socketpair_test(suspend); + aio_unix_socketpair_test(suspend, NULL); } +ATF_TC_WITHOUT_HEAD(socket_thread); +ATF_TC_BODY(socket_thread, tc) +{ + aio_unix_socketpair_test(poll_signaled, setup_thread()); +} + ATF_TC_WITHOUT_HEAD(socket_waitcomplete); ATF_TC_BODY(socket_waitcomplete, tc) { - aio_unix_socketpair_test(waitcomplete); + aio_unix_socketpair_test(waitcomplete, NULL); } struct aio_pty_arg { @@ -409,7 +516,7 @@ struct aio_pty_arg { #define PTY_LEN 256 static void -aio_pty_test(completion comp) +aio_pty_test(completion comp, struct sigevent *sev) { struct aio_context ac; int read_fd, write_fd; @@ -436,8 +543,8 @@ aio_pty_test(completion comp) } aio_context_init(&ac, read_fd, write_fd, PTY_LEN); - aio_write_test(&ac, comp); - aio_read_test(&ac, comp); + aio_write_test(&ac, comp, sev); + aio_read_test(&ac, comp, sev); close(read_fd); close(write_fd); @@ -446,24 +553,36 @@ aio_pty_test(completion comp) ATF_TC_WITHOUT_HEAD(pty_poll); ATF_TC_BODY(pty_poll, tc) { - aio_pty_test(poll); + aio_pty_test(poll, NULL); } +ATF_TC_WITHOUT_HEAD(pty_signal); +ATF_TC_BODY(pty_signal, tc) +{ + aio_pty_test(poll_signaled, setup_signal()); +} + ATF_TC_WITHOUT_HEAD(pty_suspend); ATF_TC_BODY(pty_suspend, tc) { - aio_pty_test(suspend); + aio_pty_test(suspend, NULL); } +ATF_TC_WITHOUT_HEAD(pty_thread); +ATF_TC_BODY(pty_thread, tc) +{ + aio_pty_test(poll_signaled, setup_thread()); +} + ATF_TC_WITHOUT_HEAD(pty_waitcomplete); ATF_TC_BODY(pty_waitcomplete, tc) { - aio_pty_test(waitcomplete); + aio_pty_test(waitcomplete, NULL); } #define PIPE_LEN 256 static void -aio_pipe_test(completion comp) +aio_pipe_test(completion comp, struct sigevent *sev) { struct aio_context ac; int pipes[2]; @@ -475,8 +594,8 @@ aio_pipe_test(completion comp) "pipe failed: %s", strerror(errno)); aio_context_init(&ac, pipes[0], pipes[1], PIPE_LEN); - aio_write_test(&ac, comp); - aio_read_test(&ac, comp); + aio_write_test(&ac, comp, sev); + aio_read_test(&ac, comp, sev); close(pipes[0]); close(pipes[1]); @@ -485,19 +604,31 @@ aio_pipe_test(completion comp) ATF_TC_WITHOUT_HEAD(pipe_poll); ATF_TC_BODY(pipe_poll, tc) { - aio_pipe_test(poll); + aio_pipe_test(poll, NULL); } +ATF_TC_WITHOUT_HEAD(pipe_signal); +ATF_TC_BODY(pipe_signal, tc) +{ + aio_pipe_test(poll_signaled, setup_signal()); +} + ATF_TC_WITHOUT_HEAD(pipe_suspend); ATF_TC_BODY(pipe_suspend, tc) { - aio_pipe_test(suspend); + aio_pipe_test(suspend, NULL); } +ATF_TC_WITHOUT_HEAD(pipe_thread); +ATF_TC_BODY(pipe_thread, tc) +{ + aio_pipe_test(poll_signaled, setup_thread()); +} + ATF_TC_WITHOUT_HEAD(pipe_waitcomplete); ATF_TC_BODY(pipe_waitcomplete, tc) { - aio_pipe_test(waitcomplete); + aio_pipe_test(waitcomplete, NULL); } #define MD_LEN GLOBAL_MAX @@ -532,7 +663,7 @@ aio_md_cleanup(void) } static void -aio_md_test(completion comp) +aio_md_test(completion comp, struct sigevent *sev) { int error, fd, mdctl_fd, unit; char pathname[PATH_MAX]; @@ -571,8 +702,8 @@ aio_md_test(completion comp) "opening %s failed: %s", pathname, strerror(errno)); aio_context_init(&ac, fd, fd, MD_LEN); - aio_write_test(&ac, comp); - aio_read_test(&ac, comp); + aio_write_test(&ac, comp, sev); + aio_read_test(&ac, comp, sev); close(fd); } @@ -585,13 +716,28 @@ ATF_TC_HEAD(md_poll, tc) } ATF_TC_BODY(md_poll, tc) { - aio_md_test(poll); + aio_md_test(poll, NULL); } ATF_TC_CLEANUP(md_poll, tc) { aio_md_cleanup(); } +ATF_TC_WITH_CLEANUP(md_signal); +ATF_TC_HEAD(md_signal, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(md_signal, tc) +{ + aio_md_test(poll_signaled, setup_signal()); +} +ATF_TC_CLEANUP(md_signal, tc) +{ + aio_md_cleanup(); +} + ATF_TC_WITH_CLEANUP(md_suspend); ATF_TC_HEAD(md_suspend, tc) { @@ -600,13 +746,28 @@ ATF_TC_HEAD(md_suspend, tc) } ATF_TC_BODY(md_suspend, tc) { - aio_md_test(suspend); + aio_md_test(suspend, NULL); } ATF_TC_CLEANUP(md_suspend, tc) { aio_md_cleanup(); } +ATF_TC_WITH_CLEANUP(md_thread); +ATF_TC_HEAD(md_thread, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(md_thread, tc) +{ + aio_md_test(poll_signaled, setup_thread()); +} +ATF_TC_CLEANUP(md_thread, tc) +{ + aio_md_cleanup(); +} + ATF_TC_WITH_CLEANUP(md_waitcomplete); ATF_TC_HEAD(md_waitcomplete, tc) { @@ -615,7 +776,7 @@ ATF_TC_HEAD(md_waitcomplete, tc) } ATF_TC_BODY(md_waitcomplete, tc) { - aio_md_test(waitcomplete); + aio_md_test(waitcomplete, NULL); } ATF_TC_CLEANUP(md_waitcomplete, tc) { @@ -968,28 +1129,40 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, file_poll); + ATF_TP_ADD_TC(tp, file_signal); ATF_TP_ADD_TC(tp, file_suspend); + ATF_TP_ADD_TC(tp, file_thread); ATF_TP_ADD_TC(tp, file_waitcomplete); ATF_TP_ADD_TC(tp, fifo_poll); + ATF_TP_ADD_TC(tp, fifo_signal); ATF_TP_ADD_TC(tp, fifo_suspend); + ATF_TP_ADD_TC(tp, fifo_thread); ATF_TP_ADD_TC(tp, fifo_waitcomplete); ATF_TP_ADD_TC(tp, socket_poll); + ATF_TP_ADD_TC(tp, socket_signal); ATF_TP_ADD_TC(tp, socket_suspend); + ATF_TP_ADD_TC(tp, socket_thread); ATF_TP_ADD_TC(tp, socket_waitcomplete); ATF_TP_ADD_TC(tp, pty_poll); + ATF_TP_ADD_TC(tp, pty_signal); ATF_TP_ADD_TC(tp, pty_suspend); + ATF_TP_ADD_TC(tp, pty_thread); ATF_TP_ADD_TC(tp, pty_waitcomplete); ATF_TP_ADD_TC(tp, pipe_poll); + ATF_TP_ADD_TC(tp, pipe_signal); ATF_TP_ADD_TC(tp, pipe_suspend); + ATF_TP_ADD_TC(tp, pipe_thread); ATF_TP_ADD_TC(tp, pipe_waitcomplete); ATF_TP_ADD_TC(tp, md_poll); + ATF_TP_ADD_TC(tp, md_signal); ATF_TP_ADD_TC(tp, md_suspend); + ATF_TP_ADD_TC(tp, md_thread); ATF_TP_ADD_TC(tp, md_waitcomplete); + ATF_TP_ADD_TC(tp, aio_fsync_test); ATF_TP_ADD_TC(tp, aio_large_read_test); ATF_TP_ADD_TC(tp, aio_socket_two_reads); ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write); ATF_TP_ADD_TC(tp, aio_socket_short_write_cancel); - ATF_TP_ADD_TC(tp, aio_fsync_test); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Thu Jul 13 23:48:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F0F7DB0852; Thu, 13 Jul 2017 23:48:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id CF7E16A1B3; Thu, 13 Jul 2017 23:48:06 +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 v6DNm6aO044483; Thu, 13 Jul 2017 23:48:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DNm5iQ044481; Thu, 13 Jul 2017 23:48:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707132348.v6DNm5iQ044481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Jul 2017 23:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r320976 - in releng/11.1: release/pkg_repos sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/11.1: release/pkg_repos sys/conf X-SVN-Commit-Revision: 320976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 23:48:07 -0000 Author: gjb Date: Thu Jul 13 23:48:05 2017 New Revision: 320976 URL: https://svnweb.freebsd.org/changeset/base/320976 Log: Rename releng/11.1 to RC3 as part of the 11.1-RELEASE cycle. Use the 'release_1' package set to populate the dvd1.iso packages. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/release/pkg_repos/release-dvd.conf releng/11.1/sys/conf/newvers.sh Modified: releng/11.1/release/pkg_repos/release-dvd.conf ============================================================================== --- releng/11.1/release/pkg_repos/release-dvd.conf Thu Jul 13 22:53:13 2017 (r320975) +++ releng/11.1/release/pkg_repos/release-dvd.conf Thu Jul 13 23:48:05 2017 (r320976) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_1", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Thu Jul 13 22:53:13 2017 (r320975) +++ releng/11.1/sys/conf/newvers.sh Thu Jul 13 23:48:05 2017 (r320976) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RC2" +BRANCH="RC3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jul 14 00:10:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0140DB11F5; Fri, 14 Jul 2017 00:10:52 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA7AA6AEFA; Fri, 14 Jul 2017 00:10:52 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6E0ApLh052895; Fri, 14 Jul 2017 00:10:51 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E0ApLQ052889; Fri, 14 Jul 2017 00:10:51 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707140010.v6E0ApLQ052889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 14 Jul 2017 00:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320977 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 320977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 00:10:53 -0000 Author: rlibby Date: Fri Jul 14 00:10:51 2017 New Revision: 320977 URL: https://svnweb.freebsd.org/changeset/base/320977 Log: ixl: gcc build errors Fix minor -Werror issues when building with gcc from -Wredundant-decls, -Wunused, -Wbool-operations. Also ensure the M_IXL malloc type is only defined once. Reviewed by: efj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11414 Modified: head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/i40e_prototype.h Fri Jul 14 00:10:51 2017 (r320977) @@ -538,6 +538,4 @@ enum i40e_status_code i40e_read_phy_register(struct i4 enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); -enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, - u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/if_ixlv.c Fri Jul 14 00:10:51 2017 (r320977) @@ -1074,7 +1074,7 @@ retry_send: if (error == ETIMEDOUT) { if (!send_api_ver_retried) { /* Resend message, one more time */ - send_api_ver_retried++; + send_api_ver_retried = true; device_printf(dev, "%s: Timeout while verifying API version on first" " try!\n", __func__); Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/ixl.h Fri Jul 14 00:10:51 2017 (r320977) @@ -664,8 +664,7 @@ struct ixl_sysctl_info { char *description; }; -static uint8_t ixl_bcast_addr[ETHER_ADDR_LEN] = - {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +extern const uint8_t ixl_bcast_addr[ETHER_ADDR_LEN]; /********************************************************************* * TXRX Function prototypes Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/ixl_pf.h Fri Jul 14 00:10:51 2017 (r320977) @@ -168,16 +168,9 @@ struct ixl_pf { "\nExecutes a \"Get Link Status\" command on the Admin Queue, and displays" \ " the response." \ -static char *ixl_fc_string[6] = { - "None", - "Rx", - "Tx", - "Full", - "Priority", - "Default" -}; +extern const char * const ixl_fc_string[6]; -static MALLOC_DEFINE(M_IXL, "ixl", "ixl driver allocations"); +MALLOC_DECLARE(M_IXL); /*** Functions / Macros ***/ /* Adjust the level here to 10 or over to print stats messages */ @@ -299,8 +292,8 @@ int ixl_rebuild_hw_structs_after_reset(struct ixl_pf * void ixl_set_queue_rx_itr(struct ixl_queue *); void ixl_set_queue_tx_itr(struct ixl_queue *); -void ixl_add_filter(struct ixl_vsi *, u8 *, s16 vlan); -void ixl_del_filter(struct ixl_vsi *, u8 *, s16 vlan); +void ixl_add_filter(struct ixl_vsi *, const u8 *, s16 vlan); +void ixl_del_filter(struct ixl_vsi *, const u8 *, s16 vlan); void ixl_reconfigure_filters(struct ixl_vsi *vsi); int ixl_disable_rings(struct ixl_vsi *); @@ -331,7 +324,7 @@ void ixl_init_filters(struct ixl_vsi *); void ixl_add_hw_filters(struct ixl_vsi *, int, int); void ixl_del_hw_filters(struct ixl_vsi *, int); struct ixl_mac_filter * - ixl_find_filter(struct ixl_vsi *, u8 *, s16); + ixl_find_filter(struct ixl_vsi *, const u8 *, s16); void ixl_add_mc_filter(struct ixl_vsi *, u8 *); void ixl_free_mac_filters(struct ixl_vsi *vsi); void ixl_update_vsi_stats(struct ixl_vsi *); Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/ixl_pf_main.c Fri Jul 14 00:10:51 2017 (r320977) @@ -89,6 +89,20 @@ static int ixl_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ extern int ixl_enable_iwarp; #endif +const uint8_t ixl_bcast_addr[ETHER_ADDR_LEN] = + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + +const char * const ixl_fc_string[6] = { + "None", + "Rx", + "Tx", + "Full", + "Priority", + "Default" +}; + +MALLOC_DEFINE(M_IXL, "ixl", "ixl driver allocations"); + void ixl_debug_core(struct ixl_pf *pf, enum ixl_dbg_mask mask, char *fmt, ...) { @@ -3193,7 +3207,7 @@ ixl_reconfigure_filters(struct ixl_vsi *vsi) ** This routine adds macvlan filters */ void -ixl_add_filter(struct ixl_vsi *vsi, u8 *macaddr, s16 vlan) +ixl_add_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) { struct ixl_mac_filter *f, *tmp; struct ixl_pf *pf; @@ -3239,7 +3253,7 @@ ixl_add_filter(struct ixl_vsi *vsi, u8 *macaddr, s16 v } void -ixl_del_filter(struct ixl_vsi *vsi, u8 *macaddr, s16 vlan) +ixl_del_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) { struct ixl_mac_filter *f; @@ -3264,7 +3278,7 @@ ixl_del_filter(struct ixl_vsi *vsi, u8 *macaddr, s16 v ** Find the filter with both matching mac addr and vlan id */ struct ixl_mac_filter * -ixl_find_filter(struct ixl_vsi *vsi, u8 *macaddr, s16 vlan) +ixl_find_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) { struct ixl_mac_filter *f; bool match = FALSE; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu Jul 13 23:48:05 2017 (r320976) +++ head/sys/dev/ixl/ixl_txrx.c Fri Jul 14 00:10:51 2017 (r320977) @@ -63,8 +63,6 @@ static inline void ixl_rx_input(struct rx_ring *, stru struct mbuf *, u8); static inline bool ixl_tso_detect_sparse(struct mbuf *mp); -static int ixl_tx_setup_offload(struct ixl_queue *que, - struct mbuf *mp, u32 *cmd, u32 *off); static inline u32 ixl_get_tx_head(struct ixl_queue *que); #ifdef DEV_NETMAP From owner-svn-src-all@freebsd.org Fri Jul 14 01:17:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1428DB24E4; Fri, 14 Jul 2017 01:17:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 919F26FE4C; Fri, 14 Jul 2017 01:17:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22c.google.com with SMTP id v17so58936191qka.3; Thu, 13 Jul 2017 18:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4t/b+5mG/cAKM5yEQ0PpaTjnmSQ+qcDKaAGJ4TqNE5c=; b=lvZOPgquhFM0bCzQd3DfiBtkUCrOgKzHea9oTOlbQ2Y6V4cjXIg+OFsQgm7hcr0nhE bIiSAq4TVbUa2U/Avl/y40hiFRe8xDCzkiMWOgjJW+Nu3M9QuwV1EsHSIcADEuOKX96L tBtjBQgx2c+nbFJXUJJYGs6nYdbpXyl/IQhLNElNhO6O7yH/tBxuprfjzLWb4tD0bQp6 gG97blnSC7xceDLv9tJZN4qqRe8Jnb/fIzZXuThwNUo9IvNI3jNNL941HeYx0o281dYV VCXySw9raaSMndylTh8wkwXoswt+2J8HYim6AzneHjin2rx3q833t5kYwBSPrS4CJl0y HgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4t/b+5mG/cAKM5yEQ0PpaTjnmSQ+qcDKaAGJ4TqNE5c=; b=DmN2jKfF20CLeTgf/fBm+m2EPMS7+4FKwNfuPGI8lZ1T7emYvDY1nA8V1oQ99/xhHj OEHa1yF4QgoJ1xtWgaeCIsuqtfr7hk5TtoLLxR+gR2bgYD/AXosRcti5IKQPczHLe/jL CaIN50TpFXDCwY7hM40Nf8i3n51nU/dyznMDzosRZObrfIlL/AitBiCWOYExQHBFGDUZ Xwi/i8kEJyNPbd03gU9haNqG7R8N71Ba7jA/Oyq8jsyxpu7Qldy5F1HJvf1GoEUAvAoV C6EozWHf0ojdyuvx8J3g9eoTo6q6L6RdQ0Qkhdj1isWB36tImMpYasntxX+Ntk8mta2R GDjQ== X-Gm-Message-State: AIVw11101OBPVVRf29UUaFKnON5DRuHvEq7o5MkuNVxulzc5eMsaStMu 6b2YK0qWKB+Qsp9MV6A0L7dO+oxNeo4x X-Received: by 10.55.150.193 with SMTP id y184mr8467603qkd.113.1499995022224; Thu, 13 Jul 2017 18:17:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.92.142 with HTTP; Thu, 13 Jul 2017 18:17:01 -0700 (PDT) In-Reply-To: <201707140010.v6E0ApLQ052889@repo.freebsd.org> References: <201707140010.v6E0ApLQ052889@repo.freebsd.org> From: Ngie Cooper Date: Thu, 13 Jul 2017 18:17:01 -0700 Message-ID: Subject: Re: svn commit: r320977 - head/sys/dev/ixl To: Ryan Libby Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Eric Joyner Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 01:17:03 -0000 On Thu, Jul 13, 2017 at 5:10 PM, Ryan Libby wrote: > Author: rlibby > Date: Fri Jul 14 00:10:51 2017 > New Revision: 320977 > URL: https://svnweb.freebsd.org/changeset/base/320977 ... > +const char * const ixl_fc_string[6] = { > + "None", > + "Rx", > + "Tx", > + "Full", > + "Priority", > + "Default" > +}; This should use flexible arrays, e.g., const char * const ixl_fc_string[] = { "None", ... }; -Ngie From owner-svn-src-all@freebsd.org Fri Jul 14 01:22:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A740DB2695; Fri, 14 Jul 2017 01:22:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40381701F4; Fri, 14 Jul 2017 01:22:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6E1MRaL085093; Fri, 14 Jul 2017 01:22:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E1MRLq085092; Fri, 14 Jul 2017 01:22:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201707140122.v6E1MRLq085092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 14 Jul 2017 01:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320978 - stable/11/sys/powerpc/booke X-SVN-Group: stable-11 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/11/sys/powerpc/booke X-SVN-Commit-Revision: 320978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 01:22:28 -0000 Author: jhibbits Date: Fri Jul 14 01:22:27 2017 New Revision: 320978 URL: https://svnweb.freebsd.org/changeset/base/320978 Log: MFC r320392: Disable interrupts when updating the TLB Modified: stable/11/sys/powerpc/booke/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/powerpc/booke/pmap.c ============================================================================== --- stable/11/sys/powerpc/booke/pmap.c Fri Jul 14 00:10:51 2017 (r320977) +++ stable/11/sys/powerpc/booke/pmap.c Fri Jul 14 01:22:27 2017 (r320978) @@ -3150,10 +3150,14 @@ tlb0_print_tlbentries(void) void tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) { + register_t msr; uint32_t mas0; KASSERT((entry != NULL), ("%s(): Entry is NULL!", __func__)); + msr = mfmsr(); + mtmsr(msr & ~PSL_EE); + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(slot); mtspr(SPR_MAS0, mas0); __asm __volatile("isync; tlbre"); @@ -3172,6 +3176,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) entry->mas7 = 0; break; } + mtmsr(msr); entry->virt = entry->mas2 & MAS2_EPN_MASK; entry->phys = ((vm_paddr_t)(entry->mas7 & MAS7_RPN) << 32) | @@ -3187,6 +3192,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) static void tlb1_write_entry(tlb_entry_t *e, unsigned int idx) { + register_t msr; uint32_t mas0; //debugf("tlb1_write_entry: s\n"); @@ -3195,6 +3201,9 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(idx); //debugf("tlb1_write_entry: mas0 = 0x%08x\n", mas0); + msr = mfmsr(); + mtmsr(msr & ~PSL_EE); + mtspr(SPR_MAS0, mas0); __asm __volatile("isync"); mtspr(SPR_MAS1, e->mas1); @@ -3218,6 +3227,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) } __asm __volatile("tlbwe; isync; msync"); + mtmsr(msr); //debugf("tlb1_write_entry: e\n"); } From owner-svn-src-all@freebsd.org Fri Jul 14 01:45:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DA8DB2A07; Fri, 14 Jul 2017 01:45:45 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F20C17093A; Fri, 14 Jul 2017 01:45:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6E1jiam093158; Fri, 14 Jul 2017 01:45:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E1ji3K093157; Fri, 14 Jul 2017 01:45:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201707140145.v6E1ji3K093157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 14 Jul 2017 01:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320979 - stable/11/sys/powerpc/booke X-SVN-Group: stable-11 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/11/sys/powerpc/booke X-SVN-Commit-Revision: 320979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 01:45:45 -0000 Author: jhibbits Date: Fri Jul 14 01:45:43 2017 New Revision: 320979 URL: https://svnweb.freebsd.org/changeset/base/320979 Log: MFC r320489: Use the more common Book-E idiom for disabling interrupts. Modified: stable/11/sys/powerpc/booke/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/powerpc/booke/pmap.c ============================================================================== --- stable/11/sys/powerpc/booke/pmap.c Fri Jul 14 01:22:27 2017 (r320978) +++ stable/11/sys/powerpc/booke/pmap.c Fri Jul 14 01:45:43 2017 (r320979) @@ -3156,7 +3156,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) KASSERT((entry != NULL), ("%s(): Entry is NULL!", __func__)); msr = mfmsr(); - mtmsr(msr & ~PSL_EE); + __asm __volatile("wrteei 0"); mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(slot); mtspr(SPR_MAS0, mas0); @@ -3202,7 +3202,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) //debugf("tlb1_write_entry: mas0 = 0x%08x\n", mas0); msr = mfmsr(); - mtmsr(msr & ~PSL_EE); + __asm __volatile("wrteei 0"); mtspr(SPR_MAS0, mas0); __asm __volatile("isync"); From owner-svn-src-all@freebsd.org Fri Jul 14 02:15:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA405DB2F7C; Fri, 14 Jul 2017 02:15:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 948ED71663; Fri, 14 Jul 2017 02:15:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6E2FmVq005608; Fri, 14 Jul 2017 02:15:48 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E2Fmwr005605; Fri, 14 Jul 2017 02:15:48 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707140215.v6E2Fmwr005605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 14 Jul 2017 02:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320980 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 320980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 02:15:49 -0000 Author: alc Date: Fri Jul 14 02:15:48 2017 New Revision: 320980 URL: https://svnweb.freebsd.org/changeset/base/320980 Log: Generalize vm_page_ps_is_valid() to support testing other predicates on the (super)page, renaming the function to vm_page_ps_test(). Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jul 14 01:45:43 2017 (r320979) +++ head/sys/vm/vm_map.c Fri Jul 14 02:15:48 2017 (r320980) @@ -1962,7 +1962,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p (pagesizes[p->psind] - 1)) == 0) { mask = atop(pagesizes[p->psind]) - 1; if (tmpidx + mask < psize && - vm_page_ps_is_valid(p)) { + vm_page_ps_test(p, PS_ALL_VALID, NULL)) { p += mask; threshold += mask; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jul 14 01:45:43 2017 (r320979) +++ head/sys/vm/vm_page.c Fri Jul 14 02:15:48 2017 (r320980) @@ -3472,12 +3472,11 @@ vm_page_is_valid(vm_page_t m, int base, int size) } /* - * vm_page_ps_is_valid: - * - * Returns TRUE if the entire (super)page is valid and FALSE otherwise. + * Returns true if all of the specified predicates are true for the entire + * (super)page and false otherwise. */ -boolean_t -vm_page_ps_is_valid(vm_page_t m) +bool +vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m) { int i, npages; @@ -3490,10 +3489,25 @@ vm_page_ps_is_valid(vm_page_t m) * occupy adjacent entries in vm_page_array[]. */ for (i = 0; i < npages; i++) { - if (m[i].valid != VM_PAGE_BITS_ALL) - return (FALSE); + if (&m[i] == skip_m) + continue; + if ((flags & PS_NONE_BUSY) != 0 && vm_page_busied(&m[i])) + return (false); + if ((flags & PS_ALL_DIRTY) != 0) { + /* + * Calling vm_page_test_dirty() or pmap_is_modified() + * might stop this case from spuriously returning + * "false". However, that would require a write lock + * on the object containing "m[i]". + */ + if (m[i].dirty != VM_PAGE_BITS_ALL) + return (false); + } + if ((flags & PS_ALL_VALID) != 0 && + m[i].valid != VM_PAGE_BITS_ALL) + return (false); } - return (TRUE); + return (true); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Jul 14 01:45:43 2017 (r320979) +++ head/sys/vm/vm_page.h Fri Jul 14 02:15:48 2017 (r320980) @@ -438,6 +438,18 @@ malloc2vm_flags(int malloc_flags) } #endif +/* + * Predicates supported by vm_page_ps_test(): + * + * PS_ALL_DIRTY is true only if the entire (super)page is dirty. + * However, it can be spuriously false when the (super)page has become + * dirty in the pmap but that information has not been propagated to the + * machine-independent layer. + */ +#define PS_ALL_DIRTY 0x1 +#define PS_ALL_VALID 0x2 +#define PS_NONE_BUSY 0x4 + void vm_page_busy_downgrade(vm_page_t m); void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); void vm_page_flash(vm_page_t m); @@ -469,7 +481,7 @@ vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); struct vm_pagequeue *vm_page_pagequeue(vm_page_t m); vm_page_t vm_page_prev(vm_page_t m); -boolean_t vm_page_ps_is_valid(vm_page_t m); +bool vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m); void vm_page_putfake(vm_page_t m); void vm_page_readahead_finish(vm_page_t m); bool vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, From owner-svn-src-all@freebsd.org Fri Jul 14 02:33:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B7D5DB3538; Fri, 14 Jul 2017 02:33:18 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9950671E58; Fri, 14 Jul 2017 02:33:17 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wr0-x232.google.com with SMTP id 48so262714wrz.0; Thu, 13 Jul 2017 19:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BIGeHjLkb18461yMKujNDXufpPuaiBsA4qJJ2UjDKqA=; b=QXNzBqAbJLvIeV67pxzC9NUi/wOGjC3rivljjIuKPrOKs+CI28Hmq5+wK0m9SZdWmn AEPcTxrn6pwB/2m4x+HxOJSoSfoO36WsfzuEOoUlKAyLnS0/J+FipxVjldMYr7Vu4m4J 8wJAtJ0TXelwQKDHj4ugECyDP878M40G7xVD0qsiLfCnzfCY7whXsk66o2mgfkRkUEWv VwiCw5W5zbAmG/5kDV72AAWDAFBFbYv9bV87WL5GuOZ2LVtpR9Td+sVei0Np6UQvRmwN 6DaOibCO5KtHdffAoFgsAM1gnxNw9RGhbcDc7AX+zacmaC0vnl3r7xRzQYUjlHfgwgBf QDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BIGeHjLkb18461yMKujNDXufpPuaiBsA4qJJ2UjDKqA=; b=CZyJh31q5UG1GP+YY16hy+KUVSGNnDL6KZ8UQt7QSh1C4OVOcLs5g5S7wQYaysEjP8 QVTl1aRDjuuLl7oWDUMnKzRK00GUB22NRMHEdXPmkr8Lm6wZEzRSkvl6Q43lCddBpr+T 2fon0C3QOi0FJ5qc34aXJYCoPdh89RMs/FiX5zcmg8+dZ1oH7Oh7xznsy6qkSGyQBmNt l/CsxHGU/zBUqp4b4Ck91iTmcAzmp4rCUr+7TZy/IHa4Igoln7RT//JAE96ph8E0gG54 PxXk+PiR2b6CC3cR8Z5SDT/FmR3//I8LcOTFHZ6aLqJ3H9eM7HChClY1cf/z3j99Y4TV eKag== X-Gm-Message-State: AIVw111KlvNTiU+wfDMfcpm/qXG7FYFVNxNqr+S1toeRHsI6BlkjAzV6 uKpjsPIsr8S8eBM07o29oMEz035f5Nth X-Received: by 10.223.129.163 with SMTP id 32mr3709014wra.185.1499999595604; Thu, 13 Jul 2017 19:33:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.81 with HTTP; Thu, 13 Jul 2017 19:33:14 -0700 (PDT) In-Reply-To: References: <201707140010.v6E0ApLQ052889@repo.freebsd.org> From: Ryan Libby Date: Thu, 13 Jul 2017 19:33:14 -0700 Message-ID: Subject: Re: svn commit: r320977 - head/sys/dev/ixl To: Ngie Cooper Cc: Ryan Libby , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Eric Joyner Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 02:33:18 -0000 On Thu, Jul 13, 2017 at 6:17 PM, Ngie Cooper wrote: > On Thu, Jul 13, 2017 at 5:10 PM, Ryan Libby wrote: >> Author: rlibby >> Date: Fri Jul 14 00:10:51 2017 >> New Revision: 320977 >> URL: https://svnweb.freebsd.org/changeset/base/320977 > > ... > >> +const char * const ixl_fc_string[6] = { >> + "None", >> + "Rx", >> + "Tx", >> + "Full", >> + "Priority", >> + "Default" >> +}; > > This should use flexible arrays, e.g., > > const char * const ixl_fc_string[] = { > "None", > ... > }; > > -Ngie Since this is status quo and a style point, I think I will leave this to erj's judgement. Ryan From owner-svn-src-all@freebsd.org Fri Jul 14 07:42:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA878D9991D; Fri, 14 Jul 2017 07:42:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id B62FD8039B; Fri, 14 Jul 2017 07:42:58 +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 v6E7gvUC040851; Fri, 14 Jul 2017 07:42:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E7gvOP040850; Fri, 14 Jul 2017 07:42:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707140742.v6E7gvOP040850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 14 Jul 2017 07:42: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: r320981 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 320981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 07:42:59 -0000 Author: kib Date: Fri Jul 14 07:42:57 2017 New Revision: 320981 URL: https://svnweb.freebsd.org/changeset/base/320981 Log: MFC r320501: Correct fences for sys/refcount.h. Modified: stable/11/sys/sys/refcount.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/refcount.h ============================================================================== --- stable/11/sys/sys/refcount.h Fri Jul 14 02:15:48 2017 (r320980) +++ stable/11/sys/sys/refcount.h Fri Jul 14 07:42:57 2017 (r320981) @@ -50,7 +50,7 @@ refcount_acquire(volatile u_int *count) { KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); - atomic_add_acq_int(count, 1); + atomic_add_int(count, 1); } static __inline int @@ -58,10 +58,20 @@ refcount_release(volatile u_int *count) { u_int old; - /* XXX: Should this have a rel membar? */ + atomic_thread_fence_rel(); old = atomic_fetchadd_int(count, -1); KASSERT(old > 0, ("negative refcount %p", count)); - return (old == 1); + if (old > 1) + return (0); + + /* + * Last reference. Signal the user to call the destructor. + * + * Ensure that the destructor sees all updates. The fence_rel + * at the start of the function synchronized with this fence. + */ + atomic_thread_fence_acq(); + return (1); } #endif /* ! __SYS_REFCOUNT_H__ */ From owner-svn-src-all@freebsd.org Fri Jul 14 09:34:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16C61D9C3C1; Fri, 14 Jul 2017 09:34:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id E659983DCA; Fri, 14 Jul 2017 09:34:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6E9Yivi086295; Fri, 14 Jul 2017 09:34:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6E9Yivq086290; Fri, 14 Jul 2017 09:34:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707140934.v6E9Yivq086290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 14 Jul 2017 09:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320982 - in head/sys: compat/freebsd32 kern netinet sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern netinet sys X-SVN-Commit-Revision: 320982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 09:34:46 -0000 Author: kib Date: Fri Jul 14 09:34:44 2017 New Revision: 320982 URL: https://svnweb.freebsd.org/changeset/base/320982 Log: Correct sysent flags for dynamically loaded syscalls. Using the https://github.com/google/capsicum-test/ suite, the PosixMqueue.CapModeForked test was failing due to an ECAPMODE after calling kmq_notify(). On further inspection, the dynamically loaded syscall entry was initialized with sy_flags zeroed out, since SYSCALL_INIT_HELPER() left sysent.sy_flags with the default value. Add a new helper SYSCALL{,32}_INIT_HELPER_F() which takes an additional argument to specify the sy_flags value. Submitted by: Siva Mahadevan Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11576 Modified: head/sys/compat/freebsd32/freebsd32_util.h head/sys/kern/capabilities.conf head/sys/kern/uipc_mqueue.c head/sys/netinet/sctp_syscalls.c head/sys/sys/sysent.h Modified: head/sys/compat/freebsd32/freebsd32_util.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_util.h Fri Jul 14 07:42:57 2017 (r320981) +++ head/sys/compat/freebsd32/freebsd32_util.h Fri Jul 14 09:34:44 2017 (r320982) @@ -79,23 +79,30 @@ SYSCALL32_MODULE(syscallname, & syscallname##_syscall32, & syscallname##_sysent32,\ NULL, NULL); -#define SYSCALL32_INIT_HELPER(syscallname) { \ +#define SYSCALL32_INIT_HELPER_F(syscallname, flags) { \ .new_sysent = { \ .sy_narg = (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ .sy_call = (sy_call_t *)& syscallname, \ + .sy_flags = (flags) \ }, \ .syscall_no = FREEBSD32_SYS_##syscallname \ } -#define SYSCALL32_INIT_HELPER_COMPAT(syscallname) { \ +#define SYSCALL32_INIT_HELPER_COMPAT_F(syscallname, flags) { \ .new_sysent = { \ .sy_narg = (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ .sy_call = (sy_call_t *)& sys_ ## syscallname, \ + .sy_flags = (flags) \ }, \ .syscall_no = FREEBSD32_SYS_##syscallname \ } + +#define SYSCALL32_INIT_HELPER(syscallname) \ + SYSCALL32_INIT_HELPER_F(syscallname, 0) +#define SYSCALL32_INIT_HELPER_COMPAT(syscallname) \ + SYSCALL32_INIT_HELPER_COMPAT_F(syscallname, 0) int syscall32_register(int *offset, struct sysent *new_sysent, struct sysent *old_sysent, int flags); Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Fri Jul 14 07:42:57 2017 (r320981) +++ head/sys/kern/capabilities.conf Fri Jul 14 09:34:44 2017 (r320982) @@ -350,6 +350,8 @@ kill ## ## Allow message queue operations on file descriptors, subject to capability ## rights. +## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with +## SYF_CAPENABLED. ## kmq_notify kmq_setattr @@ -545,6 +547,8 @@ sched_yield ## ## Allow I/O-related file descriptors, subject to capability rights. +## NOTE: Corresponding sysents are initialized in sys/netinet/sctp_syscalls.c +## with SYF_CAPENABLED. ## sctp_generic_recvmsg sctp_generic_sendmsg Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Jul 14 07:42:57 2017 (r320981) +++ head/sys/kern/uipc_mqueue.c Fri Jul 14 09:34:44 2017 (r320982) @@ -2708,10 +2708,10 @@ static struct vfsconf mqueuefs_vfsconf = { static struct syscall_helper_data mq_syscalls[] = { SYSCALL_INIT_HELPER(kmq_open), - SYSCALL_INIT_HELPER(kmq_setattr), - SYSCALL_INIT_HELPER(kmq_timedsend), - SYSCALL_INIT_HELPER(kmq_timedreceive), - SYSCALL_INIT_HELPER(kmq_notify), + SYSCALL_INIT_HELPER_F(kmq_setattr, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(kmq_timedsend, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(kmq_timedreceive, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(kmq_notify, SYF_CAPENABLED), SYSCALL_INIT_HELPER(kmq_unlink), SYSCALL_INIT_LAST }; @@ -2870,10 +2870,10 @@ freebsd32_kmq_notify(struct thread *td, struct freebsd static struct syscall_helper_data mq32_syscalls[] = { SYSCALL32_INIT_HELPER(freebsd32_kmq_open), - SYSCALL32_INIT_HELPER(freebsd32_kmq_setattr), - SYSCALL32_INIT_HELPER(freebsd32_kmq_timedsend), - SYSCALL32_INIT_HELPER(freebsd32_kmq_timedreceive), - SYSCALL32_INIT_HELPER(freebsd32_kmq_notify), + SYSCALL32_INIT_HELPER_F(freebsd32_kmq_setattr, SYF_CAPENABLED), + SYSCALL32_INIT_HELPER_F(freebsd32_kmq_timedsend, SYF_CAPENABLED), + SYSCALL32_INIT_HELPER_F(freebsd32_kmq_timedreceive, SYF_CAPENABLED), + SYSCALL32_INIT_HELPER_F(freebsd32_kmq_notify, SYF_CAPENABLED), SYSCALL32_INIT_HELPER_COMPAT(kmq_unlink), SYSCALL_INIT_LAST }; Modified: head/sys/netinet/sctp_syscalls.c ============================================================================== --- head/sys/netinet/sctp_syscalls.c Fri Jul 14 07:42:57 2017 (r320981) +++ head/sys/netinet/sctp_syscalls.c Fri Jul 14 09:34:44 2017 (r320982) @@ -82,10 +82,10 @@ __FBSDID("$FreeBSD$"); #include static struct syscall_helper_data sctp_syscalls[] = { - SYSCALL_INIT_HELPER(sctp_peeloff), - SYSCALL_INIT_HELPER(sctp_generic_sendmsg), - SYSCALL_INIT_HELPER(sctp_generic_sendmsg_iov), - SYSCALL_INIT_HELPER(sctp_generic_recvmsg), + SYSCALL_INIT_HELPER_F(sctp_peeloff, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(sctp_generic_sendmsg, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(sctp_generic_sendmsg_iov, SYF_CAPENABLED), + SYSCALL_INIT_HELPER_F(sctp_generic_recvmsg, SYF_CAPENABLED), SYSCALL_INIT_LAST }; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Fri Jul 14 07:42:57 2017 (r320981) +++ head/sys/sys/sysent.h Fri Jul 14 09:34:44 2017 (r320982) @@ -230,24 +230,30 @@ struct syscall_helper_data { int syscall_no; int registered; }; -#define SYSCALL_INIT_HELPER(syscallname) { \ +#define SYSCALL_INIT_HELPER_F(syscallname, flags) { \ .new_sysent = { \ .sy_narg = (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ .sy_call = (sy_call_t *)& sys_ ## syscallname, \ - .sy_auevent = SYS_AUE_##syscallname \ + .sy_auevent = SYS_AUE_##syscallname, \ + .sy_flags = (flags) \ }, \ .syscall_no = SYS_##syscallname \ } -#define SYSCALL_INIT_HELPER_COMPAT(syscallname) { \ +#define SYSCALL_INIT_HELPER_COMPAT_F(syscallname, flags) { \ .new_sysent = { \ .sy_narg = (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ .sy_call = (sy_call_t *)& syscallname, \ - .sy_auevent = SYS_AUE_##syscallname \ + .sy_auevent = SYS_AUE_##syscallname, \ + .sy_flags = (flags) \ }, \ .syscall_no = SYS_##syscallname \ } +#define SYSCALL_INIT_HELPER(syscallname) \ + SYSCALL_INIT_HELPER_F(syscallname, 0) +#define SYSCALL_INIT_HELPER_COMPAT(syscallname) \ + SYSCALL_INIT_HELPER_COMPAT_F(syscallname, 0) #define SYSCALL_INIT_LAST { \ .syscall_no = NO_SYSCALL \ } From owner-svn-src-all@freebsd.org Fri Jul 14 10:00:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A189D9CEAB; Fri, 14 Jul 2017 10:00:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id E42E184C2B; Fri, 14 Jul 2017 10:00:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 343DB1049191; Fri, 14 Jul 2017 19:33:29 +1000 (AEST) Date: Fri, 14 Jul 2017 19:33:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: rgrimes@freebsd.org cc: John Baldwin , Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320803 - head/sbin/mount In-Reply-To: <201707131911.v6DJBTMC090066@pdx.rh.CN85.dnsmgr.net> Message-ID: <20170714181053.F1041@besplex.bde.org> References: <201707131911.v6DJBTMC090066@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=idEcj6YchW-8Py-0DSwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 10:00:01 -0000 On Thu, 13 Jul 2017, Rodney W. Grimes wrote: >> On Tuesday, July 11, 2017 02:35:15 PM Ian Lepore wrote: >>> I think the docs on this are pretty clear... under -u it says: >>> >>> The set of options is determined by applying the options specified >>> in the argument to -o and finally applying the -r or -w option. > ... > > To shed some light on all of this I did the dig to find the original > documentaton on mount -u, which actually makes it rather clear what > and how things should be happening. Somehow this has been lost over > the years: > csrg change to mount.c adding -u > https://svnweb.freebsd.org/csrg/sbin/mount/mount.c?r1=39329&r2=39333 > > csrg change to mount.8 documenting -u > https://svnweb.freebsd.org/csrg/sbin/mount/mount.8?r1=39328&r2=39466 > This documenting of -u clearly states that /etc/fstab shall be > consulted during a mount -u, some place we lost that. FreeBSD intentionally removed this in the change that added -o fstab and -o current: X Index: mount.8 X =================================================================== X RCS file: /home/ncvs/src/sbin/mount/mount.8,v X retrieving revision 1.25 X retrieving revision 1.26 X diff -u -1 -r1.25 -r1.26 X --- mount.8 8 Apr 1999 13:59:42 -0000 1.25 X +++ mount.8 7 May 1999 05:22:07 -0000 1.26 X @@ -32,3 +32,3 @@ X .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 X -.\" $Id: mount.8,v 1.24 1998/10/16 00:06:56 des Exp $ X +.\" $Id: mount.8,v 1.25 1999/04/08 13:59:42 ghelmer Exp $ X .\" X ... X @@ -289,9 +302,5 @@ X flag is also specified. X -The set of options is determined by first extracting the options X -for the file system from the X -.Xr fstab 5 X -table, X -then applying any options specified by the X -.Fl o X -argument, X +The set of options is determined by applying the options specified X +in the argument to X +.Fl o X and finally applying the The new behaviour is easier to use. To get the old behaviour, use "fstab" for the first option in the list. To not have this option, just don't use it. If it were forced like it used to be, then canceling it would be difficult. Even boolean options are only easy to cancel if they have positive logic. E.g., the cancelation of "ro" is "noro", but the cancelation of "rw" is itself since "norw" gives the positive option "ro". "fstab" cannot be canceled by "nofstab" since that is not supported. Non-boolean options are even more difficult to cancel. E.g., to cancel rsize=16384 for nfs, you have to know the current value and specify this again. I checked that "ro" is currently broken for -o current as well as for -o fstab. Both ignore the specified setting of "ro" and force "noro". So all of: -u # with "ro" currently set -u -o fstab # with "ro" in fstab -u -o current # with "ro" currently set change the current "ro" setting to "noro" == "ro" == "" = absense of MNT_RDONLY in the mount flags. This is because nmount(2) is too hard to use, and its use for "ro" is still broken despite many attempts to fix it. nmount(2) apparently doesn't understand that the absence of "ro" means "noro". So users or utilities have to suppy "noro" to get the historical default of "rw". mount/mount.c does this. This is a cancelation like the ones that the user would have to do to cancel the old forced "fstab". The order of the flags is important for cancelation. mount is aware of this, but gets it wrong anyway: X $ svn ann mount.c | grep -C1 noro X 1558 rgrimes case 'w': X 76198 dd options = catopt(options, "noro"); X 1558 rgrimes break; X -- X 163671 ru if ((init_flags & MNT_UPDATE) && (ro == 0)) X 163671 ru options = catopt(options, "noro"); X 186505 obrien X $ svn log -r 163671 mount.c X ------------------------------------------------------------------------ X r163671 | ru | 2006-10-24 22:02:29 +0000 (Tue, 24 Oct 2006) | 12 lines X X Revert rev. 1.86 by jmallett@ as it breaks "ro" mounts specified X in /etc/fstab. X X This has been happening due to the priority inversion; options X specified on the command line should take precedence over options X from fstab over default "noro" option, but since both the default X "noro" and options specified on the command line (-w, -r, -o ...) X were put into the same "options" variable, "noro" took precedence X over fstab "ro" (this is easily visible with "mount -d"). X X PR: bin/100164 X X ------------------------------------------------------------------------ Before r163671, the options list was initialized to "noro", so "noro" was specified even without -u unless it is canceled by a later option. I don't know why this didn't work -- "noro" is the correct default, and canceling it it later should work. r163671 moves this to the MNT_UPDATE case. Cancelation still doesn't work for this cases. Manual cancelation does work: "ro" on the command line after "fstab" or "current" works to add the "ro" that should be added for "fstab" or "current". I debugged this only as far as seeing "-u -o fstab" turning into the options list "noatime,noro,???" in the kernel, where /etc/fstab has "ro,noatime". "noro" apparently gets added at the end of the options instead of the start, so it cancels "ro" instead of vice versa. Indeed, r163671 seems to move the addition to precisely this wrong place. So r163671 seems to be perfectly backwards for the -u case, and it is unclear why it was needed for the non-(-u) case. Later cancelation of "ro" by "noro" seems to work to give the bug for -u, so why doesn't later cancelation of "noro" by "ro" work to give correct behaviour before r163671? Bruce From owner-svn-src-all@freebsd.org Fri Jul 14 14:51:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B8B8DA3927; Fri, 14 Jul 2017 14:51:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A106E68758; Fri, 14 Jul 2017 14:51:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EEpSD1016149; Fri, 14 Jul 2017 14:51:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EEpSU1016142; Fri, 14 Jul 2017 14:51:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707141451.v6EEpSU1016142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 14 Jul 2017 14:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320983 - in vendor/zstd/dist: . contrib/pzstd doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWrapper/examples X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/zstd/dist: . contrib/pzstd doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWrapper/examples X-SVN-Commit-Revision: 320983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:51:30 -0000 Author: bapt Date: Fri Jul 14 14:51:28 2017 New Revision: 320983 URL: https://svnweb.freebsd.org/changeset/base/320983 Log: Import zstd 1.3.0 Modified: vendor/zstd/dist/Makefile vendor/zstd/dist/NEWS vendor/zstd/dist/README.md vendor/zstd/dist/appveyor.yml vendor/zstd/dist/contrib/pzstd/Pzstd.cpp vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/dist/examples/Makefile vendor/zstd/dist/lib/Makefile vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/dist/lib/common/error_private.c vendor/zstd/dist/lib/common/huf.h vendor/zstd/dist/lib/common/mem.h vendor/zstd/dist/lib/common/pool.c vendor/zstd/dist/lib/common/pool.h vendor/zstd/dist/lib/common/threading.c vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/dist/lib/decompress/huf_decompress.c vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/dist/lib/zstd.h vendor/zstd/dist/programs/Makefile vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/bench.c vendor/zstd/dist/programs/dibio.c vendor/zstd/dist/programs/dibio.h vendor/zstd/dist/programs/fileio.c vendor/zstd/dist/programs/fileio.h vendor/zstd/dist/programs/util.h vendor/zstd/dist/programs/zstd.1 vendor/zstd/dist/programs/zstd.1.md vendor/zstd/dist/programs/zstdcli.c vendor/zstd/dist/tests/Makefile vendor/zstd/dist/tests/datagencli.c vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/dist/tests/fullbench.c vendor/zstd/dist/tests/fuzzer.c vendor/zstd/dist/tests/paramgrill.c vendor/zstd/dist/tests/playTests.sh vendor/zstd/dist/tests/roundTripCrash.c vendor/zstd/dist/tests/symbols.c vendor/zstd/dist/tests/zstreamtest.c vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c Modified: vendor/zstd/dist/Makefile ============================================================================== --- vendor/zstd/dist/Makefile Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/Makefile Fri Jul 14 14:51:28 2017 (r320983) @@ -108,7 +108,7 @@ clean: #------------------------------------------------------------------------------ # make install is validated only for Linux, OSX, Hurd and some BSD targets #------------------------------------------------------------------------------ -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD)) +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) HOST_OS = POSIX CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON @@ -117,30 +117,36 @@ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUI list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs -.PHONY: install uninstall travis-install clangtest gpptest armtest usan asan uasan +.PHONY: install clangtest gpptest armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ +.PHONY: uninstall uninstall: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ +.PHONY: travis-install travis-install: $(MAKE) install PREFIX=~/install_test_dir +.PHONY: gppbuild gppbuild: clean g++ -v CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +.PHONY: gcc5build gcc5build: clean gcc-5 -v CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" +.PHONY: gcc6build gcc6build: clean gcc-6 -v CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" +.PHONY: clangbuild clangbuild: clean clang -v CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" @@ -224,10 +230,10 @@ asan-%: clean LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* msan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" # datagen.c fails this test for no obvious reason + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason msan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* asan32: clean $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" @@ -236,10 +242,11 @@ uasan: clean $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" uasan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-Og -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* tsan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + apt-install: sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) Modified: vendor/zstd/dist/NEWS ============================================================================== --- vendor/zstd/dist/NEWS Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/NEWS Fri Jul 14 14:51:28 2017 (r320983) @@ -1,3 +1,18 @@ +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + v1.2.0 cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell Modified: vendor/zstd/dist/README.md ============================================================================== --- vendor/zstd/dist/README.md Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/README.md Fri Jul 14 14:51:28 2017 (r320983) @@ -6,11 +6,18 @@ and a command line utility producing and decoding `.zs For other programming languages, you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages). -|Branch |Status | -|------------|---------| -|master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) | -|dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/facebook/zstd) | +| dev branch status | +|-------------------| +| [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] +[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" +[travisLink]: https://travis-ci.org/facebook/zstd +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0 +[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" +[CircleLink]: https://circleci.com/gh/facebook/zstd + + As a reference, several fast compression algorithms were tested and compared on a server running Linux Debian (`Linux version 4.8.0-1-amd64`), with a Core i7-6700K CPU @ 4.0GHz, @@ -60,11 +67,11 @@ Previous charts provide results applicable to typical The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon. To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data. -Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. +Training Zstandard is achieved by providing it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. Using this dictionary, the compression ratio achievable on small data improves dramatically. The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users). -It consists of roughly 10K records weighting about 1KB each. +It consists of roughly 10K records weighing about 1KB each. Compression Ratio | Compression Speed | Decompression Speed ------------------|-------------------|-------------------- Modified: vendor/zstd/dist/appveyor.yml ============================================================================== --- vendor/zstd/dist/appveyor.yml Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/appveyor.yml Fri Jul 14 14:51:28 2017 (r320983) @@ -30,12 +30,6 @@ SCRIPT: "" TEST: "cmake" - - COMPILER: "gcc" - HOST: "mingw" - PLATFORM: "x64" - SCRIPT: "" - TEST: "pzstd" - - COMPILER: "visual" HOST: "visual" PLATFORM: "x64" @@ -88,12 +82,10 @@ ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true] lib\dll\example\build_package.bat && make -C programs DEBUGFLAGS= clean zstd && - cp programs\zstd.exe zstd_%PLATFORM%.exe && - appveyor PushArtifact zstd_%PLATFORM%.exe && - cp programs\zstd.exe bin\zstd.exe && - make -C programs DEBUGFLAGS= clean zstdmt && - cp programs\zstd.exe bin\zstdmt.exe && - cd bin\ && 7z a -tzip zstd-win-release-%PLATFORM%.zip * && + cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe && + appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip && + cp zstd.exe ..\bin\zstd.exe && + cd ..\bin\ && 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * && appveyor PushArtifact zstd-win-release-%PLATFORM%.zip ) ) @@ -158,13 +150,6 @@ cmake -G "Visual Studio 14 2015 Win64" .. && cd ..\..\.. && make clean - ) - - if [%TEST%]==[pzstd] ( - make -C contrib\pzstd googletest-mingw64 && - make -C contrib\pzstd pzstd.exe && - make -C contrib\pzstd tests && - make -C contrib\pzstd check && - make -C contrib\pzstd clean ) - SET "FUZZERTEST=-T30s" - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( Modified: vendor/zstd/dist/contrib/pzstd/Pzstd.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Pzstd.cpp Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/contrib/pzstd/Pzstd.cpp Fri Jul 14 14:51:28 2017 (r320983) @@ -585,7 +585,10 @@ std::uint64_t writeFile( std::uint64_t bytesWritten = 0; std::shared_ptr out; // Grab the output queue for each decompression job (in order). - while (outs.pop(out) && !errorHolder.hasError()) { + while (outs.pop(out)) { + if (errorHolder.hasError()) { + continue; + } if (!decompress) { // If we are compressing and want to write skippable frames we can't // start writing before compression is done because we need to know the Modified: vendor/zstd/dist/doc/zstd_manual.html ============================================================================== --- vendor/zstd/dist/doc/zstd_manual.html Fri Jul 14 09:34:44 2017 (r320982) +++ vendor/zstd/dist/doc/zstd_manual.html Fri Jul 14 14:51:28 2017 (r320983) @@ -1,10 +1,10 @@ -zstd 1.2.0 Manual +zstd 1.3.0 Manual -

zstd 1.2.0 Manual

+

zstd 1.3.0 Manual


Contents

    @@ -13,14 +13,14 @@
  1. Simple API
  2. Explicit memory management
  3. Simple dictionary API
  4. -
  5. Fast dictionary API
  6. +
  7. Bulk processing dictionary API
  8. Streaming
  9. Streaming compression - HowTo
  10. Streaming decompression - HowTo
  11. START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
  12. Advanced types
  13. -
  14. Compressed size functions
  15. -
  16. Decompressed size functions
  17. +
  18. Frame size functions
  19. +
  20. Context memory usage
  21. Advanced compression functions
  22. Advanced decompression functions
  23. Advanced streaming functions
  24. @@ -31,26 +31,27 @@

Introduction

-  zstd, short for Zstandard, is a fast lossless compression algorithm, targeting real-time compression scenarios
-  at zlib-level and better compression ratios. The zstd compression library provides in-memory compression and
-  decompression functions. The library supports compression levels from 1 up to ZSTD_maxCLevel() which is 22.
+  zstd, short for Zstandard, is a fast lossless compression algorithm,
+  targeting real-time compression scenarios at zlib-level and better compression ratios.
+  The zstd compression library provides in-memory compression and decompression functions.
+  The library supports compression levels from 1 up to ZSTD_maxCLevel() which is currently 22.
   Levels >= 20, labeled `--ultra`, should be used with caution, as they require more memory.
   Compression can be done in:
     - a single step (described as Simple API)
     - a single step, reusing a context (described as Explicit memory management)
     - unbounded multiple steps (described as Streaming compression)
-  The compression ratio achievable on small data can be highly improved using compression with a dictionary in:
+  The compression ratio achievable on small data can be highly improved using a dictionary in:
     - a single step (described as Simple dictionary API)
     - a single step, reusing a dictionary (described as Fast dictionary API)
 
   Advanced experimental functions can be accessed using #define ZSTD_STATIC_LINKING_ONLY before including zstd.h.
-  These APIs shall never be used with a dynamic library.
+  Advanced experimental APIs shall never be used with a dynamic library.
   They are not "stable", their definition may change in the future. Only static linking is allowed.
 

Version


 
-
unsigned ZSTD_versionNumber(void);   /**< library version number; to be used when checking dll version */
+
unsigned ZSTD_versionNumber(void);   /**< useful to check dll version */
 

Simple API


 
@@ -66,28 +67,24 @@
 
size_t ZSTD_decompress( void* dst, size_t dstCapacity,
                   const void* src, size_t compressedSize);
 

`compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames. - `dstCapacity` is an upper bound of originalSize. + `dstCapacity` is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. @return : the number of bytes decompressed into `dst` (<= `dstCapacity`), or an errorCode if it fails (which can be tested using ZSTD_isError()).


unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
-

NOTE: This function is planned to be obsolete, in favour of ZSTD_getFrameContentSize. - ZSTD_getFrameContentSize functions the same way, returning the decompressed size of a single - frame, but distinguishes empty frames from frames with an unknown size, or errors. +

NOTE: This function is planned to be obsolete, in favor of ZSTD_getFrameContentSize(). + ZSTD_getFrameContentSize() works the same way, + returning the decompressed size of a single frame, + but distinguishes empty frames from frames with an unknown size, or errors. - Additionally, ZSTD_findDecompressedSize can be used instead. It can handle multiple - concatenated frames in one buffer, and so is more general. - As a result however, it requires more computation and entire frames to be passed to it, - as opposed to ZSTD_getFrameContentSize which requires only a single frame's header. - 'src' is the start of a zstd compressed frame. @return : content size to be decompressed, as a 64-bits value _if known_, 0 otherwise. - note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. + note 1 : decompressed size is an optional field, it may not be present, typically in streaming mode. When `return==0`, data to decompress could be any size. In which case, it's necessary to use streaming mode to decompress data. - Optionally, application can still use ZSTD_decompress() while relying on implied limits. + Optionally, application can use ZSTD_decompress() while relying on implied limits. (For example, data may be necessarily cut into blocks <= 16 KB). note 2 : decompressed size is always present when compression is done with ZSTD_compress() note 3 : decompressed size can be very large (64-bits value), @@ -96,7 +93,7 @@ note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. Always ensure result fits within application's authorized limits. Each application can set its own limits. - note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameParams() to know more. + note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameHeader() to know more.


Helper functions

int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
@@ -114,20 +111,26 @@ const char* ZSTD_getErrorName(size_t code);     /*
 ZSTD_CCtx* ZSTD_createCCtx(void);
 size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);
 

-
size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
+
size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
+                         void* dst, size_t dstCapacity,
+                   const void* src, size_t srcSize,
+                         int compressionLevel);
 

Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()).


Decompression context

  When decompressing many times,
-  it is recommended to allocate a context just once, and re-use it for each successive compression operation.
+  it is recommended to allocate a context only once,
+  and re-use it for each successive compression operation.
   This will make workload friendlier for system's memory.
-  Use one context per thread for parallel execution in multi-threaded environments. 
+  Use one context per thread for parallel execution. 
 
typedef struct ZSTD_DCtx_s ZSTD_DCtx;
 ZSTD_DCtx* ZSTD_createDCtx(void);
 size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
 

-
size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-

Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()). +

size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
+                           void* dst, size_t dstCapacity,
+                     const void* src, size_t srcSize);
+

Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx())


Simple dictionary API


@@ -137,32 +140,33 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
                          const void* src, size_t srcSize,
                          const void* dict,size_t dictSize,
                                int compressionLevel);
-

Compression using a predefined Dictionary (see dictBuilder/zdict.h). - Note : This function loads the dictionary, resulting in significant startup delay. - Note : When `dict == NULL || dictSize < 8` no dictionary is used. +

Compression using a predefined Dictionary (see dictBuilder/zdict.h). + Note : This function loads the dictionary, resulting in significant startup delay. + Note : When `dict == NULL || dictSize < 8` no dictionary is used.


size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize);
-

Decompression using a predefined Dictionary (see dictBuilder/zdict.h). - Dictionary must be identical to the one used during compression. - Note : This function loads the dictionary, resulting in significant startup delay. - Note : When `dict == NULL || dictSize < 8` no dictionary is used. +

Decompression using a predefined Dictionary (see dictBuilder/zdict.h). + Dictionary must be identical to the one used during compression. + Note : This function loads the dictionary, resulting in significant startup delay. + Note : When `dict == NULL || dictSize < 8` no dictionary is used.


-

Fast dictionary API


+

Bulk processing dictionary API


 
-
ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize, int compressionLevel);
-

When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. - ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. - ZSTD_CDict can be created once and used by multiple threads concurrently, as its usage is read-only. - `dictBuffer` can be released after ZSTD_CDict creation, as its content is copied within CDict +

ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
+                             int compressionLevel);
+

When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. + ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. + ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. + `dictBuffer` can be released after ZSTD_CDict creation, since its content is copied within CDict


size_t      ZSTD_freeCDict(ZSTD_CDict* CDict);
-

Function frees memory allocated by ZSTD_createCDict(). +

Function frees memory allocated by ZSTD_createCDict().


size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
@@ -176,20 +180,20 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
 


ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);
-

Create a digested dictionary, ready to start decompression operation without startup delay. - dictBuffer can be released after DDict creation, as its content is copied inside DDict +

Create a digested dictionary, ready to start decompression operation without startup delay. + dictBuffer can be released after DDict creation, as its content is copied inside DDict


size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);
-

Function frees memory allocated with ZSTD_createDDict() +

Function frees memory allocated with ZSTD_createDDict()


size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                   void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize,
                             const ZSTD_DDict* ddict);
-

Decompression using a digested Dictionary. - Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times. +

Decompression using a digested Dictionary. + Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times.


Streaming


@@ -236,14 +240,18 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
   ZSTD_endStream() instructs to finish a frame.
   It will perform a flush and write frame epilogue.
   The epilogue is required for decoders to consider a frame completed.
-  Similar to ZSTD_flushStream(), it may not be able to flush the full content if `output->size` is too small.
+  ZSTD_endStream() may not be able to flush full data if `output->size` is too small.
   In which case, call again ZSTD_endStream() to complete the flush.
-  @return : nb of bytes still present within internal buffer (0 if it's empty, hence compression completed)
+  @return : 0 if frame fully completed and fully flushed,
+             or >0 if some data is still present within internal buffer
+                  (value is minimum size estimation for remaining data to flush, but it could be more)
             or an error code, which can be tested using ZSTD_isError().
 
  
 
+
typedef ZSTD_CCtx ZSTD_CStream;  /**< CCtx and CStream are now effectively same object (>= v1.3.0) */
+

ZSTD_CStream management functions

ZSTD_CStream* ZSTD_createCStream(void);
 size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
 

@@ -277,6 +285,8 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffe
+
typedef ZSTD_DCtx ZSTD_DStream;  /**< DCtx and DStream are now effectively same object (>= v1.3.0) */
+

ZSTD_DStream management functions

ZSTD_DStream* ZSTD_createDStream(void);
 size_t ZSTD_freeDStream(ZSTD_DStream* zds);
 

@@ -296,7 +306,8 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o

Advanced types


 
-
typedef enum { ZSTD_fast, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD_btopt, ZSTD_btopt2 } ZSTD_strategy;   /* from faster to stronger */
+
typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
+               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;   /* from faster to stronger */
 

typedef struct {
     unsigned windowLog;      /**< largest match distance : larger == more compression, more memory needed during decompression */
@@ -319,68 +330,141 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
     ZSTD_frameParameters fParams;
 } ZSTD_parameters;
 

+
typedef struct {
+    unsigned long long frameContentSize;
+    size_t windowSize;
+    unsigned dictID;
+    unsigned checksumFlag;
+} ZSTD_frameHeader;
+

Custom memory allocation functions

typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
 typedef void  (*ZSTD_freeFunction) (void* opaque, void* address);
 typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+/* use this constant to defer to stdlib's functions */
+static const ZSTD_customMem ZSTD_defaultCMem = { NULL, NULL, NULL };
 

-

Compressed size functions


+

Frame size functions


 
 
size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
 

`src` should point to the start of a ZSTD encoded frame or skippable frame `srcSize` must be at least as large as the frame - @return : the compressed size of the frame pointed to by `src`, suitable to pass to - `ZSTD_decompress` or similar, or an error code if given invalid input. + @return : the compressed size of the frame pointed to by `src`, + suitable to pass to `ZSTD_decompress` or similar, + or an error code if given invalid input.


-

Decompressed size functions


-
-
unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
-

`src` should point to the start of a ZSTD encoded frame - `srcSize` must be at least as large as the frame header. A value greater than or equal - to `ZSTD_frameHeaderSize_max` is guaranteed to be large enough in all cases. - @return : decompressed size of the frame pointed to be `src` if known, otherwise - - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined - - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) +

#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
+#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
+unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
+

`src` should point to the start of a ZSTD encoded frame. + `srcSize` must be at least as large as the frame header. + A value >= `ZSTD_frameHeaderSize_max` is guaranteed to be large enough. + @return : - decompressed size of the frame pointed to be `src` if known + - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)


unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
-

`src` should point the start of a series of ZSTD encoded and/or skippable frames - `srcSize` must be the _exact_ size of this series +

`src` should point the start of a series of ZSTD encoded and/or skippable frames + `srcSize` must be the _exact_ size of this series (i.e. there should be a frame boundary exactly `srcSize` bytes after `src`) - @return : the decompressed size of all data in the contained frames, as a 64-bit value _if known_ - - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN - - if an error occurred: ZSTD_CONTENTSIZE_ERROR + @return : - decompressed size of all data in all successive frames + - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN + - if an error occurred: ZSTD_CONTENTSIZE_ERROR - note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. - When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. - In which case, it's necessary to use streaming mode to decompress data. - Optionally, application can still use ZSTD_decompress() while relying on implied limits. - (For example, data may be necessarily cut into blocks <= 16 KB). - note 2 : decompressed size is always present when compression is done with ZSTD_compress() - note 3 : decompressed size can be very large (64-bits value), - potentially larger than what local system can handle as a single memory segment. - In which case, it's necessary to use streaming mode to decompress data. - note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. - Always ensure result fits within application's authorized limits. - Each application can set its own limits. - note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to - read each contained frame header. This is efficient as most of the data is skipped, - however it does mean that all frame data must be present and valid. + note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. + When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. + In which case, it's necessary to use streaming mode to decompress data. + Optionally, application can still use ZSTD_decompress() while relying on implied limits. + (For example, data may be necessarily cut into blocks <= 16 KB). + note 2 : decompressed size is always present when compression is done with ZSTD_compress() + note 3 : decompressed size can be very large (64-bits value), + potentially larger than what local system can handle as a single memory segment. + In which case, it's necessary to use streaming mode to decompress data. + note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. + Always ensure result fits within application's authorized limits. + Each application can set its own limits. + note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to + read each contained frame header. This is efficient as most of the data is skipped, + however it does mean that all frame data must be present and valid.


-

Advanced compression functions


+
size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
+

`src` should point to the start of a ZSTD frame + `srcSize` must be >= ZSTD_frameHeaderSize_prefix. + @return : size of the Frame Header +


-
size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams);
-

Gives the amount of memory allocated for a ZSTD_CCtx given a set of compression parameters. - `frameContentSize` is an optional parameter, provide `0` if unknown +

Context memory usage


+
+
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
+size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
+size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
+size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
+size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
+size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
+

These functions give the current memory usage of selected object. + Object memory usage can evolve if it's re-used multiple times.


+
size_t ZSTD_estimateCCtxSize(int compressionLevel);
+size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateDCtxSize(void);
+

These functions make it possible to estimate memory usage + of a future {D,C}Ctx, before its creation. + ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one. + It will also consider src size to be arbitrarily "large", which is worst case. + If srcSize is known to always be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation. + ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + Note : CCtx estimation is only correct for single-threaded compression +


+ +
size_t ZSTD_estimateCStreamSize(int compressionLevel);
+size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateDStreamSize(size_t windowSize);
+size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);
+

ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one. + It will also consider src size to be arbitrarily "large", which is worst case. + If srcSize is known to always be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation. + ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + Note : CStream estimation is only correct for single-threaded compression. + ZSTD_DStream memory budget depends on window Size. + This information can be passed manually, using ZSTD_estimateDStreamSize, + or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame(); + Note : if streaming is init with function ZSTD_init?Stream_usingDict(), + an internal ?Dict will be created, which additional size is not estimated here. + In this case, get total size by adding ZSTD_estimate?DictSize +


+ +
size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
+size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference);
+size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);
+

ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). + ZSTD_estimateCStreamSize_advanced() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). + Note : dictionary created "byReference" are smaller +


+ +

Advanced compression functions


+
 
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
 

Create a ZSTD compression context using external alloc and free functions


-
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
-

Gives the amount of memory used by a given ZSTD_CCtx +

ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
+

workspace: The memory area to emplace the context into. + Provided pointer must 8-bytes aligned. + It must outlive context usage. + workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize() + to determine how large workspace must be to support scenario. + @return : pointer to ZSTD_CCtx*, or NULL if error (size too small) + Note : zstd will never resize nor malloc() when using a static cctx. + If it needs more memory than available, it will simply error out. + Note 2 : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally too. + Limitation 1 : currently not compatible with internal CDict creation, such as + ZSTD_CCtx_loadDictionary() or ZSTD_initCStream_usingDict(). + Limitation 2 : currently not compatible with multi-threading +


typedef enum {
@@ -399,13 +483,34 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
   It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict 
 


-
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize, unsigned byReference,
+
typedef enum { ZSTD_dm_auto=0,        /* dictionary is "full" if it starts with ZSTD_MAGIC_DICTIONARY, rawContent otherwize */
+               ZSTD_dm_rawContent,    /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */
+               ZSTD_dm_fullDict       /* refuses to load a dictionary if it does not respect Zstandard's specification */
+} ZSTD_dictMode_e;
+

+
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
+                                      unsigned byReference, ZSTD_dictMode_e dictMode,
                                       ZSTD_compressionParameters cParams, ZSTD_customMem customMem);
 

Create a ZSTD_CDict using external alloc and free, and customized compression parameters


-
size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
-

Gives the amount of memory used by a given ZSTD_sizeof_CDict +

ZSTD_CDict* ZSTD_initStaticCDict(
+                void* workspace, size_t workspaceSize,
+          const void* dict, size_t dictSize,
+                unsigned byReference, ZSTD_dictMode_e dictMode,
+                ZSTD_compressionParameters cParams);
+

Generate a digested dictionary in provided memory area. + workspace: The memory area to emplace the dictionary into. + Provided pointer must 8-bytes aligned. + It must outlive dictionary usage. + workspaceSize: Use ZSTD_estimateCDictSize() + to determine how large workspace must be. + cParams : use ZSTD_getCParams() to transform a compression level + into its relevants cParams. + @return : pointer to ZSTD_CDict*, or NULL if error (size too small) + Note : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. +


ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
@@ -423,8 +528,8 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
 


ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);
-

optimize params for a given `srcSize` and `dictSize`. - both values are optional, select `0` if unknown. +

optimize params for a given `srcSize` and `dictSize`. + both values are optional, select `0` if unknown.


size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
@@ -451,22 +556,32 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
   Note 3 : Skippable Frame Identifiers are considered valid. 
 


-
size_t ZSTD_estimateDCtxSize(void);
-

Gives the potential amount of memory allocated to create a ZSTD_DCtx -


-
ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
 

Create a ZSTD decompression context using external alloc and free functions


-
size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
-

Gives the amount of memory used by a given ZSTD_DCtx +

ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
+

workspace: The memory area to emplace the context into. + Provided pointer must 8-bytes aligned. + It must outlive context usage. + workspaceSize: Use ZSTD_estimateDCtxSize() or ZSTD_estimateDStreamSize() + to determine how large workspace must be to support scenario. + @return : pointer to ZSTD_DCtx*, or NULL if error (size too small) + Note : zstd will never resize nor malloc() when using a static dctx. + If it needs more memory than available, it will simply error out. + Note 2 : static dctx is incompatible with legacy support + Note 3 : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. + Limitation : currently not compatible with internal DDict creation, + such as ZSTD_initDStream_usingDict(). +


ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
 

Create a digested dictionary, ready to start decompression operation without startup delay. - Dictionary content is simply referenced, and therefore stays in dictBuffer. - It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict + Dictionary content is referenced, and therefore stays in dictBuffer. + It is important that dictBuffer outlives DDict, + it must remain read accessible throughout the lifetime of DDict


ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
@@ -474,8 +589,19 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
 

Create a ZSTD_DDict using external alloc and free, optionally by reference


-
size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
-

Gives the amount of memory used by a given ZSTD_DDict +

ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
+                                 const void* dict, size_t dictSize,
+                                 unsigned byReference);
+

Generate a digested dictionary in provided memory area. + workspace: The memory area to emplace the dictionary into. + Provided pointer must 8-bytes aligned. + It must outlive dictionary usage. + workspaceSize: Use ZSTD_estimateDDictSize() + to determine how large workspace must be. + @return : pointer to ZSTD_DDict*, or NULL if error (size too small) + Note : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. +


unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
@@ -499,19 +625,19 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
     Note : this use case also happens when using a non-conformant dictionary.
   - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).
   - This is not a Zstandard frame.
-  When identifying the exact failure cause, it's possible to use ZSTD_getFrameParams(), which will provide a more precise error code. 
+  When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. 
 


Advanced streaming functions


 
 

Advanced Streaming compression functions

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
-size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);   /**< size of CStream is variable, depending primarily on compression level */
+ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct, a size of 0 means unknown.  for a frame size of 0 use initCStream_advanced */
-size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. */
 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                              ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);  /**< note : cdict will just be referenced, and must outlive compression session */
-size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, unsigned long long pledgedSrcSize, ZSTD_frameParameters fParams);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
+size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
 

size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
 

start a new compression job, using same parameters from previous job. @@ -524,11 +650,11 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStre

Advanced Streaming decompression functions

typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
 ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
-size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */
 size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
 size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict will just be referenced, and must outlive decompression session */
 size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
-size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
 

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
@@ -578,21 +704,24 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx*
   Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
   A ZSTD_DCtx object can be re-used multiple times.
 
-  First typical operation is to retrieve frame parameters, using ZSTD_getFrameParams().
-  It fills a ZSTD_frameParams structure which provide important information to correctly decode the frame,
-  such as the minimum rolling buffer size to allocate to decompress data (`windowSize`),
-  and the dictionary ID used.
+  First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().
+  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,
+  such as minimum rolling buffer size to allocate to decompress data (`windowSize`),
+  and the dictionary ID in use.
   (Note : content size is optional, it may not be present. 0 means : content size unknown).
   Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information.
   As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation.
-  Each application can set its own limit, depending on local restrictions. For extended interoperability, it is recommended to support at least 8 MB.
-  Frame parameters are extracted from the beginning of the compressed frame.
-  Data fragment must be large enough to ensure successful decoding, typically `ZSTD_frameHeaderSize_max` bytes.
-  @result : 0 : successful decoding, the `ZSTD_frameParams` structure is correctly filled.
+  Each application can set its own limit, depending on local restrictions.
+  For extended interoperability, it is recommended to support windowSize of at least 8 MB.
+  Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.
+  Data fragment must be large enough to ensure successful decoding.
+  `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.
+  @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.
            >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.
            errorCode, which can be tested using ZSTD_isError().
 
-  Start decompression, with ZSTD_decompressBegin() or ZSTD_decompressBegin_usingDict().
+  Start decompression, with ZSTD_decompressBegin().
+  If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().
   Alternatively, you can copy a prepared context, using ZSTD_copyDCtx().
 
   Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.
@@ -624,29 +753,196 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx*
   b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
   c) Frame Content - any content (User Data) of length equal to Frame Size
   For skippable frames ZSTD_decompressContinue() always returns 0.
-  For skippable frames ZSTD_getFrameParams() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
+  For skippable frames ZSTD_getFrameHeader() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
     Note : If fparamsPtr->frameContentSize==0, it is ambiguous: the frame might actually be a Zstd encoded frame with no content.
            For purposes of decompression, it is valid in both cases to skip the frame using
            ZSTD_findFrameCompressedSize to find its size in bytes.
   It also returns Frame Size as fparamsPtr->frameContentSize.
 
-
typedef struct {
-    unsigned long long frameContentSize;
-    unsigned windowSize;
-    unsigned dictID;
-    unsigned checksumFlag;
-} ZSTD_frameParams;
-

-

Buffer-less streaming decompression functions

size_t ZSTD_getFrameParams(ZSTD_frameParams* fparamsPtr, const void* src, size_t srcSize);   /**< doesn't consume input, see details below */
+

Buffer-less streaming decompression functions

size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
 size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
 size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
+size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
 void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
-size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
-size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
-ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
 

+
typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
+

+

New advanced API (experimental, and compression only)


+
typedef enum {
+    /* compression parameters */
+    ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
+                              * Default level is ZSTD_CLEVEL_DEFAULT==3.
+                              * Special: value 0 means "do not change cLevel". */
+    ZSTD_p_windowLog,        /* Maximum allowed back-reference distance, expressed as power of 2.
+                              * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
+                              * Special: value 0 means "do not change windowLog". */
+    ZSTD_p_hashLog,          /* Size of the probe table, as a power of 2.
+                              * Resulting table size is (1 << (hashLog+2)).
+                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
+                              * Larger tables improve compression ratio of strategies <= dFast,
+                              * and improve speed of strategies > dFast.
+                              * Special: value 0 means "do not change hashLog". */
+    ZSTD_p_chainLog,         /* Size of the full-search table, as a power of 2.
+                              * Resulting table size is (1 << (chainLog+2)).
+                              * Larger tables result in better and slower compression.
+                              * This parameter is useless when using "fast" strategy.
+                              * Special: value 0 means "do not change chainLog". */
+    ZSTD_p_searchLog,        /* Number of search attempts, as a power of 2.
+                              * More attempts result in better and slower compression.
+                              * This parameter is useless when using "fast" and "dFast" strategies.
+                              * Special: value 0 means "do not change searchLog". */
+    ZSTD_p_minMatch,         /* Minimum size of searched matches (note : repCode matches can be smaller).
+                              * Larger values make faster compression and decompression, but decrease ratio.
+                              * Must be clamped between ZSTD_SEARCHLENGTH_MIN and ZSTD_SEARCHLENGTH_MAX.
+                              * Note that currently, for all strategies < btopt, effective minimum is 4.
+                              * Note that currently, for all strategies > fast, effective maximum is 6.
+                              * Special: value 0 means "do not change minMatchLength". */
+    ZSTD_p_targetLength,     /* Only useful for strategies >= btopt.
+                              * Length of Match considered "good enough" to stop search.
+                              * Larger values make compression stronger and slower.
+                              * Special: value 0 means "do not change targetLength". */
+    ZSTD_p_compressionStrategy, /* See ZSTD_strategy enum definition.
+                              * Cast selected strategy as unsigned for ZSTD_CCtx_setParameter() compatibility.
+                              * The higher the value of selected strategy, the more complex it is,
+                              * resulting in stronger and slower compression.
+                              * Special: value 0 means "do not change strategy". */
+
+    /* frame parameters */
+    ZSTD_p_contentSizeFlag=200, /* Content size is written into frame header _whenever known_ (default:1) */
+    ZSTD_p_checksumFlag,     /* A 32-bits checksum of content is written at end of frame (default:0) */
+    ZSTD_p_dictIDFlag,       /* When applicable, dictID of dictionary is provided in frame header (default:1) */
+
+    /* dictionary parameters (must be set before ZSTD_CCtx_loadDictionary) */
+    ZSTD_p_dictMode=300,     /* Select how dictionary content must be interpreted. Value must be from type ZSTD_dictMode_e.
+                              * default : 0==auto : dictionary will be "full" if it respects specification, otherwise it will be "rawContent" */
+    ZSTD_p_refDictContent,   /* Dictionary content will be referenced, instead of copied (default:0==byCopy).
+                              * It requires that dictionary buffer outlives its users */
+
+    /* multi-threading parameters */
+    ZSTD_p_nbThreads=400,    /* Select how many threads a compression job can spawn (default:1)
+                              * More threads improve speed, but also increase memory usage.
+                              * Can only receive a value > 1 if ZSTD_MULTITHREAD is enabled.
+                              * Special: value 0 means "do not change nbThreads" */
+    ZSTD_p_jobSize,          /* Size of a compression job. Each compression job is completed in parallel.
+                              * 0 means default, which is dynamically determined based on compression parameters.
+                              * Job size must be a minimum of overlapSize, or 1 KB, whichever is largest
+                              * The minimum size is automatically and transparently enforced */
+    ZSTD_p_overlapSizeLog,   /* Size of previous input reloaded at the beginning of each job.
+                              * 0 => no overlap, 6(default) => use 1/8th of windowSize, >=9 => use full windowSize */
+
+    /* advanced parameters - may not remain available after API update */
+    ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize,
+                              * even when referencing into Dictionary content (default:0) */
+
+} ZSTD_cParameter;
+

+
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);
+

Set one compression parameter, selected by enum ZSTD_cParameter. + Note : when `value` is an enum, cast it to unsigned for proper type checking. + @result : 0, or an error code (which can be tested with ZSTD_isError()). +


+ +
size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
+

Total input data size to be compressed as a single frame. + This value will be controlled at the end, and result in error if not respected. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Note 1 : 0 means zero, empty. + In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. + Note that ZSTD_CONTENTSIZE_UNKNOWN is default value for new compression jobs. + Note 2 : If all data is provided and consumed in a single round, + this value is overriden by srcSize instead. +


+ +
size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+

Create an internal CDict from dict buffer. + Decompression will have to use same buffer. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, + meaning "return to no-dictionary mode". + Note 1 : `dict` content will be copied internally, + except if ZSTD_p_refDictContent is set before loading. + Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters. + For this reason, compression parameters cannot be changed anymore after loading a dictionary. + It's also a CPU-heavy operation, with non-negligible impact on latency. + Note 3 : Dictionary will be used for all future compression jobs. + To return to "no-dictionary" situation, load a NULL dictionary +


+ +
size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
+

Reference a prepared dictionary, to be used for all next compression jobs. + Note that compression parameters are enforced from within CDict, + and supercede any compression parameter previously set within CCtx. + The dictionary will remain valid for future compression jobs using same CCtx. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : adding a NULL CDict means "return to no-dictionary mode". + Note 1 : Currently, only one dictionary can be managed. + Adding a new dictionary effectively "discards" any previous one. + Note 2 : CDict is just referenced, its lifetime must outlive CCtx. + +


+ +
size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize);
+

Reference a prefix (single-usage dictionary) for next compression job. + Decompression need same prefix to properly regenerate data. + Prefix is **only used once**. Tables are discarded at end of compression job. + Subsequent compression jobs will be done without prefix (if none is explicitly referenced). + If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_CDict instead. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : Adding any prefix (including NULL) invalidates any previous prefix or dictionary + Note 1 : Prefix buffer is referenced. It must outlive compression job. + Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters. + It's a CPU-heavy operation, with non-negligible impact on latency. + Note 3 : it's possible to alter ZSTD_p_dictMode using ZSTD_CCtx_setParameter() +


+ +
typedef enum {
+    ZSTD_e_continue=0, /* collect more data, encoder transparently decides when to output result, for optimal conditions */
+    ZSTD_e_flush,      /* flush any data provided so far - frame will continue, future data can still reference previous data for better compression */
+    ZSTD_e_end         /* flush any remaining data and ends current frame. Any future compression starts a new frame. */
+} ZSTD_EndDirective;
+

+
size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
+                              ZSTD_outBuffer* output,
+                              ZSTD_inBuffer* input,
+                              ZSTD_EndDirective endOp);
+

Behave about the same as ZSTD_compressStream. To note : + - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter() + - Compression parameters cannot be changed once compression is started. + - *dstPos must be <= dstCapacity, *srcPos must be <= srcSize + - *dspPos and *srcPos will be updated. They are guaranteed to remain below their respective limit. + - @return provides the minimum amount of data still to flush from internal buffers + or an error code, which can be tested using ZSTD_isError(). + if @return != 0, flush is not fully completed, there is some data left within internal buffers. + - after a ZSTD_e_end directive, if internal buffer is not fully flushed, + only ZSTD_e_end or ZSTD_e_flush operations are allowed. + It is necessary to fully flush internal buffers + before starting a new compression job, or changing compression parameters. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 14 14:52:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5418DA3BA1; Fri, 14 Jul 2017 14:52:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id AF75E689E3; Fri, 14 Jul 2017 14:52:21 +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 v6EEqKOH017938; Fri, 14 Jul 2017 14:52:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EEqKQE017932; Fri, 14 Jul 2017 14:52:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707141452.v6EEqKQE017932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 14 Jul 2017 14:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320984 - in head/sys: cam cam/scsi dev/nvme kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam cam/scsi dev/nvme kern X-SVN-Commit-Revision: 320984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:52:21 -0000 Author: imp Date: Fri Jul 14 14:52:20 2017 New Revision: 320984 URL: https://svnweb.freebsd.org/changeset/base/320984 Log: This adds CAM pass(4) support for NVMe IO's. Applications indicate the IO type (Admin or NVM) using XPT op-codes XPT_NVME_ADMIN or XPT_NVME_IO. Submitted by: Chuck Tuffli Differential Revision: https://reviews.freebsd.org/D10247 Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_pass.c head/sys/dev/nvme/nvme_sim.c head/sys/kern/subr_bus_dma.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/cam/cam_ccb.h Fri Jul 14 14:52:20 2017 (r320984) @@ -207,7 +207,7 @@ typedef enum { /* Serial Management Protocol */ XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, - /* Execiute the requestred NVMe I/O operation */ + /* Execute the requested NVMe I/O operation */ XPT_MMC_IO = 0x1d | XPT_FC_DEV_QUEUED, /* Placeholder for MMC / SD / SDIO I/O stuff */ @@ -216,6 +216,9 @@ typedef enum { | XPT_FC_XPT_ONLY, /* Scan Target */ + XPT_NVME_ADMIN = 0x1f | XPT_FC_DEV_QUEUED, + /* Execute the requested NVMe Admin operation */ + /* HBA engine commands 0x20->0x2F */ XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, /* HBA engine feature inquiry */ @@ -819,7 +822,7 @@ struct ccb_relsim { }; /* - * NVMe I/O Request CCB used for the XPT_NVME_IO function code. + * NVMe I/O Request CCB used for the XPT_NVME_IO and XPT_NVME_ADMIN function codes. */ struct ccb_nvmeio { struct ccb_hdr ccb_h; @@ -1508,6 +1511,21 @@ cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t r u_int32_t timeout) { nvmeio->ccb_h.func_code = XPT_NVME_IO; + nvmeio->ccb_h.flags = flags; + nvmeio->ccb_h.retry_count = retries; + nvmeio->ccb_h.cbfcnp = cbfcnp; + nvmeio->ccb_h.timeout = timeout; + nvmeio->data_ptr = data_ptr; + nvmeio->dxfer_len = dxfer_len; +} + +static __inline void +cam_fill_nvmeadmin(struct ccb_nvmeio *nvmeio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, + u_int32_t timeout) +{ + nvmeio->ccb_h.func_code = XPT_NVME_ADMIN; nvmeio->ccb_h.flags = flags; nvmeio->ccb_h.retry_count = retries; nvmeio->ccb_h.cbfcnp = cbfcnp; Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/cam/cam_periph.c Fri Jul 14 14:52:20 2017 (r320984) @@ -848,6 +848,17 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma dirs[1] = CAM_DIR_IN; numbufs = 2; break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) + return (0); + if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR) + return (EINVAL); + data_ptrs[0] = &ccb->nvmeio.data_ptr; + lengths[0] = ccb->nvmeio.dxfer_len; + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 1; + break; case XPT_DEV_ADVINFO: if (ccb->cdai.bufsiz == 0) return (0); @@ -1013,6 +1024,11 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ case XPT_DEV_ADVINFO: numbufs = min(mapinfo->num_bufs_used, 1); data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; + break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + data_ptrs[0] = &ccb->nvmeio.data_ptr; + numbufs = min(mapinfo->num_bufs_used, 1); break; default: /* allow ourselves to be swapped once again */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/cam/cam_xpt.c Fri Jul 14 14:52:20 2017 (r320984) @@ -2689,9 +2689,9 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ataio.resid = 0; /* FALLTHROUGH */ case XPT_NVME_IO: - if (start_ccb->ccb_h.func_code == XPT_NVME_IO) - start_ccb->nvmeio.resid = 0; /* FALLTHROUGH */ + case XPT_NVME_ADMIN: + /* FALLTHROUGH */ case XPT_MMC_IO: /* XXX just like nmve_io? */ case XPT_RESET_DEV: @@ -5548,6 +5548,7 @@ static struct kv map[] = { { XPT_MMC_IO, "XPT_MMC_IO" }, { XPT_SMP_IO, "XPT_SMP_IO" }, { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, + { XPT_NVME_ADMIN, "XPT_NVME_ADMIN" }, { XPT_ENG_INQ, "XPT_ENG_INQ" }, { XPT_ENG_EXEC, "XPT_ENG_EXEC" }, { XPT_EN_LUN, "XPT_EN_LUN" }, Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/cam/scsi/scsi_pass.c Fri Jul 14 14:52:20 2017 (r320984) @@ -1146,6 +1146,11 @@ passiocleanup(struct pass_softc *softc, struct pass_io numbufs = min(io_req->num_bufs, 1); data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + data_ptrs[0] = &ccb->nvmeio.data_ptr; + numbufs = min(io_req->num_bufs, 1); + break; default: /* allow ourselves to be swapped once again */ return; @@ -1384,6 +1389,25 @@ passmemsetup(struct cam_periph *periph, struct pass_io dirs[0] = CAM_DIR_IN; numbufs = 1; break; + case XPT_NVME_ADMIN: + case XPT_NVME_IO: + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) + return (0); + + io_req->data_flags = ccb->ccb_h.flags & CAM_DATA_MASK; + + /* + * We only support a single virtual address for NVMe + */ + if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR) + return (EINVAL); + + data_ptrs[0] = &ccb->nvmeio.data_ptr; + lengths[0] = ccb->nvmeio.dxfer_len; + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 1; + maxmap = softc->maxio; + break; default: return(EINVAL); break; /* NOTREACHED */ @@ -1957,7 +1981,8 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr */ if ((fc == XPT_SCSI_IO) || (fc == XPT_ATA_IO) || (fc == XPT_SMP_IO) || (fc == XPT_DEV_MATCH) - || (fc == XPT_DEV_ADVINFO)) { + || (fc == XPT_DEV_ADVINFO) + || (fc == XPT_NVME_ADMIN) || (fc == XPT_NVME_IO)) { error = passmemsetup(periph, io_req); if (error != 0) goto camioqueue_error; Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/dev/nvme/nvme_sim.c Fri Jul 14 14:52:20 2017 (r320984) @@ -110,7 +110,10 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) memcpy(&req->cmd, &ccb->nvmeio.cmd, sizeof(ccb->nvmeio.cmd)); - nvme_ctrlr_submit_io_request(ctrlr, req); + if (ccb->ccb_h.func_code == XPT_NVME_IO) + nvme_ctrlr_submit_io_request(ctrlr, req); + else + nvme_ctrlr_submit_admin_request(ctrlr, req); ccb->ccb_h.status |= CAM_SIM_QUEUED; } @@ -225,6 +228,7 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; case XPT_NVME_IO: /* Execute the requested I/O operation */ + case XPT_NVME_ADMIN: /* or Admin operation */ nvme_sim_nvmeio(sim, ccb); return; /* no done */ default: Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Fri Jul 14 14:51:28 2017 (r320983) +++ head/sys/kern/subr_bus_dma.c Fri Jul 14 14:52:20 2017 (r320984) @@ -218,6 +218,16 @@ _bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t sglist_cnt = 0; break; } + case XPT_NVME_IO: + case XPT_NVME_ADMIN: { + struct ccb_nvmeio *nvmeio; + + nvmeio = &ccb->nvmeio; + data_ptr = nvmeio->data_ptr; + dxfer_len = nvmeio->dxfer_len; + sglist_cnt = 0; + break; + } default: panic("_bus_dmamap_load_ccb: Unsupported func code %d", ccb_h->func_code); From owner-svn-src-all@freebsd.org Fri Jul 14 14:52:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F2B4DA3C7C; Fri, 14 Jul 2017 14:52:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1BF68B6C; Fri, 14 Jul 2017 14:52:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EEqjNL020299; Fri, 14 Jul 2017 14:52:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EEqigZ020292; Fri, 14 Jul 2017 14:52:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707141452.v6EEqigZ020292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 14 Jul 2017 14:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320985 - in vendor/zstd/1.3.0: . build contrib contrib/pzstd contrib/pzstd/utils/test doc doc/educational_decoder doc/images examples lib lib/common lib/compress lib/decompress lib/dic... X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/zstd/1.3.0: . build contrib contrib/pzstd contrib/pzstd/utils/test doc doc/educational_decoder doc/images examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/dll lib/lega... X-SVN-Commit-Revision: 320985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:52:46 -0000 Author: bapt Date: Fri Jul 14 14:52:44 2017 New Revision: 320985 URL: https://svnweb.freebsd.org/changeset/base/320985 Log: Tag import of zstd 1.3.0 Added: vendor/zstd/1.3.0/ - copied from r316975, vendor/zstd/dist/ vendor/zstd/1.3.0/contrib/cleanTabs - copied unchanged from r317875, vendor/zstd/dist/contrib/cleanTabs vendor/zstd/1.3.0/programs/zstd.1.md - copied unchanged from r320983, vendor/zstd/dist/programs/zstd.1.md Replaced: vendor/zstd/1.3.0/Makefile - copied unchanged from r320983, vendor/zstd/dist/Makefile vendor/zstd/1.3.0/NEWS - copied unchanged from r320983, vendor/zstd/dist/NEWS vendor/zstd/1.3.0/README.md - copied unchanged from r320983, vendor/zstd/dist/README.md vendor/zstd/1.3.0/appveyor.yml - copied unchanged from r320983, vendor/zstd/dist/appveyor.yml vendor/zstd/1.3.0/circle.yml - copied unchanged from r317875, vendor/zstd/dist/circle.yml vendor/zstd/1.3.0/contrib/pzstd/Options.cpp - copied unchanged from r317875, vendor/zstd/dist/contrib/pzstd/Options.cpp vendor/zstd/1.3.0/contrib/pzstd/Pzstd.cpp - copied unchanged from r320983, vendor/zstd/dist/contrib/pzstd/Pzstd.cpp vendor/zstd/1.3.0/contrib/pzstd/utils/test/ThreadPoolTest.cpp - copied unchanged from r317875, vendor/zstd/dist/contrib/pzstd/utils/test/ThreadPoolTest.cpp vendor/zstd/1.3.0/contrib/pzstd/utils/test/WorkQueueTest.cpp - copied unchanged from r317875, vendor/zstd/dist/contrib/pzstd/utils/test/WorkQueueTest.cpp vendor/zstd/1.3.0/doc/educational_decoder/zstd_decompress.c - copied unchanged from r317875, vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c vendor/zstd/1.3.0/doc/images/Cspeed4.png - copied unchanged from r317875, vendor/zstd/dist/doc/images/Cspeed4.png vendor/zstd/1.3.0/doc/images/Dspeed4.png - copied unchanged from r317875, vendor/zstd/dist/doc/images/Dspeed4.png vendor/zstd/1.3.0/doc/images/dict-cr.png - copied unchanged from r317875, vendor/zstd/dist/doc/images/dict-cr.png vendor/zstd/1.3.0/doc/images/dict-cs.png - copied unchanged from r317875, vendor/zstd/dist/doc/images/dict-cs.png vendor/zstd/1.3.0/doc/images/dict-ds.png - copied unchanged from r317875, vendor/zstd/dist/doc/images/dict-ds.png vendor/zstd/1.3.0/doc/zstd_compression_format.md - copied unchanged from r317875, vendor/zstd/dist/doc/zstd_compression_format.md vendor/zstd/1.3.0/doc/zstd_manual.html - copied unchanged from r320983, vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/1.3.0/examples/Makefile - copied unchanged from r320983, vendor/zstd/dist/examples/Makefile vendor/zstd/1.3.0/examples/simple_compression.c - copied unchanged from r317875, vendor/zstd/dist/examples/simple_compression.c vendor/zstd/1.3.0/examples/streaming_compression.c - copied unchanged from r317875, vendor/zstd/dist/examples/streaming_compression.c vendor/zstd/1.3.0/examples/streaming_decompression.c - copied unchanged from r317875, vendor/zstd/dist/examples/streaming_decompression.c vendor/zstd/1.3.0/lib/Makefile - copied unchanged from r320983, vendor/zstd/dist/lib/Makefile vendor/zstd/1.3.0/lib/README.md - copied unchanged from r317875, vendor/zstd/dist/lib/README.md vendor/zstd/1.3.0/lib/common/bitstream.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/1.3.0/lib/common/error_private.c - copied unchanged from r320983, vendor/zstd/dist/lib/common/error_private.c vendor/zstd/1.3.0/lib/common/fse.h - copied unchanged from r317875, vendor/zstd/dist/lib/common/fse.h vendor/zstd/1.3.0/lib/common/huf.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/huf.h vendor/zstd/1.3.0/lib/common/mem.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/mem.h vendor/zstd/1.3.0/lib/common/pool.c - copied unchanged from r320983, vendor/zstd/dist/lib/common/pool.c vendor/zstd/1.3.0/lib/common/pool.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/pool.h vendor/zstd/1.3.0/lib/common/threading.c - copied unchanged from r320983, vendor/zstd/dist/lib/common/threading.c vendor/zstd/1.3.0/lib/common/zstd_common.c - copied unchanged from r320983, vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/1.3.0/lib/common/zstd_errors.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/1.3.0/lib/common/zstd_internal.h - copied unchanged from r320983, vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/1.3.0/lib/compress/fse_compress.c - copied unchanged from r317875, vendor/zstd/dist/lib/compress/fse_compress.c vendor/zstd/1.3.0/lib/compress/huf_compress.c - copied unchanged from r320983, vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/1.3.0/lib/compress/zstd_compress.c - copied unchanged from r320983, vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/1.3.0/lib/compress/zstd_opt.h - copied unchanged from r320983, vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/1.3.0/lib/compress/zstdmt_compress.c - copied unchanged from r320983, vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/1.3.0/lib/compress/zstdmt_compress.h - copied unchanged from r320983, vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/1.3.0/lib/decompress/huf_decompress.c - copied unchanged from r320983, vendor/zstd/dist/lib/decompress/huf_decompress.c vendor/zstd/1.3.0/lib/decompress/zstd_decompress.c - copied unchanged from r320983, vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/1.3.0/lib/dictBuilder/cover.c - copied unchanged from r320983, vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/1.3.0/lib/dictBuilder/zdict.c - copied unchanged from r320983, vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/1.3.0/lib/dictBuilder/zdict.h - copied unchanged from r320983, vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/1.3.0/lib/legacy/zstd_v01.c - copied unchanged from r317875, vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/1.3.0/lib/legacy/zstd_v02.c - copied unchanged from r317875, vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/1.3.0/lib/legacy/zstd_v03.c - copied unchanged from r317875, vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/1.3.0/lib/legacy/zstd_v04.c - copied unchanged from r320983, vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/1.3.0/lib/legacy/zstd_v05.c - copied unchanged from r320983, vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/1.3.0/lib/legacy/zstd_v06.c - copied unchanged from r320983, vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/1.3.0/lib/legacy/zstd_v07.c - copied unchanged from r320983, vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/1.3.0/lib/zstd.h - copied unchanged from r320983, vendor/zstd/dist/lib/zstd.h vendor/zstd/1.3.0/programs/Makefile - copied unchanged from r320983, vendor/zstd/dist/programs/Makefile vendor/zstd/1.3.0/programs/README.md - copied unchanged from r320983, vendor/zstd/dist/programs/README.md vendor/zstd/1.3.0/programs/bench.c - copied unchanged from r320983, vendor/zstd/dist/programs/bench.c vendor/zstd/1.3.0/programs/dibio.c - copied unchanged from r320983, vendor/zstd/dist/programs/dibio.c vendor/zstd/1.3.0/programs/dibio.h - copied unchanged from r320983, vendor/zstd/dist/programs/dibio.h vendor/zstd/1.3.0/programs/fileio.c - copied unchanged from r320983, vendor/zstd/dist/programs/fileio.c vendor/zstd/1.3.0/programs/fileio.h - copied unchanged from r320983, vendor/zstd/dist/programs/fileio.h vendor/zstd/1.3.0/programs/platform.h - copied unchanged from r317875, vendor/zstd/dist/programs/platform.h vendor/zstd/1.3.0/programs/util.h - copied unchanged from r320983, vendor/zstd/dist/programs/util.h vendor/zstd/1.3.0/programs/zstd.1 - copied unchanged from r320983, vendor/zstd/dist/programs/zstd.1 vendor/zstd/1.3.0/programs/zstdcli.c - copied unchanged from r320983, vendor/zstd/dist/programs/zstdcli.c vendor/zstd/1.3.0/tests/Makefile - copied unchanged from r320983, vendor/zstd/dist/tests/Makefile vendor/zstd/1.3.0/tests/datagencli.c - copied unchanged from r320983, vendor/zstd/dist/tests/datagencli.c vendor/zstd/1.3.0/tests/decodecorpus.c - copied unchanged from r320983, vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/1.3.0/tests/fullbench.c - copied unchanged from r320983, vendor/zstd/dist/tests/fullbench.c vendor/zstd/1.3.0/tests/fuzzer.c - copied unchanged from r320983, vendor/zstd/dist/tests/fuzzer.c vendor/zstd/1.3.0/tests/paramgrill.c - copied unchanged from r320983, vendor/zstd/dist/tests/paramgrill.c vendor/zstd/1.3.0/tests/playTests.sh - copied unchanged from r320983, vendor/zstd/dist/tests/playTests.sh vendor/zstd/1.3.0/tests/roundTripCrash.c - copied unchanged from r320983, vendor/zstd/dist/tests/roundTripCrash.c vendor/zstd/1.3.0/tests/symbols.c - copied unchanged from r320983, vendor/zstd/dist/tests/symbols.c vendor/zstd/1.3.0/tests/test-zstd-speed.py - copied unchanged from r317875, vendor/zstd/dist/tests/test-zstd-speed.py vendor/zstd/1.3.0/tests/zbufftest.c - copied unchanged from r317875, vendor/zstd/dist/tests/zbufftest.c vendor/zstd/1.3.0/tests/zstreamtest.c - copied unchanged from r320983, vendor/zstd/dist/tests/zstreamtest.c vendor/zstd/1.3.0/zlibWrapper/Makefile - copied unchanged from r320983, vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/1.3.0/zlibWrapper/examples/zwrapbench.c - copied unchanged from r320983, vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/1.3.0/zlibWrapper/zstd_zlibwrapper.c - copied unchanged from r320983, vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c Deleted: vendor/zstd/1.3.0/.gitignore vendor/zstd/1.3.0/.travis.yml vendor/zstd/1.3.0/build/ vendor/zstd/1.3.0/lib/dll/ vendor/zstd/1.3.0/programs/windres/ Copied: vendor/zstd/1.3.0/Makefile (from r320983, vendor/zstd/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.0/Makefile Fri Jul 14 14:52:44 2017 (r320985, copy of r320983, vendor/zstd/dist/Makefile) @@ -0,0 +1,332 @@ +# ################################################################ +# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. +# ################################################################ + +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests + +# Define nul output +VOID = /dev/null + +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: | allmost examples manual + +.PHONY: allmost +allmost: + $(MAKE) -C $(ZSTDDIR) all + $(MAKE) -C $(PRGDIR) all + $(MAKE) -C $(TESTDIR) all + $(MAKE) -C $(ZWRAPDIR) all + +#skip zwrapper, can't build that on alternate architectures without the proper zlib installed +.PHONY: allarch +allarch: + $(MAKE) -C $(ZSTDDIR) all + $(MAKE) -C $(PRGDIR) all + $(MAKE) -C $(TESTDIR) all + +.PHONY: all32 +all32: + $(MAKE) -C $(PRGDIR) zstd32 + $(MAKE) -C $(TESTDIR) all32 + +.PHONY: lib +lib: + @$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: lib-release +lib-release: + @$(MAKE) -C $(ZSTDDIR) + +.PHONY: zstd +zstd: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstd-release +zstd-release: + @$(MAKE) -C $(PRGDIR) + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstdmt +zstdmt: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) + +.PHONY: zlibwrapper +zlibwrapper: + $(MAKE) -C $(ZWRAPDIR) test + +.PHONY: shortest +shortest: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: test +test: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: examples +examples: + CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all + +.PHONY: manual +manual: + $(MAKE) -C contrib/gen_html $@ + +.PHONY: cleanTabs +cleanTabs: + cd contrib; ./cleanTabs + +.PHONY: clean +clean: + @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) + @$(MAKE) -C $(PRGDIR) $@ > $(VOID) + @$(MAKE) -C $(TESTDIR) $@ > $(VOID) + @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) + @$(MAKE) -C examples/ $@ > $(VOID) + @$(MAKE) -C contrib/gen_html $@ > $(VOID) + @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @echo Cleaning completed + +#------------------------------------------------------------------------------ +# make install is validated only for Linux, OSX, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) + +HOST_OS = POSIX +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON + +.PHONY: list +list: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + +.PHONY: install clangtest gpptest armtest usan asan uasan +install: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +.PHONY: uninstall +uninstall: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +.PHONY: travis-install +travis-install: + $(MAKE) install PREFIX=~/install_test_dir + +.PHONY: gppbuild +gppbuild: clean + g++ -v + CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +.PHONY: gcc5build +gcc5build: clean + gcc-5 -v + CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: gcc6build +gcc6build: clean + gcc-6 -v + CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: clangbuild +clangbuild: clean + clang -v + CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +m32build: clean + gcc -v + $(MAKE) all32 + +armbuild: clean + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch + +aarch64build: clean + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch + +ppcbuild: clean + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch + +ppc64build: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch + +armfuzz: clean + CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +aarch64fuzz: clean + CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppcfuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppc64fuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +gpptest: clean + CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" + +clangtest: clean + clang -v + $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +armtest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +aarch64test: + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +ppctest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests + +ppc64test: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests + +arm-ppc-compilation: + $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" + +# run UBsan with -fsanitize-recover=signed-integer-overflow +# due to a bug in UBsan when doing pointer subtraction +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 + +usan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined" + +asan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address" + +asan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* + +msan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason + +msan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* + +asan32: clean + $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" + +uasan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" + +uasan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + +tsan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + +apt-install: + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) + +apt-add-repo: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + +ppcinstall: + APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install + +arminstall: + APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install + +valgrindinstall: + APT_PACKAGES="valgrind" $(MAKE) apt-install + +libc6install: + APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install + +gcc6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gpp6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install + +clang38install: + APT_PACKAGES="clang-3.8" $(MAKE) apt-install + +endif + + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +endif + + +#------------------------------------------------------------------------ +#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +cmakebuild: + cmake --version + $(RM) -r $(BUILDIR)/cmake/build + mkdir $(BUILDIR)/cmake/build + cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + +c90build: clean + gcc -v + CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` + +gnu90build: clean + gcc -v + CFLAGS="-std=gnu90" $(MAKE) allmost + +c99build: clean + gcc -v + CFLAGS="-std=c99" $(MAKE) allmost + +gnu99build: clean + gcc -v + CFLAGS="-std=gnu99" $(MAKE) allmost + +c11build: clean + gcc -v + CFLAGS="-std=c11" $(MAKE) allmost + +bmix64build: clean + gcc -v + CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test + +bmix32build: clean + gcc -v + CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test + +bmi32build: clean + gcc -v + CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test + +staticAnalyze: clean + gcc -v + CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all +endif Copied: vendor/zstd/1.3.0/NEWS (from r320983, vendor/zstd/dist/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.0/NEWS Fri Jul 14 14:52:44 2017 (r320985, copy of r320983, vendor/zstd/dist/NEWS) @@ -0,0 +1,298 @@ +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + +v1.2.0 +cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) +cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell +cli : new : zstdmt symlink hardwired to `zstd -T0` +cli : new : command --threads=# (#671) +cli : changed : cover dictionary builder by default, for improved quality, by Nick Terrell +cli : new : commands --train-cover and --train-legacy, to select dictionary algorithm and parameters +cli : experimental targets `zstd4` and `xzstd4`, with support for lz4 format, by Sean Purcell +cli : fix : does not output compressed data on console +cli : fix : ignore symbolic links unless --force specified, +API : breaking change : ZSTD_createCDict_advanced(), only use compressionParameters as argument +API : added : prototypes ZSTD_*_usingCDict_advanced(), for direct control over frameParameters. +API : improved: ZSTDMT_compressCCtx() reduced memory usage +API : fix : ZSTDMT_compressCCtx() now provides srcSize in header (#634) +API : fix : src size stored in frame header is controlled at end of frame +API : fix : enforced consistent rules for pledgedSrcSize==0 (#641) +API : fix : error code "GENERIC" replaced by "dstSizeTooSmall" when appropriate +build: improved cmake script, by @Majlen +build: enabled Multi-threading support for *BSD, by Baptiste Daroussin +tools: updated Paramgrill. Command -O# provides best parameters for sample and speed target. +new : contrib/linux-kernel version, by Nick Terrell + +v1.1.4 +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +cli : fix : --rm remains silent when input is stdin +cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski +speed : improved decompression speed in streaming mode for single shot scenarios (+5%) +memory: DDict (decompression dictionary) memory usage down from 150 KB to 20 KB +arch: 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell +API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() +API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value) +build : new: meson build system in contrib/meson, by Dima Krasner +build : improved cmake script, by @Majlen +build : added -Wformat-security flag, as recommended by Padraig Brady +doc : new : educational decoder, by Sean Purcell + +v1.1.3 +cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) +cli : new : experimental target `make zstdmt`, with multi-threading support +cli : new : improved dictionary builder "cover" (experimental), by Nick Terrell, based on prior work by Giuseppe Ottaviano. +cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski +cli : fix zstdless on Mac OS-X, by Andrew Janke +cli : fix #232 "compress non-files" +dictBuilder : improved dictionary generation quality, thanks to Nick Terrell +API : new : lib/compress/ZSTDMT_compress.h multithreading API (experimental) +API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul +API : new : ZDICT_finalizeDictionary() +API : fix : ZSTD_initCStream_usingCDict() properly writes dictID into frame header, by Gregory Szorc (#511) +API : fix : all symbols properly exposed in libzstd, by Nick Terrell +build : support for Solaris target, by Przemyslaw Skibinski +doc : clarified specification, by Sean Purcell + +v1.1.2 +API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init +API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() +API : zbuff : changed : prototypes now generate deprecation warnings +lib : improved : faster decompression speed at ultra compression settings and 32-bits mode +lib : changed : only public ZSTD_ symbols are now exposed +lib : changed : reduced usage of stack memory +lib : fixed : several corner case bugs, by Nick Terrell +cli : new : gzstd, experimental version able to decode .gz files, by Przemyslaw Skibinski +cli : new : preserve file attributes +cli : new : added zstdless and zstdgrep tools +cli : fixed : status displays total amount decoded, even for file consisting of multiple frames (like pzstd) +cli : fixed : zstdcat +zlib_wrapper : added support for gz* functions, by Przemyslaw Skibinski +install : better compatibility with FreeBSD, by Dimitry Andric +source tree : changed : zbuff source files moved to lib/deprecated + +v1.1.1 +New : command -M#, --memory=, --memlimit=, --memlimit-decompress= to limit allowed memory consumption +New : doc/zstd_manual.html, by Przemyslaw Skibinski +Improved : slightly better compression ratio at --ultra levels (>= 20) +Improved : better memory usage when using streaming compression API, thanks to @Rogier-5 report +Added : API : ZSTD_initCStream_usingCDict(), ZSTD_initDStream_usingDDict() (experimental section) +Added : example/multiple_streaming_compression.c +Changed : zstd_errors.h is now installed within /include (and replaces errors_public.h) +Updated man page +Fixed : zstd-small, zstd-compress and zstd-decompress compilation targets + +v1.1.0 +New : contrib/pzstd, parallel version of zstd, by Nick Terrell +added : NetBSD install target (#338) +Improved : speed for batches of small files +Improved : speed of zlib wrapper, by Przemyslaw Skibinski +Changed : libzstd on Windows supports legacy formats, by Christophe Chevalier +Fixed : CLI -d output to stdout by default when input is stdin (#322) +Fixed : CLI correctly detects console on Mac OS-X +Fixed : CLI supports recursive mode `-r` on Mac OS-X +Fixed : Legacy decoders use unified error codes, reported by benrg (#341), fixed by Przemyslaw Skibinski +Fixed : compatibility with OpenBSD, reported by Juan Francisco Cantero Hurtado (#319) +Fixed : compatibility with Hurd, by Przemyslaw Skibinski (#365) +Fixed : zstd-pgo, reported by octoploid (#329) + +v1.0.0 +Change Licensing, all project is now BSD, Copyright Facebook +Small decompression speed improvement +API : Streaming API supports legacy format +API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParamter() +CLI supports legacy formats v0.4+ +Fixed : compression fails on certain huge files, reported by Jesse McGrew +Enhanced documentation, by Przemyslaw Skibinski + +v0.8.1 +New streaming API +Changed : --ultra now enables levels beyond 19 +Changed : -i# now selects benchmark time in second +Fixed : ZSTD_compress* can now compress > 4 GB in a single pass, reported by Nick Terrell +Fixed : speed regression on specific patterns (#272) +Fixed : support for Z_SYNC_FLUSH, by Dmitry Krot (#291) +Fixed : ICC compilation, by Przemyslaw Skibinski + +v0.8.0 +Improved : better speed on clang and gcc -O2, thanks to Eric Biggers +New : Build on FreeBSD and DragonFly, thanks to JrMarino +Changed : modified API : ZSTD_compressEnd() +Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +Fixed : large dictionaries (> 384 KB), reported by Ilona Papava +Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson +Modified : minor compression level adaptations +Updated : compression format specification to v0.2.0 +changed : zstd.h moved to /lib directory + +v0.7.5 +Transition version, supporting decoding of v0.8.x + +v0.7.4 +Added : homebrew for Mac, by Daniel Cade +Added : more examples +Fixed : segfault when using small dictionaries, reported by Felix Handte +Modified : default compression level for CLI is now 3 +Updated : specification, to v0.1.1 + +v0.7.3 +New : compression format specification +New : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner. +New : `ZSTD_getDecompressedSize()` +New : OpenBSD target, by Juan Francisco Cantero Hurtado +New : `examples` directory +fixed : dictBuilder using HC levels, reported by Bartosz Taudul +fixed : legacy support from ZSTD_decompress_usingDDict(), reported by Felix Handte +fixed : multi-blocks decoding with intermediate uncompressed blocks, reported by Greg Slazinski +modified : removed "mem.h" and "error_public.h" dependencies from "zstd.h" (experimental section) +modified : legacy functions no longer need magic number + +v0.7.2 +fixed : ZSTD_decompressBlock() using multiple consecutive blocks. Reported by Greg Slazinski. +fixed : potential segfault on very large files (many gigabytes). Reported by Chip Turner. +fixed : CLI displays system error message when destination file cannot be created (#231). Reported by Chip Turner. + +v0.7.1 +fixed : ZBUFF_compressEnd() called multiple times with too small `dst` buffer, reported by Christophe Chevalier +fixed : dictBuilder fails if first sample is too small, reported by РуÑлан Ковалёв +fixed : corruption issue, reported by cj +modified : checksum enabled by default in command line mode + +v0.7.0 +New : Support for directory compression, using `-r`, thanks to Przemyslaw Skibinski +New : Command `--rm`, to remove source file after successful de/compression +New : Visual build scripts, by Christophe Chevalier +New : Support for Sparse File-systems (do not use space for zero-filled sectors) +New : Frame checksum support +New : Support pass-through mode (when using `-df`) +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions +New : controllable Dictionary ID +New : Support for skippable frames + +v0.6.1 +New : zlib wrapper API, thanks to Przemyslaw Skibinski +New : Ability to compile compressor / decompressor separately +Changed : new lib directory structure +Fixed : Legacy codec v0.5 compatible with dictionary decompression +Fixed : Decoder corruption error (#173) +Fixed : null-string roundtrip (#176) +New : benchmark mode can select directory as input +Experimental : midipix support, VMS support + +v0.6.0 +Stronger high compression modes, thanks to Przemyslaw Skibinski +API : ZSTD_getFrameParams() provides size of decompressed content +New : highest compression modes require `--ultra` command to fully unleash their capacity +Fixed : zstd cli return error code > 0 and removes dst file artifact when decompression fails, thanks to Chip Turner + +v0.5.1 +New : Optimal parsing => Very high compression modes, thanks to Przemyslaw Skibinski +Changed : Dictionary builder integrated into libzstd and zstd cli +Changed (!) : zstd cli now uses "multiple input files" as default mode. See `zstd -h`. +Fix : high compression modes for big-endian platforms +New : zstd cli : `-t` | `--test` command + +v0.5.0 +New : dictionary builder utility +Changed : streaming & dictionary API +Improved : better compression of small data + +v0.4.7 +Improved : small compression speed improvement in HC mode +Changed : `zstd_decompress.c` has ZSTD_LEGACY_SUPPORT to 0 by default +fix : bt search bug + +v0.4.6 +fix : fast compression mode on Windows +New : cmake configuration file, thanks to Artyom Dymchenko +Improved : high compression mode on repetitive data +New : block-level API +New : ZSTD_duplicateCCtx() + +v0.4.5 +new : -m/--multiple : compress/decompress multiple files + +v0.4.4 +Fixed : high compression modes for Windows 32 bits +new : external dictionary API extended to buffered mode and accessible through command line +new : windows DLL project, thanks to Christophe Chevalier + +v0.4.3 : +new : external dictionary API +new : zstd-frugal + +v0.4.2 : +Generic minor improvements for small blocks +Fixed : big-endian compatibility, by Peter Harris (#85) + +v0.4.1 +Fixed : ZSTD_LEGACY_SUPPORT=0 build mode (reported by Luben) +removed `zstd.c` + +v0.4.0 +Command line utility compatible with high compression levels +Removed zstdhc => merged into zstd +Added : ZBUFF API (see zstd_buffered.h) +Rolling buffer support + +v0.3.6 +small blocks params + +v0.3.5 +minor generic compression improvements + +v0.3.4 +Faster fast cLevels + +v0.3.3 +Small compression ratio improvement + +v0.3.2 +Fixed Visual Studio + +v0.3.1 : +Small compression ratio improvement + +v0.3 +HC mode : compression levels 2-26 + +v0.2.2 +Fix : Visual Studio 2013 & 2015 release compilation, by Christophe Chevalier + +v0.2.1 +Fix : Read errors, advanced fuzzer tests, by Hanno Böck + +v0.2.0 +**Breaking format change** +Faster decompression speed +Can still decode v0.1 format + +v0.1.3 +fix uninitialization warning, reported by Evan Nemerson + +v0.1.2 +frame concatenation support + +v0.1.1 +fix compression bug +detects write-flush errors + +v0.1.0 +first release Copied: vendor/zstd/1.3.0/README.md (from r320983, vendor/zstd/dist/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.0/README.md Fri Jul 14 14:52:44 2017 (r320985, copy of r320983, vendor/zstd/dist/README.md) @@ -0,0 +1,153 @@ + __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, + targeting real-time compression scenarios at zlib-level and better compression ratios. + +It is provided as an open-source BSD-licensed **C** library, +and a command line utility producing and decoding `.zst` and `.gz` files. +For other programming languages, +you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages). + +| dev branch status | +|-------------------| +| [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] + +[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" +[travisLink]: https://travis-ci.org/facebook/zstd +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0 +[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" +[CircleLink]: https://circleci.com/gh/facebook/zstd + + +As a reference, several fast compression algorithms were tested and compared +on a server running Linux Debian (`Linux version 4.8.0-1-amd64`), +with a Core i7-6700K CPU @ 4.0GHz, +using [lzbench], an open-source in-memory benchmark by @inikep +compiled with GCC 6.3.0, +on the [Silesia compression corpus]. + +[lzbench]: https://github.com/inikep/lzbench +[Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia + +| Compressor name | Ratio | Compression| Decompress.| +| --------------- | ------| -----------| ---------- | +| **zstd 1.1.3 -1** | 2.877 | 430 MB/s | 1110 MB/s | +| zlib 1.2.8 -1 | 2.743 | 110 MB/s | 400 MB/s | +| brotli 0.5.2 -0 | 2.708 | 400 MB/s | 430 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s | +| lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s | +| lz4 1.7.5 | 2.101 | 720 MB/s | 3600 MB/s | +| snappy 1.1.3 | 2.091 | 500 MB/s | 1650 MB/s | +| lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s | + +[zlib]:http://www.zlib.net/ +[LZ4]: http://www.lz4.org/ + +Zstd can also offer stronger compression ratios at the cost of compression speed. +Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma. + +The following tests were run +on a server running Linux Debian (`Linux version 4.8.0-1-amd64`) +with a Core i7-6700K CPU @ 4.0GHz, +using [lzbench], an open-source in-memory benchmark by @inikep +compiled with GCC 6.3.0, +on the [Silesia compression corpus]. + +Compression Speed vs Ratio | Decompression Speed +---------------------------|-------------------- +![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed") + +Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph. +For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) . + + +### The case for Small Data compression + +Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives. + +The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon. + +To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data. +Training Zstandard is achieved by providing it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. +Using this dictionary, the compression ratio achievable on small data improves dramatically. + +The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users). +It consists of roughly 10K records weighing about 1KB each. + +Compression Ratio | Compression Speed | Decompression Speed +------------------|-------------------|-------------------- +![Compression Ratio](doc/images/dict-cr.png "Compression Ratio") | ![Compression Speed](doc/images/dict-cs.png "Compression Speed") | ![Decompression Speed](doc/images/dict-ds.png "Decompression Speed") + + +These compression gains are achieved while simultaneously providing _faster_ compression and decompression speeds. + +Training works if there is some correlation in a family of small data samples. The more data-specific a dictionary is, the more efficient it is (there is no _universal dictionary_). +Hence, deploying one dictionary per type of data will provide the greatest benefits. +Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file. + +#### Dictionary compression How To : + +1) Create the dictionary + +`zstd --train FullPathToTrainingSet/* -o dictionaryName` + +2) Compress with dictionary + +`zstd -D dictionaryName FILE` + +3) Decompress with dictionary + +`zstd -D dictionaryName --decompress FILE.zst` + + +### Build + +Once you have the repository cloned, there are multiple ways provided to build Zstandard. + +#### Makefile + +If your system is compatible with a standard `make` (or `gmake`) binary generator, +you can simply run it at the root directory. +It will generate `zstd` within root directory. + +Other available options include : +- `make install` : create and install zstd binary, library and man page +- `make test` : create and run `zstd` and test tools on local platform + +#### cmake + +A `cmake` project generator is provided within `build/cmake`. +It can generate Makefiles or other build scripts +to create `zstd` binary, and `libzstd` dynamic and static libraries. + +#### Meson + +A Meson project is provided within `contrib/meson`. + +#### Visual Studio (Windows) + +Going into `build` directory, you will find additional possibilities : +- Projects for Visual Studio 2005, 2008 and 2010 + + VS2010 project is compatible with VS2012, VS2013 and VS2015 +- Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`, + which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. + + +### Status + +Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases. +Zstandard is considered safe for production environments. + +### License + +Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS). + +### Contributing + +The "dev" branch is the one where all contributions will be merged before reaching "master". +If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. +Direct commit to "master" are not permitted. +For more information, please read [CONTRIBUTING](CONTRIBUTING.md). + +### Miscellaneous + +Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy). Copied: vendor/zstd/1.3.0/appveyor.yml (from r320983, vendor/zstd/dist/appveyor.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.0/appveyor.yml Fri Jul 14 14:52:44 2017 (r320985, copy of r320983, vendor/zstd/dist/appveyor.yml) @@ -0,0 +1,240 @@ +- + version: 1.0.{build} + branches: + only: + - dev + - master + environment: + matrix: + - COMPILER: "gcc" + HOST: "mingw" + PLATFORM: "x64" + SCRIPT: "make allarch && make -C tests test-symbols fullbench-dll fullbench-lib" + ARTIFACT: "true" + BUILD: "true" + - COMPILER: "gcc" + HOST: "mingw" + PLATFORM: "x86" + SCRIPT: "make allarch" + ARTIFACT: "true" + BUILD: "true" + - COMPILER: "clang" + HOST: "mingw" + PLATFORM: "x64" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + BUILD: "true" + + - COMPILER: "gcc" + HOST: "mingw" + PLATFORM: "x64" + SCRIPT: "" + TEST: "cmake" + + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "x64" + CONFIGURATION: "Debug" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "Win32" + CONFIGURATION: "Debug" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "x64" + CONFIGURATION: "Release" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "Win32" + CONFIGURATION: "Release" + + install: + - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION% + - SET PATH_ORIGINAL=%PATH% + - if [%HOST%]==[mingw] ( + SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" && + SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" && + COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\make.exe && + COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\make.exe + ) + - IF [%HOST%]==[visual] IF [%PLATFORM%]==[x64] ( + SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;" + ) + + build_script: + - if [%HOST%]==[mingw] ( + ( if [%PLATFORM%]==[x64] ( + SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%" + ) else if [%PLATFORM%]==[x86] ( + SET "PATH=%PATH_MINGW32%;%PATH_ORIGINAL%" + ) ) + ) + - if [%HOST%]==[mingw] if [%BUILD%]==[true] ( + make -v && + sh -c "%COMPILER% -v" && + ECHO Building zlib to static link && + SET "CC=%COMPILER%" && + sh -c "cd .. && git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib" && + sh -c "cd ../zlib && make -f win32/Makefile.gcc libz.a" + ECHO Building zstd && + SET "CPPFLAGS=-I../../zlib" && + SET "LDFLAGS=../../zlib/libz.a" && + sh -c "%SCRIPT%" && + ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true] + lib\dll\example\build_package.bat && + make -C programs DEBUGFLAGS= clean zstd && + cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe && + appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip && + cp zstd.exe ..\bin\zstd.exe && + cd ..\bin\ && 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * && + appveyor PushArtifact zstd-win-release-%PLATFORM%.zip + ) + ) + - if [%HOST%]==[visual] ( + ECHO *** && + ECHO *** Building Visual Studio 2008 %PLATFORM%\%CONFIGURATION% in %APPVEYOR_BUILD_FOLDER% && + ECHO *** && + msbuild "build\VS2008\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v90 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\*.exe && + MD5sum build/VS2008/bin/%PLATFORM%/%CONFIGURATION%/*.exe && + COPY build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2008_%PLATFORM%_%CONFIGURATION%.exe && + ECHO *** && + ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% && + ECHO *** && + msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2010_%PLATFORM%_%CONFIGURATION%.exe && + ECHO *** && + ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% && + ECHO *** && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2012_%PLATFORM%_%CONFIGURATION%.exe && + ECHO *** && + ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% && + ECHO *** && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2013_%PLATFORM%_%CONFIGURATION%.exe && + ECHO *** && + ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% && + ECHO *** && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe && + MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe && + COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2015_%PLATFORM%_%CONFIGURATION%.exe && + COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe tests\ + ) + + test_script: + - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION% + - SET "CC=gcc" + - SET "CXX=g++" + - if [%TEST%]==[cmake] ( + mkdir build\cmake\build && + cd build\cmake\build && + cmake -G "Visual Studio 14 2015 Win64" .. && + cd ..\..\.. && + make clean + ) + - SET "FUZZERTEST=-T30s" + - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( + CD tests && + SET ZSTD=./zstd.exe && + sh -e playTests.sh --test-large-data && + fullbench.exe -i1 && + fullbench.exe -i1 -P0 && + fuzzer_VS2008_%PLATFORM%_Release.exe %FUZZERTEST% && + fuzzer_VS2010_%PLATFORM%_Release.exe %FUZZERTEST% && + fuzzer_VS2012_%PLATFORM%_Release.exe %FUZZERTEST% && + fuzzer_VS2013_%PLATFORM%_Release.exe %FUZZERTEST% && + fuzzer_VS2015_%PLATFORM%_Release.exe %FUZZERTEST% + ) + +- + version: 1.0.{build} + environment: + matrix: + - COMPILER: "gcc" + HOST: "mingw" + PLATFORM: "x64" + SCRIPT: "make allarch" + - COMPILER: "gcc" + HOST: "mingw" + PLATFORM: "x86" + SCRIPT: "make allarch" + - COMPILER: "clang" + HOST: "mingw" + PLATFORM: "x64" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "x64" + CONFIGURATION: "Debug" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "Win32" + CONFIGURATION: "Debug" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "x64" + CONFIGURATION: "Release" + - COMPILER: "visual" + HOST: "visual" + PLATFORM: "Win32" + CONFIGURATION: "Release" + + install: + - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION% + - SET PATH_ORIGINAL=%PATH% + - if [%HOST%]==[mingw] ( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 14 14:53:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66EDCDA3D04; Fri, 14 Jul 2017 14:53: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 mx1.freebsd.org (Postfix) with ESMTPS id E7D0B68CAF; Fri, 14 Jul 2017 14:53: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 v6EErEKe020367; Fri, 14 Jul 2017 14:53:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EErEpf020364; Fri, 14 Jul 2017 14:53:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707141453.v6EErEpf020364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 14 Jul 2017 14:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320986 - in head: share/man/man4 sys/dev/arcmsr X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 320986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:53:15 -0000 Author: delphij Date: Fri Jul 14 14:53:13 2017 New Revision: 320986 URL: https://svnweb.freebsd.org/changeset/base/320986 Log: Update arcmsr(4) to 1.40.00.00 in order to add support of ARC-1884 SATA RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 3 days Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Fri Jul 14 14:52:44 2017 (r320985) +++ head/share/man/man4/arcmsr.4 Fri Jul 14 14:53:13 2017 (r320986) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2015 +.Dd July 14, 2017 .Dt ARCMSR 4 .Os .Sh NAME @@ -147,6 +147,8 @@ ARC-1880 ARC-1882 .It ARC-1883 +.It +ARC-1884 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Fri Jul 14 14:52:44 2017 (r320985) +++ head/sys/dev/arcmsr/arcmsr.c Fri Jul 14 14:53:13 2017 (r320986) @@ -77,6 +77,7 @@ ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs ** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 +** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ****************************************************************************************** */ @@ -148,7 +149,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.30.00.00 2015-11-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.00 2017-07-11" #include /* ************************************************************************** @@ -185,6 +186,8 @@ static void arcmsr_rescanLun_cb(struct cam_periph *per static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); +static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); +void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); #endif @@ -376,6 +379,12 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, ARCMSR_HBDMU_ALL_INT_DISABLE); } break; + case ACB_ADAPTER_TYPE_E: { + /* disable all outbound interrupt */ + intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE); + } + break; } return (intmask_org); } @@ -418,6 +427,13 @@ static void arcmsr_enable_allintr( struct AdapterContr acb->outbound_int_enable = mask; } break; + case ACB_ADAPTER_TYPE_E: { + /* enable outbound Post Queue, outbound doorbell Interrupt */ + mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org & mask); + acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f; + } + break; } } /* @@ -503,6 +519,28 @@ static u_int8_t arcmsr_hbd_wait_msgint_ready(struct Ad return (FALSE); } /* +********************************************************************** +********************************************************************** +*/ +static u_int8_t arcmsr_hbe_wait_msgint_ready(struct AdapterControlBlock *acb) +{ + u_int32_t Index, read_doorbell; + u_int8_t Retries = 0x00; + + do { + for(Index=0; Index < 100; Index++) { + read_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + if((read_doorbell ^ acb->in_doorbell) & ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE) { + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0);/*clear interrupt*/ + acb->in_doorbell = read_doorbell; + return TRUE; + } + UDELAY(10000); + }/*max 1 seconds*/ + }while(Retries++ < 20);/*max 20 sec*/ + return (FALSE); +} +/* ************************************************************************ ************************************************************************ */ @@ -576,6 +614,25 @@ static void arcmsr_flush_hbd_cache(struct AdapterContr ************************************************************************ ************************************************************************ */ +static void arcmsr_flush_hbe_cache(struct AdapterControlBlock *acb) +{ + int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + do { + if(arcmsr_hbe_wait_msgint_ready(acb)) { + break; + } else { + retry_count--; + } + }while(retry_count != 0); +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -595,6 +652,10 @@ static void arcmsr_flush_adapter_cache(struct AdapterC arcmsr_flush_hbd_cache(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_flush_hbe_cache(acb); + } + break; } } /* @@ -715,6 +776,19 @@ static void arcmsr_abort_hbd_allcmd(struct AdapterCont ********************************************************************* ********************************************************************* */ +static void arcmsr_abort_hbe_allcmd(struct AdapterControlBlock *acb) +{ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_ABORT_CMD); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); + } +} +/* +********************************************************************* +********************************************************************* +*/ static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -734,6 +808,10 @@ static void arcmsr_abort_allcmd(struct AdapterControlB arcmsr_abort_hbd_allcmd(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_abort_hbe_allcmd(acb); + } + break; } } /* @@ -836,6 +914,9 @@ static void arcmsr_drain_donequeue(struct AdapterContr case ACB_ADAPTER_TYPE_D: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ break; + case ACB_ADAPTER_TYPE_E: + srb = acb->psrb_pool[flag_srb]; + break; case ACB_ADAPTER_TYPE_A: case ACB_ADAPTER_TYPE_B: default: @@ -938,6 +1019,10 @@ static void arcmsr_done4abort_postqueue(struct Adapter arcmsr_hbd_postqueue_isr(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_hbe_postqueue_isr(acb); + } + break; } } /* @@ -1149,6 +1234,15 @@ static void arcmsr_post_srb(struct AdapterControlBlock ARCMSR_LOCK_RELEASE(&acb->postDone_lock); } break; + case ACB_ADAPTER_TYPE_E: { + u_int32_t ccb_post_stamp, arc_cdb_size; + + arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; + ccb_post_stamp = (srb->smid | ((arc_cdb_size-1) >> 6)); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_high, 0); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); + } + break; } } /* @@ -1184,6 +1278,12 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_E: { + struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; + + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; + } + break; } return(qbuffer); } @@ -1220,6 +1320,12 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_E: { + struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; + + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; + } + break; } return(qbuffer); } @@ -1251,6 +1357,12 @@ static void arcmsr_iop_message_read(struct AdapterCont CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; + case ACB_ADAPTER_TYPE_E: { + /* let IOP know data has been read */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -1293,6 +1405,15 @@ static void arcmsr_iop_message_wrote(struct AdapterCon CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY); } break; + case ACB_ADAPTER_TYPE_E: { + /* + ** push inbound doorbell tell iop, driver data write ok + ** and wait reply on next hwinterrupt for next Qbuffer post + */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_WRITE_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -1352,6 +1473,20 @@ static void arcmsr_stop_hbd_bgrb(struct AdapterControl ************************************************************************ ************************************************************************ */ +static void arcmsr_stop_hbe_bgrb(struct AdapterControlBlock *acb) +{ + acb->acb_flags &= ~ACB_F_MSG_START_BGRB; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); + } +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -1371,6 +1506,10 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterCon arcmsr_stop_hbd_bgrb(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_stop_hbe_bgrb(acb); + } + break; } } /* @@ -1446,7 +1585,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || + (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1541,7 +1681,8 @@ static void arcmsr_Write_data_2iop_wqbuffer(struct Ada u_int8_t *iop_data; int32_t allxfer_len=0; - if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || + (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1694,6 +1835,14 @@ static void arcmsr_dr_handle(struct AdapterControlBloc devicemap += 4; } break; + case ACB_ADAPTER_TYPE_E: + devicemap = offsetof(struct HBE_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; } if(acb->acb_flags & ACB_F_BUS_HANG_ON) @@ -1792,6 +1941,18 @@ static void arcmsr_hbd_message_isr(struct AdapterContr ************************************************************************** ************************************************************************** */ +static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { + u_int32_t outbound_message; + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) + arcmsr_dr_handle( acb ); +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { u_int32_t doorbell_status; @@ -1876,6 +2037,35 @@ static void arcmsr_hbd_doorbell_isr(struct AdapterCont ************************************************************************** ************************************************************************** */ +static void arcmsr_hbe_doorbell_isr(struct AdapterControlBlock *acb) +{ + u_int32_t doorbell_status, in_doorbell; + + /* + ******************************************************************* + ** Maybe here we need to check wrqbuffer_lock is lock or not + ** DOORBELL: din! don! + ** check if there are any mail need to pack from firmware + ******************************************************************* + */ + in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /* clear doorbell interrupt */ + doorbell_status = in_doorbell ^ acb->in_doorbell; + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK) { + arcmsr_iop2drv_data_wrote_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK) { + arcmsr_iop2drv_data_read_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE) { + arcmsr_hbe_message_isr(acb); /* messenger of "driver to iop commands" */ + } + acb->in_doorbell = in_doorbell; +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) { u_int32_t flag_srb; @@ -2013,6 +2203,34 @@ static void arcmsr_hbd_postqueue_isr(struct AdapterCon CHIP_REG_READ32(HBD_MessageUnit, 0, outboundlist_interrupt_cause); /*Dummy ioread32 to force pci flush */ } /* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb) +{ + u_int16_t error; + uint32_t doneq_index; + uint16_t cmdSMID; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + doneq_index = acb->doneq_index; + while ((CHIP_REG_READ32(HBE_MessageUnit, 0, reply_post_producer_index) & 0xFFFF) != doneq_index) { + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + arcmsr_drain_donequeue(acb, (u_int32_t)cmdSMID, error); + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + } + acb->doneq_index = doneq_index; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_consumer_index, doneq_index); +} +/* ********************************************************************** ********************************************************************** */ @@ -2143,6 +2361,37 @@ static void arcmsr_handle_hbd_isr( struct AdapterContr // CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable); } /* +********************************************************************** +********************************************************************** +*/ +static void arcmsr_handle_hbe_isr( struct AdapterControlBlock *acb) +{ + u_int32_t host_interrupt_status; + /* + ********************************************* + ** check outbound intstatus + ********************************************* + */ + host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status) & + (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR); + if(!host_interrupt_status) { + /*it must be share irq*/ + return; + } + do { + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbe_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbe_postqueue_isr(acb); + } + host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); +} +/* ****************************************************************************** ****************************************************************************** */ @@ -2161,6 +2410,9 @@ static void arcmsr_interrupt(struct AdapterControlBloc case ACB_ADAPTER_TYPE_D: arcmsr_handle_hbd_isr(acb); break; + case ACB_ADAPTER_TYPE_E: + arcmsr_handle_hbe_isr(acb); + break; default: printf("arcmsr%d: interrupt service," " unknown adapter type =%d\n", acb->pci_unit, acb->adapter_type); @@ -2205,6 +2457,12 @@ static void arcmsr_polling_devmap(void *arg) case ACB_ADAPTER_TYPE_D: CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; + + case ACB_ADAPTER_TYPE_E: + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + break; } if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0) @@ -2907,6 +3165,7 @@ static void arcmsr_action(struct cam_sim *psim, union else cpi->base_transfer_speed = 300000; if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1884) || (acb->vendor_device_id == PCIDevVenIDARC1680) || (acb->vendor_device_id == PCIDevVenIDARC1214)) { @@ -2991,6 +3250,7 @@ static void arcmsr_action(struct cam_sim *psim, union cts->protocol = PROTO_SCSI; if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1884) || (acb->vendor_device_id == PCIDevVenIDARC1680) || (acb->vendor_device_id == PCIDevVenIDARC1214)) { @@ -3150,6 +3410,20 @@ static void arcmsr_start_hbd_bgrb(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_start_hbe_bgrb(struct AdapterControlBlock *acb) +{ + acb->acb_flags |= ACB_F_MSG_START_BGRB; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_START_BGRB); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); + } +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -3165,6 +3439,9 @@ static void arcmsr_start_adapter_bgrb(struct AdapterCo case ACB_ADAPTER_TYPE_D: arcmsr_start_hbd_bgrb(acb); break; + case ACB_ADAPTER_TYPE_E: + arcmsr_start_hbe_bgrb(acb); + break; } } /* @@ -3388,8 +3665,63 @@ polling_ccb_retry: } /* ********************************************************************** +** ********************************************************************** */ +static void arcmsr_polling_hbe_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) +{ + struct CommandControlBlock *srb; + u_int32_t poll_srb_done=0, poll_count=0, doneq_index; + u_int16_t error, cmdSMID; + +polling_ccb_retry: + poll_count++; + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + while(1) { + doneq_index = acb->doneq_index; + if((CHIP_REG_READ32(HBE_MessageUnit, 0, reply_post_producer_index) & 0xFFFF) == doneq_index) { + if(poll_srb_done) { + break;/*chip FIFO no ccb for completion already*/ + } else { + UDELAY(25000); + if ((poll_count > 100) && (poll_srb != NULL)) { + break; + } + if (acb->srboutstandingcount == 0) { + break; + } + goto polling_ccb_retry; + } + } + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + acb->doneq_index = doneq_index; + srb = acb->psrb_pool[cmdSMID]; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + if (poll_srb != NULL) + poll_srb_done = (srb == poll_srb) ? 1:0; + if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { + if(srb->srb_state == ARCMSR_SRB_ABORTED) { + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); + srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; + arcmsr_srb_complete(srb, 1); + continue; + } + printf("arcmsr%d: polling get an illegal srb command done srb='%p'srboutstandingcount=%d \n" + , acb->pci_unit, srb, acb->srboutstandingcount); + continue; + } + arcmsr_report_srb_state(acb, srb, error); + } /*drain reply FIFO*/ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_producer_index, doneq_index); +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) { switch (acb->adapter_type) { @@ -3409,6 +3741,10 @@ static void arcmsr_polling_srbdone(struct AdapterContr arcmsr_polling_hbd_srbdone(acb, poll_srb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_polling_hbe_srbdone(acb, poll_srb); + } + break; } } /* @@ -3615,6 +3951,58 @@ static void arcmsr_get_hbd_config(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_get_hbe_config(struct AdapterControlBlock *acb) +{ + char *acb_firm_model = acb->firm_model; + char *acb_firm_version = acb->firm_version; + char *acb_device_map = acb->device_map; + size_t iop_firm_model = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_MODEL_OFFSET]); /*firm_model,15,60-67*/ + size_t iop_firm_version = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/ + size_t iop_device_map = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + int i; + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); + } + + i = 0; + while(i < 8) { + *acb_firm_model = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_model+i); + /* 8 bytes firm_model, 15, 60-67*/ + acb_firm_model++; + i++; + } + i = 0; + while(i < 16) { + *acb_firm_version = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_version+i); + /* 16 bytes firm_version, 17, 68-83*/ + acb_firm_version++; + i++; + } + i = 0; + while(i < 16) { + *acb_device_map = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_device_map+i); + acb_device_map++; + i++; + } + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); + acb->firm_request_len = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ + acb->firm_numbers_queue = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ + acb->firm_sdram_size = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ + acb->firm_ide_channels = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ + acb->firm_cfg_version = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -3634,6 +4022,10 @@ static void arcmsr_get_firmware_spec(struct AdapterCon arcmsr_get_hbd_config(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_get_hbe_config(acb); + } + break; } } /* @@ -3695,6 +4087,18 @@ static void arcmsr_wait_firmware_ready( struct Adapter } } break; + case ACB_ADAPTER_TYPE_E: { + while ((CHIP_REG_READ32(HBE_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK) == 0) + { + if (timeout++ > 4000) /* (4000*15)/1000 = 60 sec */ + { + printf( "arcmsr%d:timed out waiting for firmware ready\n", acb->pci_unit); + return; + } + UDELAY(15000); /* wait 15 milli-seconds */ + } + } + break; } } /* @@ -3738,6 +4142,14 @@ static void arcmsr_clear_doorbell_queue_buffer( struct } break; + case ACB_ADAPTER_TYPE_E: { + /* empty doorbell Qbuffer if door bell ringed */ + acb->in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear doorbell interrupt */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -3844,6 +4256,27 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont } } break; + case ACB_ADAPTER_TYPE_E: { + u_int32_t cdb_phyaddr_lo32; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + offsetof(struct CommandControlBlock, arcmsr_cdb); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[1], ARCMSR_SIGNATURE_1884); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[2], cdb_phyaddr_lo32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[3], srb_phyaddr_hi32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[4], SRB_SIZE); + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + ARCMSR_SRBS_POOL_SIZE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[5], cdb_phyaddr_lo32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[6], srb_phyaddr_hi32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[7], COMPLETION_Q_POOL_SIZE); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_SET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'set srb high part physical address' timeout \n", acb->pci_unit); + return FALSE; + } + } + break; } return (TRUE); } @@ -3853,21 +4286,14 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont */ static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb) { - switch (acb->adapter_type) + if (acb->adapter_type == ACB_ADAPTER_TYPE_B) { - case ACB_ADAPTER_TYPE_A: - case ACB_ADAPTER_TYPE_C: - case ACB_ADAPTER_TYPE_D: - break; - case ACB_ADAPTER_TYPE_B: { - struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ACTIVE_EOI_MODE); - if(!arcmsr_hbb_wait_msgint_ready(acb)) { - printf( "arcmsr%d: 'iop enable eoi mode' timeout \n", acb->pci_unit); - return; - } + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ACTIVE_EOI_MODE); + if(!arcmsr_hbb_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'iop enable eoi mode' timeout \n", acb->pci_unit); + return; } - break; } } /* @@ -3913,7 +4339,8 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg " srb dmamap bus_dmamap_create error\n", acb->pci_unit); return; } - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D)) + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) + || (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { srb_tmp->cdb_phyaddr_low = srb_phyaddr; srb_tmp->cdb_phyaddr_high = (u_int32_t)((srb_phyaddr >> 16) >> 16); @@ -3921,10 +4348,12 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg else srb_tmp->cdb_phyaddr_low = srb_phyaddr >> 5; srb_tmp->acb = acb; + srb_tmp->smid = i << 16; acb->srbworkingQ[i] = acb->psrb_pool[i] = srb_tmp; srb_phyaddr = srb_phyaddr + SRB_SIZE; srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp + SRB_SIZE); } + acb->pCompletionQ = (pCompletion_Q)srb_tmp; acb->vir2phy_offset = (unsigned long)srb_tmp - (unsigned long)srb_phyaddr; } /* @@ -3992,6 +4421,12 @@ static u_int32_t arcmsr_initialize(device_t dev) max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } break; + case PCIDevVenIDARC1884: + acb->adapter_type = ACB_ADAPTER_TYPE_E; + acb->adapter_bus_speed = ACB_BUS_SPEED_12G; + max_coherent_size = ARCMSR_SRBS_POOL_SIZE + COMPLETION_Q_POOL_SIZE; + acb->completionQ_entry = COMPLETION_Q_POOL_SIZE / sizeof(struct deliver_completeQ); + break; case PCIDevVenIDARC1214: { acb->adapter_type = ACB_ADAPTER_TYPE_D; acb->adapter_bus_speed = ACB_BUS_SPEED_6G; @@ -4140,141 +4575,177 @@ static u_int32_t arcmsr_initialize(device_t dev) pci_write_config(dev, PCIR_COMMAND, pci_command, 2); switch(acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { - u_int32_t rid0 = PCIR_BAR(0); - vm_offset_t mem_base0; + u_int32_t rid0 = PCIR_BAR(0); + vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); - if(acb->sys_res_arcmsr[0] == NULL) { - arcmsr_free_resource(acb); - printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); - return ENOMEM; - } - if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); - return ENXIO; - } - mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); - if(mem_base0 == 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); - return ENXIO; - } - acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); - acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); - acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); + if(acb->sys_res_arcmsr[0] == NULL) { + arcmsr_free_resource(acb); + printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); + return ENOMEM; } + if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); + return ENXIO; + } + mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); + if(mem_base0 == 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); + return ENXIO; + } + acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); + acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); + acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->rid = 0; + } break; case ACB_ADAPTER_TYPE_B: { - struct HBB_MessageUnit *phbbmu; - struct CommandControlBlock *freesrb; - u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) }; - vm_offset_t mem_base[]={0,0}; - u_long size; - if (vendor_dev_id == PCIDevVenIDARC1203) - size = sizeof(struct HBB_DOORBELL_1203); - else - size = sizeof(struct HBB_DOORBELL); - for(i=0; i < 2; i++) { - if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } - if(acb->sys_res_arcmsr[i] == NULL) { - arcmsr_free_resource(acb); - printf("arcmsr%d: bus_alloc_resource %d failure!\n", device_get_unit(dev), i); - return ENOMEM; - } - if(rman_get_start(acb->sys_res_arcmsr[i]) <= 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_start %d failure!\n", device_get_unit(dev), i); - return ENXIO; - } - mem_base[i] = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[i]); - if(mem_base[i] == 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_virtual %d failure!\n", device_get_unit(dev), i); - return ENXIO; - } - acb->btag[i] = rman_get_bustag(acb->sys_res_arcmsr[i]); - acb->bhandle[i] = rman_get_bushandle(acb->sys_res_arcmsr[i]); - } - freesrb = (struct CommandControlBlock *)acb->uncacheptr; - acb->pmu = (struct MessageUnit_UNION *)((unsigned long)freesrb+ARCMSR_SRBS_POOL_SIZE); - phbbmu = (struct HBB_MessageUnit *)acb->pmu; - phbbmu->hbb_doorbell = (struct HBB_DOORBELL *)mem_base[0]; - phbbmu->hbb_rwbuffer = (struct HBB_RWBUFFER *)mem_base[1]; - if (vendor_dev_id == PCIDevVenIDARC1203) { - phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell); - phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell_mask); - phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell); - phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell_mask); + struct HBB_MessageUnit *phbbmu; + struct CommandControlBlock *freesrb; + u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) }; + vm_offset_t mem_base[]={0,0}; + u_long size; + if (vendor_dev_id == PCIDevVenIDARC1203) + size = sizeof(struct HBB_DOORBELL_1203); + else + size = sizeof(struct HBB_DOORBELL); + for(i=0; i < 2; i++) { + if(i == 0) { + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } else { - phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL, drv2iop_doorbell); - phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL, drv2iop_doorbell_mask); - phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL, iop2drv_doorbell); - phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL, iop2drv_doorbell_mask); + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } - } - break; - case ACB_ADAPTER_TYPE_C: { - u_int32_t rid0 = PCIR_BAR(1); - vm_offset_t mem_base0; - - acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); - if(acb->sys_res_arcmsr[0] == NULL) { + if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); - printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); + printf("arcmsr%d: bus_alloc_resource %d failure!\n", device_get_unit(dev), i); return ENOMEM; } - if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { + if(rman_get_start(acb->sys_res_arcmsr[i]) <= 0) { arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); + printf("arcmsr%d: rman_get_start %d failure!\n", device_get_unit(dev), i); return ENXIO; } - mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); - if(mem_base0 == 0) { + mem_base[i] = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[i]); + if(mem_base[i] == 0) { arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); + printf("arcmsr%d: rman_get_virtual %d failure!\n", device_get_unit(dev), i); return ENXIO; } - acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); - acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); - acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->btag[i] = rman_get_bustag(acb->sys_res_arcmsr[i]); + acb->bhandle[i] = rman_get_bushandle(acb->sys_res_arcmsr[i]); } + freesrb = (struct CommandControlBlock *)acb->uncacheptr; + acb->pmu = (struct MessageUnit_UNION *)((unsigned long)freesrb+ARCMSR_SRBS_POOL_SIZE); + phbbmu = (struct HBB_MessageUnit *)acb->pmu; + phbbmu->hbb_doorbell = (struct HBB_DOORBELL *)mem_base[0]; + phbbmu->hbb_rwbuffer = (struct HBB_RWBUFFER *)mem_base[1]; + if (vendor_dev_id == PCIDevVenIDARC1203) { + phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell); + phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell_mask); + phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell); + phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell_mask); + } else { + phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL, drv2iop_doorbell); + phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL, drv2iop_doorbell_mask); + phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL, iop2drv_doorbell); + phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL, iop2drv_doorbell_mask); + } + acb->rid = 0; + } break; + case ACB_ADAPTER_TYPE_C: { + u_int32_t rid0 = PCIR_BAR(1); + vm_offset_t mem_base0; + + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); + if(acb->sys_res_arcmsr[0] == NULL) { + arcmsr_free_resource(acb); + printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); + return ENOMEM; + } + if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); + return ENXIO; + } + mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); + if(mem_base0 == 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); + return ENXIO; + } + acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); + acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); + acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->rid = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 14 14:55:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5DA0DA3DCE; Fri, 14 Jul 2017 14:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E55968E3E; Fri, 14 Jul 2017 14:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EEtZpH020530; Fri, 14 Jul 2017 14:55:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EEtZrT020523; Fri, 14 Jul 2017 14:55:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707141455.v6EEtZrT020523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 14 Jul 2017 14:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320987 - in head/contrib/zstd: . contrib/pzstd doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWrapper/examples X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/contrib/zstd: . contrib/pzstd doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWrapper/examples X-SVN-Commit-Revision: 320987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:55:37 -0000 Author: bapt Date: Fri Jul 14 14:55:34 2017 New Revision: 320987 URL: https://svnweb.freebsd.org/changeset/base/320987 Log: Update zstd to 1.3.0 Modified: head/contrib/zstd/Makefile head/contrib/zstd/NEWS head/contrib/zstd/README.md head/contrib/zstd/appveyor.yml head/contrib/zstd/contrib/pzstd/Pzstd.cpp head/contrib/zstd/doc/zstd_manual.html head/contrib/zstd/examples/Makefile head/contrib/zstd/lib/Makefile head/contrib/zstd/lib/common/bitstream.h head/contrib/zstd/lib/common/error_private.c head/contrib/zstd/lib/common/huf.h head/contrib/zstd/lib/common/mem.h head/contrib/zstd/lib/common/pool.c head/contrib/zstd/lib/common/pool.h head/contrib/zstd/lib/common/threading.c head/contrib/zstd/lib/common/zstd_common.c head/contrib/zstd/lib/common/zstd_errors.h head/contrib/zstd/lib/common/zstd_internal.h head/contrib/zstd/lib/compress/huf_compress.c head/contrib/zstd/lib/compress/zstd_compress.c head/contrib/zstd/lib/compress/zstd_opt.h head/contrib/zstd/lib/compress/zstdmt_compress.c head/contrib/zstd/lib/compress/zstdmt_compress.h head/contrib/zstd/lib/decompress/huf_decompress.c head/contrib/zstd/lib/decompress/zstd_decompress.c head/contrib/zstd/lib/dictBuilder/cover.c head/contrib/zstd/lib/dictBuilder/zdict.c head/contrib/zstd/lib/dictBuilder/zdict.h head/contrib/zstd/lib/legacy/zstd_v04.c head/contrib/zstd/lib/legacy/zstd_v05.c head/contrib/zstd/lib/legacy/zstd_v06.c head/contrib/zstd/lib/legacy/zstd_v07.c head/contrib/zstd/lib/zstd.h head/contrib/zstd/programs/Makefile head/contrib/zstd/programs/README.md head/contrib/zstd/programs/bench.c head/contrib/zstd/programs/dibio.c head/contrib/zstd/programs/dibio.h head/contrib/zstd/programs/fileio.c head/contrib/zstd/programs/fileio.h head/contrib/zstd/programs/util.h head/contrib/zstd/programs/zstd.1 head/contrib/zstd/programs/zstd.1.md head/contrib/zstd/programs/zstdcli.c head/contrib/zstd/tests/Makefile head/contrib/zstd/tests/datagencli.c head/contrib/zstd/tests/decodecorpus.c head/contrib/zstd/tests/fullbench.c head/contrib/zstd/tests/fuzzer.c head/contrib/zstd/tests/paramgrill.c head/contrib/zstd/tests/playTests.sh head/contrib/zstd/tests/roundTripCrash.c head/contrib/zstd/tests/symbols.c head/contrib/zstd/tests/zstreamtest.c head/contrib/zstd/zlibWrapper/Makefile head/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c Directory Properties: head/contrib/zstd/ (props changed) Modified: head/contrib/zstd/Makefile ============================================================================== --- head/contrib/zstd/Makefile Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/Makefile Fri Jul 14 14:55:34 2017 (r320987) @@ -108,7 +108,7 @@ clean: #------------------------------------------------------------------------------ # make install is validated only for Linux, OSX, Hurd and some BSD targets #------------------------------------------------------------------------------ -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD)) +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) HOST_OS = POSIX CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON @@ -117,30 +117,36 @@ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUI list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs -.PHONY: install uninstall travis-install clangtest gpptest armtest usan asan uasan +.PHONY: install clangtest gpptest armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ +.PHONY: uninstall uninstall: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ +.PHONY: travis-install travis-install: $(MAKE) install PREFIX=~/install_test_dir +.PHONY: gppbuild gppbuild: clean g++ -v CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +.PHONY: gcc5build gcc5build: clean gcc-5 -v CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" +.PHONY: gcc6build gcc6build: clean gcc-6 -v CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" +.PHONY: clangbuild clangbuild: clean clang -v CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" @@ -224,10 +230,10 @@ asan-%: clean LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* msan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" # datagen.c fails this test for no obvious reason + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason msan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* asan32: clean $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" @@ -236,10 +242,11 @@ uasan: clean $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" uasan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-Og -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* tsan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + apt-install: sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) Modified: head/contrib/zstd/NEWS ============================================================================== --- head/contrib/zstd/NEWS Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/NEWS Fri Jul 14 14:55:34 2017 (r320987) @@ -1,3 +1,18 @@ +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + v1.2.0 cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell Modified: head/contrib/zstd/README.md ============================================================================== --- head/contrib/zstd/README.md Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/README.md Fri Jul 14 14:55:34 2017 (r320987) @@ -6,11 +6,18 @@ and a command line utility producing and decoding `.zs For other programming languages, you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages). -|Branch |Status | -|------------|---------| -|master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) | -|dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/facebook/zstd) | +| dev branch status | +|-------------------| +| [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] +[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" +[travisLink]: https://travis-ci.org/facebook/zstd +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0 +[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" +[CircleLink]: https://circleci.com/gh/facebook/zstd + + As a reference, several fast compression algorithms were tested and compared on a server running Linux Debian (`Linux version 4.8.0-1-amd64`), with a Core i7-6700K CPU @ 4.0GHz, @@ -60,11 +67,11 @@ Previous charts provide results applicable to typical The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon. To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data. -Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. +Training Zstandard is achieved by providing it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. Using this dictionary, the compression ratio achievable on small data improves dramatically. The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users). -It consists of roughly 10K records weighting about 1KB each. +It consists of roughly 10K records weighing about 1KB each. Compression Ratio | Compression Speed | Decompression Speed ------------------|-------------------|-------------------- Modified: head/contrib/zstd/appveyor.yml ============================================================================== --- head/contrib/zstd/appveyor.yml Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/appveyor.yml Fri Jul 14 14:55:34 2017 (r320987) @@ -30,12 +30,6 @@ SCRIPT: "" TEST: "cmake" - - COMPILER: "gcc" - HOST: "mingw" - PLATFORM: "x64" - SCRIPT: "" - TEST: "pzstd" - - COMPILER: "visual" HOST: "visual" PLATFORM: "x64" @@ -88,12 +82,10 @@ ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true] lib\dll\example\build_package.bat && make -C programs DEBUGFLAGS= clean zstd && - cp programs\zstd.exe zstd_%PLATFORM%.exe && - appveyor PushArtifact zstd_%PLATFORM%.exe && - cp programs\zstd.exe bin\zstd.exe && - make -C programs DEBUGFLAGS= clean zstdmt && - cp programs\zstd.exe bin\zstdmt.exe && - cd bin\ && 7z a -tzip zstd-win-release-%PLATFORM%.zip * && + cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe && + appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip && + cp zstd.exe ..\bin\zstd.exe && + cd ..\bin\ && 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * && appveyor PushArtifact zstd-win-release-%PLATFORM%.zip ) ) @@ -158,13 +150,6 @@ cmake -G "Visual Studio 14 2015 Win64" .. && cd ..\..\.. && make clean - ) - - if [%TEST%]==[pzstd] ( - make -C contrib\pzstd googletest-mingw64 && - make -C contrib\pzstd pzstd.exe && - make -C contrib\pzstd tests && - make -C contrib\pzstd check && - make -C contrib\pzstd clean ) - SET "FUZZERTEST=-T30s" - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( Modified: head/contrib/zstd/contrib/pzstd/Pzstd.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/Pzstd.cpp Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/contrib/pzstd/Pzstd.cpp Fri Jul 14 14:55:34 2017 (r320987) @@ -585,7 +585,10 @@ std::uint64_t writeFile( std::uint64_t bytesWritten = 0; std::shared_ptr out; // Grab the output queue for each decompression job (in order). - while (outs.pop(out) && !errorHolder.hasError()) { + while (outs.pop(out)) { + if (errorHolder.hasError()) { + continue; + } if (!decompress) { // If we are compressing and want to write skippable frames we can't // start writing before compression is done because we need to know the Modified: head/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/contrib/zstd/doc/zstd_manual.html Fri Jul 14 14:53:13 2017 (r320986) +++ head/contrib/zstd/doc/zstd_manual.html Fri Jul 14 14:55:34 2017 (r320987) @@ -1,10 +1,10 @@ -zstd 1.2.0 Manual +zstd 1.3.0 Manual -

zstd 1.2.0 Manual

+

zstd 1.3.0 Manual


Contents

    @@ -13,14 +13,14 @@
  1. Simple API
  2. Explicit memory management
  3. Simple dictionary API
  4. -
  5. Fast dictionary API
  6. +
  7. Bulk processing dictionary API
  8. Streaming
  9. Streaming compression - HowTo
  10. Streaming decompression - HowTo
  11. START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
  12. Advanced types
  13. -
  14. Compressed size functions
  15. -
  16. Decompressed size functions
  17. +
  18. Frame size functions
  19. +
  20. Context memory usage
  21. Advanced compression functions
  22. Advanced decompression functions
  23. Advanced streaming functions
  24. @@ -31,26 +31,27 @@

Introduction

-  zstd, short for Zstandard, is a fast lossless compression algorithm, targeting real-time compression scenarios
-  at zlib-level and better compression ratios. The zstd compression library provides in-memory compression and
-  decompression functions. The library supports compression levels from 1 up to ZSTD_maxCLevel() which is 22.
+  zstd, short for Zstandard, is a fast lossless compression algorithm,
+  targeting real-time compression scenarios at zlib-level and better compression ratios.
+  The zstd compression library provides in-memory compression and decompression functions.
+  The library supports compression levels from 1 up to ZSTD_maxCLevel() which is currently 22.
   Levels >= 20, labeled `--ultra`, should be used with caution, as they require more memory.
   Compression can be done in:
     - a single step (described as Simple API)
     - a single step, reusing a context (described as Explicit memory management)
     - unbounded multiple steps (described as Streaming compression)
-  The compression ratio achievable on small data can be highly improved using compression with a dictionary in:
+  The compression ratio achievable on small data can be highly improved using a dictionary in:
     - a single step (described as Simple dictionary API)
     - a single step, reusing a dictionary (described as Fast dictionary API)
 
   Advanced experimental functions can be accessed using #define ZSTD_STATIC_LINKING_ONLY before including zstd.h.
-  These APIs shall never be used with a dynamic library.
+  Advanced experimental APIs shall never be used with a dynamic library.
   They are not "stable", their definition may change in the future. Only static linking is allowed.
 

Version


 
-
unsigned ZSTD_versionNumber(void);   /**< library version number; to be used when checking dll version */
+
unsigned ZSTD_versionNumber(void);   /**< useful to check dll version */
 

Simple API


 
@@ -66,28 +67,24 @@
 
size_t ZSTD_decompress( void* dst, size_t dstCapacity,
                   const void* src, size_t compressedSize);
 

`compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames. - `dstCapacity` is an upper bound of originalSize. + `dstCapacity` is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. @return : the number of bytes decompressed into `dst` (<= `dstCapacity`), or an errorCode if it fails (which can be tested using ZSTD_isError()).


unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
-

NOTE: This function is planned to be obsolete, in favour of ZSTD_getFrameContentSize. - ZSTD_getFrameContentSize functions the same way, returning the decompressed size of a single - frame, but distinguishes empty frames from frames with an unknown size, or errors. +

NOTE: This function is planned to be obsolete, in favor of ZSTD_getFrameContentSize(). + ZSTD_getFrameContentSize() works the same way, + returning the decompressed size of a single frame, + but distinguishes empty frames from frames with an unknown size, or errors. - Additionally, ZSTD_findDecompressedSize can be used instead. It can handle multiple - concatenated frames in one buffer, and so is more general. - As a result however, it requires more computation and entire frames to be passed to it, - as opposed to ZSTD_getFrameContentSize which requires only a single frame's header. - 'src' is the start of a zstd compressed frame. @return : content size to be decompressed, as a 64-bits value _if known_, 0 otherwise. - note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. + note 1 : decompressed size is an optional field, it may not be present, typically in streaming mode. When `return==0`, data to decompress could be any size. In which case, it's necessary to use streaming mode to decompress data. - Optionally, application can still use ZSTD_decompress() while relying on implied limits. + Optionally, application can use ZSTD_decompress() while relying on implied limits. (For example, data may be necessarily cut into blocks <= 16 KB). note 2 : decompressed size is always present when compression is done with ZSTD_compress() note 3 : decompressed size can be very large (64-bits value), @@ -96,7 +93,7 @@ note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. Always ensure result fits within application's authorized limits. Each application can set its own limits. - note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameParams() to know more. + note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameHeader() to know more.


Helper functions

int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
@@ -114,20 +111,26 @@ const char* ZSTD_getErrorName(size_t code);     /*
 ZSTD_CCtx* ZSTD_createCCtx(void);
 size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);
 

-
size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
+
size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
+                         void* dst, size_t dstCapacity,
+                   const void* src, size_t srcSize,
+                         int compressionLevel);
 

Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()).


Decompression context

  When decompressing many times,
-  it is recommended to allocate a context just once, and re-use it for each successive compression operation.
+  it is recommended to allocate a context only once,
+  and re-use it for each successive compression operation.
   This will make workload friendlier for system's memory.
-  Use one context per thread for parallel execution in multi-threaded environments. 
+  Use one context per thread for parallel execution. 
 
typedef struct ZSTD_DCtx_s ZSTD_DCtx;
 ZSTD_DCtx* ZSTD_createDCtx(void);
 size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
 

-
size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-

Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()). +

size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
+                           void* dst, size_t dstCapacity,
+                     const void* src, size_t srcSize);
+

Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx())


Simple dictionary API


@@ -137,32 +140,33 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
                          const void* src, size_t srcSize,
                          const void* dict,size_t dictSize,
                                int compressionLevel);
-

Compression using a predefined Dictionary (see dictBuilder/zdict.h). - Note : This function loads the dictionary, resulting in significant startup delay. - Note : When `dict == NULL || dictSize < 8` no dictionary is used. +

Compression using a predefined Dictionary (see dictBuilder/zdict.h). + Note : This function loads the dictionary, resulting in significant startup delay. + Note : When `dict == NULL || dictSize < 8` no dictionary is used.


size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize);
-

Decompression using a predefined Dictionary (see dictBuilder/zdict.h). - Dictionary must be identical to the one used during compression. - Note : This function loads the dictionary, resulting in significant startup delay. - Note : When `dict == NULL || dictSize < 8` no dictionary is used. +

Decompression using a predefined Dictionary (see dictBuilder/zdict.h). + Dictionary must be identical to the one used during compression. + Note : This function loads the dictionary, resulting in significant startup delay. + Note : When `dict == NULL || dictSize < 8` no dictionary is used.


-

Fast dictionary API


+

Bulk processing dictionary API


 
-
ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize, int compressionLevel);
-

When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. - ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. - ZSTD_CDict can be created once and used by multiple threads concurrently, as its usage is read-only. - `dictBuffer` can be released after ZSTD_CDict creation, as its content is copied within CDict +

ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
+                             int compressionLevel);
+

When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. + ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. + ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. + `dictBuffer` can be released after ZSTD_CDict creation, since its content is copied within CDict


size_t      ZSTD_freeCDict(ZSTD_CDict* CDict);
-

Function frees memory allocated by ZSTD_createCDict(). +

Function frees memory allocated by ZSTD_createCDict().


size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
@@ -176,20 +180,20 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
 


ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);
-

Create a digested dictionary, ready to start decompression operation without startup delay. - dictBuffer can be released after DDict creation, as its content is copied inside DDict +

Create a digested dictionary, ready to start decompression operation without startup delay. + dictBuffer can be released after DDict creation, as its content is copied inside DDict


size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);
-

Function frees memory allocated with ZSTD_createDDict() +

Function frees memory allocated with ZSTD_createDDict()


size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                   void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize,
                             const ZSTD_DDict* ddict);
-

Decompression using a digested Dictionary. - Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times. +

Decompression using a digested Dictionary. + Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times.


Streaming


@@ -236,14 +240,18 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
   ZSTD_endStream() instructs to finish a frame.
   It will perform a flush and write frame epilogue.
   The epilogue is required for decoders to consider a frame completed.
-  Similar to ZSTD_flushStream(), it may not be able to flush the full content if `output->size` is too small.
+  ZSTD_endStream() may not be able to flush full data if `output->size` is too small.
   In which case, call again ZSTD_endStream() to complete the flush.
-  @return : nb of bytes still present within internal buffer (0 if it's empty, hence compression completed)
+  @return : 0 if frame fully completed and fully flushed,
+             or >0 if some data is still present within internal buffer
+                  (value is minimum size estimation for remaining data to flush, but it could be more)
             or an error code, which can be tested using ZSTD_isError().
 
  
 
+
typedef ZSTD_CCtx ZSTD_CStream;  /**< CCtx and CStream are now effectively same object (>= v1.3.0) */
+

ZSTD_CStream management functions

ZSTD_CStream* ZSTD_createCStream(void);
 size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
 

@@ -277,6 +285,8 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffe
+
typedef ZSTD_DCtx ZSTD_DStream;  /**< DCtx and DStream are now effectively same object (>= v1.3.0) */
+

ZSTD_DStream management functions

ZSTD_DStream* ZSTD_createDStream(void);
 size_t ZSTD_freeDStream(ZSTD_DStream* zds);
 

@@ -296,7 +306,8 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o

Advanced types


 
-
typedef enum { ZSTD_fast, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD_btopt, ZSTD_btopt2 } ZSTD_strategy;   /* from faster to stronger */
+
typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
+               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;   /* from faster to stronger */
 

typedef struct {
     unsigned windowLog;      /**< largest match distance : larger == more compression, more memory needed during decompression */
@@ -319,68 +330,141 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
     ZSTD_frameParameters fParams;
 } ZSTD_parameters;
 

+
typedef struct {
+    unsigned long long frameContentSize;
+    size_t windowSize;
+    unsigned dictID;
+    unsigned checksumFlag;
+} ZSTD_frameHeader;
+

Custom memory allocation functions

typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
 typedef void  (*ZSTD_freeFunction) (void* opaque, void* address);
 typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+/* use this constant to defer to stdlib's functions */
+static const ZSTD_customMem ZSTD_defaultCMem = { NULL, NULL, NULL };
 

-

Compressed size functions


+

Frame size functions


 
 
size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
 

`src` should point to the start of a ZSTD encoded frame or skippable frame `srcSize` must be at least as large as the frame - @return : the compressed size of the frame pointed to by `src`, suitable to pass to - `ZSTD_decompress` or similar, or an error code if given invalid input. + @return : the compressed size of the frame pointed to by `src`, + suitable to pass to `ZSTD_decompress` or similar, + or an error code if given invalid input.


-

Decompressed size functions


-
-
unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
-

`src` should point to the start of a ZSTD encoded frame - `srcSize` must be at least as large as the frame header. A value greater than or equal - to `ZSTD_frameHeaderSize_max` is guaranteed to be large enough in all cases. - @return : decompressed size of the frame pointed to be `src` if known, otherwise - - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined - - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) +

#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
+#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
+unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
+

`src` should point to the start of a ZSTD encoded frame. + `srcSize` must be at least as large as the frame header. + A value >= `ZSTD_frameHeaderSize_max` is guaranteed to be large enough. + @return : - decompressed size of the frame pointed to be `src` if known + - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)


unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
-

`src` should point the start of a series of ZSTD encoded and/or skippable frames - `srcSize` must be the _exact_ size of this series +

`src` should point the start of a series of ZSTD encoded and/or skippable frames + `srcSize` must be the _exact_ size of this series (i.e. there should be a frame boundary exactly `srcSize` bytes after `src`) - @return : the decompressed size of all data in the contained frames, as a 64-bit value _if known_ - - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN - - if an error occurred: ZSTD_CONTENTSIZE_ERROR + @return : - decompressed size of all data in all successive frames + - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN + - if an error occurred: ZSTD_CONTENTSIZE_ERROR - note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. - When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. - In which case, it's necessary to use streaming mode to decompress data. - Optionally, application can still use ZSTD_decompress() while relying on implied limits. - (For example, data may be necessarily cut into blocks <= 16 KB). - note 2 : decompressed size is always present when compression is done with ZSTD_compress() - note 3 : decompressed size can be very large (64-bits value), - potentially larger than what local system can handle as a single memory segment. - In which case, it's necessary to use streaming mode to decompress data. - note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. - Always ensure result fits within application's authorized limits. - Each application can set its own limits. - note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to - read each contained frame header. This is efficient as most of the data is skipped, - however it does mean that all frame data must be present and valid. + note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. + When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. + In which case, it's necessary to use streaming mode to decompress data. + Optionally, application can still use ZSTD_decompress() while relying on implied limits. + (For example, data may be necessarily cut into blocks <= 16 KB). + note 2 : decompressed size is always present when compression is done with ZSTD_compress() + note 3 : decompressed size can be very large (64-bits value), + potentially larger than what local system can handle as a single memory segment. + In which case, it's necessary to use streaming mode to decompress data. + note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. + Always ensure result fits within application's authorized limits. + Each application can set its own limits. + note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to + read each contained frame header. This is efficient as most of the data is skipped, + however it does mean that all frame data must be present and valid.


-

Advanced compression functions


+
size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
+

`src` should point to the start of a ZSTD frame + `srcSize` must be >= ZSTD_frameHeaderSize_prefix. + @return : size of the Frame Header +


-
size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams);
-

Gives the amount of memory allocated for a ZSTD_CCtx given a set of compression parameters. - `frameContentSize` is an optional parameter, provide `0` if unknown +

Context memory usage


+
+
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
+size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
+size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
+size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
+size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
+size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
+

These functions give the current memory usage of selected object. + Object memory usage can evolve if it's re-used multiple times.


+
size_t ZSTD_estimateCCtxSize(int compressionLevel);
+size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateDCtxSize(void);
+

These functions make it possible to estimate memory usage + of a future {D,C}Ctx, before its creation. + ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one. + It will also consider src size to be arbitrarily "large", which is worst case. + If srcSize is known to always be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation. + ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + Note : CCtx estimation is only correct for single-threaded compression +


+ +
size_t ZSTD_estimateCStreamSize(int compressionLevel);
+size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateDStreamSize(size_t windowSize);
+size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);
+

ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one. + It will also consider src size to be arbitrarily "large", which is worst case. + If srcSize is known to always be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation. + ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + Note : CStream estimation is only correct for single-threaded compression. + ZSTD_DStream memory budget depends on window Size. + This information can be passed manually, using ZSTD_estimateDStreamSize, + or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame(); + Note : if streaming is init with function ZSTD_init?Stream_usingDict(), + an internal ?Dict will be created, which additional size is not estimated here. + In this case, get total size by adding ZSTD_estimate?DictSize +


+ +
size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
+size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference);
+size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);
+

ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). + ZSTD_estimateCStreamSize_advanced() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). + Note : dictionary created "byReference" are smaller +


+ +

Advanced compression functions


+
 
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
 

Create a ZSTD compression context using external alloc and free functions


-
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
-

Gives the amount of memory used by a given ZSTD_CCtx +

ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
+

workspace: The memory area to emplace the context into. + Provided pointer must 8-bytes aligned. + It must outlive context usage. + workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize() + to determine how large workspace must be to support scenario. + @return : pointer to ZSTD_CCtx*, or NULL if error (size too small) + Note : zstd will never resize nor malloc() when using a static cctx. + If it needs more memory than available, it will simply error out. + Note 2 : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally too. + Limitation 1 : currently not compatible with internal CDict creation, such as + ZSTD_CCtx_loadDictionary() or ZSTD_initCStream_usingDict(). + Limitation 2 : currently not compatible with multi-threading +


typedef enum {
@@ -399,13 +483,34 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
   It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict 
 


-
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize, unsigned byReference,
+
typedef enum { ZSTD_dm_auto=0,        /* dictionary is "full" if it starts with ZSTD_MAGIC_DICTIONARY, rawContent otherwize */
+               ZSTD_dm_rawContent,    /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */
+               ZSTD_dm_fullDict       /* refuses to load a dictionary if it does not respect Zstandard's specification */
+} ZSTD_dictMode_e;
+

+
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
+                                      unsigned byReference, ZSTD_dictMode_e dictMode,
                                       ZSTD_compressionParameters cParams, ZSTD_customMem customMem);
 

Create a ZSTD_CDict using external alloc and free, and customized compression parameters


-
size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
-

Gives the amount of memory used by a given ZSTD_sizeof_CDict +

ZSTD_CDict* ZSTD_initStaticCDict(
+                void* workspace, size_t workspaceSize,
+          const void* dict, size_t dictSize,
+                unsigned byReference, ZSTD_dictMode_e dictMode,
+                ZSTD_compressionParameters cParams);
+

Generate a digested dictionary in provided memory area. + workspace: The memory area to emplace the dictionary into. + Provided pointer must 8-bytes aligned. + It must outlive dictionary usage. + workspaceSize: Use ZSTD_estimateCDictSize() + to determine how large workspace must be. + cParams : use ZSTD_getCParams() to transform a compression level + into its relevants cParams. + @return : pointer to ZSTD_CDict*, or NULL if error (size too small) + Note : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. +


ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
@@ -423,8 +528,8 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
 


ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);
-

optimize params for a given `srcSize` and `dictSize`. - both values are optional, select `0` if unknown. +

optimize params for a given `srcSize` and `dictSize`. + both values are optional, select `0` if unknown.


size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
@@ -451,22 +556,32 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
   Note 3 : Skippable Frame Identifiers are considered valid. 
 


-
size_t ZSTD_estimateDCtxSize(void);
-

Gives the potential amount of memory allocated to create a ZSTD_DCtx -


-
ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
 

Create a ZSTD decompression context using external alloc and free functions


-
size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
-

Gives the amount of memory used by a given ZSTD_DCtx +

ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
+

workspace: The memory area to emplace the context into. + Provided pointer must 8-bytes aligned. + It must outlive context usage. + workspaceSize: Use ZSTD_estimateDCtxSize() or ZSTD_estimateDStreamSize() + to determine how large workspace must be to support scenario. + @return : pointer to ZSTD_DCtx*, or NULL if error (size too small) + Note : zstd will never resize nor malloc() when using a static dctx. + If it needs more memory than available, it will simply error out. + Note 2 : static dctx is incompatible with legacy support + Note 3 : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. + Limitation : currently not compatible with internal DDict creation, + such as ZSTD_initDStream_usingDict(). +


ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
 

Create a digested dictionary, ready to start decompression operation without startup delay. - Dictionary content is simply referenced, and therefore stays in dictBuffer. - It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict + Dictionary content is referenced, and therefore stays in dictBuffer. + It is important that dictBuffer outlives DDict, + it must remain read accessible throughout the lifetime of DDict


ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
@@ -474,8 +589,19 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
 

Create a ZSTD_DDict using external alloc and free, optionally by reference


-
size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
-

Gives the amount of memory used by a given ZSTD_DDict +

ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
+                                 const void* dict, size_t dictSize,
+                                 unsigned byReference);
+

Generate a digested dictionary in provided memory area. + workspace: The memory area to emplace the dictionary into. + Provided pointer must 8-bytes aligned. + It must outlive dictionary usage. + workspaceSize: Use ZSTD_estimateDDictSize() + to determine how large workspace must be. + @return : pointer to ZSTD_DDict*, or NULL if error (size too small) + Note : there is no corresponding "free" function. + Since workspace was allocated externally, it must be freed externally. +


unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
@@ -499,19 +625,19 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_
     Note : this use case also happens when using a non-conformant dictionary.
   - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).
   - This is not a Zstandard frame.
-  When identifying the exact failure cause, it's possible to use ZSTD_getFrameParams(), which will provide a more precise error code. 
+  When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. 
 


Advanced streaming functions


 
 

Advanced Streaming compression functions

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
-size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);   /**< size of CStream is variable, depending primarily on compression level */
+ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct, a size of 0 means unknown.  for a frame size of 0 use initCStream_advanced */
-size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. */
 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                              ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);  /**< note : cdict will just be referenced, and must outlive compression session */
-size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, unsigned long long pledgedSrcSize, ZSTD_frameParameters fParams);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
+size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
 

size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
 

start a new compression job, using same parameters from previous job. @@ -524,11 +650,11 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStre

Advanced Streaming decompression functions

typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
 ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
-size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */
 size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
 size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict will just be referenced, and must outlive decompression session */
 size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
-size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
 

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
@@ -578,21 +704,24 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx*
   Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
   A ZSTD_DCtx object can be re-used multiple times.
 
-  First typical operation is to retrieve frame parameters, using ZSTD_getFrameParams().
-  It fills a ZSTD_frameParams structure which provide important information to correctly decode the frame,
-  such as the minimum rolling buffer size to allocate to decompress data (`windowSize`),
-  and the dictionary ID used.
+  First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().
+  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,
+  such as minimum rolling buffer size to allocate to decompress data (`windowSize`),
+  and the dictionary ID in use.
   (Note : content size is optional, it may not be present. 0 means : content size unknown).
   Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information.
   As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation.
-  Each application can set its own limit, depending on local restrictions. For extended interoperability, it is recommended to support at least 8 MB.
-  Frame parameters are extracted from the beginning of the compressed frame.
-  Data fragment must be large enough to ensure successful decoding, typically `ZSTD_frameHeaderSize_max` bytes.
-  @result : 0 : successful decoding, the `ZSTD_frameParams` structure is correctly filled.
+  Each application can set its own limit, depending on local restrictions.
+  For extended interoperability, it is recommended to support windowSize of at least 8 MB.
+  Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.
+  Data fragment must be large enough to ensure successful decoding.
+  `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.
+  @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.
            >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.
            errorCode, which can be tested using ZSTD_isError().
 
-  Start decompression, with ZSTD_decompressBegin() or ZSTD_decompressBegin_usingDict().
+  Start decompression, with ZSTD_decompressBegin().
+  If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().
   Alternatively, you can copy a prepared context, using ZSTD_copyDCtx().
 
   Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.
@@ -624,29 +753,196 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx*
   b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
   c) Frame Content - any content (User Data) of length equal to Frame Size
   For skippable frames ZSTD_decompressContinue() always returns 0.
-  For skippable frames ZSTD_getFrameParams() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
+  For skippable frames ZSTD_getFrameHeader() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
     Note : If fparamsPtr->frameContentSize==0, it is ambiguous: the frame might actually be a Zstd encoded frame with no content.
            For purposes of decompression, it is valid in both cases to skip the frame using
            ZSTD_findFrameCompressedSize to find its size in bytes.
   It also returns Frame Size as fparamsPtr->frameContentSize.
 
-
typedef struct {
-    unsigned long long frameContentSize;
-    unsigned windowSize;
-    unsigned dictID;
-    unsigned checksumFlag;
-} ZSTD_frameParams;
-

-

Buffer-less streaming decompression functions

size_t ZSTD_getFrameParams(ZSTD_frameParams* fparamsPtr, const void* src, size_t srcSize);   /**< doesn't consume input, see details below */
+

Buffer-less streaming decompression functions

size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
 size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
 size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
+size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
 void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
-size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
-size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
-ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
 

+
typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
+

+

New advanced API (experimental, and compression only)


+
typedef enum {
+    /* compression parameters */
+    ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
+                              * Default level is ZSTD_CLEVEL_DEFAULT==3.
+                              * Special: value 0 means "do not change cLevel". */
+    ZSTD_p_windowLog,        /* Maximum allowed back-reference distance, expressed as power of 2.
+                              * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
+                              * Special: value 0 means "do not change windowLog". */
+    ZSTD_p_hashLog,          /* Size of the probe table, as a power of 2.
+                              * Resulting table size is (1 << (hashLog+2)).
+                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
+                              * Larger tables improve compression ratio of strategies <= dFast,
+                              * and improve speed of strategies > dFast.
+                              * Special: value 0 means "do not change hashLog". */
+    ZSTD_p_chainLog,         /* Size of the full-search table, as a power of 2.
+                              * Resulting table size is (1 << (chainLog+2)).
+                              * Larger tables result in better and slower compression.
+                              * This parameter is useless when using "fast" strategy.
+                              * Special: value 0 means "do not change chainLog". */
+    ZSTD_p_searchLog,        /* Number of search attempts, as a power of 2.
+                              * More attempts result in better and slower compression.
+                              * This parameter is useless when using "fast" and "dFast" strategies.
+                              * Special: value 0 means "do not change searchLog". */
+    ZSTD_p_minMatch,         /* Minimum size of searched matches (note : repCode matches can be smaller).
+                              * Larger values make faster compression and decompression, but decrease ratio.
+                              * Must be clamped between ZSTD_SEARCHLENGTH_MIN and ZSTD_SEARCHLENGTH_MAX.
+                              * Note that currently, for all strategies < btopt, effective minimum is 4.
+                              * Note that currently, for all strategies > fast, effective maximum is 6.
+                              * Special: value 0 means "do not change minMatchLength". */
+    ZSTD_p_targetLength,     /* Only useful for strategies >= btopt.
+                              * Length of Match considered "good enough" to stop search.
+                              * Larger values make compression stronger and slower.
+                              * Special: value 0 means "do not change targetLength". */
+    ZSTD_p_compressionStrategy, /* See ZSTD_strategy enum definition.
+                              * Cast selected strategy as unsigned for ZSTD_CCtx_setParameter() compatibility.
+                              * The higher the value of selected strategy, the more complex it is,
+                              * resulting in stronger and slower compression.
+                              * Special: value 0 means "do not change strategy". */
+
+    /* frame parameters */
+    ZSTD_p_contentSizeFlag=200, /* Content size is written into frame header _whenever known_ (default:1) */
+    ZSTD_p_checksumFlag,     /* A 32-bits checksum of content is written at end of frame (default:0) */
+    ZSTD_p_dictIDFlag,       /* When applicable, dictID of dictionary is provided in frame header (default:1) */
+
+    /* dictionary parameters (must be set before ZSTD_CCtx_loadDictionary) */
+    ZSTD_p_dictMode=300,     /* Select how dictionary content must be interpreted. Value must be from type ZSTD_dictMode_e.
+                              * default : 0==auto : dictionary will be "full" if it respects specification, otherwise it will be "rawContent" */
+    ZSTD_p_refDictContent,   /* Dictionary content will be referenced, instead of copied (default:0==byCopy).
+                              * It requires that dictionary buffer outlives its users */
+
+    /* multi-threading parameters */
+    ZSTD_p_nbThreads=400,    /* Select how many threads a compression job can spawn (default:1)
+                              * More threads improve speed, but also increase memory usage.
+                              * Can only receive a value > 1 if ZSTD_MULTITHREAD is enabled.
+                              * Special: value 0 means "do not change nbThreads" */
+    ZSTD_p_jobSize,          /* Size of a compression job. Each compression job is completed in parallel.
+                              * 0 means default, which is dynamically determined based on compression parameters.
+                              * Job size must be a minimum of overlapSize, or 1 KB, whichever is largest
+                              * The minimum size is automatically and transparently enforced */
+    ZSTD_p_overlapSizeLog,   /* Size of previous input reloaded at the beginning of each job.
+                              * 0 => no overlap, 6(default) => use 1/8th of windowSize, >=9 => use full windowSize */
+
+    /* advanced parameters - may not remain available after API update */
+    ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize,
+                              * even when referencing into Dictionary content (default:0) */
+
+} ZSTD_cParameter;
+

+
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);
+

Set one compression parameter, selected by enum ZSTD_cParameter. + Note : when `value` is an enum, cast it to unsigned for proper type checking. + @result : 0, or an error code (which can be tested with ZSTD_isError()). +


+ +
size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
+

Total input data size to be compressed as a single frame. + This value will be controlled at the end, and result in error if not respected. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Note 1 : 0 means zero, empty. + In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. + Note that ZSTD_CONTENTSIZE_UNKNOWN is default value for new compression jobs. + Note 2 : If all data is provided and consumed in a single round, + this value is overriden by srcSize instead. +


+ +
size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+

Create an internal CDict from dict buffer. + Decompression will have to use same buffer. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, + meaning "return to no-dictionary mode". + Note 1 : `dict` content will be copied internally, + except if ZSTD_p_refDictContent is set before loading. + Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters. + For this reason, compression parameters cannot be changed anymore after loading a dictionary. + It's also a CPU-heavy operation, with non-negligible impact on latency. + Note 3 : Dictionary will be used for all future compression jobs. + To return to "no-dictionary" situation, load a NULL dictionary +


+ +
size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
+

Reference a prepared dictionary, to be used for all next compression jobs. + Note that compression parameters are enforced from within CDict, + and supercede any compression parameter previously set within CCtx. + The dictionary will remain valid for future compression jobs using same CCtx. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : adding a NULL CDict means "return to no-dictionary mode". + Note 1 : Currently, only one dictionary can be managed. + Adding a new dictionary effectively "discards" any previous one. + Note 2 : CDict is just referenced, its lifetime must outlive CCtx. + +


+ +
size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize);
+

Reference a prefix (single-usage dictionary) for next compression job. + Decompression need same prefix to properly regenerate data. + Prefix is **only used once**. Tables are discarded at end of compression job. + Subsequent compression jobs will be done without prefix (if none is explicitly referenced). + If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_CDict instead. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : Adding any prefix (including NULL) invalidates any previous prefix or dictionary + Note 1 : Prefix buffer is referenced. It must outlive compression job. + Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters. + It's a CPU-heavy operation, with non-negligible impact on latency. + Note 3 : it's possible to alter ZSTD_p_dictMode using ZSTD_CCtx_setParameter() +


+ +
typedef enum {
+    ZSTD_e_continue=0, /* collect more data, encoder transparently decides when to output result, for optimal conditions */
+    ZSTD_e_flush,      /* flush any data provided so far - frame will continue, future data can still reference previous data for better compression */
+    ZSTD_e_end         /* flush any remaining data and ends current frame. Any future compression starts a new frame. */
+} ZSTD_EndDirective;
+

+
size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
+                              ZSTD_outBuffer* output,
+                              ZSTD_inBuffer* input,
+                              ZSTD_EndDirective endOp);
+

Behave about the same as ZSTD_compressStream. To note : + - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter() + - Compression parameters cannot be changed once compression is started. + - *dstPos must be <= dstCapacity, *srcPos must be <= srcSize + - *dspPos and *srcPos will be updated. They are guaranteed to remain below their respective limit. + - @return provides the minimum amount of data still to flush from internal buffers + or an error code, which can be tested using ZSTD_isError(). + if @return != 0, flush is not fully completed, there is some data left within internal buffers. + - after a ZSTD_e_end directive, if internal buffer is not fully flushed, + only ZSTD_e_end or ZSTD_e_flush operations are allowed. + It is necessary to fully flush internal buffers + before starting a new compression job, or changing compression parameters. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 14 14:58:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBBA7DA3EF9; Fri, 14 Jul 2017 14:58:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A24690D5; Fri, 14 Jul 2017 14:58:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EEwAsH020654; Fri, 14 Jul 2017 14:58:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EEwAv6020653; Fri, 14 Jul 2017 14:58:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707141458.v6EEwAv6020653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 14 Jul 2017 14:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320988 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 320988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 14:58:12 -0000 Author: bapt Date: Fri Jul 14 14:58:10 2017 New Revision: 320988 URL: https://svnweb.freebsd.org/changeset/base/320988 Log: Update pci_vendors to 2017.07.13 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Fri Jul 14 14:55:34 2017 (r320987) +++ head/share/misc/pci_vendors Fri Jul 14 14:58:10 2017 (r320988) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.05.25 -# Date: 2017-05-25 03:15:02 +# Version: 2017.07.13 +# Date: 2017-07-13 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -561,6 +561,7 @@ 00af SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA 1d49 0202 ThinkSystem 430-8e SAS/SATA 12Gb HBA + 1d49 0204 ThinkSystem 430-8i SAS/SATA 12Gb Dense HBA 00be SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00bf SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00c0 SAS3324 PCI-Express Fusion-MPT SAS-3 @@ -2139,13 +2140,12 @@ # Radeon HD 7970 X2 1787 2317 Radeon HD 7990 1787 3000 Tahiti XT2 [Radeon HD 7970 GHz Edition] - 6799 New Zealand [Radeon HD 7900 Series] 679a Tahiti PRO [Radeon HD 7950/8950 OEM / R9 280] 1002 0b01 Radeon HD 8950 OEM 1002 3000 Tahiti PRO2 [Radeon HD 7950 Boost] 1462 3000 Radeon HD 8950 OEM 174b a003 Radeon R9 280 - 679b Malta [Radeon HD 7990] + 679b Malta [Radeon HD 7990/8990 OEM] 1002 0b28 Radeon HD 8990 OEM 1002 0b2a Radeon HD 7990 1462 8036 Radeon HD 8990 OEM @@ -2205,28 +2205,34 @@ 174b e324 Sapphire Nitro R9 390 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE - 67c0 Ellesmere [Polaris10] + 67c0 Ellesmere [Radeon Pro WX 7100] 67c4 Ellesmere [Radeon Pro WX 7100] + 1002 0336 Radeon Pro Duo + 1002 1336 Radeon Pro Duo 67c7 Ellesmere [Radeon Pro WX 5100] 67ca Ellesmere [Polaris10] 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] - 67df Ellesmere [Radeon RX 470/480] + 67df Ellesmere [Radeon RX 470/480/570/580] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 1043 04fd Radeon RX 480 8GB + 1458 22f0 Radeon RX 570 1462 3411 Radeon RX 470 1462 3413 Radeon RX 480 148c 2372 Radeon RX 480 148c 2373 Radeon RX 470 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 + 1682 9588 Radeon RX 580 XTR 174b e347 Radeon RX 470/480 174b e349 Radeon RX 470 1787 a470 Radeon RX 470 1787 a480 Radeon RX 480 + 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB + 1da2 e366 Radeon RX 570 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] 67e3 Baffin [Radeon Pro WX 4100] @@ -2234,7 +2240,7 @@ 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] 67ef Baffin [Radeon RX 460] - 67ff Baffin [Polaris11] + 67ff Baffin [Radeon RX 560] 6800 Wimbledon XT [Radeon HD 7970M] 1002 0124 Radeon HD 7970M 8086 2110 Radeon HD 7970M @@ -2430,6 +2436,7 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] + 6863 Vega 10 [Radeon Vega Frontier Edition] 687f Vega [Radeon RX Vega] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] @@ -2940,9 +2947,10 @@ 174b e308 Radeon R9 380 Nitro 4G D5 6980 Polaris12 6981 Polaris12 - 6985 Polaris12 + 6985 Lexa XT [Radeon PRO WX 3100] 6986 Polaris12 6987 Polaris12 + 6995 Lexa XT [Radeon PRO WX 2100] 699f Lexa PRO [Radeon RX 550] 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge @@ -3804,6 +3812,7 @@ 1014 0338 PCI-X DDR Auxiliary Cache Adapter (575C) 0302 Winnipeg PCI-X Host Bridge 0308 CalIOC2 PCI-E Root Port + 0311 FC 5740/1954 4-Port 10/100/1000 Base-TX PCI-X Adapter for POWER 0314 ZISC 036 Neural accelerator card 032d Axon - Cell Companion Chip 1014 03a1 PCIe PowerXCell 8i Cell Accelerator Board @@ -3834,6 +3843,7 @@ 1014 04c7 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCA) 1014 04c8 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CD2) 1014 04c9 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCD) + 03dc POWER8 Host Bridge (PHB3) 044b GenWQE Accelerator Adapter 04aa Flash Adapter 90 (PCIe2 0.9TB) 04da PCI-E IPR SAS+ Adapter (ASIC) @@ -4499,6 +4509,8 @@ 0533 MGA G200EH 103c 3381 iLO4 0534 G200eR2 + 0538 G200eH + 1590 00e4 iLO5 VGA 0540 M91XX 102b 2080 M9140 LP PCIe x16 102b 20c0 Xenia @@ -5011,6 +5023,8 @@ 12ee PCI-X 2.0 Local Bus Adapter 1302 RMP-3 Shared Memory Driver 1303 RMP-3 (Remote Management Processor) + 22f6 iLO5 Virtual USB Controller + 1590 00e4 iLO5 Standard Virtual USB Controller 2910 E2910A PCIBus Exerciser 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer 3206 Adaptec Embedded Serial ATA HostRAID @@ -5398,6 +5412,7 @@ 1546 803c FWB-PCIE1X11B 8240 XIO2001 PCI Express-to-PCI Bridge 8241 TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller + 1014 04b2 S824 (8286-42A) 8400 ACX 100 22Mbps Wireless Interface 1186 3b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus] 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter @@ -6015,6 +6030,7 @@ 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter + 1590 0223 Synergy 6810C 25/50Gb Ethernet Adapter 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter @@ -6068,8 +6084,12 @@ 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA 103c 7040 FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus Adapter [HPAE311A] 2532 ISP2532-based 8Gb Fibre Channel to PCI Express HBA + 1014 041e FC EN0Y/EN12 PCIe2 LP 8 Gb 4-port Fibre Channel Adapter for POWER 103c 3262 StorageWorks 81Q 103c 3263 StorageWorks 82Q + 1077 015c QLE2560 PCI Express to 8Gb FC Single Channel + 1077 015d QLE2562 PCI Express to 8Gb FC Dual Channel + 1077 015e QLE2564 PCI Express to 8Gb FC Quad Channel 1077 0167 QME2572 Dual Port FC8 HBA Mezzanine 1590 00fc StoreFabric 84Q 8Gb Quad Port Fibre Channel Host Bus Adapter 3022 ISP4022-based Ethernet NIC @@ -6084,6 +6104,7 @@ 7322 IBA7322 QDR InfiniBand HCA 8000 10GbE Converged Network Adapter (TCP/IP Networking) 8001 10GbE Converged Network Adapter (FCoE) + 1014 03af FC 5708/5270 10 Gb FCoE PCIe Dual Port Adapter for POWER 8020 cLOM8214 1/10GbE Controller 1028 1f64 QMD8262-k 10G DP bNDC KR 103c 3346 CN1000Q Dual Port Converged Network Adapter @@ -6107,15 +6128,27 @@ 8031 8300 Series 10GbE Converged Network Adapter (FCoE) 8032 8300 Series 10GbE Converged Network Adapter (iSCSI) 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 0011 FastLinQ QL41212H 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) + 1077 0001 25GE 2P QL41262HxCU-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) @@ -9947,6 +9980,8 @@ 0f02 GF108 [GeForce GT 730] 0f06 GF108 [GeForce GT 730] 0fb0 GM200 High Definition Audio + 0fb8 GP108 High Definition Audio Controller + 0fb9 GP107GL High Definition Audio Controller 0fbb GM204 High Definition Audio Controller 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] @@ -10620,6 +10655,7 @@ 134f GM108M [GeForce 920MX] 137a GM108GLM [Quadro K620M / Quadro M500M] 17aa 505a Quadro M500M + 137b GM108GLM [Quadro M520 Mobile] 137d GM108M [GeForce 940A] 1380 GM107 [GeForce GTX 750 Ti] 1381 GM107 [GeForce GTX 750] @@ -10665,6 +10701,7 @@ 13d8 GM204M [GeForce GTX 970M] 13d9 GM204M [GeForce GTX 965M] 13da GM204M [GeForce GTX 980] + 13e7 GM204 [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] @@ -10690,7 +10727,7 @@ 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] - 161a GM204M [GeForce GTX 980] + 161a GM204M [GeForce GTX 980 Mobile] 1667 GM204M [GeForce GTX 965M] 1725 GP100 172e GP100 @@ -10744,10 +10781,11 @@ 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL - 1cb1 GP107GL [Quardo P1000] - 1cb2 GP107GL [Quardo P600] - 1cb3 GP107GL [Quardo P400] + 1cb1 GP107GL [Quadro P1000] + 1cb2 GP107GL [Quadro P600] + 1cb3 GP107GL [Quadro P400] 1d01 GP108 [GeForce GT 1030] + 1d10 GP108 [GeForce MX150] 1d81 GV100 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) @@ -10771,7 +10809,8 @@ e100 Proteus-X: LightPulse IOV Fibre Channel Host Adapter e131 LightPulse 8Gb/s PCIe Shared I/O Fibre Channel Adapter e180 Proteus-X: LightPulse IOV Fibre Channel Host Adapter - e200 Lancer-X: LightPulse Fibre Channel Host Adapter + e200 LightPulse LPe16002 + 1014 03f1 PCIe2 16 Gb 2-port Fibre Channel Adapter (FC EL5B; CCIN 577F) e208 LightPulse 16Gb Fibre Channel Host Adapter (Lancer-VF) e220 OneConnect NIC (Lancer) 17aa 1054 ThinkServer LPm16002B-M6-L AnyFabric @@ -10800,6 +10839,7 @@ f0e5 Zephyr LightPulse Fibre Channel Host Adapter f0f5 Neptune LightPulse Fibre Channel Host Adapter f100 Saturn-X: LightPulse Fibre Channel Host Adapter + 1014 038a 8Gb PCI Express Dual Port FC Adapter for POWER 103c 3282 8Gb Dual-port PCI-e FC HBA f111 Saturn-X LightPulse Fibre Channel Host Adapter f112 Saturn-X LightPulse Fibre Channel Host Adapter @@ -10822,6 +10862,8 @@ fc40 Saturn-X: LightPulse Fibre Channel Host Adapter fc50 Proteus-X: LightPulse IOV Fibre Channel Host Adapter fd00 Helios-X LightPulse Fibre Channel Host Adapter +# Also IBM FC 5759 / FC 1910 for POWER + 10df fd02 LightPulse LP11002 Dual-port 4Gigabit PCI Fibre Channel Adapter fd11 Helios-X LightPulse Fibre Channel Host Adapter fd12 Helios-X LightPulse Fibre Channel Host Adapter fe00 Zephyr-X LightPulse Fibre Channel Host Adapter @@ -10923,6 +10965,7 @@ 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 17aa 224f ThinkPad X1 Carbon 5th Gen 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader 5288 RTS5288 PCI Express Card Reader @@ -11028,6 +11071,7 @@ 1775 11cc CC11/CL11 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter + 8086 2055 NUC Kit DN2820FYKH 8086 d615 Desktop Board D510MO/D525MW 8169 RTL8169 PCI Gigabit Ethernet Controller 1025 0079 Aspire 5024WLMi @@ -14773,7 +14817,7 @@ 12d6 Analogic Corp 12d7 Biotronic SRL 12d8 Pericom Semiconductor - 01a7 PI7C21P100 PCI to PCI Bridge + 01a7 7C21P100 2-port PCI-X to PCI-X Bridge 400a PI7C9X442SL PCI Express Bridge Port 400e PI7C9X442SL USB OHCI Controller 400f PI7C9X442SL USB EHCI Controller @@ -15081,6 +15125,8 @@ 5160 RealSSD P420h 5161 RealSSD P420m 5163 RealSSD P425m + 5180 9100 PRO NVMe SSD + 5181 9100 MAX NVMe SSD 1345 Arescom Inc 1347 Odetics 1349 Sumitomo Electric Industries, Ltd. @@ -16081,6 +16127,7 @@ 509f T540-509F Unified Wire Ethernet Controller 50a0 T540-50A0 Unified Wire Ethernet Controller 50a1 T540-50A1 Unified Wire Ethernet Controller + 50a2 T580-50A2 Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16133,6 +16180,7 @@ 549f T540-509F Unified Wire Ethernet Controller 54a0 T540-50A0 Unified Wire Ethernet Controller 54a1 T540-50A1 Unified Wire Ethernet Controller + 54a2 T580-50A2 Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16185,6 +16233,7 @@ 559f T540-509F Unified Wire Storage Controller 55a0 T540-50A0 Unified Wire Storage Controller 55a1 T540-50A1 Unified Wire Storage Controller + 55a2 T580-50A2 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16237,6 +16286,7 @@ 569f T540-509F Unified Wire Storage Controller 56a0 T540-50A0 Unified Wire Storage Controller 56a1 T540-50A1 Unified Wire Storage Controller + 56a2 T580-50A2 Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16328,6 +16378,7 @@ 589f T540-509F Unified Wire Ethernet Controller [VF] 58a0 T540-50A0 Unified Wire Ethernet Controller [VF] 58a1 T540-50A1 Unified Wire Ethernet Controller [VF] + 58a2 T580-50A2 Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16343,6 +16394,9 @@ 6015 T6201-BT Unified Wire Ethernet Controller 6080 T6225-6080 Unified Wire Ethernet Controller 6081 T62100-6081 Unified Wire Ethernet Controller + 6082 T6225-6082 Unified Wire Ethernet Controller + 6083 T62100-6083 Unified Wire Ethernet Controller + 6084 T64100-6084 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16358,6 +16412,9 @@ 6415 T6201-BT Unified Wire Ethernet Controller 6480 T6225-6080 Unified Wire Ethernet Controller 6481 T62100-6081 Unified Wire Ethernet Controller + 6482 T6225-6082 Unified Wire Ethernet Controller + 6483 T62100-6083 Unified Wire Ethernet Controller + 6484 T64100-6084 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16373,6 +16430,9 @@ 6515 T6201-BT Unified Wire Storage Controller 6580 T6225-6080 Unified Wire Storage Controller 6581 T62100-6081 Unified Wire Storage Controller + 6582 T6225-6082 Unified Wire Storage Controller + 6583 T62100-6083 Unified Wire Storage Controller + 6584 T64100-6084 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16388,6 +16448,9 @@ 6615 T6201-BT Unified Wire Storage Controller 6680 T6225-6080 Unified Wire Storage Controller 6681 T62100-6081 Unified Wire Storage Controller + 6682 T6225-6082 Unified Wire Storage Controller + 6683 T62100-6083 Unified Wire Storage Controller + 6684 T64100-6084 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16403,6 +16466,9 @@ 6815 T6201-BT Unified Wire Ethernet Controller [VF] 6880 T6225-6080 Unified Wire Ethernet Controller [VF] 6881 T62100-6081 Unified Wire Ethernet Controller [VF] + 6882 T6225-6082 Unified Wire Ethernet Controller [VF] + 6883 T62100-6083 Unified Wire Ethernet Controller [VF] + 6884 T64100-6084 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -17003,6 +17069,7 @@ 1028 1f68 BCM57800 1-Gigabit Ethernet 168d NetXtreme II BCM57840 10/20 Gigabit Ethernet 168e NetXtreme II BCM57810 10 Gigabit Ethernet + 1014 0492 PCIe2 2-port 10 GbE BaseT RJ45 Adapter (FC EN0W; CCIN 2CC4) 103c 1798 Flex-10 10Gb 2-port 530FLB Adapter [Meru] 103c 17a5 Flex-10 10Gb 2-port 530M Adapter 103c 18d3 Ethernet 10Gb 2-port 530T Adapter @@ -17929,7 +17996,8 @@ 0001 SOC-it 101 System Controller 1540 PROVIDEO MULTIMEDIA Co Ltd 1541 MACHONE Communications -1542 Concurrent Computer Corporation +# nee VIVID Technology Inc. +1542 Concurrent Real-Time 9260 RCIM-II Real-Time Clock & Interrupt Module 9271 RCIM-III Real-Time Clock & Interrupt Module (PCIe) 9272 Pulse Width Modulator Card @@ -18133,6 +18201,7 @@ 103c 18d6 InfiniBand FDR/EN 10/40Gb Dual Port 544QSFP Adapter 15b3 0025 ConnectX-3 IB QDR Dual Port Mezzanine Card 15b3 0026 ConnectX-3 IB FDR Dual Port Mezzanine Card + 15b3 0028 ConnectX-3 VPI Dual QSFP+ Port QDR Infiniband 40Gb/s or 10Gb Ethernet 15b3 0059 ConnectX-3 VPI IB FDR/40 GbE Single Port QSFP+ Mezzanine Card 15b3 0065 ConnectX-3 VPI IB FDR/40 GbE Dual Port QSFP+ Adapter 15b3 0066 ConnectX-3 IB FDR10 Dual Port Mezzanine Card @@ -18209,6 +18278,7 @@ 6372 MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe 2.0 2.5GT/s] 6732 MT26418 [ConnectX VPI PCIe 2.0 5GT/s - IB DDR / 10GigE] 673c MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] + 1014 0487 GX++ 1-port 4X IB QDR Adapter for Power 795 103c 1782 4X QDR InfiniBand Mezzanine HCA for c-Class BladeSystem 15b3 0021 HP InfiniBand 4X QDR CX-2 PCI-e G2 Dual Port HCA 6746 MT26438 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE Virtualization+] @@ -18217,6 +18287,8 @@ 6750 MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] 1014 0461 2-Port 10 GbE RoCE SR LP PCIe2 (rev b0) 15b3 0018 HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1) +# FC EC26 + 15b3 6572 IBM Flex System EN4132 2-port 10Gb RoCE Adapter 675a MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s] 6764 MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+] 103c 3313 NC542m Dual Port Flex-10 10GbE BLc Adapter @@ -19746,15 +19818,15 @@ 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter 0a03 SFC9220 10/40G Ethernet Controller - 1924 8011 SFN8022-R1 Flareon 8000 Series 10G Adapter - 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter - 1924 8013 SFN8042-R1 Flareon 8000 Series 10/40G Adapter - 1924 8014 SFN8542-R1 Flareon Ultra 8000 Series 10/40G Adapter - 1924 8016 SFN8022-R2 Flareon 8000 Series 10G Adapter - 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter - 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter - 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1924 801a SFN8722-R1 Flareon Ultra 8000 Series OCP 10G Adapter + 1924 8011 SFN8022-R1 8000 Series 10G Adapter + 1924 8012 SFN8522-R1 8000 Series 10G Adapter + 1924 8013 SFN8042-R1 8000 Series 10/40G Adapter + 1924 8014 SFN8542-R1 8000 Series 10/40G Adapter + 1924 8016 SFN8022-R2 8000 Series 10G Adapte + 1924 8017 SFN8522-R2 8000 Series 10G Adapter + 1924 8018 SFN8042-R2 8000 Series 10/40G Adapter + 1924 8019 SFN8542-R2 8000 Series 10/40G Adapter + 1924 801a SFN8722-R1 8000 Series OCP 10G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) @@ -20008,20 +20080,29 @@ 0212 BladeEngine2 10Gb Gen2 PCIe iSCSI Adapter 0221 BladeEngine3 10Gb Gen2 PCIe Network Adapter 0222 BladeEngine3 10Gb Gen2 PCIe iSCSI Adapter - 0700 OneConnect 10Gb NIC + 0700 OneConnect OCe10100/OCe10102 Series 10 GbE 103c 1747 NC550SFP DualPort 10GbE Server Adapter 103c 1749 NC550SFP Dual Port Server Adapter 103c 174a NC551m Dual Port FlexFabric 10Gb Adapter 103c 174b StorageWorks NC550 DualPort Converged Network Adapter 103c 3314 NC551i Dual Port FlexFabric 10Gb Adapter 0702 OneConnect 10Gb iSCSI Initiator - 0704 OneConnect 10Gb FCoE Initiator + 0704 OneConnect OCe10100/OCe10102 Series 10 GbE CNA + 10df e602 OneConnect OCe10100 10Gb CNA + 10df e630 OneConnect OCe10102-FM-E / OCe10102-FX-E for EMC VNX Symmetrix 0710 OneConnect 10Gb NIC (be3) +# FC 5287 / FC 5284; CCIN 5287 + 1014 03d0 PCIe2 2-port 10GbE SR Adapter for POWER +# FC 5288 / FC 5286; CCIN 5288 + 1014 03d1 PCIe2 2-port 10GbE SFP+ Copper Adapter for POWER + 1014 0409 Integrated Multifunction Card with Dual 10GbE SR Optical + Dual 1GbE for Power 750/760 + 1014 040a Integrated Multifunction Card with Dual 10GbE SR Copper + Dual 1GbE for Power 750/760 103c 3315 NC553i 10Gb 2-port FlexFabric Converged Network Adapter 103c 3340 NC552SFP 2-port 10Gb Server Adapter 103c 3341 NC552m 10Gb 2-port FlexFabric Converged Network Adapter 103c 3345 NC553m 10Gb 2-port FlexFabric Converged Network Adapter 103c 337b NC554FLB 10Gb 2-port FlexFabric Converged Network Adapter + 10df e733 Flex System EN4054 4-port 10Gb Ethernet Mezzanine Adapter 0712 OneConnect 10Gb iSCSI Initiator (be3) 0714 OneConnect 10Gb FCoE Initiator (be3) 103c 3315 NC553i 10Gb 2-port FlexFabric Converged Network Adapter @@ -20297,6 +20378,7 @@ 001e ADQ208 001f DSU 0020 ADQ14 + 0023 ADQ7 2014 TX320 2019 S6000 # now owned by HGST (a Western Digital subsidiary) @@ -20505,6 +20587,7 @@ 0004 ExaNIC X10-GM 0005 ExaNIC X40 0006 ExaNIC X10-HPT + 0007 ExaNIC X40 1cf7 Subspace Dynamics 1d00 Pure Storage 1d18 RME @@ -20549,10 +20632,11 @@ 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d78 DERA 1d7c Aerotech, Inc. -1d87 Rockchip Inc. RK3399 PCI Express Root Port +1d87 Fuzhou Rockchip Electronics Co., Ltd 1d8f Enyx 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. +1da2 Sapphire Technology Limited 1de1 Tekram Technology Co.,Ltd. 0391 TRM-S1040 [DC-315 / DC-395 series] 2020 DC-390 @@ -20605,6 +20689,7 @@ 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter + 1154 0368 LGY-PCIE-MG 1432 8104 10 Gigabit Ethernet PCI Express Adapter 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter @@ -22513,6 +22598,7 @@ 10ba 80003ES2LAN Gigabit Ethernet Controller (Copper) 10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes) 10bc 82571EB Gigabit Ethernet Controller (Copper) + 1014 0368 4-Port 10/100/1000 Base-TX PCI Express Adapter for POWER 103c 704b NC364T PCI Express Quad Port Gigabit Server Adapter 108e 11bc x4 PCI-Express Quad Gigabit Ethernet UTP Low Profile Adapter 8086 10bc PRO/1000 PT Quad Port LP Server Adapter @@ -23016,6 +23102,7 @@ 1529 82599 10 Gigabit Dual Port Network Connection with FCoE 152a 82599 10 Gigabit Dual Port Backplane Connection with FCoE 152e 82599 Virtual Function + 152f I350 Virtual Function 1530 X540 Virtual Function 1533 I210 Gigabit Network Connection 103c 0003 Ethernet I210-T1 GbE NIC @@ -23074,6 +23161,8 @@ 18d4 0c08 X550 10Gb 2-port RJ45 OCP Mezz Card MOP81-I-10GT2 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 + 8086 001b Ethernet Server Adapter X550-T2 for OCP + 8086 001d Ethernet 10G 2P X550-t Adapter 8086 0022 Ethernet Converged Network Adapter X550-T2 1564 X550 Virtual Function 1565 X550 Virtual Function @@ -23216,22 +23305,38 @@ 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] + 15c2 Ethernet Connection X553 Backplane + 15c3 Ethernet Connection X553 Backplane + 15c4 Ethernet Connection X553 10 GbE SFP+ 15c5 X553 Virtual Function + 15c6 Ethernet Connection X553 1GbE + 15c7 Ethernet Connection X553 1GbE + 15c8 Ethernet Connection X553/X557-AT 10GBASE-T + 15ce Ethernet Connection X553 10 GbE SFP+ 15d0 Ethernet SDI Adapter FM10420-100GbE-QDA2 15d1 Ethernet Controller 10G X550T 8086 0002 Ethernet Converged Network Adapter X550-T1 + 8086 001b Ethernet Server Adapter X550-T1 for OCP 8086 0021 Ethernet Converged Network Adapter X550-T1 8086 00a2 Ethernet Converged Network Adapter X550-T1 15d2 JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] 15d3 JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] + 15d4 JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] 15d5 Ethernet SDI Adapter FM10420-25GbE-DA2 8086 0001 Intel(R) Ethernet SDI Adapter FM10420-25GbE-DA2 15d6 Ethernet Connection (5) I219-V 15d7 Ethernet Connection (4) I219-LM 15d8 Ethernet Connection (4) I219-V + 17aa 224f ThinkPad X1 Carbon 5th Gen 15d9 JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016] 15da JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] + 15df Ethernet Connection (8) I219-LM + 15e0 Ethernet Connection (8) I219-V + 15e1 Ethernet Connection (9) I219-LM + 15e2 Ethernet Connection (9) I219-V 15e3 Ethernet Connection (5) I219-LM + 15e4 Ethernet Connection X553 1GbE + 15e5 Ethernet Connection X553 1GbE 1600 Broadwell-U Host Bridge -OPI 1601 Broadwell-U PCI Express x16 Controller 1602 Broadwell-U Integrated Graphics @@ -23271,31 +23376,32 @@ 163d Broadwell-U Integrated Graphics 163e Broadwell-U Integrated Graphics 1889 Ethernet Adaptive Virtual Function - 1900 Skylake Host Bridge/DRAM Registers - 1901 Skylake PCIe Controller (x16) + 1900 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1901 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) 1902 HD Graphics 510 - 1903 Skylake Processor Thermal Subsystem - 1904 Skylake Host Bridge/DRAM Registers + 1903 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem + 1904 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1028 06f3 Latitude 3570 17aa 382a B51-80 Laptop - 1905 Skylake PCIe Controller (x8) + 1905 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) 1906 HD Graphics 510 17aa 382a B51-80 Laptop - 1908 Skylake Host Bridge/DRAM Registers - 1909 Skylake PCIe Controller (x4) - 190c Skylake Host Bridge/DRAM Registers - 190f Skylake Host Bridge/DRAM Registers - 1910 Skylake Host Bridge/DRAM Registers - 1911 Skylake Gaussian Mixture Model + 1908 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1909 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x4) + 190c Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 190f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1910 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1911 Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model + 17aa 224f ThinkPad X1 Carbon 5th Gen 1912 HD Graphics 530 1916 HD Graphics 520 1028 06f3 Latitude 3570 - 1918 Skylake Host Bridge/DRAM Registers - 1919 Skylake Imaging Unit + 1918 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1919 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit 191b HD Graphics 530 191d HD Graphics P530 191e HD Graphics 515 - 191f Skylake Host Bridge/DRAM Registers + 191f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1921 HD Graphics 520 1926 Iris Graphics 540 1927 Iris Graphics 550 @@ -24531,6 +24637,7 @@ 24fd Wireless 8265 / 8275 # Windstorm Peak 8086 0010 Dual Band Wireless-AC 8265 + 8086 1130 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -26676,6 +26783,7 @@ 17aa 4021 Intel Ethernet Connection X722 for 10G SFP+ 17aa 4022 Ethernet Connection X722 for 10GbE SFP+ 37d1 Ethernet Connection X722 for 1GbE + 14cd 0010 88E1514 Ethernet OCP 2x1G RJ45 Phy Card [USI-1514-1GbaseT] 1590 0216 Ethernet 1Gb 2-port 368i Adapter 1590 0217 Ethernet 1Gb 2-port 368FLR-MMT Adapter 1590 0247 Ethernet 1Gb 4-port 369i Adapter @@ -27229,9 +27337,13 @@ 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5902 HD Graphics 610 + 5904 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers + 17aa 224f ThinkPad X1 Carbon 5th Gen 590f Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5910 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5912 HD Graphics 630 + 5916 HD Graphics 620 + 17aa 224f ThinkPad X1 Carbon 5th Gen 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster @@ -27908,6 +28020,8 @@ 9d03 Sunrise Point-LP SATA Controller [AHCI mode] 1028 06f3 Latitude 3570 17aa 382a B51-80 Laptop + 9d10 Sunrise Point-LP PCI Express Root Port #1 + 9d12 Sunrise Point-LP PCI Express Root Port #3 9d14 Sunrise Point-LP PCI Express Root Port #5 17aa 382a B51-80 Laptop 9d15 Sunrise Point-LP PCI Express Root Port #6 @@ -27918,9 +28032,11 @@ 17aa 382a B51-80 Laptop 9d21 Sunrise Point-LP PMC 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d23 Sunrise Point-LP SMBus 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d27 Sunrise Point-LP Serial IO UART Controller #0 9d28 Sunrise Point-LP Serial IO UART Controller #1 @@ -27932,14 +28048,18 @@ 17aa 382a B51-80 Laptop 9d31 Sunrise Point-LP Thermal subsystem 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d3a Sunrise Point-LP CSME HECI #1 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d43 Sunrise Point-LP LPC Controller 17aa 382a B51-80 Laptop 9d48 Sunrise Point-LP LPC Controller 1028 06f3 Latitude 3570 + 9d58 Sunrise Point-LP LPC Controller + 17aa 224f ThinkPad X1 Carbon 5th Gen 9d60 Sunrise Point-LP Serial IO I2C Controller #0 1028 06f3 Latitude 3570 8086 9d60 100 Series PCH/Sunrise Point PCH I2C0 [Skylake/Kaby Lake LPSS I2C] @@ -28520,6 +28640,20 @@ 9005 0552 Series 8 - ASR-8805 - 8 internal 0 external 12G SAS Port/PCIe 3.0 9005 0553 Series 8 - ASR-8085 - 0 internal 8 external 12G SAS Port/PCIe 3.0 9005 0554 Series 8 - ASR-8885 - 8 internal 8 external 12G SAS Port/PCIe 3.0 + 028f Smart Storage PQI 12G SAS/PCIe 3 + 103c 0600 Smart Array P408i-p SR Gen10 + 103c 0601 Smart Array P408e-p SR Gen10 + 103c 0602 Smart Array P408i-a SR Gen10 + 103c 0603 Smart Array P408i-c SR Gen10 + 103c 0650 Smart Array E208i-p SR Gen10 + 103c 0651 Smart Array E208e-p SR Gen10 + 103c 0652 Smart Array E208i-c SR Gen10 + 103c 0654 Smart Array E208i-a SR Gen10 + 103c 0655 Smart Array P408e-m SR Gen10 + 103c 0700 Smart Array P204i-c SR Gen10 + 103c 0701 Smart Array P204i-b SR Gen10 + 103c 1100 Smart Array P816i-a SR Gen10 + 103c 1101 Smart Array P416ie-m SR G10 0410 AIC-9410W SAS (Razor HBA RAID) 9005 0410 ASC-48300(Spirit RAID) 9005 0411 ASC-58300 (Oakmont RAID) From owner-svn-src-all@freebsd.org Fri Jul 14 15:42:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26D58DA4B32; Fri, 14 Jul 2017 15:42:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3BE66A639; Fri, 14 Jul 2017 15:42:13 +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 v6EFgD0e040168; Fri, 14 Jul 2017 15:42:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EFgD04040167; Fri, 14 Jul 2017 15:42:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707141542.v6EFgD04040167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 14 Jul 2017 15:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320989 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 320989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 15:42:14 -0000 Author: kib Date: Fri Jul 14 15:42:12 2017 New Revision: 320989 URL: https://svnweb.freebsd.org/changeset/base/320989 Log: Language improvements. Submitted by: wblock MFC after: 3 days Differential revision: https://reviews.freebsd.org/D10826 Modified: head/libexec/rtld-elf/rtld.1 Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Fri Jul 14 14:58:10 2017 (r320988) +++ head/libexec/rtld-elf/rtld.1 Fri Jul 14 15:42:12 2017 (r320989) @@ -309,7 +309,7 @@ The syntax of the direct invocation is .Op Ar image arguments .Ed .Pp -The options are as follows: +The options are: .Bl -tag -width indent .It Fl f Ar fd File descriptor @@ -339,21 +339,22 @@ Ends the options. The argument following .Fl - -is interpreted as the path of binary to execute. +is interpreted as the path of the binary to execute. .El .Pp -To conform to user expectation to not break some naively restricted -execution environments, in the direct execution mode +In the direct execution mode, .Nm -emulates verification of the binary execute permission -for current user. +emulates verification of the binary execute permission for the +current user. +This is done to avoid breaking user expectations in naively restricted +execution environments. The verification only uses Unix .Dv DACs , ignores .Dv ACLs -and is racy by its nature. -The environments which rely on such restrictions are weak -and breakable on its own. +and is naturally prone to race conditions. +Environments which rely on such restrictions are weak +and breakable on their own. .Sh FILES .Bl -tag -width ".Pa /var/run/ld-elf32.so.hints" -compact .It Pa /var/run/ld-elf.so.hints From owner-svn-src-all@freebsd.org Fri Jul 14 16:05:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205AEDA63EC; Fri, 14 Jul 2017 16:05:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D74066B068; Fri, 14 Jul 2017 16:05:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EG5sGh049500; Fri, 14 Jul 2017 16:05:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EG5suS049499; Fri, 14 Jul 2017 16:05:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707141605.v6EG5suS049499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 14 Jul 2017 16:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320990 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 320990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 16:05:56 -0000 Author: pfg Date: Fri Jul 14 16:05:54 2017 New Revision: 320990 URL: https://svnweb.freebsd.org/changeset/base/320990 Log: libthr: 'count' is unsigned so don't check for negative values. Obtained from: DragonFlyBSD (git e7db8139) Modified: head/lib/libthr/thread/thr_barrier.c Modified: head/lib/libthr/thread/thr_barrier.c ============================================================================== --- head/lib/libthr/thread/thr_barrier.c Fri Jul 14 15:42:12 2017 (r320989) +++ head/lib/libthr/thread/thr_barrier.c Fri Jul 14 16:05:54 2017 (r320990) @@ -100,7 +100,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, pthread_barrier_t bar; int pshared; - if (barrier == NULL || count <= 0) + if (barrier == NULL || count == 0) return (EINVAL); if (attr == NULL || *attr == NULL || From owner-svn-src-all@freebsd.org Fri Jul 14 16:28:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40107DA6A24; Fri, 14 Jul 2017 16:28:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBDC66BA1B; Fri, 14 Jul 2017 16:28:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v6EGS6rf018208 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 14 Jul 2017 19:28:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6EGS6rf018208 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6EGS6YP018207; Fri, 14 Jul 2017 19:28:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 14 Jul 2017 19:28:06 +0300 From: Konstantin Belousov To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320990 - head/lib/libthr/thread Message-ID: <20170714162806.GX1935@kib.kiev.ua> References: <201707141605.v6EG5suS049499@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707141605.v6EG5suS049499@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 16:28:12 -0000 On Fri, Jul 14, 2017 at 04:05:54PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jul 14 16:05:54 2017 > New Revision: 320990 > URL: https://svnweb.freebsd.org/changeset/base/320990 > > Log: > libthr: 'count' is unsigned so don't check for negative values. count is unsigned but pthread_barrier.b_count is not. At very least, this change is half-done. > > Obtained from: DragonFlyBSD (git e7db8139) > > Modified: > head/lib/libthr/thread/thr_barrier.c > > Modified: head/lib/libthr/thread/thr_barrier.c > ============================================================================== > --- head/lib/libthr/thread/thr_barrier.c Fri Jul 14 15:42:12 2017 (r320989) > +++ head/lib/libthr/thread/thr_barrier.c Fri Jul 14 16:05:54 2017 (r320990) > @@ -100,7 +100,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, > pthread_barrier_t bar; > int pshared; > > - if (barrier == NULL || count <= 0) > + if (barrier == NULL || count == 0) > return (EINVAL); > > if (attr == NULL || *attr == NULL || From owner-svn-src-all@freebsd.org Fri Jul 14 16:45:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38354DA725A; Fri, 14 Jul 2017 16:45:48 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE576C464; Fri, 14 Jul 2017 16:45:47 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EGjkkF065874; Fri, 14 Jul 2017 16:45:46 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EGjkL6065872; Fri, 14 Jul 2017 16:45:46 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201707141645.v6EGjkL6065872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 14 Jul 2017 16:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320991 - in head: lib/libmt usr.bin/mt X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in head: lib/libmt usr.bin/mt X-SVN-Commit-Revision: 320991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 16:45:48 -0000 Author: ken Date: Fri Jul 14 16:45:46 2017 New Revision: 320991 URL: https://svnweb.freebsd.org/changeset/base/320991 Log: Add IBM TS1155 density codes to libmt and the mt(1) man page. These are taken directly from the density report from a TS1155 tape drive. (Using mt getdensity) lib/libmt/mtlib.c: Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi values. The bpmm/bpi values are the same as TS1150, but there are 50% more tracks. usr.bin/mt/mt.1: Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi values and number of tracks. Bump the man page date. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/lib/libmt/mtlib.c head/usr.bin/mt/mt.1 Modified: head/lib/libmt/mtlib.c ============================================================================== --- head/lib/libmt/mtlib.c Fri Jul 14 16:05:54 2017 (r320990) +++ head/lib/libmt/mtlib.c Fri Jul 14 16:45:46 2017 (r320991) @@ -641,6 +641,7 @@ static struct densities { { 0x53, 13452, 341681, "3592A3 (unencrypted)" }, { 0x54, 19686, 500024, "3592A4 (unencrypted)" }, { 0x55, 20670, 525018, "3592A5 (unencrypted)" }, + { 0x56, 20670, 525018, "3592B5 (unencrypted)" }, { 0x58, 15142, 384607, "LTO-5" }, { 0x5A, 15142, 384607, "LTO-6" }, { 0x5C, 19107, 485318, "LTO-7" }, @@ -650,6 +651,7 @@ static struct densities { { 0x73, 13452, 341681, "3592A3 (encrypted)" }, { 0x74, 19686, 500024, "3592A4 (encrypted)" }, { 0x75, 20670, 525018, "3592A5 (encrypted)" }, + { 0x76, 20670, 525018, "3592B5 (encrypted)" }, { 0x8c, 1789, 45434, "EXB-8500c" }, { 0x90, 1703, 43245, "EXB-8200c" }, { 0, 0, 0, NULL } Modified: head/usr.bin/mt/mt.1 ============================================================================== --- head/usr.bin/mt/mt.1 Fri Jul 14 16:05:54 2017 (r320990) +++ head/usr.bin/mt/mt.1 Fri Jul 14 16:45:46 2017 (r320991) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 11, 2017 +.Dd July 14, 2017 .Dt MT 1 .Os .Sh NAME @@ -518,6 +518,7 @@ Value Width Tracks Density Code Typ 0x53 12.7 (0.5) 1152 13,452 (341,681) C 3592A3 (unencrypted) 0x54 12.7 (0.5) 2560 19,686 (500,024) C 3592A4 (unencrypted) 0x55 12.7 (0.5) 5120 20,670 (525,018) C 3592A5 (unencrypted) +0x56 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (unencrypted) 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 @@ -527,6 +528,7 @@ Value Width Tracks Density Code Typ 0x73 12.7 (0.5) 1152 13,452 (341,681) C 3592A3 (encrypted) 0x74 12.7 (0.5) 2560 19,686 (500,024) C 3592A4 (encrypted) 0x75 12.7 (0.5) 5120 20,670 (525,018) C 3592A5 (encrypted) +0x76 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (encrypted) 0x8c 8.0 (0.315) 1 1,789 (45,434) RLL CS EXB-8500c 5,9 0x90 8.0 (0.315) 1 1,703 (43,245) RLL CS EXB-8200c 5,9 .Ed From owner-svn-src-all@freebsd.org Fri Jul 14 17:07:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6231CDA82B5; Fri, 14 Jul 2017 17:07:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7B06E57B; Fri, 14 Jul 2017 17:07:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EH7SML076956; Fri, 14 Jul 2017 17:07:28 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EH7STB076955; Fri, 14 Jul 2017 17:07:28 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201707141707.v6EH7STB076955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 14 Jul 2017 17:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320992 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 320992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 17:07:29 -0000 Author: brd (doc,ports committer) Date: Fri Jul 14 17:07:28 2017 New Revision: 320992 URL: https://svnweb.freebsd.org/changeset/base/320992 Log: Add a complete example to tsearch(3) Reviewed by: wblock, sevan, bruffer MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11053 Modified: head/lib/libc/stdlib/tsearch.3 Modified: head/lib/libc/stdlib/tsearch.3 ============================================================================== --- head/lib/libc/stdlib/tsearch.3 Fri Jul 14 16:45:46 2017 (r320991) +++ head/lib/libc/stdlib/tsearch.3 Fri Jul 14 17:07:28 2017 (r320992) @@ -27,7 +27,7 @@ .\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp .\" $FreeBSD$ .\" -.Dd October 9, 2016 +.Dd June 4, 2017 .Dt TSEARCH 3 .Os .Sh NAME @@ -130,6 +130,64 @@ is NULL or the datum cannot be found. The .Fn twalk function returns no value. +.Sh EXAMPLES +This example uses +.Fn tsearch +to search for four strings in +.Dv root . +Because the strings are not already present, they are added. +.Fn tsearch +is called twice on the fourth string to demonstrate that a string is not added when it is already present. +.Fn tfind +is used to find the single instance of the fourth string, and +.Fn tdelete +removes it. +Finally, +.Fn twalk +is used to return and display the resulting binary search tree. +.Bd -literal +#include +#include +#include + +int +comp(const void *a, const void *b) +{ + + return strcmp(a, b); +} + +void +printwalk(const posix_tnode * node, VISIT v, int __unused0) +{ + + if (v == postorder || v == leaf) { + printf("node: %s\n\\", *(char **)node); + } +} + +int +main(void) +{ + posix_tnode *root = NULL; + + char one[] = "blah1"; + char two[] = "blah-2"; + char three[] = "blah-3"; + char four[] = "blah-4"; + + tsearch(one, &root, comp); + tsearch(two, &root, comp); + tsearch(three, &root, comp); + tsearch(four, &root, comp); + tsearch(four, &root, comp); + printf("four: %s\n", *(char **)tfind(four, &root, comp)); + tdelete(four, &root, comp); + + twalk(root, printwalk); + return 0; +} +.Ed .Sh SEE ALSO .Xr bsearch 3 , .Xr hsearch 3 , From owner-svn-src-all@freebsd.org Fri Jul 14 17:27:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21180DA8B1B; Fri, 14 Jul 2017 17:27:17 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E30636F57A; Fri, 14 Jul 2017 17:27:16 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EHRGWm085914; Fri, 14 Jul 2017 17:27:16 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EHRGU3085913; Fri, 14 Jul 2017 17:27:16 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201707141727.v6EHRGU3085913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 14 Jul 2017 17:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320993 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 320993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 17:27:17 -0000 Author: brd (doc,ports committer) Date: Fri Jul 14 17:27:15 2017 New Revision: 320993 URL: https://svnweb.freebsd.org/changeset/base/320993 Log: Follow up to r320992, properly escape the backslash so it renders properly. MFC after: 1 week Forgotten by: brd X-MFC-With: r320992 Modified: head/lib/libc/stdlib/tsearch.3 Modified: head/lib/libc/stdlib/tsearch.3 ============================================================================== --- head/lib/libc/stdlib/tsearch.3 Fri Jul 14 17:07:28 2017 (r320992) +++ head/lib/libc/stdlib/tsearch.3 Fri Jul 14 17:27:15 2017 (r320993) @@ -162,7 +162,7 @@ printwalk(const posix_tnode * node, VISIT v, int __unu { if (v == postorder || v == leaf) { - printf("node: %s\n\\", *(char **)node); + printf("node: %s\en", *(char **)node); } } @@ -181,7 +181,7 @@ main(void) tsearch(three, &root, comp); tsearch(four, &root, comp); tsearch(four, &root, comp); - printf("four: %s\n", *(char **)tfind(four, &root, comp)); + printf("four: %s\en", *(char **)tfind(four, &root, comp)); tdelete(four, &root, comp); twalk(root, printwalk); From owner-svn-src-all@freebsd.org Fri Jul 14 18:13:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730D1DA974B; Fri, 14 Jul 2017 18:13:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39E2F70EAA; Fri, 14 Jul 2017 18:13:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EIDsSm006888; Fri, 14 Jul 2017 18:13:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EIDsda006887; Fri, 14 Jul 2017 18:13:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707141813.v6EIDsda006887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 14 Jul 2017 18:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320996 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 320996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 18:13:55 -0000 Author: ian Date: Fri Jul 14 18:13:54 2017 New Revision: 320996 URL: https://svnweb.freebsd.org/changeset/base/320996 Log: Allow setting debug.clocktime as a tunable. Print 64-bit time_t correctly on 32-bit systems. Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Fri Jul 14 17:41:15 2017 (r320995) +++ head/sys/kern/subr_clock.c Fri Jul 14 18:13:54 2017 (r320996) @@ -72,7 +72,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT "Local offset from UTC in seconds"); static int ct_debug; -SYSCTL_INT(_debug, OID_AUTO, clocktime, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, clocktime, CTLFLAG_RWTUN, &ct_debug, 0, "Enable printing of clocktime debugging"); static int wall_cmos_clock; @@ -171,7 +171,7 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * ts->tv_nsec = ct->nsec; if (ct_debug) - printf(" = %ld.%09ld\n", (long)ts->tv_sec, (long)ts->tv_nsec); + printf(" = %jd.%09ld\n", (intmax_t)ts->tv_sec, ts->tv_nsec); return (0); } @@ -209,8 +209,8 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * ct->sec = rsec; ct->nsec = ts->tv_nsec; if (ct_debug) { - printf("ts_to_ct(%ld.%09ld) = ", - (long)ts->tv_sec, (long)ts->tv_nsec); + printf("ts_to_ct(%jd.%09ld) = ", + (intmax_t)ts->tv_sec, ts->tv_nsec); print_ct(ct); printf("\n"); } From owner-svn-src-all@freebsd.org Fri Jul 14 18:36:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A80CEDA9D1F; Fri, 14 Jul 2017 18:36:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75B0271819; Fri, 14 Jul 2017 18:36:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EIaFw6015056; Fri, 14 Jul 2017 18:36:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EIaF8R015055; Fri, 14 Jul 2017 18:36:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707141836.v6EIaF8R015055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 14 Jul 2017 18:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320997 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 320997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 18:36:16 -0000 Author: ian Date: Fri Jul 14 18:36:15 2017 New Revision: 320997 URL: https://svnweb.freebsd.org/changeset/base/320997 Log: Minor optimization: instead of converting between days and years using loops that start in 1970, assume most conversions are going to be for recent dates and use a precomputed number of days through the end of 2016. Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Fri Jul 14 18:13:54 2017 (r320996) +++ head/sys/kern/subr_clock.c Fri Jul 14 18:36:15 2017 (r320997) @@ -97,6 +97,13 @@ static const int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +/* + * Optimization: using a precomputed count of days between POSIX_BASE_YEAR and a + * recent year avoids lots of needless loop iterations in conversion. + * recent_base_days is the number of days through the end of recent_base_year. + */ +static const int recent_base_year = 2016; +static const int recent_base_days = 17167; /* * This inline avoids some unnecessary modulo operations @@ -157,8 +164,14 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * * Compute days since start of time * First from years, then from months. */ - days = 0; - for (i = POSIX_BASE_YEAR; i < year; i++) + if (year > recent_base_year) { + i = recent_base_year; + days = recent_base_days; + } else { + i = POSIX_BASE_YEAR; + days = 0; + } + for (; i < year; i++) days += days_in_year(i); /* Months */ @@ -188,8 +201,14 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * ct->dow = day_of_week(days); - /* Subtract out whole years, counting them in i. */ - for (year = POSIX_BASE_YEAR; days >= days_in_year(year); year++) + /* Subtract out whole years. */ + if (days >= recent_base_days) { + year = recent_base_year + 1; + days -= recent_base_days; + } else { + year = POSIX_BASE_YEAR; + } + for (; days >= days_in_year(year); year++) days -= days_in_year(year); ct->year = year; From owner-svn-src-all@freebsd.org Fri Jul 14 20:47:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FDBDAC08E; Fri, 14 Jul 2017 20:47:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D010762B1; Fri, 14 Jul 2017 20:47:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6EKlgwv070976; Fri, 14 Jul 2017 20:47:42 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6EKlgWq070971; Fri, 14 Jul 2017 20:47:42 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707142047.v6EKlgWq070971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 14 Jul 2017 20:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320998 - in stable/11/sys/fs: nfs nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/11/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 320998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 20:47:43 -0000 Author: rmacklem Date: Fri Jul 14 20:47:41 2017 New Revision: 320998 URL: https://svnweb.freebsd.org/changeset/base/320998 Log: MFC: r320322 Add two new compound RPCs to the NFSv4.1/pNFS client. When the NFSv4.1 client is doing pNFS, it needs to get an Open and a Layout for every file it will be doing I/O on. The current code does two separate RPCs to get these. This patch adds two new compounds that do the both the Open and LayoutGet in the same RPC, reducing the RPC count. It also factors out the code that sets up and parses the LayoutGet operation into separate functions, so that the code doesn't get duplicated for these new RPCs. This patch is fairly large, but should only affect the NFSv4.1 client when the "pnfs" option is specified. Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfsport.h stable/11/sys/fs/nfs/nfsproto.h stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Fri Jul 14 18:36:15 2017 (r320997) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Fri Jul 14 20:47:41 2017 (r320998) @@ -175,7 +175,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; */ int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); Modified: stable/11/sys/fs/nfs/nfsport.h ============================================================================== --- stable/11/sys/fs/nfs/nfsport.h Fri Jul 14 18:36:15 2017 (r320997) +++ stable/11/sys/fs/nfs/nfsport.h Fri Jul 14 20:47:41 2017 (r320998) @@ -357,11 +357,13 @@ #define NFSPROC_WRITEDS 51 #define NFSPROC_READDS 52 #define NFSPROC_COMMITDS 53 +#define NFSPROC_OPENLAYGET 54 +#define NFSPROC_CREATELAYGET 55 /* * Must be defined as one higher than the last NFSv4.1 Proc# above. */ -#define NFSV41_NPROCS 54 +#define NFSV41_NPROCS 56 #endif /* NFS_V3NPROCS */ @@ -390,7 +392,7 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV41_NPROCS + 15]; + uint64_t rpccnt[NFSV41_NPROCS + 13]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS]; uint64_t srvrpc_errs; Modified: stable/11/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/11/sys/fs/nfs/nfsproto.h Fri Jul 14 18:36:15 2017 (r320997) +++ stable/11/sys/fs/nfs/nfsproto.h Fri Jul 14 20:47:41 2017 (r320998) @@ -342,11 +342,13 @@ #define NFSPROC_WRITEDS 51 #define NFSPROC_READDS 52 #define NFSPROC_COMMITDS 53 +#define NFSPROC_OPENLAYGET 54 +#define NFSPROC_CREATELAYGET 55 /* * Must be defined as one higher than the last NFSv4.1 Proc# above. */ -#define NFSV41_NPROCS 54 +#define NFSV41_NPROCS 56 #endif /* NFS_V3NPROCS */ Modified: stable/11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri Jul 14 18:36:15 2017 (r320997) +++ stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri Jul 14 20:47:41 2017 (r320998) @@ -112,6 +112,8 @@ static struct { { NFSV4OP_WRITE, 1, "WriteDS", 7, }, { NFSV4OP_READ, 1, "ReadDS", 6, }, { NFSV4OP_COMMIT, 1, "CommitDS", 8, }, + { NFSV4OP_OPEN, 3, "OpenLayoutGet", 13, }, + { NFSV4OP_OPEN, 8, "CreateLayGet", 12, }, }; /* @@ -120,7 +122,7 @@ static struct { static int nfs_bigrequest[NFSV41_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }; /* Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 14 18:36:15 2017 (r320997) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 14 20:47:41 2017 (r320998) @@ -127,6 +127,29 @@ static enum nfsclds_state nfscl_getsameserver(struct n static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, struct nfsfh *, struct ucred *, NFSPROC_T *, void *); #endif +static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, + uint64_t, uint64_t, nfsv4stateid_t *, int, int); +static int nfsrv_parselayoutget(struct nfsrv_descript *, nfsv4stateid_t *, + int *, struct nfsclflayouthead *); +static int nfsrpc_getopenlayout(struct nfsmount *, vnode_t, u_int8_t *, + int, uint8_t *, int, uint32_t, struct nfsclopen *, uint8_t *, int, + struct nfscldeleg **, struct ucred *, NFSPROC_T *); +static int nfsrpc_getcreatelayout(vnode_t, char *, int, struct vattr *, + nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, + struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, + struct nfsfh **, int *, int *, void *, int *); +static int nfsrpc_openlayoutrpc(struct nfsmount *, vnode_t, u_int8_t *, + int, uint8_t *, int, uint32_t, struct nfsclopen *, uint8_t *, int, + struct nfscldeleg **, nfsv4stateid_t *, int, int, int *, + struct nfsclflayouthead *, int *, struct ucred *, NFSPROC_T *); +static int nfsrpc_createlayout(vnode_t, char *, int, struct vattr *, + nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, + struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, + struct nfsfh **, int *, int *, void *, int *, nfsv4stateid_t *, + int, int, int *, struct nfsclflayouthead *, int *); +static int nfsrpc_layoutgetres(struct nfsmount *, vnode_t, uint8_t *, + int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, + struct nfsclflayouthead *, int, int *, struct ucred *, NFSPROC_T *); /* * nfs null call from vfs. @@ -301,11 +324,27 @@ else printf(" fhl=0\n"); clidrev = 0; if (ret == NFSCLOPEN_DOOPEN) { if (np->n_v4 != NULL) { - error = nfsrpc_openrpc(nmp, vp, np->n_v4->n4_data, - np->n_v4->n4_fhlen, np->n_fhp->nfh_fh, - np->n_fhp->nfh_len, mode, op, - NFS4NODENAME(np->n_v4), np->n_v4->n4_namelen, &dp, - 0, 0x0, cred, p, 0, 0); + /* + * For the first attempt, try and get a layout, if + * pNFS is enabled for the mount. + */ + if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || + nfs_numnfscbd == 0 || + (np->n_flag & NNOLAYOUT) != 0 || retrycnt > 0) + error = nfsrpc_openrpc(nmp, vp, + np->n_v4->n4_data, + np->n_v4->n4_fhlen, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len, mode, op, + NFS4NODENAME(np->n_v4), + np->n_v4->n4_namelen, + &dp, 0, 0x0, cred, p, 0, 0); + else + error = nfsrpc_getopenlayout(nmp, vp, + np->n_v4->n4_data, + np->n_v4->n4_fhlen, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len, mode, op, + NFS4NODENAME(np->n_v4), + np->n_v4->n4_namelen, &dp, cred, p); if (dp != NULL) { #ifdef APPLE OSBitAndAtomic((int32_t)~NDELEGMOD, (UInt32 *)&np->n_flag); @@ -1894,9 +1933,15 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, st clidrev = nmp->nm_clp->nfsc_clientidrev; else clidrev = 0; - error = nfsrpc_createv4(dvp, name, namelen, vap, cverf, fmode, - owp, &dp, cred, p, dnap, nnap, nfhpp, attrflagp, dattrflagp, - dstuff, &unlocked); + if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || + nfs_numnfscbd == 0 || retrycnt > 0) + error = nfsrpc_createv4(dvp, name, namelen, vap, cverf, + fmode, owp, &dp, cred, p, dnap, nnap, nfhpp, + attrflagp, dattrflagp, dstuff, &unlocked); + else + error = nfsrpc_getcreatelayout(dvp, name, namelen, vap, + cverf, fmode, owp, &dp, cred, p, dnap, nnap, nfhpp, + attrflagp, dattrflagp, dstuff, &unlocked); /* * There is no need to invalidate cached attributes here, * since new post-delegation issue attributes are always @@ -4785,149 +4830,22 @@ nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i nfsv4stateid_t *stateidp, int *retonclosep, struct nfsclflayouthead *flhp, struct ucred *cred, NFSPROC_T *p, void *stuff) { - uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - struct nfsfh *nfhp; - struct nfsclflayout *flp, *prevflp, *tflp; - int cnt, error, gotiomode, fhcnt, nfhlen, i, j; - uint8_t *cp; - uint64_t retlen; + int error; - flp = NULL; - gotiomode = -1; nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL); - NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED + 3 * NFSX_HYPER + - NFSX_STATEID); - *tl++ = newnfs_false; /* Don't signal availability. */ - *tl++ = txdr_unsigned(NFSLAYOUT_NFSV4_1_FILES); - *tl++ = txdr_unsigned(iomode); - txdr_hyper(offset, tl); - tl += 2; - txdr_hyper(len, tl); - tl += 2; - txdr_hyper(minlen, tl); - tl += 2; - *tl++ = txdr_unsigned(stateidp->seqid); - NFSCL_DEBUG(4, "layget seq=%d\n", (int)stateidp->seqid); - *tl++ = stateidp->other[0]; - *tl++ = stateidp->other[1]; - *tl++ = stateidp->other[2]; - *tl = txdr_unsigned(layoutlen); + nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, + layoutlen, 0); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); + NFSCL_DEBUG(4, "layget err=%d st=%d\n", error, nd->nd_repstat); if (error != 0) return (error); - if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + NFSX_STATEID); - if (*tl++ != 0) - *retonclosep = 1; - else - *retonclosep = 0; - stateidp->seqid = fxdr_unsigned(uint32_t, *tl++); - NFSCL_DEBUG(4, "retoncls=%d stseq=%d\n", *retonclosep, - (int)stateidp->seqid); - stateidp->other[0] = *tl++; - stateidp->other[1] = *tl++; - stateidp->other[2] = *tl++; - cnt = fxdr_unsigned(int, *tl); - NFSCL_DEBUG(4, "layg cnt=%d\n", cnt); - if (cnt <= 0 || cnt > 10000) { - /* Don't accept more than 10000 layouts in reply. */ - error = NFSERR_BADXDR; - goto nfsmout; - } - for (i = 0; i < cnt; i++) { - /* Dissect all the way to the file handle cnt. */ - NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_HYPER + - 6 * NFSX_UNSIGNED + NFSX_V4DEVICEID); - fhcnt = fxdr_unsigned(int, *(tl + 11 + - NFSX_V4DEVICEID / NFSX_UNSIGNED)); - NFSCL_DEBUG(4, "fhcnt=%d\n", fhcnt); - if (fhcnt < 0 || fhcnt > 100) { - /* Don't accept more than 100 file handles. */ - error = NFSERR_BADXDR; - goto nfsmout; - } - if (fhcnt > 1) - flp = malloc(sizeof(*flp) + (fhcnt - 1) * - sizeof(struct nfsfh *), - M_NFSFLAYOUT, M_WAITOK); - else - flp = malloc(sizeof(*flp), - M_NFSFLAYOUT, M_WAITOK); - flp->nfsfl_flags = 0; - flp->nfsfl_fhcnt = 0; - flp->nfsfl_devp = NULL; - flp->nfsfl_off = fxdr_hyper(tl); tl += 2; - retlen = fxdr_hyper(tl); tl += 2; - if (flp->nfsfl_off + retlen < flp->nfsfl_off) - flp->nfsfl_end = UINT64_MAX - flp->nfsfl_off; - else - flp->nfsfl_end = flp->nfsfl_off + retlen; - flp->nfsfl_iomode = fxdr_unsigned(int, *tl++); - if (gotiomode == -1) - gotiomode = flp->nfsfl_iomode; - NFSCL_DEBUG(4, "layg reqiom=%d retiom=%d\n", iomode, - (int)flp->nfsfl_iomode); - if (fxdr_unsigned(int, *tl++) != - NFSLAYOUT_NFSV4_1_FILES) { - printf("NFSv4.1: got non-files layout\n"); - error = NFSERR_BADXDR; - goto nfsmout; - } - NFSBCOPY(++tl, flp->nfsfl_dev, NFSX_V4DEVICEID); - tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); - flp->nfsfl_util = fxdr_unsigned(uint32_t, *tl++); - NFSCL_DEBUG(4, "flutil=0x%x\n", flp->nfsfl_util); - flp->nfsfl_stripe1 = fxdr_unsigned(uint32_t, *tl++); - flp->nfsfl_patoff = fxdr_hyper(tl); tl += 2; - if (fxdr_unsigned(int, *tl) != fhcnt) { - printf("EEK! bad fhcnt\n"); - error = NFSERR_BADXDR; - goto nfsmout; - } - for (j = 0; j < fhcnt; j++) { - NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - nfhlen = fxdr_unsigned(int, *tl); - if (nfhlen <= 0 || nfhlen > NFSX_V4FHMAX) { - error = NFSERR_BADXDR; - goto nfsmout; - } - nfhp = malloc(sizeof(*nfhp) + nfhlen - 1, - M_NFSFH, M_WAITOK); - flp->nfsfl_fh[j] = nfhp; - flp->nfsfl_fhcnt++; - nfhp->nfh_len = nfhlen; - NFSM_DISSECT(cp, uint8_t *, NFSM_RNDUP(nfhlen)); - NFSBCOPY(cp, nfhp->nfh_fh, nfhlen); - } - if (flp->nfsfl_iomode == gotiomode) { - /* Keep the list in increasing offset order. */ - tflp = LIST_FIRST(flhp); - prevflp = NULL; - while (tflp != NULL && - tflp->nfsfl_off < flp->nfsfl_off) { - prevflp = tflp; - tflp = LIST_NEXT(tflp, nfsfl_list); - } - if (prevflp == NULL) - LIST_INSERT_HEAD(flhp, flp, nfsfl_list); - else - LIST_INSERT_AFTER(prevflp, flp, - nfsfl_list); - } else { - printf("nfscl_layoutget(): got wrong iomode\n"); - nfscl_freeflayout(flp); - } - flp = NULL; - } - } - if (nd->nd_repstat != 0 && error == 0) + if (nd->nd_repstat == 0) + error = nfsrv_parselayoutget(nd, stateidp, retonclosep, flhp); + if (error == 0 && nd->nd_repstat != 0) error = nd->nd_repstat; -nfsmout: - if (error != 0 && flp != NULL) - nfscl_freeflayout(flp); mbuf_freem(nd->nd_mrep); return (error); } @@ -5228,8 +5146,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str struct nfscllayout **lypp, struct ucred *cred, NFSPROC_T *p) { struct nfscllayout *lyp; - struct nfsclflayout *flp, *tflp; - struct nfscldevinfo *dip; + struct nfsclflayout *flp; struct nfsclflayouthead flh; int error = 0, islocked, layoutlen, recalled, retonclose; nfsv4stateid_t stateid; @@ -5271,35 +5188,13 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str (uint64_t)0, layoutlen, &stateid, &retonclose, &flh, cred, p, NULL); } + error = nfsrpc_layoutgetres(nmp, vp, nfhp->nfh_fh, + nfhp->nfh_len, &stateid, retonclose, notifybitsp, &lyp, + &flh, error, NULL, cred, p); if (error == 0) - LIST_FOREACH(tflp, &flh, nfsfl_list) { - error = nfscl_adddevinfo(nmp, NULL, tflp); - if (error != 0) { - error = nfsrpc_getdeviceinfo(nmp, - tflp->nfsfl_dev, - NFSLAYOUT_NFSV4_1_FILES, - notifybitsp, &dip, cred, p); - if (error != 0) - break; - error = nfscl_adddevinfo(nmp, dip, - tflp); - if (error != 0) - printf( - "getlayout: cannot add\n"); - } - } - if (error == 0) { - /* - * nfscl_layout() always returns with the nfsly_lock - * set to a refcnt (shared lock). - */ - error = nfscl_layout(nmp, vp, nfhp->nfh_fh, - nfhp->nfh_len, &stateid, retonclose, &flh, &lyp, - cred, p); - if (error == 0) - *lypp = lyp; - } else if (islocked != 0) - nfsv4_unlock(&lyp->nfsly_lock, 0); + *lypp = lyp; + else if (islocked != 0) + nfscl_rellayout(lyp, 1); } else *lypp = lyp; return (error); @@ -6021,4 +5916,756 @@ nfsmout: return (error); } #endif + +/* + * Set up the XDR arguments for the LayoutGet operation. + */ +static void +nfsrv_setuplayoutget(struct nfsrv_descript *nd, int iomode, uint64_t offset, + uint64_t len, uint64_t minlen, nfsv4stateid_t *stateidp, int layoutlen, + int usecurstateid) +{ + uint32_t *tl; + + NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED + 3 * NFSX_HYPER + + NFSX_STATEID); + *tl++ = newnfs_false; /* Don't signal availability. */ + *tl++ = txdr_unsigned(NFSLAYOUT_NFSV4_1_FILES); + *tl++ = txdr_unsigned(iomode); + txdr_hyper(offset, tl); + tl += 2; + txdr_hyper(len, tl); + tl += 2; + txdr_hyper(minlen, tl); + tl += 2; + if (usecurstateid != 0) { + /* Special stateid for Current stateid. */ + *tl++ = txdr_unsigned(1); + *tl++ = 0; + *tl++ = 0; + *tl++ = 0; + } else { + *tl++ = txdr_unsigned(stateidp->seqid); + NFSCL_DEBUG(4, "layget seq=%d\n", (int)stateidp->seqid); + *tl++ = stateidp->other[0]; + *tl++ = stateidp->other[1]; + *tl++ = stateidp->other[2]; + } + *tl = txdr_unsigned(layoutlen); +} + +/* + * Parse the reply for a successful LayoutGet operation. + */ +static int +nfsrv_parselayoutget(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, + int *retonclosep, struct nfsclflayouthead *flhp) +{ + uint32_t *tl; + struct nfsclflayout *flp, *prevflp, *tflp; + int cnt, error, gotiomode, fhcnt, nfhlen, i, j; + uint64_t retlen; + struct nfsfh *nfhp; + uint8_t *cp; + + error = 0; + flp = NULL; + gotiomode = -1; + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + NFSX_STATEID); + if (*tl++ != 0) + *retonclosep = 1; + else + *retonclosep = 0; + stateidp->seqid = fxdr_unsigned(uint32_t, *tl++); + NFSCL_DEBUG(4, "retoncls=%d stseq=%d\n", *retonclosep, + (int)stateidp->seqid); + stateidp->other[0] = *tl++; + stateidp->other[1] = *tl++; + stateidp->other[2] = *tl++; + cnt = fxdr_unsigned(int, *tl); + NFSCL_DEBUG(4, "layg cnt=%d\n", cnt); + if (cnt <= 0 || cnt > 10000) { + /* Don't accept more than 10000 layouts in reply. */ + error = NFSERR_BADXDR; + goto nfsmout; + } + for (i = 0; i < cnt; i++) { + /* Dissect all the way to the file handle cnt. */ + NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_HYPER + + 6 * NFSX_UNSIGNED + NFSX_V4DEVICEID); + fhcnt = fxdr_unsigned(int, *(tl + 11 + + NFSX_V4DEVICEID / NFSX_UNSIGNED)); + NFSCL_DEBUG(4, "fhcnt=%d\n", fhcnt); + if (fhcnt < 0 || fhcnt > 100) { + /* Don't accept more than 100 file handles. */ + error = NFSERR_BADXDR; + goto nfsmout; + } + if (fhcnt > 1) + flp = malloc(sizeof(*flp) + (fhcnt - 1) * + sizeof(struct nfsfh *), M_NFSFLAYOUT, M_WAITOK); + else + flp = malloc(sizeof(*flp), M_NFSFLAYOUT, M_WAITOK); + flp->nfsfl_flags = 0; + flp->nfsfl_fhcnt = 0; + flp->nfsfl_devp = NULL; + flp->nfsfl_off = fxdr_hyper(tl); tl += 2; + retlen = fxdr_hyper(tl); tl += 2; + if (flp->nfsfl_off + retlen < flp->nfsfl_off) + flp->nfsfl_end = UINT64_MAX - flp->nfsfl_off; + else + flp->nfsfl_end = flp->nfsfl_off + retlen; + flp->nfsfl_iomode = fxdr_unsigned(int, *tl++); + if (gotiomode == -1) + gotiomode = flp->nfsfl_iomode; + if (fxdr_unsigned(int, *tl++) != NFSLAYOUT_NFSV4_1_FILES) { + printf("NFSv4.1: got non-files layout\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + NFSBCOPY(++tl, flp->nfsfl_dev, NFSX_V4DEVICEID); + tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); + flp->nfsfl_util = fxdr_unsigned(uint32_t, *tl++); + NFSCL_DEBUG(4, "flutil=0x%x\n", flp->nfsfl_util); + flp->nfsfl_stripe1 = fxdr_unsigned(uint32_t, *tl++); + flp->nfsfl_patoff = fxdr_hyper(tl); tl += 2; + if (fxdr_unsigned(int, *tl) != fhcnt) { + printf("EEK! bad fhcnt\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + for (j = 0; j < fhcnt; j++) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + nfhlen = fxdr_unsigned(int, *tl); + if (nfhlen <= 0 || nfhlen > NFSX_V4FHMAX) { + error = NFSERR_BADXDR; + goto nfsmout; + } + nfhp = malloc(sizeof(*nfhp) + nfhlen - 1, M_NFSFH, + M_WAITOK); + flp->nfsfl_fh[j] = nfhp; + flp->nfsfl_fhcnt++; + nfhp->nfh_len = nfhlen; + NFSM_DISSECT(cp, uint8_t *, NFSM_RNDUP(nfhlen)); + NFSBCOPY(cp, nfhp->nfh_fh, nfhlen); + } + if (flp->nfsfl_iomode == gotiomode) { + /* Keep the list in increasing offset order. */ + tflp = LIST_FIRST(flhp); + prevflp = NULL; + while (tflp != NULL && + tflp->nfsfl_off < flp->nfsfl_off) { + prevflp = tflp; + tflp = LIST_NEXT(tflp, nfsfl_list); + } + if (prevflp == NULL) + LIST_INSERT_HEAD(flhp, flp, nfsfl_list); + else + LIST_INSERT_AFTER(prevflp, flp, + nfsfl_list); + } else { + printf("nfscl_layoutget(): got wrong iomode\n"); + nfscl_freeflayout(flp); + } + flp = NULL; + } +nfsmout: + if (error != 0 && flp != NULL) + nfscl_freeflayout(flp); + return (error); +} + +/* + * Similar to nfsrpc_getlayout(), except that it uses nfsrpc_openlayget(), + * so that it does both an Open and a Layoutget. + */ +static int +nfsrpc_getopenlayout(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, + int fhlen, uint8_t *newfhp, int newfhlen, uint32_t mode, + struct nfsclopen *op, uint8_t *name, int namelen, struct nfscldeleg **dpp, + struct ucred *cred, NFSPROC_T *p) +{ + struct nfscllayout *lyp; + struct nfsclflayout *flp; + struct nfsclflayouthead flh; + int error, islocked, layoutlen, recalled, retonclose, usecurstateid; + int laystat; + nfsv4stateid_t stateid; + struct nfsclsession *tsep; + + error = 0; + /* + * If lyp is returned non-NULL, there will be a refcnt (shared lock) + * on it, iff flp != NULL or a lock (exclusive lock) on it iff + * flp == NULL. + */ + lyp = nfscl_getlayout(nmp->nm_clp, newfhp, newfhlen, 0, &flp, + &recalled); + NFSCL_DEBUG(4, "nfsrpc_getopenlayout nfscl_getlayout lyp=%p\n", lyp); + if (lyp == NULL) + islocked = 0; + else if (flp != NULL) + islocked = 1; + else + islocked = 2; + if ((lyp == NULL || flp == NULL) && recalled == 0) { + LIST_INIT(&flh); + tsep = nfsmnt_mdssession(nmp); + layoutlen = tsep->nfsess_maxcache - (NFSX_STATEID + + 3 * NFSX_UNSIGNED); + if (lyp == NULL) + usecurstateid = 1; + else { + usecurstateid = 0; + stateid.seqid = lyp->nfsly_stateid.seqid; + stateid.other[0] = lyp->nfsly_stateid.other[0]; + stateid.other[1] = lyp->nfsly_stateid.other[1]; + stateid.other[2] = lyp->nfsly_stateid.other[2]; + } + error = nfsrpc_openlayoutrpc(nmp, vp, nfhp, fhlen, + newfhp, newfhlen, mode, op, name, namelen, + dpp, &stateid, usecurstateid, layoutlen, + &retonclose, &flh, &laystat, cred, p); + NFSCL_DEBUG(4, "aft nfsrpc_openlayoutrpc laystat=%d err=%d\n", + laystat, error); + laystat = nfsrpc_layoutgetres(nmp, vp, newfhp, newfhlen, + &stateid, retonclose, NULL, &lyp, &flh, laystat, &islocked, + cred, p); + } else + error = nfsrpc_openrpc(nmp, vp, nfhp, fhlen, newfhp, newfhlen, + mode, op, name, namelen, dpp, 0, 0, cred, p, 0, 0); + if (islocked == 2) + nfscl_rellayout(lyp, 1); + else if (islocked == 1) + nfscl_rellayout(lyp, 0); + return (error); +} + +/* + * This function does an Open+LayoutGet for an NFSv4.1 mount with pNFS + * enabled, only for the CLAIM_NULL case. All other NFSv4 Opens are + * handled by nfsrpc_openrpc(). + * For the case where op == NULL, dvp is the directory. When op != NULL, it + * can be NULL. + */ +static int +nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, + int fhlen, uint8_t *newfhp, int newfhlen, uint32_t mode, + struct nfsclopen *op, uint8_t *name, int namelen, struct nfscldeleg **dpp, + nfsv4stateid_t *stateidp, int usecurstateid, + int layoutlen, int *retonclosep, struct nfsclflayouthead *flhp, + int *laystatp, struct ucred *cred, NFSPROC_T *p) +{ + uint32_t *tl; + struct nfsrv_descript nfsd, *nd = &nfsd; + struct nfscldeleg *ndp = NULL; + struct nfsvattr nfsva; + struct nfsclsession *tsep; + uint32_t rflags, deleg; + nfsattrbit_t attrbits; + int error, ret, acesize, limitby, iomode; + + *dpp = NULL; + *laystatp = ENXIO; + nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL); + NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); + *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); + *tl++ = txdr_unsigned((mode >> NFSLCK_SHIFT) & NFSV4OPEN_DENYBOTH); + tsep = nfsmnt_mdssession(nmp); + *tl++ = tsep->nfsess_clientid.lval[0]; + *tl = tsep->nfsess_clientid.lval[1]; + nfsm_strtom(nd, op->nfso_own->nfsow_owner, NFSV4CL_LOCKNAMELEN); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV4OPEN_NOCREATE); + *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); + nfsm_strtom(nd, name, namelen); + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + NFSZERO_ATTRBIT(&attrbits); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFY); + nfsrv_putattrbit(nd, &attrbits); + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_LAYOUTGET); + if ((mode & NFSV4OPEN_ACCESSWRITE) != 0) + iomode = NFSLAYOUTIOMODE_RW; + else + iomode = NFSLAYOUTIOMODE_READ; + nfsrv_setuplayoutget(nd, iomode, 0, UINT64_MAX, 0, stateidp, + layoutlen, usecurstateid); + error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, vp, p, cred, + NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); + if (error != 0) + return (error); + NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); + if (nd->nd_repstat != 0) + *laystatp = nd->nd_repstat; + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + /* ND_NOMOREDATA will be set if the Open operation failed. */ + NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + + 6 * NFSX_UNSIGNED); + op->nfso_stateid.seqid = *tl++; + op->nfso_stateid.other[0] = *tl++; + op->nfso_stateid.other[1] = *tl++; + op->nfso_stateid.other[2] = *tl; + rflags = fxdr_unsigned(u_int32_t, *(tl + 6)); + error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + if (error != 0) + goto nfsmout; + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(u_int32_t, *tl); + if (deleg == NFSV4OPEN_DELEGATEREAD || + deleg == NFSV4OPEN_DELEGATEWRITE) { + if (!(op->nfso_own->nfsow_clp->nfsc_flags & + NFSCLFLAGS_FIRSTDELEG)) + op->nfso_own->nfsow_clp->nfsc_flags |= + (NFSCLFLAGS_FIRSTDELEG | NFSCLFLAGS_GOTDELEG); + ndp = malloc(sizeof(struct nfscldeleg) + newfhlen, + M_NFSCLDELEG, M_WAITOK); + LIST_INIT(&ndp->nfsdl_owner); + LIST_INIT(&ndp->nfsdl_lock); + ndp->nfsdl_clp = op->nfso_own->nfsow_clp; + ndp->nfsdl_fhlen = newfhlen; + NFSBCOPY(newfhp, ndp->nfsdl_fh, newfhlen); + newnfs_copyincred(cred, &ndp->nfsdl_cred); + nfscl_lockinit(&ndp->nfsdl_rwlock); + NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + + NFSX_UNSIGNED); + ndp->nfsdl_stateid.seqid = *tl++; + ndp->nfsdl_stateid.other[0] = *tl++; + ndp->nfsdl_stateid.other[1] = *tl++; + ndp->nfsdl_stateid.other[2] = *tl++; + ret = fxdr_unsigned(int, *tl); + if (deleg == NFSV4OPEN_DELEGATEWRITE) { + ndp->nfsdl_flags = NFSCLDL_WRITE; + /* + * Indicates how much the file can grow. + */ + NFSM_DISSECT(tl, u_int32_t *, + 3 * NFSX_UNSIGNED); + limitby = fxdr_unsigned(int, *tl++); + switch (limitby) { + case NFSV4OPEN_LIMITSIZE: + ndp->nfsdl_sizelimit = fxdr_hyper(tl); + break; + case NFSV4OPEN_LIMITBLOCKS: + ndp->nfsdl_sizelimit = + fxdr_unsigned(u_int64_t, *tl++); + ndp->nfsdl_sizelimit *= + fxdr_unsigned(u_int64_t, *tl); + break; + default: + error = NFSERR_BADXDR; + goto nfsmout; + }; + } else + ndp->nfsdl_flags = NFSCLDL_READ; + if (ret != 0) + ndp->nfsdl_flags |= NFSCLDL_RECALL; + error = nfsrv_dissectace(nd, &ndp->nfsdl_ace, &ret, + &acesize, p); + if (error != 0) + goto nfsmout; + } else if (deleg != NFSV4OPEN_DELEGATENONE) { + error = NFSERR_BADXDR; + goto nfsmout; + } + if ((rflags & NFSV4OPEN_LOCKTYPEPOSIX) != 0 || + nfscl_assumeposixlocks) + op->nfso_posixlock = 1; + else + op->nfso_posixlock = 0; + NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + /* If the 2nd element == NFS_OK, the Getattr succeeded. */ + if (*++tl == 0) { + error = nfsv4_loadattr(nd, NULL, &nfsva, NULL, + NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, + NULL, NULL, NULL, p, cred); + if (error != 0) + goto nfsmout; + if (ndp != NULL) { + ndp->nfsdl_change = nfsva.na_filerev; + ndp->nfsdl_modtime = nfsva.na_mtime; + ndp->nfsdl_flags |= NFSCLDL_MODTIMESET; + *dpp = ndp; + ndp = NULL; + } + /* + * At this point, the Open has succeeded, so set + * nd_repstat = NFS_OK. If the Layoutget failed, + * this function just won't return a layout. + */ + if (nd->nd_repstat == 0) { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *laystatp = fxdr_unsigned(int, *++tl); + if (*laystatp == 0) { + error = nfsrv_parselayoutget(nd, + stateidp, retonclosep, flhp); + if (error != 0) + *laystatp = error; + } + } else + nd->nd_repstat = 0; /* Return 0 for Open. */ + } + } + if (nd->nd_repstat != 0 && error == 0) + error = nd->nd_repstat; +nfsmout: + free(ndp, M_NFSCLDELEG); + mbuf_freem(nd->nd_mrep); + return (error); +} + +/* + * Similar nfsrpc_createv4(), but also does the LayoutGet operation. + * Used only for mounts with pNFS enabled. + */ +static int +nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, + nfsquad_t cverf, int fmode, struct nfsclowner *owp, struct nfscldeleg **dpp, + struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, + struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, + int *dattrflagp, void *dstuff, int *unlockedp, nfsv4stateid_t *stateidp, + int usecurstateid, int layoutlen, int *retonclosep, + struct nfsclflayouthead *flhp, int *laystatp) +{ + uint32_t *tl; + int error = 0, deleg, newone, ret, acesize, limitby; + struct nfsrv_descript nfsd, *nd = &nfsd; + struct nfsclopen *op; + struct nfscldeleg *dp = NULL; + struct nfsnode *np; + struct nfsfh *nfhp; + struct nfsclsession *tsep; + nfsattrbit_t attrbits; + nfsv4stateid_t stateid; + uint32_t rflags; + struct nfsmount *nmp; + + nmp = VFSTONFS(dvp->v_mount); + np = VTONFS(dvp); + *laystatp = ENXIO; + *unlockedp = 0; + *nfhpp = NULL; + *dpp = NULL; + *attrflagp = 0; + *dattrflagp = 0; + if (namelen > NFS_MAXNAMLEN) + return (ENAMETOOLONG); + NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp); + /* + * For V4, this is actually an Open op. + */ + NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(owp->nfsow_seqid); + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD); + *tl++ = txdr_unsigned(NFSV4OPEN_DENYNONE); + tsep = nfsmnt_mdssession(nmp); + *tl++ = tsep->nfsess_clientid.lval[0]; + *tl = tsep->nfsess_clientid.lval[1]; + nfsm_strtom(nd, owp->nfsow_owner, NFSV4CL_LOCKNAMELEN); + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV4OPEN_CREATE); + if ((fmode & O_EXCL) != 0) { + if (NFSHASSESSPERSIST(nmp)) { + /* Use GUARDED for persistent sessions. */ + *tl = txdr_unsigned(NFSCREATE_GUARDED); + nfscl_fillsattr(nd, vap, dvp, 0, 0); + } else { + /* Otherwise, use EXCLUSIVE4_1. */ + *tl = txdr_unsigned(NFSCREATE_EXCLUSIVE41); + NFSM_BUILD(tl, u_int32_t *, NFSX_VERF); + *tl++ = cverf.lval[0]; + *tl = cverf.lval[1]; + nfscl_fillsattr(nd, vap, dvp, 0, 0); + } + } else { + *tl = txdr_unsigned(NFSCREATE_UNCHECKED); + nfscl_fillsattr(nd, vap, dvp, 0, 0); + } + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); + nfsm_strtom(nd, name, namelen); + /* Get the new file's handle and attributes, plus save the FH. */ + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV4OP_SAVEFH); + *tl++ = txdr_unsigned(NFSV4OP_GETFH); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + NFSGETATTR_ATTRBIT(&attrbits); + nfsrv_putattrbit(nd, &attrbits); + /* Get the directory's post-op attributes. */ + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + nfsm_fhtom(nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + nfsrv_putattrbit(nd, &attrbits); + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV4OP_RESTOREFH); + *tl = txdr_unsigned(NFSV4OP_LAYOUTGET); + nfsrv_setuplayoutget(nd, NFSLAYOUTIOMODE_RW, 0, UINT64_MAX, 0, stateidp, + layoutlen, usecurstateid); + error = nfscl_request(nd, dvp, p, cred, dstuff); + if (error != 0) + return (error); + NFSCL_DEBUG(4, "nfsrpc_createlayout stat=%d err=%d\n", nd->nd_repstat, + error); + if (nd->nd_repstat != 0) + *laystatp = nd->nd_repstat; + NFSCL_INCRSEQID(owp->nfsow_seqid, nd); + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + NFSCL_DEBUG(4, "nfsrpc_createlayout open succeeded\n"); + NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + + 6 * NFSX_UNSIGNED); + stateid.seqid = *tl++; + stateid.other[0] = *tl++; + stateid.other[1] = *tl++; + stateid.other[2] = *tl; + rflags = fxdr_unsigned(u_int32_t, *(tl + 6)); + nfsrv_getattrbits(nd, &attrbits, NULL, NULL); + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(int, *tl); + if (deleg == NFSV4OPEN_DELEGATEREAD || + deleg == NFSV4OPEN_DELEGATEWRITE) { + if (!(owp->nfsow_clp->nfsc_flags & + NFSCLFLAGS_FIRSTDELEG)) + owp->nfsow_clp->nfsc_flags |= + (NFSCLFLAGS_FIRSTDELEG | NFSCLFLAGS_GOTDELEG); + dp = malloc(sizeof(struct nfscldeleg) + NFSX_V4FHMAX, + M_NFSCLDELEG, M_WAITOK); + LIST_INIT(&dp->nfsdl_owner); + LIST_INIT(&dp->nfsdl_lock); + dp->nfsdl_clp = owp->nfsow_clp; + newnfs_copyincred(cred, &dp->nfsdl_cred); + nfscl_lockinit(&dp->nfsdl_rwlock); + NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + + NFSX_UNSIGNED); + dp->nfsdl_stateid.seqid = *tl++; + dp->nfsdl_stateid.other[0] = *tl++; + dp->nfsdl_stateid.other[1] = *tl++; + dp->nfsdl_stateid.other[2] = *tl++; + ret = fxdr_unsigned(int, *tl); + if (deleg == NFSV4OPEN_DELEGATEWRITE) { + dp->nfsdl_flags = NFSCLDL_WRITE; + /* + * Indicates how much the file can grow. + */ + NFSM_DISSECT(tl, u_int32_t *, + 3 * NFSX_UNSIGNED); + limitby = fxdr_unsigned(int, *tl++); + switch (limitby) { + case NFSV4OPEN_LIMITSIZE: + dp->nfsdl_sizelimit = fxdr_hyper(tl); + break; + case NFSV4OPEN_LIMITBLOCKS: + dp->nfsdl_sizelimit = + fxdr_unsigned(u_int64_t, *tl++); + dp->nfsdl_sizelimit *= + fxdr_unsigned(u_int64_t, *tl); + break; + default: + error = NFSERR_BADXDR; + goto nfsmout; + }; + } else { + dp->nfsdl_flags = NFSCLDL_READ; + } + if (ret != 0) + dp->nfsdl_flags |= NFSCLDL_RECALL; + error = nfsrv_dissectace(nd, &dp->nfsdl_ace, &ret, + &acesize, p); + if (error != 0) + goto nfsmout; + } else if (deleg != NFSV4OPEN_DELEGATENONE) { + error = NFSERR_BADXDR; + goto nfsmout; + } + + /* Now, we should have the status for the SaveFH. */ + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*++tl == 0) { + NFSCL_DEBUG(4, "nfsrpc_createlayout SaveFH ok\n"); + /* + * Now, process the GetFH and Getattr for the newly + * created file. nfscl_mtofh() will set + * ND_NOMOREDATA if these weren't successful. + */ + error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); + NFSCL_DEBUG(4, "aft nfscl_mtofh err=%d\n", error); + if (error != 0) + goto nfsmout; + } else + nd->nd_flag |= ND_NOMOREDATA; + /* Now we have the PutFH and Getattr for the directory. */ + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (*++tl != 0) + nd->nd_flag |= ND_NOMOREDATA; + else { + NFSM_DISSECT(tl, uint32_t *, 2 * + NFSX_UNSIGNED); + if (*++tl != 0) + nd->nd_flag |= ND_NOMOREDATA; + } + } + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + NFSCL_DEBUG(4, "aft nfsm_loadattr err=%d\n", error); + if (error != 0) + goto nfsmout; + *dattrflagp = 1; + if (dp != NULL && *attrflagp != 0) { + dp->nfsdl_change = nnap->na_filerev; + dp->nfsdl_modtime = nnap->na_mtime; + dp->nfsdl_flags |= NFSCLDL_MODTIMESET; + } + /* + * We can now complete the Open state. + */ + nfhp = *nfhpp; + if (dp != NULL) { + dp->nfsdl_fhlen = nfhp->nfh_len; + NFSBCOPY(nfhp->nfh_fh, dp->nfsdl_fh, + nfhp->nfh_len); + } + /* + * Get an Open structure that will be + * attached to the OpenOwner, acquired already. + */ + error = nfscl_open(dvp, nfhp->nfh_fh, nfhp->nfh_len, + (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), 0, + cred, p, NULL, &op, &newone, NULL, 0); + if (error != 0) + goto nfsmout; + op->nfso_stateid = stateid; + newnfs_copyincred(cred, &op->nfso_cred); + + nfscl_openrelease(nmp, op, error, newone); + *unlockedp = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 14 21:13:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 590C4DAC631; Fri, 14 Jul 2017 21:13:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 19F6D76D6F; Fri, 14 Jul 2017 21:13:07 +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 v6ELD6KU083058; Fri, 14 Jul 2017 21:13:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ELD6dq083057; Fri, 14 Jul 2017 21:13:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201707142113.v6ELD6dq083057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 14 Jul 2017 21:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320999 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 320999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 21:13:07 -0000 Author: brooks Date: Fri Jul 14 21:13:05 2017 New Revision: 320999 URL: https://svnweb.freebsd.org/changeset/base/320999 Log: Add 32-bit compat for kinfo_proc's ki_tdaddr. This appears to have been an oversight in r213536. Reviewed by: markj MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11521 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Jul 14 20:47:41 2017 (r320998) +++ head/sys/kern/kern_proc.c Fri Jul 14 21:13:05 2017 (r320999) @@ -1301,6 +1301,7 @@ freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, PTRTRIM_CP(*ki, *ki32, ki_pcb); PTRTRIM_CP(*ki, *ki32, ki_kstack); PTRTRIM_CP(*ki, *ki32, ki_udata); + PTRTRIM_CP(*ki, *ki32, ki_tdaddr); CP(*ki, *ki32, ki_sflag); CP(*ki, *ki32, ki_tdflags); } From owner-svn-src-all@freebsd.org Fri Jul 14 21:43:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82A4DDAD022; Fri, 14 Jul 2017 21:43:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7AC779F2; Fri, 14 Jul 2017 21:43:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ELhvtP095053; Fri, 14 Jul 2017 21:43:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ELhv6p095052; Fri, 14 Jul 2017 21:43:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707142143.v6ELhv6p095052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 14 Jul 2017 21:43: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: r321000 - stable/11/usr.bin/nfsstat X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.bin/nfsstat X-SVN-Commit-Revision: 321000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 21:43:58 -0000 Author: rmacklem Date: Fri Jul 14 21:43:57 2017 New Revision: 321000 URL: https://svnweb.freebsd.org/changeset/base/321000 Log: MFC: r320323 Add RPC count reporting for the two new RPCs added by r320322. Modified: stable/11/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/11/usr.bin/nfsstat/nfsstat.c Fri Jul 14 21:13:05 2017 (r320999) +++ stable/11/usr.bin/nfsstat/nfsstat.c Fri Jul 14 21:43:57 2017 (r321000) @@ -926,6 +926,13 @@ exp41_intpr(int clientOnly, int serverOnly) (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMITDS]); if (printtitle) printf( + "%12.12s %12.12s\n", + "OpenLayout", "CreateLayout"); + printf("%12ju %12ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPENLAYGET], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATELAYGET]); + if (printtitle) + printf( "%12.12s %12.12s %12.12s %12.12s %12.12s %12.12s\n", "OpenOwner", "Opens", "LockOwner", "Locks", "Delegs", "LocalOwn"); From owner-svn-src-all@freebsd.org Fri Jul 14 21:50:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CC6DAD1FA; Fri, 14 Jul 2017 21:50:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7462677BC3; Fri, 14 Jul 2017 21:50:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ELo4lW095348; Fri, 14 Jul 2017 21:50:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ELo4QG095347; Fri, 14 Jul 2017 21:50:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707142150.v6ELo4QG095347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 14 Jul 2017 21:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321001 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 321001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 21:50:05 -0000 Author: asomers Date: Fri Jul 14 21:50:04 2017 New Revision: 321001 URL: https://svnweb.freebsd.org/changeset/base/321001 Log: Fix the build with GCC after r320975 Reported by: pfg MFC after: 20 days X-MFC-With: 320975 Sponsored by: Spectra Logic Corp Modified: head/tests/sys/aio/aio_test.c Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Fri Jul 14 21:43:57 2017 (r321000) +++ head/tests/sys/aio/aio_test.c Fri Jul 14 21:50:04 2017 (r321001) @@ -222,7 +222,7 @@ setup_signal(void) * separate process */ static struct sigevent* -setup_thread() +setup_thread(void) { static struct sigevent sev; From owner-svn-src-all@freebsd.org Sat Jul 15 00:45:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 711EFDAFCAD; Sat, 15 Jul 2017 00:45:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E79A8098A; Sat, 15 Jul 2017 00:45:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6F0jMuQ069953; Sat, 15 Jul 2017 00:45:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F0jMoC069952; Sat, 15 Jul 2017 00:45:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707150045.v6F0jMoC069952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jul 2017 00:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321002 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 00:45:23 -0000 Author: ian Date: Sat Jul 15 00:45:22 2017 New Revision: 321002 URL: https://svnweb.freebsd.org/changeset/base/321002 Log: Revert r320997. There are reports of it getting the wrong results, so clearly my testing was insuffficent, and it's best to just revert it until I get it straightened out. Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Fri Jul 14 21:50:04 2017 (r321001) +++ head/sys/kern/subr_clock.c Sat Jul 15 00:45:22 2017 (r321002) @@ -97,13 +97,6 @@ static const int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -/* - * Optimization: using a precomputed count of days between POSIX_BASE_YEAR and a - * recent year avoids lots of needless loop iterations in conversion. - * recent_base_days is the number of days through the end of recent_base_year. - */ -static const int recent_base_year = 2016; -static const int recent_base_days = 17167; /* * This inline avoids some unnecessary modulo operations @@ -164,14 +157,8 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * * Compute days since start of time * First from years, then from months. */ - if (year > recent_base_year) { - i = recent_base_year; - days = recent_base_days; - } else { - i = POSIX_BASE_YEAR; - days = 0; - } - for (; i < year; i++) + days = 0; + for (i = POSIX_BASE_YEAR; i < year; i++) days += days_in_year(i); /* Months */ @@ -201,14 +188,8 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * ct->dow = day_of_week(days); - /* Subtract out whole years. */ - if (days >= recent_base_days) { - year = recent_base_year + 1; - days -= recent_base_days; - } else { - year = POSIX_BASE_YEAR; - } - for (; days >= days_in_year(year); year++) + /* Subtract out whole years, counting them in i. */ + for (year = POSIX_BASE_YEAR; days >= days_in_year(year); year++) days -= days_in_year(year); ct->year = year; From owner-svn-src-all@freebsd.org Sat Jul 15 01:49:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D10DB2280; Sat, 15 Jul 2017 01:49:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E75982AB8; Sat, 15 Jul 2017 01:49:55 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6F1ntFm094116; Sat, 15 Jul 2017 01:49:55 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F1ntjD094115; Sat, 15 Jul 2017 01:49:55 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707150149.v6F1ntjD094115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 15 Jul 2017 01:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321003 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 321003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 01:49:56 -0000 Author: alc Date: Sat Jul 15 01:49:54 2017 New Revision: 321003 URL: https://svnweb.freebsd.org/changeset/base/321003 Log: Extract the innermost loop of pmap_remove() out into its own function, pmap_remove_ptes(). (This new function will also be used by an upcoming change to pmap_enter() that adds support for psind == 1 mappings.) Submitted by: Yufeng Zhou (an earlier version) Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jul 15 00:45:22 2017 (r321002) +++ head/sys/amd64/amd64/pmap.c Sat Jul 15 01:49:54 2017 (r321003) @@ -629,6 +629,9 @@ static int pmap_remove_pte(pmap_t pmap, pt_entry_t *pt static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, struct spglist *free); +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + pd_entry_t *pde, struct spglist *free, + struct rwlock **lockp); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m, struct rwlock **lockp); static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, @@ -3736,6 +3739,44 @@ pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry } /* + * Removes the specified range of addresses from the page table page. + */ +static bool +pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + pd_entry_t *pde, struct spglist *free, struct rwlock **lockp) +{ + pt_entry_t PG_G, *pte; + vm_offset_t va; + bool anyvalid; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + PG_G = pmap_global_bit(pmap); + anyvalid = false; + va = eva; + for (pte = pmap_pde_to_pte(pde, sva); sva != eva; pte++, + sva += PAGE_SIZE) { + if (*pte == 0) { + if (va != eva) { + pmap_invalidate_range(pmap, va, sva); + va = eva; + } + continue; + } + if ((*pte & PG_G) == 0) + anyvalid = true; + else if (va == eva) + va = sva; + if (pmap_remove_pte(pmap, pte, sva, *pde, free, lockp)) { + sva += PAGE_SIZE; + break; + } + } + if (va != eva) + pmap_invalidate_range(pmap, va, sva); + return (anyvalid); +} + +/* * Remove the given range of addresses from the specified map. * * It is assumed that the start and end are properly @@ -3745,11 +3786,11 @@ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { struct rwlock *lock; - vm_offset_t va, va_next; + vm_offset_t va_next; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; - pt_entry_t *pte, PG_G, PG_V; + pt_entry_t PG_G, PG_V; struct spglist free; int anyvalid; @@ -3852,28 +3893,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (va_next > eva) va_next = eva; - va = va_next; - for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, - sva += PAGE_SIZE) { - if (*pte == 0) { - if (va != va_next) { - pmap_invalidate_range(pmap, va, sva); - va = va_next; - } - continue; - } - if ((*pte & PG_G) == 0) - anyvalid = 1; - else if (va == va_next) - va = sva; - if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free, - &lock)) { - sva += PAGE_SIZE; - break; - } - } - if (va != va_next) - pmap_invalidate_range(pmap, va, sva); + if (pmap_remove_ptes(pmap, sva, va_next, pde, &free, &lock)) + anyvalid = 1; } if (lock != NULL) rw_wunlock(lock); From owner-svn-src-all@freebsd.org Sat Jul 15 06:33:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B4BDDB7989; Sat, 15 Jul 2017 06:33: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 mx1.freebsd.org (Postfix) with ESMTPS id 2905B65F82; Sat, 15 Jul 2017 06:33: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 v6F6XecP013034; Sat, 15 Jul 2017 06:33:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F6XeB0013033; Sat, 15 Jul 2017 06:33:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707150633.v6F6XeB0013033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 15 Jul 2017 06:33: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: r321004 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 321004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 06:33:41 -0000 Author: kib Date: Sat Jul 15 06:33:39 2017 New Revision: 321004 URL: https://svnweb.freebsd.org/changeset/base/321004 Log: MFC r320804: Fix handling of one more possible exception on return to usermode. Modified: stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Sat Jul 15 01:49:54 2017 (r321003) +++ stable/11/sys/i386/i386/trap.c Sat Jul 15 06:33:39 2017 (r321004) @@ -550,11 +550,7 @@ user_trctrap_out: vm86_trap((struct vm86frame *)frame); goto out; } - if (type == T_STKFLT) - break; - /* FALL THROUGH */ - case T_SEGNPFLT: /* segment not present fault */ if (curpcb->pcb_flags & PCB_VM86CALL) break; @@ -595,6 +591,9 @@ user_trctrap_out: frame->tf_eip = (int)doreti_iret_fault; goto out; } + if (type == T_STKFLT) + break; + if (frame->tf_eip == (int)doreti_popl_ds) { frame->tf_eip = (int)doreti_popl_ds_fault; goto out; From owner-svn-src-all@freebsd.org Sat Jul 15 06:38:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E52C6DB7AC9; Sat, 15 Jul 2017 06:38:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id ADEF566108; Sat, 15 Jul 2017 06:38:02 +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 v6F6c1iW013234; Sat, 15 Jul 2017 06:38:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F6c1EA013233; Sat, 15 Jul 2017 06:38:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707150638.v6F6c1EA013233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 15 Jul 2017 06:38:01 +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: r321005 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/i386/i386 X-SVN-Commit-Revision: 321005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 06:38:03 -0000 Author: kib Date: Sat Jul 15 06:38:01 2017 New Revision: 321005 URL: https://svnweb.freebsd.org/changeset/base/321005 Log: MFC r320804: Fix handling of one more possible exception on return to usermode. Modified: stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Sat Jul 15 06:33:39 2017 (r321004) +++ stable/10/sys/i386/i386/trap.c Sat Jul 15 06:38:01 2017 (r321005) @@ -567,11 +567,7 @@ trap(struct trapframe *frame) vm86_trap((struct vm86frame *)frame); goto out; } - if (type == T_STKFLT) - break; - /* FALL THROUGH */ - case T_SEGNPFLT: /* segment not present fault */ if (curpcb->pcb_flags & PCB_VM86CALL) break; @@ -612,6 +608,9 @@ trap(struct trapframe *frame) frame->tf_eip = (int)doreti_iret_fault; goto out; } + if (type == T_STKFLT) + break; + if (frame->tf_eip == (int)doreti_popl_ds) { frame->tf_eip = (int)doreti_popl_ds_fault; goto out; From owner-svn-src-all@freebsd.org Sat Jul 15 08:24:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CB87DBD38F; Sat, 15 Jul 2017 08:24:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1985768B89; Sat, 15 Jul 2017 08:24:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6F8OUG6028423; Sat, 15 Jul 2017 08:24:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F8OUXq028422; Sat, 15 Jul 2017 08:24:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707150824.v6F8OUXq028422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 08:24: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: r321006 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/amd64/linux X-SVN-Commit-Revision: 321006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 08:24:31 -0000 Author: dchagin Date: Sat Jul 15 08:24:29 2017 New Revision: 321006 URL: https://svnweb.freebsd.org/changeset/base/321006 Log: MFC r319057: In r246085 some bits that are MI movied out into headers in compat/linux, but I missed that when I commited x86_64 Linuxulator. So remove the duplicates. Modified: stable/11/sys/amd64/linux/linux.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sat Jul 15 06:38:01 2017 (r321005) +++ stable/11/sys/amd64/linux/linux.h Sat Jul 15 08:24:29 2017 (r321006) @@ -101,9 +101,6 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_NAME_MAX 255 -#define LINUX_CTL_MAXNAME 10 - #define LINUX_AT_COUNT 19 /* Count of used aux entry types. */ struct l___sysctl_args @@ -117,11 +114,6 @@ struct l___sysctl_args l_ulong __spare[4]; }; -/* Scheduling policies */ -#define LINUX_SCHED_OTHER 0 -#define LINUX_SCHED_FIFO 1 -#define LINUX_SCHED_RR 2 - /* Resource limits */ #define LINUX_RLIMIT_CPU 0 #define LINUX_RLIMIT_FSIZE 1 @@ -455,20 +447,6 @@ struct l_pollfd { l_short events; l_short revents; }; - - -#define LINUX_CLONE_VM 0x00000100 -#define LINUX_CLONE_FS 0x00000200 -#define LINUX_CLONE_FILES 0x00000400 -#define LINUX_CLONE_SIGHAND 0x00000800 -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ -#define LINUX_CLONE_VFORK 0x00004000 -#define LINUX_CLONE_PARENT 0x00008000 -#define LINUX_CLONE_THREAD 0x00010000 -#define LINUX_CLONE_SETTLS 0x00080000 -#define LINUX_CLONE_PARENT_SETTID 0x00100000 -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 -#define LINUX_CLONE_CHILD_SETTID 0x01000000 #define LINUX_ARCH_SET_GS 0x1001 #define LINUX_ARCH_SET_FS 0x1002 From owner-svn-src-all@freebsd.org Sat Jul 15 08:27:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F9FDBD43E; Sat, 15 Jul 2017 08:27:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D47C68CE6; Sat, 15 Jul 2017 08:27:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6F8RN9v028578; Sat, 15 Jul 2017 08:27:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F8RN0M028575; Sat, 15 Jul 2017 08:27:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707150827.v6F8RN0M028575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 08:27: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: r321007 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 321007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 08:27:24 -0000 Author: dchagin Date: Sat Jul 15 08:27:23 2017 New Revision: 321007 URL: https://svnweb.freebsd.org/changeset/base/321007 Log: MFC r320595: Add support for musl consumers to the Linuxulator. PR: 213809 Submitted by: Yonas Yanfa (for amd64) Reported by: Yonas Yanfa Relnotes: yes Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sat Jul 15 08:24:29 2017 (r321006) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sat Jul 15 08:27:23 2017 (r321007) @@ -921,9 +921,22 @@ static Elf64_Brandinfo linux_glibc2brandshort = { .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; +static Elf64_Brandinfo linux_muslbrand = { + .brand = ELFOSABI_LINUX, + .machine = EM_X86_64, + .compat_3_brand = "Linux", + .emul_path = "/compat/linux", + .interp_path = "/lib/ld-musl-x86_64.so.1", + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .brand_note = &linux64_brandnote, + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE +}; + Elf64_Brandinfo *linux_brandlist[] = { &linux_glibc2brand, &linux_glibc2brandshort, + &linux_muslbrand, NULL }; Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sat Jul 15 08:24:29 2017 (r321006) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sat Jul 15 08:27:23 2017 (r321007) @@ -1139,9 +1139,22 @@ static Elf32_Brandinfo linux_glibc2brand = { .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; +static Elf32_Brandinfo linux_muslbrand = { + .brand = ELFOSABI_LINUX, + .machine = EM_386, + .compat_3_brand = "Linux", + .emul_path = "/compat/linux", + .interp_path = "/lib/ld-musl-i386.so.1", + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .brand_note = &linux32_brandnote, + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE +}; + Elf32_Brandinfo *linux_brandlist[] = { &linux_brand, &linux_glibc2brand, + &linux_muslbrand, NULL }; Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sat Jul 15 08:24:29 2017 (r321006) +++ stable/11/sys/i386/linux/linux_sysvec.c Sat Jul 15 08:27:23 2017 (r321007) @@ -1118,9 +1118,22 @@ static Elf32_Brandinfo linux_glibc2brand = { .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; +static Elf32_Brandinfo linux_muslbrand = { + .brand = ELFOSABI_LINUX, + .machine = EM_386, + .compat_3_brand = "Linux", + .emul_path = "/compat/linux", + .interp_path = "/lib/ld-musl-i386.so.1", + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .brand_note = &linux_brandnote, + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE +}; + Elf32_Brandinfo *linux_brandlist[] = { &linux_brand, &linux_glibc2brand, + &linux_muslbrand, NULL }; From owner-svn-src-all@freebsd.org Sat Jul 15 09:04:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE8CCDBE0DB; Sat, 15 Jul 2017 09:04:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C17D69EB1; Sat, 15 Jul 2017 09:04:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6F94N4C058658; Sat, 15 Jul 2017 09:04:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6F94NYG058657; Sat, 15 Jul 2017 09:04:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707150904.v6F94NYG058657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 15 Jul 2017 09:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321008 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 321008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 09:04:24 -0000 Author: manu Date: Sat Jul 15 09:04:23 2017 New Revision: 321008 URL: https://svnweb.freebsd.org/changeset/base/321008 Log: etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined While here only install ipfw rc script if MK_IPFW is defined. Reported by: ngie Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Jul 15 08:27:23 2017 (r321007) +++ head/etc/rc.d/Makefile Sat Jul 15 09:04:23 2017 (r321008) @@ -47,7 +47,6 @@ FILES= DAEMON \ ip6addrctl \ ipfilter \ ipfs \ - ipfw \ ipmon \ ipnat \ ipsec \ @@ -204,6 +203,13 @@ HASTPACKAGE= hast .if ${MK_INETD} != "no" FILES+= inetd +.endif + +.if ${MK_IPFW} != "no" +FILES+= ipfw +.if ${MK_NETGRAPH} != "no" +FILES+= ipfw_netflow +.endif .endif .if ${MK_ISCSI} != "no" From owner-svn-src-all@freebsd.org Sat Jul 15 09:22:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C92DBE42A; Sat, 15 Jul 2017 09:22:28 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 28CE46A6D6; Sat, 15 Jul 2017 09:22:26 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id b6125dc1; Sat, 15 Jul 2017 11:15:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=sdiMpWzK4N/myL/663qgvZKgWJs=; b=SxTDFl3KHKd96OweHQx5oYUzl/F9 BR58Z0RcWLQSBh783j7vyS/OGgu25+slKhovZdKRseBI/6Z+hi0w9rEDC/0BW0/V yo2sP4RfH7x1bh0KLlkUMol4rsMwl8iRLdnAEoqWf6eKX1Exku1pK3uMk8k/lZQS jW9odnxo/MK+YtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=ifUyA60sy8v3MOLtOg4/ymzRStIIzHgZW/RMiikB4tbZV+OjS8QSCWaE 8dLXb5+7+70QmZXKnRmD7DnzY09n6IjX8avHXBE2qzmOem7CwYl4QN7qHJYC+CA6 Q2QFRmpKqtg/1yX1Mxx78QpMpPxnnJlDYBG9cZzbuikKsOY0Glg= Received: from arcadia (sal69-2-78-192-146-206.fbxo.proxad.net [78.192.146.206]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 46e6ed5d TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 15 Jul 2017 11:15:42 +0200 (CEST) Date: Sat, 15 Jul 2017 11:15:41 +0200 From: Emmanuel Vadot To: Ngie Cooper Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320944 - head/etc/rc.d Message-Id: <20170715111541.0680aae867a2146673fec94e@bidouilliste.com> In-Reply-To: <9D643ACB-FA58-499B-9783-71246C323ECC@gmail.com> References: <201707131340.v6DDeIE9086139@repo.freebsd.org> <9D643ACB-FA58-499B-9783-71246C323ECC@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 09:22:28 -0000 On Thu, 13 Jul 2017 08:44:36 -0700 Ngie Cooper wrote: > > > On Jul 13, 2017, at 06:40, Emmanuel Vadot wrote: > > > > Author: manu > > Date: Thu Jul 13 13:40:18 2017 > > New Revision: 320944 > > URL: https://svnweb.freebsd.org/changeset/base/320944 > > > > Log: > > Add an rc.d script to setup a netflow export via ng_netflow > > The default is to export netflow data on localhost on the netflow port. > > ngtee is used to have the lowest overhead possible. > > The ipfw ng hook is the netflow port (it can only be numeric) > > Default is netflow version 5. > > Hi Emmanuel, > The script isn't being installed. Could you please integrate it in to etc/rc.d/Makefile under a block conditional on MK_IPFW/MK_NETGRAPH? > Thanks! > -Ngie Fixed in 321008, thanks! -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat Jul 15 14:48:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05626AFBBC5; Sat, 15 Jul 2017 14:48:33 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D248E72608; Sat, 15 Jul 2017 14:48:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FEmWn6096245; Sat, 15 Jul 2017 14:48:32 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FEmV7I096241; Sat, 15 Jul 2017 14:48:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151448.v6FEmV7I096241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 14:48:31 +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: r321009 - in stable/10/sys: compat/linux kern sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: compat/linux kern sys X-SVN-Commit-Revision: 321009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 14:48:33 -0000 Author: dchagin Date: Sat Jul 15 14:48:31 2017 New Revision: 321009 URL: https://svnweb.freebsd.org/changeset/base/321009 Log: MFC r281829 (by trasz@): Modify kern___getcwd() to take max pathlen limit as an additional argument. This will be used for the Linux emulation layer - for Linux, PATH_MAX is 4096 and not 1024. Modified: stable/10/sys/compat/linux/linux_getcwd.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/kern/vfs_cache.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_getcwd.c ============================================================================== --- stable/10/sys/compat/linux/linux_getcwd.c Sat Jul 15 09:04:23 2017 (r321008) +++ stable/10/sys/compat/linux/linux_getcwd.c Sat Jul 15 14:48:31 2017 (r321009) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include @@ -423,14 +424,14 @@ linux_getcwd(struct thread *td, struct linux_getcwd_ar len = args->bufsize; - if (len > MAXPATHLEN*4) - len = MAXPATHLEN*4; + if (len > LINUX_PATH_MAX) + len = LINUX_PATH_MAX; else if (len < 2) return ERANGE; path = malloc(len, M_TEMP, M_WAITOK); - error = kern___getcwd(td, path, UIO_SYSSPACE, len); + error = kern___getcwd(td, path, UIO_SYSSPACE, len, LINUX_PATH_MAX); if (!error) { lenused = strlen(path) + 1; if (lenused <= args->bufsize) { Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jul 15 09:04:23 2017 (r321008) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jul 15 14:48:31 2017 (r321009) @@ -60,6 +60,8 @@ #define LINUX_MREMAP_MAYMOVE 1 #define LINUX_MREMAP_FIXED 2 +#define LINUX_PATH_MAX 4096 + extern const char *linux_kplatform; /* Modified: stable/10/sys/kern/vfs_cache.c ============================================================================== --- stable/10/sys/kern/vfs_cache.c Sat Jul 15 09:04:23 2017 (r321008) +++ stable/10/sys/kern/vfs_cache.c Sat Jul 15 14:48:31 2017 (r321009) @@ -1073,11 +1073,13 @@ int sys___getcwd(struct thread *td, struct __getcwd_args *uap) { - return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen)); + return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen, + MAXPATHLEN)); } int -kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen) +kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen, + u_int path_max) { char *bp, *tmpbuf; struct filedesc *fdp; @@ -1088,8 +1090,8 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s return (ENODEV); if (buflen < 2) return (EINVAL); - if (buflen > MAXPATHLEN) - buflen = MAXPATHLEN; + if (buflen > path_max) + buflen = path_max; tmpbuf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td->td_proc->p_fd; Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jul 15 09:04:23 2017 (r321008) +++ stable/10/sys/sys/syscallsubr.h Sat Jul 15 14:48:31 2017 (r321009) @@ -59,7 +59,7 @@ struct sched_param; struct __wrusage; int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, - u_int buflen); + u_int buflen, u_int path_max); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp); int kern_accept4(struct thread *td, int s, struct sockaddr **name, From owner-svn-src-all@freebsd.org Sat Jul 15 14:57:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE4BAFBED9; Sat, 15 Jul 2017 14:57:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E15F772B4B; Sat, 15 Jul 2017 14:57:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FEvP6J000283; Sat, 15 Jul 2017 14:57:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FEvPUk000282; Sat, 15 Jul 2017 14:57:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151457.v6FEvPUk000282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 14:57:25 +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: r321010 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 321010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 14:57:26 -0000 Author: dchagin Date: Sat Jul 15 14:57:24 2017 New Revision: 321010 URL: https://svnweb.freebsd.org/changeset/base/321010 Log: MFC r281882(by trasz@): Simplify linux_getcwd(), removing code that was longer used. Modified: stable/10/sys/compat/linux/linux_getcwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_getcwd.c ============================================================================== --- stable/10/sys/compat/linux/linux_getcwd.c Sat Jul 15 14:48:31 2017 (r321009) +++ stable/10/sys/compat/linux/linux_getcwd.c Sat Jul 15 14:57:24 2017 (r321010) @@ -2,11 +2,15 @@ /* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. + * Copyright (c) 2015 The FreeBSD Foundation * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Bill Sommerfeld. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -36,19 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include #include -#include -#include #include -#include #include -#include -#include /* XXX only for DIRBLKSIZ */ #ifdef COMPAT_LINUX32 #include @@ -60,408 +54,37 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -static int -linux_getcwd_scandir(struct vnode **, struct vnode **, - char **, char *, struct thread *); -static int -linux_getcwd_common(struct vnode *, struct vnode *, - char **, char *, int, int, struct thread *); - -#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) - /* - * Vnode variable naming conventions in this file: - * - * rvp: the current root we're aiming towards. - * lvp, *lvpp: the "lower" vnode - * uvp, *uvpp: the "upper" vnode. - * - * Since all the vnodes we're dealing with are directories, and the - * lookups are going *up* in the filesystem rather than *down*, the - * usual "pvp" (parent) or "dvp" (directory) naming conventions are - * too confusing. - */ - -/* - * XXX Will infinite loop in certain cases if a directory read reliably - * returns EINVAL on last block. - * XXX is EINVAL the right thing to return if a directory is malformed? - */ - -/* - * XXX Untested vs. mount -o union; probably does the wrong thing. - */ - -/* - * Find parent vnode of *lvpp, return in *uvpp - * - * If we care about the name, scan it looking for name of directory - * entry pointing at lvp. - * - * Place the name in the buffer which starts at bufp, immediately - * before *bpp, and move bpp backwards to point at the start of it. - * - * On entry, *lvpp is a locked vnode reference; on exit, it is vput and NULL'ed - * On exit, *uvpp is either NULL or is a locked vnode reference. - */ -static int -linux_getcwd_scandir(lvpp, uvpp, bpp, bufp, td) - struct vnode **lvpp; - struct vnode **uvpp; - char **bpp; - char *bufp; - struct thread *td; -{ - int error = 0; - int eofflag; - off_t off; - int tries; - struct uio uio; - struct iovec iov; - char *dirbuf = NULL; - int dirbuflen; - ino_t fileno; - struct vattr va; - struct vnode *uvp = NULL; - struct vnode *lvp = *lvpp; - struct componentname cn; - int len, reclen; - tries = 0; - - /* - * If we want the filename, get some info we need while the - * current directory is still locked. - */ - if (bufp != NULL) { - error = VOP_GETATTR(lvp, &va, td->td_ucred); - if (error) { - vput(lvp); - *lvpp = NULL; - *uvpp = NULL; - return error; - } - } - - /* - * Ok, we have to do it the hard way.. - * Next, get parent vnode using lookup of .. - */ - cn.cn_nameiop = LOOKUP; - cn.cn_flags = ISLASTCN | ISDOTDOT | RDONLY; - cn.cn_thread = td; - cn.cn_cred = td->td_ucred; - cn.cn_pnbuf = NULL; - cn.cn_nameptr = ".."; - cn.cn_namelen = 2; - cn.cn_consume = 0; - cn.cn_lkflags = LK_SHARED; - - /* - * At this point, lvp is locked and will be unlocked by the lookup. - * On successful return, *uvpp will be locked - */ -#ifdef MAC - error = mac_vnode_check_lookup(td->td_ucred, lvp, &cn); - if (error == 0) -#endif - error = VOP_LOOKUP(lvp, uvpp, &cn); - if (error) { - vput(lvp); - *lvpp = NULL; - *uvpp = NULL; - return error; - } - uvp = *uvpp; - - /* If we don't care about the pathname, we're done */ - if (bufp == NULL) { - vput(lvp); - *lvpp = NULL; - return 0; - } - - fileno = va.va_fileid; - - dirbuflen = DIRBLKSIZ; - if (dirbuflen < va.va_blocksize) - dirbuflen = va.va_blocksize; - dirbuf = malloc(dirbuflen, M_LINUX, M_WAITOK); - -#if 0 -unionread: -#endif - off = 0; - do { - /* call VOP_READDIR of parent */ - iov.iov_base = dirbuf; - iov.iov_len = dirbuflen; - - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = off; - uio.uio_resid = dirbuflen; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = td; - - eofflag = 0; - -#ifdef MAC - error = mac_vnode_check_readdir(td->td_ucred, uvp); - if (error == 0) -#endif /* MAC */ - error = VOP_READDIR(uvp, &uio, td->td_ucred, &eofflag, - 0, 0); - - off = uio.uio_offset; - - /* - * Try again if NFS tosses its cookies. - * XXX this can still loop forever if the directory is busted - * such that the second or subsequent page of it always - * returns EINVAL - */ - if ((error == EINVAL) && (tries < 3)) { - off = 0; - tries++; - continue; /* once more, with feeling */ - } - - if (!error) { - char *cpos; - struct dirent *dp; - - cpos = dirbuf; - tries = 0; - - /* scan directory page looking for matching vnode */ - for (len = (dirbuflen - uio.uio_resid); len > 0; len -= reclen) { - dp = (struct dirent *) cpos; - reclen = dp->d_reclen; - - /* check for malformed directory.. */ - if (reclen < DIRENT_MINSIZE) { - error = EINVAL; - goto out; - } - /* - * XXX should perhaps do VOP_LOOKUP to - * check that we got back to the right place, - * but getting the locking games for that - * right would be heinous. - */ - if ((dp->d_type != DT_WHT) && - (dp->d_fileno == fileno)) { - char *bp = *bpp; - bp -= dp->d_namlen; - - if (bp <= bufp) { - error = ERANGE; - goto out; - } - bcopy(dp->d_name, bp, dp->d_namlen); - error = 0; - *bpp = bp; - goto out; - } - cpos += reclen; - } - } - } while (!eofflag); - error = ENOENT; - -out: - vput(lvp); - *lvpp = NULL; - free(dirbuf, M_LINUX); - return error; -} - - -/* - * common routine shared by sys___getcwd() and linux_vn_isunder() - */ - -#define GETCWD_CHECK_ACCESS 0x0001 - -static int -linux_getcwd_common (lvp, rvp, bpp, bufp, limit, flags, td) - struct vnode *lvp; - struct vnode *rvp; - char **bpp; - char *bufp; - int limit; - int flags; - struct thread *td; -{ - struct filedesc *fdp = td->td_proc->p_fd; - struct vnode *uvp = NULL; - char *bp = NULL; - int error; - accmode_t accmode = VEXEC; - - if (rvp == NULL) { - rvp = fdp->fd_rdir; - if (rvp == NULL) - rvp = rootvnode; - } - - VREF(rvp); - VREF(lvp); - - /* - * Error handling invariant: - * Before a `goto out': - * lvp is either NULL, or locked and held. - * uvp is either NULL, or locked and held. - */ - - error = vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - panic("vn_lock LK_RETRY returned error %d", error); - if (bufp) - bp = *bpp; - /* - * this loop will terminate when one of the following happens: - * - we hit the root - * - getdirentries or lookup fails - * - we run out of space in the buffer. - */ - if (lvp == rvp) { - if (bp) - *(--bp) = '/'; - goto out; - } - do { - if (lvp->v_type != VDIR) { - error = ENOTDIR; - goto out; - } - - /* - * access check here is optional, depending on - * whether or not caller cares. - */ - if (flags & GETCWD_CHECK_ACCESS) { - error = VOP_ACCESS(lvp, accmode, td->td_ucred, td); - if (error) - goto out; - accmode = VEXEC|VREAD; - } - - /* - * step up if we're a covered vnode.. - */ - while (lvp->v_vflag & VV_ROOT) { - struct vnode *tvp; - - if (lvp == rvp) - goto out; - - tvp = lvp; - lvp = lvp->v_mount->mnt_vnodecovered; - vput(tvp); - /* - * hodie natus est radici frater - */ - if (lvp == NULL) { - error = ENOENT; - goto out; - } - VREF(lvp); - error = vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - panic("vn_lock LK_RETRY returned %d", error); - } - error = linux_getcwd_scandir(&lvp, &uvp, &bp, bufp, td); - if (error) - goto out; -#ifdef DIAGNOSTIC - if (lvp != NULL) - panic("getcwd: oops, forgot to null lvp"); - if (bufp && (bp <= bufp)) { - panic("getcwd: oops, went back too far"); - } -#endif - if (bp) - *(--bp) = '/'; - lvp = uvp; - uvp = NULL; - limit--; - } while ((lvp != rvp) && (limit > 0)); - -out: - if (bpp) - *bpp = bp; - if (uvp) - vput(uvp); - if (lvp) - vput(lvp); - vrele(rvp); - return error; -} - - -/* * Find pathname of process's current directory. - * - * Use vfs vnode-to-name reverse cache; if that fails, fall back - * to reading directory contents. */ - int linux_getcwd(struct thread *td, struct linux_getcwd_args *args) { - char *bp, *bend, *path; - int error, len, lenused; + char *path; + int error, lenused; #ifdef DEBUG if (ldebug(getcwd)) printf(ARGS(getcwd, "%p, %ld"), args->buf, (long)args->bufsize); #endif - len = args->bufsize; + /* + * Linux returns ERANGE instead of EINVAL. + */ + if (args->bufsize < 2) + return (ERANGE); - if (len > LINUX_PATH_MAX) - len = LINUX_PATH_MAX; - else if (len < 2) - return ERANGE; + path = malloc(LINUX_PATH_MAX, M_TEMP, M_WAITOK); - path = malloc(len, M_TEMP, M_WAITOK); - - error = kern___getcwd(td, path, UIO_SYSSPACE, len, LINUX_PATH_MAX); - if (!error) { + error = kern___getcwd(td, path, UIO_SYSSPACE, args->bufsize, + LINUX_PATH_MAX); + if (error == 0) { lenused = strlen(path) + 1; - if (lenused <= args->bufsize) { + error = copyout(path, args->buf, lenused); + if (error == 0) td->td_retval[0] = lenused; - error = copyout(path, args->buf, lenused); - } - else - error = ERANGE; - } else { - bp = &path[len]; - bend = bp; - *(--bp) = '\0'; - - /* - * 5th argument here is "max number of vnodes to traverse". - * Since each entry takes up at least 2 bytes in the output buffer, - * limit it to N/2 vnodes for an N byte buffer. - */ - - error = linux_getcwd_common (td->td_proc->p_fd->fd_cdir, NULL, - &bp, path, len/2, GETCWD_CHECK_ACCESS, td); - if (error) - goto out; - lenused = bend - bp; - td->td_retval[0] = lenused; - /* put the result into user buffer */ - error = copyout(bp, args->buf, lenused); } -out: + free(path, M_TEMP); return (error); } - From owner-svn-src-all@freebsd.org Sat Jul 15 15:00:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A935EAFBFCC; Sat, 15 Jul 2017 15:00:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F3872C8D; Sat, 15 Jul 2017 15:00:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FF0Dm3000471; Sat, 15 Jul 2017 15:00:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FF0DWG000470; Sat, 15 Jul 2017 15:00:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707151500.v6FF0DWG000470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 15 Jul 2017 15:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321011 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 321011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 15:00:14 -0000 Author: pfg Date: Sat Jul 15 15:00:13 2017 New Revision: 321011 URL: https://svnweb.freebsd.org/changeset/base/321011 Log: libthr: check for possible overflow in the pthread_barrier_init() count. Following up on r320900, where the check for negative count values was removed, add a check to prevent integer overflow. This is to account that b_count, b_waiters but most importantly the total number of threads in the system are signed values. Discussed with: kib MFC after: 2 weeks Modified: head/lib/libthr/thread/thr_barrier.c Modified: head/lib/libthr/thread/thr_barrier.c ============================================================================== --- head/lib/libthr/thread/thr_barrier.c Sat Jul 15 14:57:24 2017 (r321010) +++ head/lib/libthr/thread/thr_barrier.c Sat Jul 15 15:00:13 2017 (r321011) @@ -100,7 +100,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, pthread_barrier_t bar; int pshared; - if (barrier == NULL || count == 0) + if (barrier == NULL || count == 0 || count > INT_MAX) return (EINVAL); if (attr == NULL || *attr == NULL || From owner-svn-src-all@freebsd.org Sat Jul 15 15:08:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9E56AFC1C9; Sat, 15 Jul 2017 15:08:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 664E9730E6; Sat, 15 Jul 2017 15:08:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FF8IMj004445; Sat, 15 Jul 2017 15:08:18 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FF8IbP004444; Sat, 15 Jul 2017 15:08:18 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151508.v6FF8IbP004444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 15:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321012 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 321012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 15:08:19 -0000 Author: dchagin Date: Sat Jul 15 15:08:18 2017 New Revision: 321012 URL: https://svnweb.freebsd.org/changeset/base/321012 Log: MFC r292744: Return EINVAL in case of incorrect sigev_signo value specified instead of panicing. Modified: stable/10/sys/compat/linux/linux_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_timer.c ============================================================================== --- stable/10/sys/compat/linux/linux_timer.c Sat Jul 15 15:00:13 2017 (r321011) +++ stable/10/sys/compat/linux/linux_timer.c Sat Jul 15 15:08:18 2017 (r321012) @@ -57,6 +57,8 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, str CP(*l_sig, *sig, sigev_notify); switch (l_sig->sigev_notify) { case L_SIGEV_SIGNAL: + if (!LINUX_SIG_VALID(l_sig->sigev_signo)) + return (EINVAL); sig->sigev_notify = SIGEV_SIGNAL; sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); @@ -73,6 +75,8 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, str return (EINVAL); #endif case L_SIGEV_THREAD_ID: + if (!LINUX_SIG_VALID(l_sig->sigev_signo)) + return (EINVAL); sig->sigev_notify = SIGEV_THREAD_ID; CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); From owner-svn-src-all@freebsd.org Sat Jul 15 15:21:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F3EAFC4E1; Sat, 15 Jul 2017 15:21:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501A173858; Sat, 15 Jul 2017 15:21:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FFLhTv011500; Sat, 15 Jul 2017 15:21:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FFLhva011499; Sat, 15 Jul 2017 15:21:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151521.v6FFLhva011499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 15:21:43 +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: r321013 - stable/10/sys/amd64/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/amd64/linux X-SVN-Commit-Revision: 321013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 15:21:44 -0000 Author: dchagin Date: Sat Jul 15 15:21:43 2017 New Revision: 321013 URL: https://svnweb.freebsd.org/changeset/base/321013 Log: MFC r293907 (glebius@) partially: Change linux get_robust_list system call to match actual linux one. This is the forgotten part of r293897. Modified: stable/10/sys/amd64/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jul 15 15:08:18 2017 (r321012) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jul 15 15:21:43 2017 (r321013) @@ -461,8 +461,8 @@ 272 AUE_NULL STD { int linux_unshare(void); } 273 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } -274 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ - l_size_t *len); } +274 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } 275 AUE_NULL STD { int linux_splice(void); } 276 AUE_NULL STD { int linux_tee(void); } 277 AUE_NULL STD { int linux_sync_file_range(void); } From owner-svn-src-all@freebsd.org Sat Jul 15 15:26:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA291AFC6F5; Sat, 15 Jul 2017 15:26:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8DBE73A56; Sat, 15 Jul 2017 15:26:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FFQcvR012362; Sat, 15 Jul 2017 15:26:38 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FFQcSr012360; Sat, 15 Jul 2017 15:26:38 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151526.v6FFQcSr012360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 15:26:38 +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: r321014 - stable/10/sys/amd64/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/amd64/linux X-SVN-Commit-Revision: 321014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 15:26:40 -0000 Author: dchagin Date: Sat Jul 15 15:26:38 2017 New Revision: 321014 URL: https://svnweb.freebsd.org/changeset/base/321014 Log: MFC r293908: Regen after get_robust_list fix. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_systrace_args.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jul 15 15:21:43 2017 (r321013) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jul 15 15:26:38 2017 (r321014) @@ -965,7 +965,7 @@ struct linux_set_robust_list_args { }; struct linux_get_robust_list_args { char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; - char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char head_l_[PADL_(struct linux_robust_list_head **)]; struct linux_robust_list_head ** head; char head_r_[PADR_(struct linux_robust_list_head **)]; char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; }; struct linux_splice_args { Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jul 15 15:21:43 2017 (r321013) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jul 15 15:26:38 2017 (r321014) @@ -2020,7 +2020,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 274: { struct linux_get_robust_list_args *p = params; iarg[0] = p->pid; /* l_int */ - uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head * */ + uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head ** */ uarg[2] = (intptr_t) p->len; /* l_size_t * */ *n_args = 3; break; @@ -5347,7 +5347,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 1: - p = "struct linux_robust_list_head *"; + p = "struct linux_robust_list_head **"; break; case 2: p = "l_size_t *"; From owner-svn-src-all@freebsd.org Sat Jul 15 16:42:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDB4AFD700; Sat, 15 Jul 2017 16:42:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7744E7540E; Sat, 15 Jul 2017 16:42:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FGgtda043918; Sat, 15 Jul 2017 16:42:55 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FGgthE043917; Sat, 15 Jul 2017 16:42:55 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707151642.v6FGgthE043917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 15 Jul 2017 16:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321015 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 321015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 16:42:56 -0000 Author: alc Date: Sat Jul 15 16:42:55 2017 New Revision: 321015 URL: https://svnweb.freebsd.org/changeset/base/321015 Log: Style-only change: Consistently use the variable name "pdpg" throughout this file. Previously, half of the pointers to a vm_page being used as a page directory page were named "pdpg" and the rest were named "mpde". Discussed with: kib MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jul 15 15:26:38 2017 (r321014) +++ head/sys/amd64/amd64/pmap.c Sat Jul 15 16:42:55 2017 (r321015) @@ -4556,23 +4556,23 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t { pd_entry_t *pde, newpde; pt_entry_t PG_V; - vm_page_t mpde; + vm_page_t pdpg; struct spglist free; PG_V = pmap_valid_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((mpde = pmap_allocpde(pmap, va, NULL)) == NULL) { + if ((pdpg = pmap_allocpde(pmap, va, NULL)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (FALSE); } - pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(mpde)); + pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); pde = &pde[pmap_pde_index(va)]; if ((*pde & PG_V) != 0) { - KASSERT(mpde->wire_count > 1, - ("pmap_enter_pde: mpde's wire count is too low")); - mpde->wire_count--; + KASSERT(pdpg->wire_count > 1, + ("pmap_enter_pde: pdpg's wire count is too low")); + pdpg->wire_count--; CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (FALSE); @@ -4588,7 +4588,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t if (!pmap_pv_insert_pde(pmap, va, VM_PAGE_TO_PHYS(m), lockp)) { SLIST_INIT(&free); - if (pmap_unwire_ptp(pmap, va, mpde, &free)) { + if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { /* * Although "va" is not mapped, paging- * structure caches could nonetheless have @@ -5013,6 +5013,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ vm_offset_t addr; vm_offset_t end_addr = src_addr + len; vm_offset_t va_next; + vm_page_t dst_pdpg, dstmpte, srcmpte; pt_entry_t PG_A, PG_M, PG_V; if (dst_addr != src_addr) @@ -5047,7 +5048,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ for (addr = src_addr; addr < end_addr; addr = va_next) { pt_entry_t *src_pte, *dst_pte; - vm_page_t dstmpde, dstmpte, srcmpte; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t srcptepaddr, *pde; @@ -5083,11 +5083,11 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ if (srcptepaddr & PG_PS) { if ((addr & PDRMASK) != 0 || addr + NBPDR > end_addr) continue; - dstmpde = pmap_allocpde(dst_pmap, addr, NULL); - if (dstmpde == NULL) + dst_pdpg = pmap_allocpde(dst_pmap, addr, NULL); + if (dst_pdpg == NULL) break; pde = (pd_entry_t *) - PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpde)); + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dst_pdpg)); pde = &pde[pmap_pde_index(addr)]; if (*pde == 0 && ((srcptepaddr & PG_MANAGED) == 0 || pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr & @@ -5096,7 +5096,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE); atomic_add_long(&pmap_pde_mappings, 1); } else - dstmpde->wire_count--; + dst_pdpg->wire_count--; continue; } @@ -6447,8 +6447,8 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_of pdp_entry_t newpdpe, oldpdpe; pd_entry_t *firstpde, newpde, *pde; pt_entry_t PG_A, PG_M, PG_RW, PG_V; - vm_paddr_t mpdepa; - vm_page_t mpde; + vm_paddr_t pdpgpa; + vm_page_t pdpg; PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); @@ -6459,15 +6459,15 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_of oldpdpe = *pdpe; KASSERT((oldpdpe & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pdpe: oldpdpe is missing PG_PS and/or PG_V")); - if ((mpde = vm_page_alloc(NULL, va >> PDPSHIFT, VM_ALLOC_INTERRUPT | + if ((pdpg = vm_page_alloc(NULL, va >> PDPSHIFT, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { CTR2(KTR_PMAP, "pmap_demote_pdpe: failure for va %#lx" " in pmap %p", va, pmap); return (FALSE); } - mpdepa = VM_PAGE_TO_PHYS(mpde); - firstpde = (pd_entry_t *)PHYS_TO_DMAP(mpdepa); - newpdpe = mpdepa | PG_M | PG_A | (oldpdpe & PG_U) | PG_RW | PG_V; + pdpgpa = VM_PAGE_TO_PHYS(pdpg); + firstpde = (pd_entry_t *)PHYS_TO_DMAP(pdpgpa); + newpdpe = pdpgpa | PG_M | PG_A | (oldpdpe & PG_U) | PG_RW | PG_V; KASSERT((oldpdpe & PG_A) != 0, ("pmap_demote_pdpe: oldpdpe is missing PG_A")); KASSERT((oldpdpe & (PG_M | PG_RW)) != PG_RW, From owner-svn-src-all@freebsd.org Sat Jul 15 16:52:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79461AFD8C2; Sat, 15 Jul 2017 16:52:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 181C17580A; Sat, 15 Jul 2017 16:52:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FGqe7x048047; Sat, 15 Jul 2017 16:52:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FGqe5W048046; Sat, 15 Jul 2017 16:52:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151652.v6FGqe5W048046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 16:52:40 +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: r321016 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 321016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 16:52:41 -0000 Author: dchagin Date: Sat Jul 15 16:52:40 2017 New Revision: 321016 URL: https://svnweb.freebsd.org/changeset/base/321016 Log: Temporarily r284696: MFC r284613. When using KTRACE, set a variable to the appropriate value and don't leave it initialized at NULL. Will MFC it after proper MFC of r272823. Modified: stable/10/sys/kern/uipc_syscalls.c Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 16:42:55 2017 (r321015) +++ stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 16:52:40 2017 (r321016) @@ -2746,10 +2746,6 @@ sys_sctp_generic_sendmsg (td, uap) auio.uio_td = td; auio.uio_offset = 0; /* XXX */ auio.uio_resid = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) - ktruio = cloneuio(&auio); -#endif /* KTRACE */ len = auio.uio_resid = uap->mlen; CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, @@ -2873,10 +2869,6 @@ sys_sctp_generic_sendmsg_iov(td, uap) goto sctp_bad; } } -#ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) - ktruio = cloneuio(&auio); -#endif /* KTRACE */ len = auio.uio_resid; CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, From owner-svn-src-all@freebsd.org Sat Jul 15 16:55:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96506AFD944; Sat, 15 Jul 2017 16:55:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 642B075969; Sat, 15 Jul 2017 16:55:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FGt21A048206; Sat, 15 Jul 2017 16:55:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FGt2B7048200; Sat, 15 Jul 2017 16:55:02 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151655.v6FGt2B7048200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 16:55:02 +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: r321017 - in stable/10/sys: compat/freebsd32 conf kern netinet sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: compat/freebsd32 conf kern netinet sys X-SVN-Commit-Revision: 321017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 16:55:03 -0000 Author: dchagin Date: Sat Jul 15 16:55:02 2017 New Revision: 321017 URL: https://svnweb.freebsd.org/changeset/base/321017 Log: MFC r272823: Move the SCTP syscalls to netinet with the rest of the SCTP code. The syscalls themselves are tightly coupled with the network stack and therefore should not be in the generic socket code. The following four syscalls have been marked as NOSTD so they can be dynamically registered in sctp_syscalls_init() function: sys_sctp_peeloff sys_sctp_generic_sendmsg sys_sctp_generic_sendmsg_iov sys_sctp_generic_recvmsg The syscalls are also set up to be dynamically registered when COMPAT32 option is configured. As a side effect of moving the SCTP syscalls, getsock_cap needs to be made available outside of the uipc_syscalls.c source file. A proper prototype has been added to the sys/socketvar.h header file. API tests from the SCTP reference implementation have been run to ensure compatibility. (http://code.google.com/p/sctp-refimpl/source/checkout) Added: stable/10/sys/netinet/sctp_syscalls.c - copied unchanged from r272823, head/sys/netinet/sctp_syscalls.c Modified: stable/10/sys/compat/freebsd32/syscalls.master stable/10/sys/conf/files stable/10/sys/kern/syscalls.master stable/10/sys/kern/uipc_syscalls.c stable/10/sys/sys/socketvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/10/sys/compat/freebsd32/syscalls.master Sat Jul 15 16:52:40 2017 (r321016) +++ stable/10/sys/compat/freebsd32/syscalls.master Sat Jul 15 16:55:02 2017 (r321017) @@ -845,14 +845,14 @@ 468 AUE_NULL UNIMPL nosys 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr -471 AUE_NULL NOPROTO { int sctp_peeloff(int sd, uint32_t name); } -472 AUE_NULL NOPROTO { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ +471 AUE_NULL NOPROTO|NOSTD { int sctp_peeloff(int sd, uint32_t name); } +472 AUE_NULL NOPROTO|NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -473 AUE_NULL NOPROTO { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ +473 AUE_NULL NOPROTO|NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -474 AUE_NULL NOPROTO { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ +474 AUE_NULL NOPROTO|NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ struct sockaddr * from, __socklen_t *fromlenaddr, \ struct sctp_sndrcvinfo *sinfo, int *msg_flags); } #ifdef PAD64_REQUIRED Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sat Jul 15 16:52:40 2017 (r321016) +++ stable/10/sys/conf/files Sat Jul 15 16:55:02 2017 (r321017) @@ -3570,6 +3570,7 @@ netinet/sctp_output.c optional inet sctp | inet6 sctp netinet/sctp_pcb.c optional inet sctp | inet6 sctp netinet/sctp_peeloff.c optional inet sctp | inet6 sctp netinet/sctp_ss_functions.c optional inet sctp | inet6 sctp +netinet/sctp_syscalls.c optional inet sctp | inet6 sctp netinet/sctp_sysctl.c optional inet sctp | inet6 sctp netinet/sctp_timer.c optional inet sctp | inet6 sctp netinet/sctp_usrreq.c optional inet sctp | inet6 sctp Modified: stable/10/sys/kern/syscalls.master ============================================================================== --- stable/10/sys/kern/syscalls.master Sat Jul 15 16:52:40 2017 (r321016) +++ stable/10/sys/kern/syscalls.master Sat Jul 15 16:55:02 2017 (r321017) @@ -837,14 +837,14 @@ 468 AUE_NULL UNIMPL nosys 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr -471 AUE_NULL STD { int sctp_peeloff(int sd, uint32_t name); } -472 AUE_NULL STD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ +471 AUE_NULL NOSTD { int sctp_peeloff(int sd, uint32_t name); } +472 AUE_NULL NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -473 AUE_NULL STD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ +473 AUE_NULL NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -474 AUE_NULL STD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ +474 AUE_NULL NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ struct sockaddr * from, __socklen_t *fromlenaddr, \ struct sctp_sndrcvinfo *sinfo, int *msg_flags); } 475 AUE_PREAD STD { ssize_t pread(int fd, void *buf, \ Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 16:52:40 2017 (r321016) +++ stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 16:55:02 2017 (r321017) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_sctp.h" #include "opt_compat.h" #include "opt_ktrace.h" @@ -92,13 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(INET) || defined(INET6) -#ifdef SCTP -#include -#include -#endif /* SCTP */ -#endif /* INET || INET6 */ - /* * Flags for accept1() and kern_accept4(), in addition to SOCK_CLOEXEC * and SOCK_NONBLOCK. @@ -157,7 +149,7 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU * capability rights are present. * A reference on the file entry is held upon returning. */ -static int +int getsock_cap(struct filedesc *fdp, int fd, cap_rights_t *rightsp, struct file **fpp, u_int *fflagp) { @@ -2573,485 +2565,4 @@ out: error = EINTR; return (error); -} - -/* - * SCTP syscalls. - * Functionality only compiled in if SCTP is defined in the kernel Makefile, - * otherwise all return EOPNOTSUPP. - * XXX: We should make this loadable one day. - */ -int -sys_sctp_peeloff(td, uap) - struct thread *td; - struct sctp_peeloff_args /* { - int sd; - caddr_t name; - } */ *uap; -{ -#if (defined(INET) || defined(INET6)) && defined(SCTP) - struct file *nfp = NULL; - struct socket *head, *so; - cap_rights_t rights; - u_int fflag; - int error, fd; - - AUDIT_ARG_FD(uap->sd); - error = fgetsock(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF), - &head, &fflag); - if (error != 0) - goto done2; - if (head->so_proto->pr_protocol != IPPROTO_SCTP) { - error = EOPNOTSUPP; - goto done; - } - error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); - if (error != 0) - goto done; - /* - * At this point we know we do have a assoc to pull - * we proceed to get the fd setup. This may block - * but that is ok. - */ - - error = falloc(td, &nfp, &fd, 0); - if (error != 0) - goto done; - td->td_retval[0] = fd; - - CURVNET_SET(head->so_vnet); - so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) { - error = ENOMEM; - goto noconnection; - } - /* - * Before changing the flags on the socket, we have to bump the - * reference count. Otherwise, if the protocol calls sofree(), - * the socket will be released due to a zero refcount. - */ - SOCK_LOCK(so); - soref(so); /* file descriptor reference */ - SOCK_UNLOCK(so); - - ACCEPT_LOCK(); - - TAILQ_REMOVE(&head->so_comp, so, so_list); - head->so_qlen--; - so->so_state |= (head->so_state & SS_NBIO); - so->so_state &= ~SS_NOFDREF; - so->so_qstate &= ~SQ_COMP; - so->so_head = NULL; - ACCEPT_UNLOCK(); - finit(nfp, fflag, DTYPE_SOCKET, so, &socketops); - error = sctp_do_peeloff(head, so, (sctp_assoc_t)uap->name); - if (error != 0) - goto noconnection; - if (head->so_sigio != NULL) - fsetown(fgetown(&head->so_sigio), &so->so_sigio); - -noconnection: - /* - * close the new descriptor, assuming someone hasn't ripped it - * out from under us. - */ - if (error != 0) - fdclose(td->td_proc->p_fd, nfp, fd, td); - - /* - * Release explicitly held references before returning. - */ - CURVNET_RESTORE(); -done: - if (nfp != NULL) - fdrop(nfp, td); - fputsock(head); -done2: - return (error); -#else /* SCTP */ - return (EOPNOTSUPP); -#endif /* SCTP */ -} - -int -sys_sctp_generic_sendmsg (td, uap) - struct thread *td; - struct sctp_generic_sendmsg_args /* { - int sd, - caddr_t msg, - int mlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, - int flags - } */ *uap; -{ -#if (defined(INET) || defined(INET6)) && defined(SCTP) - struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; - struct socket *so; - struct file *fp = NULL; - struct sockaddr *to = NULL; -#ifdef KTRACE - struct uio *ktruio = NULL; -#endif - struct uio auio; - struct iovec iov[1]; - cap_rights_t rights; - int error = 0, len; - - if (uap->sinfo != NULL) { - error = copyin(uap->sinfo, &sinfo, sizeof (sinfo)); - if (error != 0) - return (error); - u_sinfo = &sinfo; - } - - cap_rights_init(&rights, CAP_SEND); - if (uap->tolen != 0) { - error = getsockaddr(&to, uap->to, uap->tolen); - if (error != 0) { - to = NULL; - goto sctp_bad2; - } - cap_rights_set(&rights, CAP_CONNECT); - } - - AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); - if (error != 0) - goto sctp_bad; -#ifdef KTRACE - if (to && (KTRPOINT(td, KTR_STRUCT))) - ktrsockaddr(to); -#endif - - iov[0].iov_base = uap->msg; - iov[0].iov_len = uap->mlen; - - so = (struct socket *)fp->f_data; - if (so->so_proto->pr_protocol != IPPROTO_SCTP) { - error = EOPNOTSUPP; - goto sctp_bad; - } -#ifdef MAC - error = mac_socket_check_send(td->td_ucred, so); - if (error != 0) - goto sctp_bad; -#endif /* MAC */ - - auio.uio_iov = iov; - auio.uio_iovcnt = 1; - auio.uio_segflg = UIO_USERSPACE; - auio.uio_rw = UIO_WRITE; - auio.uio_td = td; - auio.uio_offset = 0; /* XXX */ - auio.uio_resid = 0; - len = auio.uio_resid = uap->mlen; - CURVNET_SET(so->so_vnet); - error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, - (struct mbuf *)NULL, uap->flags, u_sinfo, td); - CURVNET_RESTORE(); - if (error != 0) { - if (auio.uio_resid != len && (error == ERESTART || - error == EINTR || error == EWOULDBLOCK)) - error = 0; - /* Generation of SIGPIPE can be controlled per socket. */ - if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && - !(uap->flags & MSG_NOSIGNAL)) { - PROC_LOCK(td->td_proc); - tdsignal(td, SIGPIPE); - PROC_UNLOCK(td->td_proc); - } - } - if (error == 0) - td->td_retval[0] = len - auio.uio_resid; -#ifdef KTRACE - if (ktruio != NULL) { - ktruio->uio_resid = td->td_retval[0]; - ktrgenio(uap->sd, UIO_WRITE, ktruio, error); - } -#endif /* KTRACE */ -sctp_bad: - if (fp != NULL) - fdrop(fp, td); -sctp_bad2: - free(to, M_SONAME); - return (error); -#else /* SCTP */ - return (EOPNOTSUPP); -#endif /* SCTP */ -} - -int -sys_sctp_generic_sendmsg_iov(td, uap) - struct thread *td; - struct sctp_generic_sendmsg_iov_args /* { - int sd, - struct iovec *iov, - int iovlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, - int flags - } */ *uap; -{ -#if (defined(INET) || defined(INET6)) && defined(SCTP) - struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; - struct socket *so; - struct file *fp = NULL; - struct sockaddr *to = NULL; -#ifdef KTRACE - struct uio *ktruio = NULL; -#endif - struct uio auio; - struct iovec *iov, *tiov; - cap_rights_t rights; - ssize_t len; - int error, i; - - if (uap->sinfo != NULL) { - error = copyin(uap->sinfo, &sinfo, sizeof (sinfo)); - if (error != 0) - return (error); - u_sinfo = &sinfo; - } - cap_rights_init(&rights, CAP_SEND); - if (uap->tolen != 0) { - error = getsockaddr(&to, uap->to, uap->tolen); - if (error != 0) { - to = NULL; - goto sctp_bad2; - } - cap_rights_set(&rights, CAP_CONNECT); - } - - AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); - if (error != 0) - goto sctp_bad1; - -#ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) - error = freebsd32_copyiniov((struct iovec32 *)uap->iov, - uap->iovlen, &iov, EMSGSIZE); - else -#endif - error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE); - if (error != 0) - goto sctp_bad1; -#ifdef KTRACE - if (to && (KTRPOINT(td, KTR_STRUCT))) - ktrsockaddr(to); -#endif - - so = (struct socket *)fp->f_data; - if (so->so_proto->pr_protocol != IPPROTO_SCTP) { - error = EOPNOTSUPP; - goto sctp_bad; - } -#ifdef MAC - error = mac_socket_check_send(td->td_ucred, so); - if (error != 0) - goto sctp_bad; -#endif /* MAC */ - - auio.uio_iov = iov; - auio.uio_iovcnt = uap->iovlen; - auio.uio_segflg = UIO_USERSPACE; - auio.uio_rw = UIO_WRITE; - auio.uio_td = td; - auio.uio_offset = 0; /* XXX */ - auio.uio_resid = 0; - tiov = iov; - for (i = 0; i iovlen; i++, tiov++) { - if ((auio.uio_resid += tiov->iov_len) < 0) { - error = EINVAL; - goto sctp_bad; - } - } - len = auio.uio_resid; - CURVNET_SET(so->so_vnet); - error = sctp_lower_sosend(so, to, &auio, - (struct mbuf *)NULL, (struct mbuf *)NULL, - uap->flags, u_sinfo, td); - CURVNET_RESTORE(); - if (error != 0) { - if (auio.uio_resid != len && (error == ERESTART || - error == EINTR || error == EWOULDBLOCK)) - error = 0; - /* Generation of SIGPIPE can be controlled per socket */ - if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && - !(uap->flags & MSG_NOSIGNAL)) { - PROC_LOCK(td->td_proc); - tdsignal(td, SIGPIPE); - PROC_UNLOCK(td->td_proc); - } - } - if (error == 0) - td->td_retval[0] = len - auio.uio_resid; -#ifdef KTRACE - if (ktruio != NULL) { - ktruio->uio_resid = td->td_retval[0]; - ktrgenio(uap->sd, UIO_WRITE, ktruio, error); - } -#endif /* KTRACE */ -sctp_bad: - free(iov, M_IOV); -sctp_bad1: - if (fp != NULL) - fdrop(fp, td); -sctp_bad2: - free(to, M_SONAME); - return (error); -#else /* SCTP */ - return (EOPNOTSUPP); -#endif /* SCTP */ -} - -int -sys_sctp_generic_recvmsg(td, uap) - struct thread *td; - struct sctp_generic_recvmsg_args /* { - int sd, - struct iovec *iov, - int iovlen, - struct sockaddr *from, - __socklen_t *fromlenaddr, - struct sctp_sndrcvinfo *sinfo, - int *msg_flags - } */ *uap; -{ -#if (defined(INET) || defined(INET6)) && defined(SCTP) - uint8_t sockbufstore[256]; - struct uio auio; - struct iovec *iov, *tiov; - struct sctp_sndrcvinfo sinfo; - struct socket *so; - struct file *fp = NULL; - struct sockaddr *fromsa; - cap_rights_t rights; -#ifdef KTRACE - struct uio *ktruio = NULL; -#endif - ssize_t len; - int error, fromlen, i, msg_flags; - - AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, - cap_rights_init(&rights, CAP_RECV), &fp, NULL); - if (error != 0) - return (error); -#ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) - error = freebsd32_copyiniov((struct iovec32 *)uap->iov, - uap->iovlen, &iov, EMSGSIZE); - else -#endif - error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE); - if (error != 0) - goto out1; - - so = fp->f_data; - if (so->so_proto->pr_protocol != IPPROTO_SCTP) { - error = EOPNOTSUPP; - goto out; - } -#ifdef MAC - error = mac_socket_check_receive(td->td_ucred, so); - if (error != 0) - goto out; -#endif /* MAC */ - - if (uap->fromlenaddr != NULL) { - error = copyin(uap->fromlenaddr, &fromlen, sizeof (fromlen)); - if (error != 0) - goto out; - } else { - fromlen = 0; - } - if (uap->msg_flags) { - error = copyin(uap->msg_flags, &msg_flags, sizeof (int)); - if (error != 0) - goto out; - } else { - msg_flags = 0; - } - auio.uio_iov = iov; - auio.uio_iovcnt = uap->iovlen; - auio.uio_segflg = UIO_USERSPACE; - auio.uio_rw = UIO_READ; - auio.uio_td = td; - auio.uio_offset = 0; /* XXX */ - auio.uio_resid = 0; - tiov = iov; - for (i = 0; i iovlen; i++, tiov++) { - if ((auio.uio_resid += tiov->iov_len) < 0) { - error = EINVAL; - goto out; - } - } - len = auio.uio_resid; - fromsa = (struct sockaddr *)sockbufstore; - -#ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) - ktruio = cloneuio(&auio); -#endif /* KTRACE */ - memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); - CURVNET_SET(so->so_vnet); - error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, - fromsa, fromlen, &msg_flags, - (struct sctp_sndrcvinfo *)&sinfo, 1); - CURVNET_RESTORE(); - if (error != 0) { - if (auio.uio_resid != len && (error == ERESTART || - error == EINTR || error == EWOULDBLOCK)) - error = 0; - } else { - if (uap->sinfo) - error = copyout(&sinfo, uap->sinfo, sizeof (sinfo)); - } -#ifdef KTRACE - if (ktruio != NULL) { - ktruio->uio_resid = len - auio.uio_resid; - ktrgenio(uap->sd, UIO_READ, ktruio, error); - } -#endif /* KTRACE */ - if (error != 0) - goto out; - td->td_retval[0] = len - auio.uio_resid; - - if (fromlen && uap->from) { - len = fromlen; - if (len <= 0 || fromsa == 0) - len = 0; - else { - len = MIN(len, fromsa->sa_len); - error = copyout(fromsa, uap->from, (size_t)len); - if (error != 0) - goto out; - } - error = copyout(&len, uap->fromlenaddr, sizeof (socklen_t)); - if (error != 0) - goto out; - } -#ifdef KTRACE - if (KTRPOINT(td, KTR_STRUCT)) - ktrsockaddr(fromsa); -#endif - if (uap->msg_flags) { - error = copyout(&msg_flags, uap->msg_flags, sizeof (int)); - if (error != 0) - goto out; - } -out: - free(iov, M_IOV); -out1: - if (fp != NULL) - fdrop(fp, td); - - return (error); -#else /* SCTP */ - return (EOPNOTSUPP); -#endif /* SCTP */ } Copied: stable/10/sys/netinet/sctp_syscalls.c (from r272823, head/sys/netinet/sctp_syscalls.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 16:55:02 2017 (r321017, copy of r272823, head/sys/netinet/sctp_syscalls.c) @@ -0,0 +1,588 @@ +/*- + * Copyright (c) 1982, 1986, 1989, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_capsicum.h" +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_sctp.h" +#include "opt_compat.h" +#include "opt_ktrace.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef KTRACE +#include +#endif +#ifdef COMPAT_FREEBSD32 +#include +#endif + +#include + +#include +#include + +#include +#include + +static struct syscall_helper_data sctp_syscalls[] = { + SYSCALL_INIT_HELPER(sctp_peeloff), + SYSCALL_INIT_HELPER(sctp_generic_sendmsg), + SYSCALL_INIT_HELPER(sctp_generic_sendmsg_iov), + SYSCALL_INIT_HELPER(sctp_generic_recvmsg), + SYSCALL_INIT_LAST +}; + +static void +sctp_syscalls_init(void *unused __unused) +{ + int error; + + error = syscall_helper_register(sctp_syscalls); + KASSERT((error == 0), + ("%s: syscall_helper_register failed for sctp syscalls", __func__)); +#ifdef COMPAT_FREEBSD32 + error = syscall32_helper_register(sctp_syscalls); + KASSERT((error == 0), + ("%s: syscall32_helper_register failed for sctp syscalls", + __func__)); +#endif +} +SYSINIT(sctp_syscalls, SI_SUB_SYSCALLS, SI_ORDER_ANY, sctp_syscalls_init, NULL); + +/* + * SCTP syscalls. + * Functionality only compiled in if SCTP is defined in the kernel Makefile, + * otherwise all return EOPNOTSUPP. + * XXX: We should make this loadable one day. + */ +int +sys_sctp_peeloff(td, uap) + struct thread *td; + struct sctp_peeloff_args /* { + int sd; + caddr_t name; + } */ *uap; +{ +#if (defined(INET) || defined(INET6)) && defined(SCTP) + struct file *nfp = NULL; + struct socket *head, *so; + cap_rights_t rights; + u_int fflag; + int error, fd; + + AUDIT_ARG_FD(uap->sd); + error = fgetsock(td, uap->sd, cap_rights_init(&rights, CAP_PEELOFF), + &head, &fflag); + if (error != 0) + goto done2; + if (head->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto done; + } + error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); + if (error != 0) + goto done; + /* + * At this point we know we do have a assoc to pull + * we proceed to get the fd setup. This may block + * but that is ok. + */ + + error = falloc(td, &nfp, &fd, 0); + if (error != 0) + goto done; + td->td_retval[0] = fd; + + CURVNET_SET(head->so_vnet); + so = sonewconn(head, SS_ISCONNECTED); + if (so == NULL) { + error = ENOMEM; + goto noconnection; + } + /* + * Before changing the flags on the socket, we have to bump the + * reference count. Otherwise, if the protocol calls sofree(), + * the socket will be released due to a zero refcount. + */ + SOCK_LOCK(so); + soref(so); /* file descriptor reference */ + SOCK_UNLOCK(so); + + ACCEPT_LOCK(); + + TAILQ_REMOVE(&head->so_comp, so, so_list); + head->so_qlen--; + so->so_state |= (head->so_state & SS_NBIO); + so->so_state &= ~SS_NOFDREF; + so->so_qstate &= ~SQ_COMP; + so->so_head = NULL; + ACCEPT_UNLOCK(); + finit(nfp, fflag, DTYPE_SOCKET, so, &socketops); + error = sctp_do_peeloff(head, so, (sctp_assoc_t)uap->name); + if (error != 0) + goto noconnection; + if (head->so_sigio != NULL) + fsetown(fgetown(&head->so_sigio), &so->so_sigio); + +noconnection: + /* + * close the new descriptor, assuming someone hasn't ripped it + * out from under us. + */ + if (error != 0) + fdclose(td->td_proc->p_fd, nfp, fd, td); + + /* + * Release explicitly held references before returning. + */ + CURVNET_RESTORE(); +done: + if (nfp != NULL) + fdrop(nfp, td); + fputsock(head); +done2: + return (error); +#else /* SCTP */ + return (EOPNOTSUPP); +#endif /* SCTP */ +} + +int +sys_sctp_generic_sendmsg (td, uap) + struct thread *td; + struct sctp_generic_sendmsg_args /* { + int sd, + caddr_t msg, + int mlen, + caddr_t to, + __socklen_t tolen, + struct sctp_sndrcvinfo *sinfo, + int flags + } */ *uap; +{ +#if (defined(INET) || defined(INET6)) && defined(SCTP) + struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; + struct socket *so; + struct file *fp = NULL; + struct sockaddr *to = NULL; +#ifdef KTRACE + struct uio *ktruio = NULL; +#endif + struct uio auio; + struct iovec iov[1]; + cap_rights_t rights; + int error = 0, len; + + if (uap->sinfo != NULL) { + error = copyin(uap->sinfo, &sinfo, sizeof (sinfo)); + if (error != 0) + return (error); + u_sinfo = &sinfo; + } + + cap_rights_init(&rights, CAP_SEND); + if (uap->tolen != 0) { + error = getsockaddr(&to, uap->to, uap->tolen); + if (error != 0) { + to = NULL; + goto sctp_bad2; + } + cap_rights_set(&rights, CAP_CONNECT); + } + + AUDIT_ARG_FD(uap->sd); + error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); + if (error != 0) + goto sctp_bad; +#ifdef KTRACE + if (to && (KTRPOINT(td, KTR_STRUCT))) + ktrsockaddr(to); +#endif + + iov[0].iov_base = uap->msg; + iov[0].iov_len = uap->mlen; + + so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } +#ifdef MAC + error = mac_socket_check_send(td->td_ucred, so); + if (error != 0) + goto sctp_bad; +#endif /* MAC */ + + auio.uio_iov = iov; + auio.uio_iovcnt = 1; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + auio.uio_offset = 0; /* XXX */ + auio.uio_resid = 0; + len = auio.uio_resid = uap->mlen; + CURVNET_SET(so->so_vnet); + error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, + (struct mbuf *)NULL, uap->flags, u_sinfo, td); + CURVNET_RESTORE(); + if (error != 0) { + if (auio.uio_resid != len && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + /* Generation of SIGPIPE can be controlled per socket. */ + if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && + !(uap->flags & MSG_NOSIGNAL)) { + PROC_LOCK(td->td_proc); + tdsignal(td, SIGPIPE); + PROC_UNLOCK(td->td_proc); + } + } + if (error == 0) + td->td_retval[0] = len - auio.uio_resid; +#ifdef KTRACE + if (ktruio != NULL) { + ktruio->uio_resid = td->td_retval[0]; + ktrgenio(uap->sd, UIO_WRITE, ktruio, error); + } +#endif /* KTRACE */ +sctp_bad: + if (fp != NULL) + fdrop(fp, td); +sctp_bad2: + free(to, M_SONAME); + return (error); +#else /* SCTP */ + return (EOPNOTSUPP); +#endif /* SCTP */ +} + +int +sys_sctp_generic_sendmsg_iov(td, uap) + struct thread *td; + struct sctp_generic_sendmsg_iov_args /* { + int sd, + struct iovec *iov, + int iovlen, + caddr_t to, + __socklen_t tolen, + struct sctp_sndrcvinfo *sinfo, + int flags + } */ *uap; +{ +#if (defined(INET) || defined(INET6)) && defined(SCTP) + struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; + struct socket *so; + struct file *fp = NULL; + struct sockaddr *to = NULL; +#ifdef KTRACE + struct uio *ktruio = NULL; +#endif + struct uio auio; + struct iovec *iov, *tiov; + cap_rights_t rights; + ssize_t len; + int error, i; + + if (uap->sinfo != NULL) { + error = copyin(uap->sinfo, &sinfo, sizeof (sinfo)); + if (error != 0) + return (error); + u_sinfo = &sinfo; + } + cap_rights_init(&rights, CAP_SEND); + if (uap->tolen != 0) { + error = getsockaddr(&to, uap->to, uap->tolen); + if (error != 0) { + to = NULL; + goto sctp_bad2; + } + cap_rights_set(&rights, CAP_CONNECT); + } + + AUDIT_ARG_FD(uap->sd); + error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); + if (error != 0) + goto sctp_bad1; + +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + error = freebsd32_copyiniov((struct iovec32 *)uap->iov, + uap->iovlen, &iov, EMSGSIZE); + else +#endif + error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE); + if (error != 0) + goto sctp_bad1; +#ifdef KTRACE + if (to && (KTRPOINT(td, KTR_STRUCT))) + ktrsockaddr(to); +#endif + + so = (struct socket *)fp->f_data; + if (so->so_proto->pr_protocol != IPPROTO_SCTP) { + error = EOPNOTSUPP; + goto sctp_bad; + } +#ifdef MAC + error = mac_socket_check_send(td->td_ucred, so); + if (error != 0) + goto sctp_bad; +#endif /* MAC */ + + auio.uio_iov = iov; + auio.uio_iovcnt = uap->iovlen; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + auio.uio_offset = 0; /* XXX */ + auio.uio_resid = 0; + tiov = iov; + for (i = 0; i iovlen; i++, tiov++) { + if ((auio.uio_resid += tiov->iov_len) < 0) { + error = EINVAL; + goto sctp_bad; + } + } + len = auio.uio_resid; + CURVNET_SET(so->so_vnet); + error = sctp_lower_sosend(so, to, &auio, + (struct mbuf *)NULL, (struct mbuf *)NULL, + uap->flags, u_sinfo, td); + CURVNET_RESTORE(); + if (error != 0) { + if (auio.uio_resid != len && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + /* Generation of SIGPIPE can be controlled per socket */ + if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && + !(uap->flags & MSG_NOSIGNAL)) { + PROC_LOCK(td->td_proc); + tdsignal(td, SIGPIPE); + PROC_UNLOCK(td->td_proc); + } + } + if (error == 0) + td->td_retval[0] = len - auio.uio_resid; +#ifdef KTRACE + if (ktruio != NULL) { + ktruio->uio_resid = td->td_retval[0]; + ktrgenio(uap->sd, UIO_WRITE, ktruio, error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jul 15 17:00:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDC0DAFDC25; Sat, 15 Jul 2017 17:00:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA23F75B47; Sat, 15 Jul 2017 17:00:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FH0hs8051264; Sat, 15 Jul 2017 17:00:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FH0hUK051262; Sat, 15 Jul 2017 17:00:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151700.v6FH0hUK051262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 17:00:43 +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: r321018 - in stable/10/sys: compat/freebsd32 kern X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 321018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:00:45 -0000 Author: dchagin Date: Sat Jul 15 17:00:43 2017 New Revision: 321018 URL: https://svnweb.freebsd.org/changeset/base/321018 Log: Regen after r321017. Move the SCTP syscalls to netinet with the rest of the SCTP code. Modified: stable/10/sys/compat/freebsd32/freebsd32_sysent.c stable/10/sys/kern/init_sysent.c Modified: stable/10/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_sysent.c Sat Jul 15 16:55:02 2017 (r321017) +++ stable/10/sys/compat/freebsd32/freebsd32_sysent.c Sat Jul 15 17:00:43 2017 (r321018) @@ -517,10 +517,10 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 469 = __getpath_fromfd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 470 = __getpath_fromaddr */ - { AS(sctp_peeloff_args), (sy_call_t *)sys_sctp_peeloff, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 471 = sctp_peeloff */ - { AS(sctp_generic_sendmsg_args), (sy_call_t *)sys_sctp_generic_sendmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 472 = sctp_generic_sendmsg */ - { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)sys_sctp_generic_sendmsg_iov, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 473 = sctp_generic_sendmsg_iov */ - { AS(sctp_generic_recvmsg_args), (sy_call_t *)sys_sctp_generic_recvmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 474 = sctp_generic_recvmsg */ + { AS(sctp_peeloff_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 471 = sctp_peeloff */ + { AS(sctp_generic_sendmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */ + { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */ + { AS(sctp_generic_recvmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 474 = sctp_generic_recvmsg */ #ifdef PAD64_REQUIRED { AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 475 = freebsd32_pread */ { AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 476 = freebsd32_pwrite */ Modified: stable/10/sys/kern/init_sysent.c ============================================================================== --- stable/10/sys/kern/init_sysent.c Sat Jul 15 16:55:02 2017 (r321017) +++ stable/10/sys/kern/init_sysent.c Sat Jul 15 17:00:43 2017 (r321018) @@ -504,10 +504,10 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 469 = __getpath_fromfd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 470 = __getpath_fromaddr */ - { AS(sctp_peeloff_args), (sy_call_t *)sys_sctp_peeloff, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 471 = sctp_peeloff */ - { AS(sctp_generic_sendmsg_args), (sy_call_t *)sys_sctp_generic_sendmsg, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 472 = sctp_generic_sendmsg */ - { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)sys_sctp_generic_sendmsg_iov, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 473 = sctp_generic_sendmsg_iov */ - { AS(sctp_generic_recvmsg_args), (sy_call_t *)sys_sctp_generic_recvmsg, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 474 = sctp_generic_recvmsg */ + { AS(sctp_peeloff_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 471 = sctp_peeloff */ + { AS(sctp_generic_sendmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */ + { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */ + { AS(sctp_generic_recvmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 474 = sctp_generic_recvmsg */ { AS(pread_args), (sy_call_t *)sys_pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 475 = pread */ { AS(pwrite_args), (sy_call_t *)sys_pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 476 = pwrite */ { AS(mmap_args), (sy_call_t *)sys_mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 477 = mmap */ From owner-svn-src-all@freebsd.org Sat Jul 15 17:03:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08115AFDCB2; Sat, 15 Jul 2017 17:03:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB03175EA2; Sat, 15 Jul 2017 17:03:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FH3a0i052142; Sat, 15 Jul 2017 17:03:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FH3aWE052141; Sat, 15 Jul 2017 17:03:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151703.v6FH3aWE052141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 17:03:36 +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: r321019 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 321019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:03:37 -0000 Author: dchagin Date: Sat Jul 15 17:03:35 2017 New Revision: 321019 URL: https://svnweb.freebsd.org/changeset/base/321019 Log: MFC r284613 (by tuexen@): When using KTRACE, set a variable to the appropriate value and don't leave it initialized at NULL. Modified: stable/10/sys/netinet/sctp_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_syscalls.c ============================================================================== --- stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:00:43 2017 (r321018) +++ stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:03:35 2017 (r321019) @@ -277,6 +277,10 @@ sys_sctp_generic_sendmsg (td, uap) auio.uio_td = td; auio.uio_offset = 0; /* XXX */ auio.uio_resid = 0; +#ifdef KTRACE + if (KTRPOINT(td, KTR_GENIO)) + ktruio = cloneuio(&auio); +#endif /* KTRACE */ len = auio.uio_resid = uap->mlen; CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, @@ -400,6 +404,10 @@ sys_sctp_generic_sendmsg_iov(td, uap) goto sctp_bad; } } +#ifdef KTRACE + if (KTRPOINT(td, KTR_GENIO)) + ktruio = cloneuio(&auio); +#endif /* KTRACE */ len = auio.uio_resid; CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, From owner-svn-src-all@freebsd.org Sat Jul 15 17:25:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7D3AFE8CF; Sat, 15 Jul 2017 17:25:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0E877C2A; Sat, 15 Jul 2017 17:25:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FHPfKd065313; Sat, 15 Jul 2017 17:25:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FHPeF5065300; Sat, 15 Jul 2017 17:25:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151725.v6FHPeF5065300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 17:25:40 +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: r321020 - in stable/10/sys: compat/svr4 dev/streams kern netinet ofed/include/linux sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: compat/svr4 dev/streams kern netinet ofed/include/linux sys X-SVN-Commit-Revision: 321020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:25:42 -0000 Author: dchagin Date: Sat Jul 15 17:25:40 2017 New Revision: 321020 URL: https://svnweb.freebsd.org/changeset/base/321020 Log: MFC r281436 (by mjg@): fd: remove filedesc argument from fdclose Just accept a thread instead. This makes it consistent with fdalloc. No functional changes. Modified: stable/10/sys/compat/svr4/svr4_stream.c stable/10/sys/dev/streams/streams.c stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_fork.c stable/10/sys/kern/sys_pipe.c stable/10/sys/kern/tty_pts.c stable/10/sys/kern/uipc_mqueue.c stable/10/sys/kern/uipc_sem.c stable/10/sys/kern/uipc_shm.c stable/10/sys/kern/uipc_syscalls.c stable/10/sys/netinet/sctp_syscalls.c stable/10/sys/ofed/include/linux/file.h stable/10/sys/sys/filedesc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/svr4/svr4_stream.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_stream.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/compat/svr4/svr4_stream.c Sat Jul 15 17:25:40 2017 (r321020) @@ -1828,7 +1828,7 @@ svr4_do_getmsg(td, uap, fp) break; default: - fdclose(td->td_proc->p_fd, afp, st->s_afd, td); + fdclose(td, afp, st->s_afd); fdrop(afp, td); st->s_afd = -1; mtx_unlock(&Giant); @@ -1966,7 +1966,7 @@ svr4_do_getmsg(td, uap, fp) if (error) { if (afp) { - fdclose(td->td_proc->p_fd, afp, st->s_afd, td); + fdclose(td, afp, st->s_afd); fdrop(afp, td); st->s_afd = -1; } Modified: stable/10/sys/dev/streams/streams.c ============================================================================== --- stable/10/sys/dev/streams/streams.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/dev/streams/streams.c Sat Jul 15 17:25:40 2017 (r321020) @@ -188,7 +188,6 @@ MODULE_DEPEND(streams, svr4elf, 1, 1, 1); static int streamsopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct filedesc *fdp; struct svr4_strm *st; struct socket *so; struct file *fp; @@ -244,14 +243,13 @@ streamsopen(struct cdev *dev, int oflags, int devtype, return EOPNOTSUPP; } - fdp = td->td_proc->p_fd; if ((error = falloc(td, &fp, &fd, 0)) != 0) return error; /* An extra reference on `fp' has been held for us by falloc(). */ error = socreate(family, &so, type, protocol, td->td_ucred, td); if (error) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return error; } Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/kern_descrip.c Sat Jul 15 17:25:40 2017 (r321020) @@ -2184,8 +2184,9 @@ setugidsafety(struct thread *td) * file descriptor out from under the thread creating the file object. */ void -fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td) +fdclose(struct thread *td, struct file *fp, int idx) { + struct filedesc *fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); if (fdp->fd_ofiles[idx].fde_file == fp) { Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/kern_fork.c Sat Jul 15 17:25:40 2017 (r321020) @@ -983,7 +983,7 @@ fail2: uma_zfree(proc_zone, newproc); #ifdef PROCDESC if ((flags & RFPROCDESC) != 0 && fp_procdesc != NULL) { - fdclose(td->td_proc->p_fd, fp_procdesc, *procdescp, td); + fdclose(td, fp_procdesc, *procdescp); fdrop(fp_procdesc, td); } #endif Modified: stable/10/sys/kern/sys_pipe.c ============================================================================== --- stable/10/sys/kern/sys_pipe.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/sys_pipe.c Sat Jul 15 17:25:40 2017 (r321020) @@ -403,13 +403,11 @@ kern_pipe(struct thread *td, int fildes[2]) int kern_pipe2(struct thread *td, int fildes[2], int flags) { - struct filedesc *fdp; struct file *rf, *wf; struct pipe *rpipe, *wpipe; struct pipepair *pp; int fd, fflags, error; - fdp = td->td_proc->p_fd; pipe_paircreate(td, &pp); rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; @@ -435,7 +433,7 @@ kern_pipe2(struct thread *td, int fildes[2], int flags finit(rf, fflags, DTYPE_PIPE, rpipe, &pipeops); error = falloc(td, &wf, &fd, flags); if (error) { - fdclose(fdp, rf, fildes[0], td); + fdclose(td, rf, fildes[0]); fdrop(rf, td); /* rpipe has been closed by fdrop(). */ pipeclose(wpipe); Modified: stable/10/sys/kern/tty_pts.c ============================================================================== --- stable/10/sys/kern/tty_pts.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/tty_pts.c Sat Jul 15 17:25:40 2017 (r321020) @@ -839,7 +839,7 @@ sys_posix_openpt(struct thread *td, struct posix_openp /* Allocate the actual pseudo-TTY. */ error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp); if (error != 0) { - fdclose(td->td_proc->p_fd, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (error); } Modified: stable/10/sys/kern/uipc_mqueue.c ============================================================================== --- stable/10/sys/kern/uipc_mqueue.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/uipc_mqueue.c Sat Jul 15 17:25:40 2017 (r321020) @@ -2023,7 +2023,7 @@ kern_kmq_open(struct thread *td, const char *upath, in if (error) { sx_xunlock(&mqfs_data.mi_lock); - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (error); } Modified: stable/10/sys/kern/uipc_sem.c ============================================================================== --- stable/10/sys/kern/uipc_sem.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/uipc_sem.c Sat Jul 15 17:25:40 2017 (r321020) @@ -515,7 +515,7 @@ ksem_create(struct thread *td, const char *name, semid */ error = ksem_create_copyout_semid(td, semidp, fd, compat32); if (error) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (error); } @@ -535,7 +535,7 @@ ksem_create(struct thread *td, const char *name, semid if (error == 0 && path[0] != '/') error = EINVAL; if (error) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); free(path, M_KSEM); return (error); @@ -586,7 +586,7 @@ ksem_create(struct thread *td, const char *name, semid if (error) { KASSERT(ks == NULL, ("ksem_create error with a ksem")); - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (error); } Modified: stable/10/sys/kern/uipc_shm.c ============================================================================== --- stable/10/sys/kern/uipc_shm.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/uipc_shm.c Sat Jul 15 17:25:40 2017 (r321020) @@ -741,7 +741,7 @@ sys_shm_open(struct thread *td, struct shm_open_args * if (uap->path == SHM_ANON) { /* A read-only anonymous object is pointless. */ if ((uap->flags & O_ACCMODE) == O_RDONLY) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (EINVAL); } @@ -757,7 +757,7 @@ sys_shm_open(struct thread *td, struct shm_open_args * if (error == 0 && path[0] != '/') error = EINVAL; if (error) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); free(path, M_SHMFD); return (error); @@ -823,7 +823,7 @@ sys_shm_open(struct thread *td, struct shm_open_args * sx_xunlock(&shm_dict_lock); if (error) { - fdclose(fdp, fp, fd, td); + fdclose(td, fp, fd); fdrop(fp, td); return (error); } Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 17:25:40 2017 (r321020) @@ -216,7 +216,7 @@ sys_socket(td, uap) error = socreate(uap->domain, &so, type, uap->protocol, td->td_ucred, td); if (error != 0) { - fdclose(td->td_proc->p_fd, fp, fd, td); + fdclose(td, fp, fd); } else { finit(fp, FREAD | FWRITE | fflag, DTYPE_SOCKET, so, &socketops); if ((fflag & FNONBLOCK) != 0) @@ -386,7 +386,7 @@ accept1(td, s, uname, anamelen, flags) error = copyout(&namelen, anamelen, sizeof(namelen)); if (error != 0) - fdclose(td->td_proc->p_fd, fp, td->td_retval[0], td); + fdclose(td, fp, td->td_retval[0]); fdrop(fp, td); free(name, M_SONAME); return (error); @@ -540,7 +540,7 @@ noconnection: * out from under us. */ if (error != 0) - fdclose(fdp, nfp, fd, td); + fdclose(td, nfp, fd); /* * Release explicitly held references before returning. We return @@ -710,7 +710,6 @@ int kern_socketpair(struct thread *td, int domain, int type, int protocol, int *rsv) { - struct filedesc *fdp = td->td_proc->p_fd; struct file *fp1, *fp2; struct socket *so1, *so2; int fd, error, oflag, fflag; @@ -774,10 +773,10 @@ kern_socketpair(struct thread *td, int domain, int typ fdrop(fp2, td); return (0); free4: - fdclose(fdp, fp2, rsv[1], td); + fdclose(td, fp2, rsv[1]); fdrop(fp2, td); free3: - fdclose(fdp, fp1, rsv[0], td); + fdclose(td, fp1, rsv[0]); fdrop(fp1, td); free2: if (so2 != NULL) Modified: stable/10/sys/netinet/sctp_syscalls.c ============================================================================== --- stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:25:40 2017 (r321020) @@ -187,7 +187,7 @@ noconnection: * out from under us. */ if (error != 0) - fdclose(td->td_proc->p_fd, nfp, fd, td); + fdclose(td, nfp, fd); /* * Release explicitly held references before returning. Modified: stable/10/sys/ofed/include/linux/file.h ============================================================================== --- stable/10/sys/ofed/include/linux/file.h Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/ofed/include/linux/file.h Sat Jul 15 17:25:40 2017 (r321020) @@ -82,7 +82,7 @@ put_unused_fd(unsigned int fd) * installed, so no need to free the associated Linux file * structure. */ - fdclose(curthread->td_proc->p_fd, file, fd, curthread); + fdclose(curthread, file, fd); /* drop extra reference */ fdrop(file, curthread); Modified: stable/10/sys/sys/filedesc.h ============================================================================== --- stable/10/sys/sys/filedesc.h Sat Jul 15 17:03:35 2017 (r321019) +++ stable/10/sys/sys/filedesc.h Sat Jul 15 17:25:40 2017 (r321020) @@ -154,7 +154,7 @@ int fdalloc(struct thread *td, int minfd, int *result) int fdallocn(struct thread *td, int minfd, int *fds, int n); int fdavail(struct thread *td, int n); int fdcheckstd(struct thread *td); -void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); +void fdclose(struct thread *td, struct file *fp, int idx); void fdcloseexec(struct thread *td); struct filedesc *fdcopy(struct filedesc *fdp); void fdunshare(struct thread *td); From owner-svn-src-all@freebsd.org Sat Jul 15 17:28:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3CBEAFE953; Sat, 15 Jul 2017 17:28:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CF37C8AE; Sat, 15 Jul 2017 17:28:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FHS37r065454; Sat, 15 Jul 2017 17:28:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FHS3nc065451; Sat, 15 Jul 2017 17:28:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151728.v6FHS3nc065451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 17:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321021 - in stable/10/sys: kern netinet sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: kern netinet sys X-SVN-Commit-Revision: 321021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:28:04 -0000 Author: dchagin Date: Sat Jul 15 17:28:03 2017 New Revision: 321021 URL: https://svnweb.freebsd.org/changeset/base/321021 Log: MFC r281437 (by mjg@): Replace struct filedesc argument in getsock_cap with struct thread This is is a step towards removal of spurious arguments. Modified: stable/10/sys/kern/uipc_syscalls.c stable/10/sys/netinet/sctp_syscalls.c stable/10/sys/sys/socketvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 17:25:40 2017 (r321020) +++ stable/10/sys/kern/uipc_syscalls.c Sat Jul 15 17:28:03 2017 (r321021) @@ -150,17 +150,17 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU * A reference on the file entry is held upon returning. */ int -getsock_cap(struct filedesc *fdp, int fd, cap_rights_t *rightsp, +getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp, u_int *fflagp) { struct file *fp; int error; - error = fget_unlocked(fdp, fd, rightsp, 0, &fp, NULL); + error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, 0, &fp, NULL); if (error != 0) return (error); if (fp->f_type != DTYPE_SOCKET) { - fdrop(fp, curthread); + fdrop(fp, td); return (ENOTSOCK); } if (fflagp != NULL) @@ -258,8 +258,8 @@ kern_bindat(struct thread *td, int dirfd, int fd, stru AUDIT_ARG_FD(fd); AUDIT_ARG_SOCKADDR(td, dirfd, sa); - error = getsock_cap(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_BIND), &fp, NULL); + error = getsock_cap(td, fd, cap_rights_init(&rights, CAP_BIND), + &fp, NULL); if (error != 0) return (error); so = fp->f_data; @@ -326,8 +326,8 @@ sys_listen(td, uap) int error; AUDIT_ARG_FD(uap->s); - error = getsock_cap(td->td_proc->p_fd, uap->s, - cap_rights_init(&rights, CAP_LISTEN), &fp, NULL); + error = getsock_cap(td, uap->s, cap_rights_init(&rights, CAP_LISTEN), + &fp, NULL); if (error == 0) { so = fp->f_data; #ifdef MAC @@ -403,7 +403,6 @@ int kern_accept4(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, int flags, struct file **fp) { - struct filedesc *fdp; struct file *headfp, *nfp = NULL; struct sockaddr *sa = NULL; struct socket *head, *so; @@ -416,8 +415,7 @@ kern_accept4(struct thread *td, int s, struct sockaddr *name = NULL; AUDIT_ARG_FD(s); - fdp = td->td_proc->p_fd; - error = getsock_cap(fdp, s, cap_rights_init(&rights, CAP_ACCEPT), + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_ACCEPT), &headfp, &fflag); if (error != 0) return (error); @@ -624,8 +622,8 @@ kern_connectat(struct thread *td, int dirfd, int fd, s AUDIT_ARG_FD(fd); AUDIT_ARG_SOCKADDR(td, dirfd, sa); - error = getsock_cap(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_CONNECT), &fp, NULL); + error = getsock_cap(td, fd, cap_rights_init(&rights, CAP_CONNECT), + &fp, NULL); if (error != 0) return (error); so = fp->f_data; @@ -892,7 +890,7 @@ kern_sendit(td, s, mp, flags, control, segflg) AUDIT_ARG_SOCKADDR(td, AT_FDCWD, mp->msg_name); cap_rights_set(&rights, CAP_CONNECT); } - error = getsock_cap(td->td_proc->p_fd, s, &rights, &fp, NULL); + error = getsock_cap(td, s, &rights, &fp, NULL); if (error != 0) return (error); so = (struct socket *)fp->f_data; @@ -1092,8 +1090,8 @@ kern_recvit(td, s, mp, fromseg, controlp) *controlp = NULL; AUDIT_ARG_FD(s); - error = getsock_cap(td->td_proc->p_fd, s, - cap_rights_init(&rights, CAP_RECV), &fp, NULL); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_RECV), + &fp, NULL); if (error != 0) return (error); so = fp->f_data; @@ -1407,8 +1405,8 @@ sys_shutdown(td, uap) int error; AUDIT_ARG_FD(uap->s); - error = getsock_cap(td->td_proc->p_fd, uap->s, - cap_rights_init(&rights, CAP_SHUTDOWN), &fp, NULL); + error = getsock_cap(td, uap->s, cap_rights_init(&rights, CAP_SHUTDOWN), + &fp, NULL); if (error == 0) { so = fp->f_data; error = soshutdown(so, uap->how); @@ -1472,8 +1470,8 @@ kern_setsockopt(td, s, level, name, val, valseg, valsi } AUDIT_ARG_FD(s); - error = getsock_cap(td->td_proc->p_fd, s, - cap_rights_init(&rights, CAP_SETSOCKOPT), &fp, NULL); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SETSOCKOPT), + &fp, NULL); if (error == 0) { so = fp->f_data; error = sosetopt(so, &sopt); @@ -1553,8 +1551,8 @@ kern_getsockopt(td, s, level, name, val, valseg, valsi } AUDIT_ARG_FD(s); - error = getsock_cap(td->td_proc->p_fd, s, - cap_rights_init(&rights, CAP_GETSOCKOPT), &fp, NULL); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_GETSOCKOPT), + &fp, NULL); if (error == 0) { so = fp->f_data; error = sogetopt(so, &sopt); @@ -1614,8 +1612,8 @@ kern_getsockname(struct thread *td, int fd, struct soc int error; AUDIT_ARG_FD(fd); - error = getsock_cap(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_GETSOCKNAME), &fp, NULL); + error = getsock_cap(td, fd, cap_rights_init(&rights, CAP_GETSOCKNAME), + &fp, NULL); if (error != 0) return (error); so = fp->f_data; @@ -1713,8 +1711,8 @@ kern_getpeername(struct thread *td, int fd, struct soc int error; AUDIT_ARG_FD(fd); - error = getsock_cap(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_GETPEERNAME), &fp, NULL); + error = getsock_cap(td, fd, cap_rights_init(&rights, CAP_GETPEERNAME), + &fp, NULL); if (error != 0) return (error); so = fp->f_data; @@ -2154,8 +2152,8 @@ kern_sendfile_getsock(struct thread *td, int s, struct /* * The socket must be a stream socket and connected. */ - error = getsock_cap(td->td_proc->p_fd, s, cap_rights_init(&rights, - CAP_SEND), sock_fp, NULL); + error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), + sock_fp, NULL); if (error != 0) return (error); *so = (*sock_fp)->f_data; Modified: stable/10/sys/netinet/sctp_syscalls.c ============================================================================== --- stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:25:40 2017 (r321020) +++ stable/10/sys/netinet/sctp_syscalls.c Sat Jul 15 17:28:03 2017 (r321021) @@ -248,7 +248,7 @@ sys_sctp_generic_sendmsg (td, uap) } AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); + error = getsock_cap(td, uap->sd, &rights, &fp, NULL); if (error != 0) goto sctp_bad; #ifdef KTRACE @@ -361,7 +361,7 @@ sys_sctp_generic_sendmsg_iov(td, uap) } AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, &rights, &fp, NULL); + error = getsock_cap(td, uap->sd, &rights, &fp, NULL); if (error != 0) goto sctp_bad1; @@ -476,8 +476,8 @@ sys_sctp_generic_recvmsg(td, uap) int error, fromlen, i, msg_flags; AUDIT_ARG_FD(uap->sd); - error = getsock_cap(td->td_proc->p_fd, uap->sd, - cap_rights_init(&rights, CAP_RECV), &fp, NULL); + error = getsock_cap(td, uap->sd, cap_rights_init(&rights, CAP_RECV), + &fp, NULL); if (error != 0) return (error); #ifdef COMPAT_FREEBSD32 Modified: stable/10/sys/sys/socketvar.h ============================================================================== --- stable/10/sys/sys/socketvar.h Sat Jul 15 17:25:40 2017 (r321020) +++ stable/10/sys/sys/socketvar.h Sat Jul 15 17:28:03 2017 (r321021) @@ -317,7 +317,7 @@ struct uio; */ int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); -int getsock_cap(struct filedesc *fdp, int fd, cap_rights_t *rightsp, +int getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp, u_int *fflagp); void soabort(struct socket *so); int soaccept(struct socket *so, struct sockaddr **nam); From owner-svn-src-all@freebsd.org Sat Jul 15 17:44:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8ADCAFED58; Sat, 15 Jul 2017 17:44:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A55187D452; Sat, 15 Jul 2017 17:44:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FHiT6U073497; Sat, 15 Jul 2017 17:44:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FHiTI9073496; Sat, 15 Jul 2017 17:44:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151744.v6FHiTI9073496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 17:44:29 +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: r321022 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 321022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:44:31 -0000 Author: dchagin Date: Sat Jul 15 17:44:29 2017 New Revision: 321022 URL: https://svnweb.freebsd.org/changeset/base/321022 Log: MFC r296503: Linux accept() system call return EOPNOTSUPP errno instead of EINVAL for UDP sockets. MFC r296504: Does not leak fp. While here remove bogus cast of fp->f_data. MFC r313913: Initialize cap_rights before use. Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jul 15 17:28:03 2017 (r321021) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jul 15 17:44:29 2017 (r321022) @@ -836,7 +836,10 @@ linux_accept_common(struct thread *td, int s, l_uintpt socklen_t * __restrict anamelen; int flags; } */ bsd_args; - int error; + cap_rights_t rights; + struct socket *so; + struct file *fp; + int error, error1; bsd_args.s = s; /* XXX: */ @@ -851,6 +854,18 @@ linux_accept_common(struct thread *td, int s, l_uintpt if (error) { if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); + if (error == EINVAL) { + error1 = getsock_cap(td, s, + cap_rights_init(&rights, CAP_ACCEPT), &fp, NULL); + if (error1 != 0) + return (error1); + so = fp->f_data; + if (so->so_type == SOCK_DGRAM) { + fdrop(fp, td); + return (EOPNOTSUPP); + } + fdrop(fp, td); + } return (error); } if (addr) From owner-svn-src-all@freebsd.org Sat Jul 15 17:59:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61BCAAFEF26; Sat, 15 Jul 2017 17:59:29 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22F137D83D; Sat, 15 Jul 2017 17:59:29 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FHxSkm077679; Sat, 15 Jul 2017 17:59:28 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FHxS4x077678; Sat, 15 Jul 2017 17:59:28 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201707151759.v6FHxS4x077678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 15 Jul 2017 17:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321023 - head/usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.sbin/ctladm X-SVN-Commit-Revision: 321023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 17:59:29 -0000 Author: bcr (doc committer) Date: Sat Jul 15 17:59:28 2017 New Revision: 321023 URL: https://svnweb.freebsd.org/changeset/base/321023 Log: The ctladm man page incorrectly duplicated the text for the delete subcommand in the modify section. Rewrite the modify description text in two places to say modify/modified instead of remove/removed. PR: 220710 Submitted by: sseekamp@risei.net Reviewed by: mav@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11608 Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sat Jul 15 17:44:29 2017 (r321022) +++ head/usr.sbin/ctladm/ctladm.8 Sat Jul 15 17:59:28 2017 (r321023) @@ -35,7 +35,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd January 23, 2017 +.Dd July 15, 2017 .Dt CTLADM 8 .Os .Sh NAME @@ -751,13 +751,13 @@ Modify a LUN size. The backend, the LUN number, and the size must be specified. .Bl -tag -width 14n .It Fl b Ar backend -Specify the backend that owns the LUN to be removed. +Specify the backend that owns the LUN to be modified. Examples are .Dq ramdisk and .Dq block . .It Fl l Ar lun_id -Specify the LUN number to remove. +Specify the LUN number to modify. .It Fl o Ar name=value Specify a backend-specific name/value pair. Multiple From owner-svn-src-all@freebsd.org Sat Jul 15 18:05:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F5BAFF1AB; Sat, 15 Jul 2017 18:05:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B4167DCDB; Sat, 15 Jul 2017 18:05:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FI5SMM081526; Sat, 15 Jul 2017 18:05:28 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FI5SgC081522; Sat, 15 Jul 2017 18:05:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151805.v6FI5SgC081522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 18:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321024 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 321024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 18:05:29 -0000 Author: dchagin Date: Sat Jul 15 18:05:28 2017 New Revision: 321024 URL: https://svnweb.freebsd.org/changeset/base/321024 Log: MFC r297597 (by bapt@): Add kern.features flags for linux and linux64 modules kern.features.linux: 1 meaning linux 32 bits binaries are supported kern.features.linux64: 1 meaning linux 64 bits binaries are supported The goal here is to help 3rd party applications (including ports) to determine if the host do support linux emulation Relnotes: yes Modified: stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Sat Jul 15 17:59:28 2017 (r321023) +++ stable/10/sys/amd64/linux/linux_sysvec.c Sat Jul 15 18:05:28 2017 (r321024) @@ -990,3 +990,4 @@ static moduledata_t linux64_elf_mod = { DECLARE_MODULE_TIED(linux64elf, linux64_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_DEPEND(linux64elf, linux_common, 1, 1, 1); +FEATURE(linux64, "Linux 64bit support"); Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jul 15 17:59:28 2017 (r321023) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jul 15 18:05:28 2017 (r321024) @@ -1208,3 +1208,4 @@ static moduledata_t linux_elf_mod = { DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_DEPEND(linuxelf, linux_common, 1, 1, 1); +FEATURE(linux, "Linux 32bit support"); Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jul 15 17:59:28 2017 (r321023) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jul 15 18:05:28 2017 (r321024) @@ -1203,3 +1203,4 @@ static moduledata_t linux_elf_mod = { }; DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +FEATURE(linux, "Linux 32bit support"); From owner-svn-src-all@freebsd.org Sat Jul 15 18:08:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89548AFF25A; Sat, 15 Jul 2017 18:08:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 507D77DE4B; Sat, 15 Jul 2017 18:08:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FI8K5O081758; Sat, 15 Jul 2017 18:08:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FI8KcS081757; Sat, 15 Jul 2017 18:08:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151808.v6FI8KcS081757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 18:08:20 +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: r321025 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 321025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 18:08:21 -0000 Author: dchagin Date: Sat Jul 15 18:08:20 2017 New Revision: 321025 URL: https://svnweb.freebsd.org/changeset/base/321025 Log: MFC r298071 (by pfg@): compat/linux: for pointers replace 0 with NULL. plvc is a pointer, no functional change. Found with devel/coccinelle. Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Jul 15 18:05:28 2017 (r321024) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Jul 15 18:08:20 2017 (r321025) @@ -2912,7 +2912,7 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, st vw->clips = NULL; ppvc = &(vw->clips); while (clipcount-- > 0) { - if (plvc == 0) { + if (plvc == NULL) { error = EFAULT; break; } else { From owner-svn-src-all@freebsd.org Sat Jul 15 18:26:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 324E1AFF9A7; Sat, 15 Jul 2017 18:26:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2B897E6EC; Sat, 15 Jul 2017 18:26:00 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FIQ0rv089507; Sat, 15 Jul 2017 18:26:00 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FIQ088089501; Sat, 15 Jul 2017 18:26:00 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707151826.v6FIQ088089501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Jul 2017 18:25:59 +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: r321026 - in stable/10/sys: amd64/linux compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/10/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 321026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 18:26:01 -0000 Author: dchagin Date: Sat Jul 15 18:25:59 2017 New Revision: 321026 URL: https://svnweb.freebsd.org/changeset/base/321026 Log: MFC r305994 (by emaste@): Catch up to sys/capability.h rename to sys/capsicum.h in r263232 Modified: stable/10/sys/amd64/linux/linux_machdep.c stable/10/sys/compat/linux/linux_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/10/sys/amd64/linux/linux_machdep.c Sat Jul 15 18:08:20 2017 (r321025) +++ stable/10/sys/amd64/linux/linux_machdep.c Sat Jul 15 18:25:59 2017 (r321026) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jul 15 18:08:20 2017 (r321025) +++ stable/10/sys/compat/linux/linux_event.c Sat Jul 15 18:25:59 2017 (r321026) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include From owner-svn-src-all@freebsd.org Sat Jul 15 18:43:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8957AFFD47; Sat, 15 Jul 2017 18:43:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597D97ED93; Sat, 15 Jul 2017 18:43:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FIhe6B097430; Sat, 15 Jul 2017 18:43:40 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FIhdFZ097415; Sat, 15 Jul 2017 18:43:39 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201707151843.v6FIhdFZ097415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Jul 2017 18:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321027 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . mk X-SVN-Commit-Revision: 321027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 18:43:41 -0000 Author: sjg Date: Sat Jul 15 18:43:39 2017 New Revision: 321027 URL: https://svnweb.freebsd.org/changeset/base/321027 Log: Import bmake-20170711 Several misc cleanups, refactor main() to reduce size. Adds -v option to always fully expand variables (only interesting to NetBSD) And in particular (from ChangeLog): o meta.c: ensure command output in meta file has ending newline even when filemon not being used. When matching ${.MAKE.META.IGNORE_PATTERNS} do not use pathname via ':L' since any ':' in pathname breaks that. Instead set a '${.p.}' to pathname in the target context and use that. Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/buf.h vendor/NetBSD/bmake/dist/dir.h vendor/NetBSD/bmake/dist/hash.h vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/sprite.h Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/ChangeLog Sat Jul 15 18:43:39 2017 (r321027) @@ -1,3 +1,16 @@ +2017-07-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170711 + forgot to update after merge on 20170708 ;-) + o main.c: refactor to reduce size of main function. + add -v option to always fully expand values. + o meta.c: ensure command output in meta file has ending newline + even when filemon not being used. + When matching ${.MAKE.META.IGNORE_PATTERNS} do not use + pathname via ':L' since any ':' in pathname breaks that. + Instead set a '${.p.}' to pathname in the target context and + use that. + 2017-05-10 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170510 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/Makefile Sat Jul 15 18:43:39 2017 (r321027) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.92 2017/05/10 22:29:04 sjg Exp $ +# $Id: Makefile,v 1.94 2017/07/15 18:22:14 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170510 +_MAKE_VERSION= 20170711 PROG= bmake Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/bmake.1 Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 1, 2017 +.Dd June 22, 2017 .Dt BMAKE 1 .Os .Sh NAME @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -691,9 +713,9 @@ in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -776,6 +798,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -1287,7 +1313,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1751,7 +1777,7 @@ may be any one of the following: .Bl -tag -width "Cm XX" .It Cm \&|\&| Logical OR. -.It Cm \&\*[Am]\*[Am] +.It Cm \&&& Logical .Tn AND ; of higher precedence than @@ -1768,7 +1794,7 @@ The boolean operator may be used to logically negate an entire conditional. It is of higher precedence than -.Ql Ic \&\*[Am]\*[Am] . +.Ql Ic \&&& . .Pp The value of .Ar expression Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Sat Jul 15 18:43:39 2017 (r321027) @@ -6,8 +6,8 @@ NNAAMMEE SSYYNNOOPPSSIISS bbmmaakkee [--BBeeiikkNNnnqqrrssttWWwwXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s] [--ff _m_a_k_e_f_i_l_e] [--II _d_i_r_e_c_t_o_r_y] [--JJ _p_r_i_v_a_t_e] [--jj _m_a_x___j_o_b_s] - [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [_v_a_r_i_a_b_l_e_=_v_a_l_u_e] - [_t_a_r_g_e_t _._._.] + [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [--vv _v_a_r_i_a_b_l_e] + [_v_a_r_i_a_b_l_e_=_v_a_l_u_e] [_t_a_r_g_e_t _._._.] DDEESSCCRRIIPPTTIIOONN bbmmaakkee is a program designed to simplify the maintenance of other pro- @@ -118,7 +118,9 @@ DDEESSCCRRIIPPTTIIOONN _t Print debugging information about target list mainte- nance. - _V Force the --VV option to print raw values of variables. + _V Force the --VV option to print raw values of variables, + overriding the default behavior set via + _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S. _v Print debugging information about variable assignment. @@ -209,13 +211,26 @@ DDEESSCCRRIIPPTTIIOONN to-date. --VV _v_a_r_i_a_b_l_e - Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global con- - text. Do not build any targets. Multiple instances of this - option may be specified; the variables will be printed one per - line, with a blank line for each null or undefined variable. If - _v_a_r_i_a_b_l_e contains a `$' then the value will be expanded before - printing. + Print the value of _v_a_r_i_a_b_l_e. Do not build any targets. Multiple + instances of this option may be specified; the variables will be + printed one per line, with a blank line for each null or unde- + fined variable. The value printed is extracted from the global + context after all makefiles have been read. By default, the raw + variable contents (which may include additional unexpanded vari- + able references) are shown. If _v_a_r_i_a_b_l_e contains a `$' then the + value will be recursively expanded to its complete resultant text + before printing. The expanded value will also be printed if + _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S is set to true and the --ddVV option has not + been used to override it. Note that loop-local and target-local + variables, as well as values taken temporarily by global vari- + ables during makefile processing, are not accessible via this + option. The --ddvv debug mode can be used to see these at the cost + of generating substantial extraneous output. + --vv _v_a_r_i_a_b_l_e + Like --VV but the variable is always expanded to its complete + value. + --WW Treat any warnings during makefile parsing as errors. --ww Print entering and leaving directory messages, pre and post pro- @@ -488,7 +503,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S A boolean that controls the default behavior of the --VV - option. + option. If true, variable values printed with --VV are + fully expanded; if false, the raw variable contents + (which may include additional unexpanded variable refer- + ences) are shown. _._M_A_K_E_._E_X_P_O_R_T_E_D The list of variables exported by bbmmaakkee. @@ -1523,4 +1541,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 7.1_RC1 February 1, 2017 NetBSD 7.1_RC1 +NetBSD 7.1_RC1 June 22, 2017 NetBSD 7.1_RC1 Modified: vendor/NetBSD/bmake/dist/buf.h ============================================================================== --- vendor/NetBSD/bmake/dist/buf.h Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/buf.h Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.17 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.h,v 1.19 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * Header for users of the buf library. */ -#ifndef _BUF_H -#define _BUF_H +#ifndef MAKE_BUF_H +#define MAKE_BUF_H typedef char Byte; @@ -116,4 +116,4 @@ void Buf_Init(Buffer *, int); Byte *Buf_Destroy(Buffer *, Boolean); Byte *Buf_DestroyCompact(Buffer *); -#endif /* _BUF_H */ +#endif /* MAKE_BUF_H */ Modified: vendor/NetBSD/bmake/dist/dir.h ============================================================================== --- vendor/NetBSD/bmake/dist/dir.h Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/dir.h Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.15 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: dir.h,v 1.18 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,8 +75,8 @@ /* dir.h -- */ -#ifndef _DIR -#define _DIR +#ifndef MAKE_DIR_H +#define MAKE_DIR_H typedef struct Path { char *name; /* Name of directory */ @@ -105,4 +105,4 @@ void Dir_PrintPath(Lst); void Dir_Destroy(void *); void * Dir_CopyDir(void *); -#endif /* _DIR */ +#endif /* MAKE_DIR_H */ Modified: vendor/NetBSD/bmake/dist/hash.h ============================================================================== --- vendor/NetBSD/bmake/dist/hash.h Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/hash.h Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: hash.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -78,8 +78,8 @@ * which maintains hash tables. */ -#ifndef _HASH -#define _HASH +#ifndef _HASH_H +#define _HASH_H /* * The following defines one entry in the hash table. @@ -146,4 +146,4 @@ void Hash_DeleteEntry(Hash_Table *, Hash_Entry *); Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); Hash_Entry *Hash_EnumNext(Hash_Search *); -#endif /* _HASH */ +#endif /* _HASH_H */ Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/main.c Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $ */ +/* $NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $"); #endif #endif /* not lint */ #endif @@ -159,7 +159,9 @@ Boolean deleteOnError; /* .DELETE_ON_ERROR: set */ static Boolean noBuiltins; /* -r flag */ static Lst makefiles; /* ordered list of makefiles to read */ -static Boolean printVars; /* print value of one or more vars */ +static int printVars; /* -[vV] argument */ +#define COMPAT_VARS 1 +#define EXPAND_VARS 2 static Lst variables; /* list of variables to print */ int maxJobs; /* -j argument */ static int maxJobTokens; /* -j argument */ @@ -421,7 +423,7 @@ MainParseArgs(int argc, char **argv) Boolean inOption, dashDash = FALSE; char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */ -#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstw" +#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w" /* Can't actually use getopt(3) because rescanning is not portable */ getopt_def = OPTFLAGS; @@ -546,8 +548,9 @@ rearg: Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); break; case 'V': + case 'v': if (argvalue == NULL) goto noarg; - printVars = TRUE; + printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS; (void)Lst_AtEnd(variables, argvalue); Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); @@ -877,6 +880,89 @@ MakeMode(const char *mode) free(mp); } +static void +doPrintVars(void) +{ + LstNode ln; + Boolean expandVars; + + if (printVars == EXPAND_VARS) + expandVars = TRUE; + else if (debugVflag) + expandVars = FALSE; + else + expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); + + for (ln = Lst_First(variables); ln != NULL; + ln = Lst_Succ(ln)) { + char *var = (char *)Lst_Datum(ln); + char *value; + char *p1; + + if (strchr(var, '$')) { + value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, + VARF_WANTRES); + } else if (expandVars) { + char tmp[128]; + int len = snprintf(tmp, sizeof(tmp), "${%s}", var); + + if (len >= (int)sizeof(tmp)) + Fatal("%s: variable name too big: %s", + progname, var); + value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, + VARF_WANTRES); + } else { + value = Var_Value(var, VAR_GLOBAL, &p1); + } + printf("%s\n", value ? value : ""); + free(p1); + } +} + +static Boolean +runTargets(void) +{ + Lst targs; /* target nodes to create -- passed to Make_Init */ + Boolean outOfDate; /* FALSE if all targets up to date */ + + /* + * Have now read the entire graph and need to make a list of + * targets to create. If none was given on the command line, + * we consult the parsing module to find the main target(s) + * to create. + */ + if (Lst_IsEmpty(create)) + targs = Parse_MainName(); + else + targs = Targ_FindList(create, TARG_CREATE); + + if (!compatMake) { + /* + * Initialize job module before traversing the graph + * now that any .BEGIN and .END targets have been read. + * This is done only if the -q flag wasn't given + * (to prevent the .BEGIN from being executed should + * it exist). + */ + if (!queryFlag) { + Job_Init(); + jobsRunning = TRUE; + } + + /* Traverse the graph, checking on all the targets */ + outOfDate = Make_Run(targs); + } else { + /* + * Compat_Init will take care of creating all the + * targets as well as initializing the module. + */ + Compat_Run(targs); + outOfDate = FALSE; + } + Lst_Destroy(targs, NULL); + return outOfDate; +} + /*- * main -- * The main function, for obvious reasons. Initializes variables @@ -897,8 +983,7 @@ MakeMode(const char *mode) int main(int argc, char **argv) { - Lst targs; /* target nodes to create -- passed to Make_Init */ - Boolean outOfDate = FALSE; /* FALSE if all targets up to date */ + Boolean outOfDate; /* FALSE if all targets up to date */ struct stat sb, sa; char *p1, *path; char mdpath[MAXPATHLEN]; @@ -1027,7 +1112,7 @@ main(int argc, char **argv) create = Lst_Init(FALSE); makefiles = Lst_Init(FALSE); - printVars = FALSE; + printVars = 0; debugVflag = FALSE; variables = Lst_Init(FALSE); beSilent = FALSE; /* Print commands as executed */ @@ -1406,73 +1491,13 @@ main(int argc, char **argv) /* print the values of any variables requested by the user */ if (printVars) { - LstNode ln; - Boolean expandVars; - - if (debugVflag) - expandVars = FALSE; - else - expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); - for (ln = Lst_First(variables); ln != NULL; - ln = Lst_Succ(ln)) { - char *var = (char *)Lst_Datum(ln); - char *value; - - if (strchr(var, '$')) { - value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, - VARF_WANTRES); - } else if (expandVars) { - char tmp[128]; - - if (snprintf(tmp, sizeof(tmp), "${%s}", var) >= (int)(sizeof(tmp))) - Fatal("%s: variable name too big: %s", - progname, var); - value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, - VARF_WANTRES); - } else { - value = Var_Value(var, VAR_GLOBAL, &p1); - } - printf("%s\n", value ? value : ""); - free(p1); - } + doPrintVars(); + outOfDate = FALSE; } else { - /* - * Have now read the entire graph and need to make a list of - * targets to create. If none was given on the command line, - * we consult the parsing module to find the main target(s) - * to create. - */ - if (Lst_IsEmpty(create)) - targs = Parse_MainName(); - else - targs = Targ_FindList(create, TARG_CREATE); - - if (!compatMake) { - /* - * Initialize job module before traversing the graph - * now that any .BEGIN and .END targets have been read. - * This is done only if the -q flag wasn't given - * (to prevent the .BEGIN from being executed should - * it exist). - */ - if (!queryFlag) { - Job_Init(); - jobsRunning = TRUE; - } - - /* Traverse the graph, checking on all the targets */ - outOfDate = Make_Run(targs); - } else { - /* - * Compat_Init will take care of creating all the - * targets as well as initializing the module. - */ - Compat_Run(targs); - } + outOfDate = runTargets(); } #ifdef CLEANUP - Lst_Destroy(targs, NULL); Lst_Destroy(variables, NULL); Lst_Destroy(makefiles, NULL); Lst_Destroy(create, (FreeProc *)free); @@ -1931,7 +1956,8 @@ usage(void) "usage: %s [-BeikNnqrstWwX] \n\ [-C directory] [-D variable] [-d flags] [-f makefile]\n\ [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n\ - [-V variable] [variable=value] [target ...]\n", progname); + [-V variable] [-v variable] [variable=value] [target ...]\n", + progname); exit(2); } Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/make.1 Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 1, 2017 +.Dd June 22, 2017 .Dt MAKE 1 .Os .Sh NAME @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -691,9 +713,9 @@ in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -776,6 +798,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -1287,7 +1313,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1751,7 +1777,7 @@ may be any one of the following: .Bl -tag -width "Cm XX" .It Cm \&|\&| Logical OR. -.It Cm \&\*[Am]\*[Am] +.It Cm \&&& Logical .Tn AND ; of higher precedence than @@ -1768,7 +1794,7 @@ The boolean operator may be used to logically negate an entire conditional. It is of higher precedence than -.Ql Ic \&\*[Am]\*[Am] . +.Ql Ic \&&& . .Pp The value of .Ar expression Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/meta.c Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.67 2016/08/17 15:52:42 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.68 2017/07/09 04:54:00 sjg Exp $ */ /* * Implement 'meta' mode. @@ -727,7 +727,7 @@ meta_job_error(Job *job, GNode *gn, int flags, int sta pbm = &Mybm; } if (pbm->mfp != NULL) { - fprintf(pbm->mfp, "*** Error code %d%s\n", + fprintf(pbm->mfp, "\n*** Error code %d%s\n", status, (flags & JOB_IGNERR) ? "(ignored)" : ""); @@ -782,13 +782,13 @@ int meta_cmd_finish(void *pbmp) { int error = 0; -#ifdef USE_FILEMON BuildMon *pbm = pbmp; int x; if (!pbm) pbm = &Mybm; +#ifdef USE_FILEMON if (pbm->filemon_fd >= 0) { if (close(pbm->filemon_fd) < 0) error = errno; @@ -796,8 +796,9 @@ meta_cmd_finish(void *pbmp) if (error == 0 && x != 0) error = x; pbm->filemon_fd = pbm->mon_fd = -1; - } + } else #endif + fprintf(pbm->mfp, "\n"); /* ensure end with newline */ return error; } @@ -861,6 +862,8 @@ fgetLine(char **bufp, size_t *szp, int o, FILE *fp) newsz = ROUNDUP((fs.st_size / 2), BUFSIZ); if (newsz <= bufsz) newsz = ROUNDUP(fs.st_size, BUFSIZ); + if (newsz <= bufsz) + return x; /* truncated */ if (DEBUG(META)) fprintf(debug_file, "growing buffer %u -> %u\n", (unsigned)bufsz, (unsigned)newsz); @@ -948,10 +951,10 @@ meta_ignore(GNode *gn, const char *p) if (metaIgnorePatterns) { char *pm; - snprintf(fname, sizeof(fname), - "${%s:@m@${%s:L:M$m}@}", - MAKE_META_IGNORE_PATTERNS, p); - pm = Var_Subst(NULL, fname, gn, VARF_WANTRES); + Var_Set(".p.", p, gn, 0); + pm = Var_Subst(NULL, + "${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}", + gn, VARF_WANTRES); if (*pm) { #ifdef DEBUG_META_MODE if (DEBUG(META)) Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Jul 15 18:43:39 2017 (r321027) @@ -1,3 +1,22 @@ +2017-06-30 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170630 + + * meta.stage.mk: avoid triggering stage_* targets with nothing to do. + +2017-05-23 Simon J. Gerraty + + * meta2deps.py: take special care of '..' + +2017-05-15 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170515 + + * dirdeps.mk (DEP_EXPORT_VARS): on rare occasions it is + useful/necessary for a Makefile.depend file to export some knobs. + This is complicated when we are doing DIRDEPS_CACHE, so we will + handle export of any variables listed in DEP_EXPORT_VARS. + 2017-05-08 Simon J. Gerraty * install-mk (MK_VERSION): 20170505 Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.88 2017/04/24 20:34:59 sjg Exp $ +# $Id: dirdeps.mk,v 1.89 2017/05/17 17:41:47 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -636,6 +636,11 @@ _build_all_dirs := ${_build_all_dirs:O:u} x!= { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ echo 'dirdeps: ${_build_all_dirs:${M_oneperline}}'; echo; } >&3; echo x!= { ${_build_all_dirs:@x@${target($x):?:echo '$x: _DIRDEP_USE';}@} echo; } >&3; echo +.if !empty(DEP_EXPORT_VARS) +# Discouraged, but there are always exceptions. +# Handle it here rather than explain how. +x!= { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3; echo +.endif .else # this makes it all happen dirdeps: ${_build_all_dirs} @@ -644,6 +649,11 @@ ${_build_all_dirs}: _DIRDEP_USE .if ${_debug_reldir} .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs} +.endif + +.if !empty(DEP_EXPORT_VARS) +.export ${DEP_EXPORT_VARS} +DEP_EXPORT_VARS= .endif # this builds the dependency graph Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/mk/install-mk Sat Jul 15 18:43:39 2017 (r321027) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.145 2017/05/09 04:05:32 sjg Exp $ +# $Id: install-mk,v 1.148 2017/06/30 23:46:15 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170505 +MK_VERSION=20170630 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/lib.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/lib.mk Sat Jul 15 18:25:59 2017 (r321026) +++ vendor/NetBSD/bmake/dist/mk/lib.mk Sat Jul 15 18:43:39 2017 (r321027) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.61 2017/05/06 17:30:09 sjg Exp $ +# $Id: lib.mk,v 1.62 2017/06/11 03:24:04 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -268,8 +268,7 @@ ${CXX_SUFFIXES:%=%.o}: ${COMPILE.cc} ${.IMPSRC} .S.o .s.o: - @echo ${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} - @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} + ${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} .if (${LD_X} == "") .c.po: @@ -282,21 +281,18 @@ ${CXX_SUFFIXES:%=%.po}: ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} .else .c.po: - @echo ${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET}.o + ${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET}.o @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o ${CXX_SUFFIXES:%=%.po}: - @echo ${COMPILE.cc} ${CXX_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.cc} ${CXX_PG} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.cc} ${CXX_PG} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S${PICO} .s${PICO}: - @echo ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .endif @@ -312,21 +308,18 @@ ${CXX_SUFFIXES:%=%${PICO}}: .else .c${PICO}: - @echo ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o ${CXX_SUFFIXES:%=%${PICO}}: - @echo ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.po .s.po: - @echo ${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .endif @@ -418,7 +411,7 @@ lib${LIB}.${LD_so}:: lib${LIB}.a .else # MK_LIBTOOL=yes lib${LIB}.a:: ${OBJS} - @echo building standard ${LIB} library + @${META_NOECHO} building standard ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_objs} ${RANLIB} ${.TARGET} @@ -426,7 +419,7 @@ lib${LIB}.a:: ${OBJS} POBJS+= ${OBJS:.o=.po} .NOPATH: ${POBJS} lib${LIB}_p.a:: ${POBJS} - @echo building profiled ${LIB} library + @${META_NOECHO} building profiled ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_pobjs} ${RANLIB} ${.TARGET} @@ -434,7 +427,7 @@ lib${LIB}_p.a:: ${POBJS} SOBJS+= ${OBJS:.o=${PICO}} .NOPATH: ${SOBJS} lib${LIB}_pic.a:: ${SOBJS} - @echo building shared object ${LIB} library + @${META_NOECHO} building shared object ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_sobjs} ${RANLIB} ${.TARGET} @@ -444,7 +437,7 @@ lib${LIB}_pic.a:: ${SOBJS} # bound to be non-portable... # this is known to work for NetBSD 1.6 and FreeBSD 4.2 lib${LIB}.${LD_so}: ${SOLIB} ${DPADD} - @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) + @${META_NOECHO} building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) @rm -f ${.TARGET} .if ${TARGET_OSNAME} == "NetBSD" || ${TARGET_OSNAME} == "FreeBSD" .if ${OBJECT_FMT} == "ELF" @@ -468,7 +461,7 @@ LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} .NOPATH: ${LOBJS} LLIBS?= -lc llib-l${LIB}.ln: ${LOBJS} - @echo building llib-l${LIB}.ln + @${META_NOECHO} building llib-l${LIB}.ln @rm -f llib-l${LIB}.ln @${LINT} -C${LIB} ${LOBJS} ${LLIBS} @@ -508,10 +501,8 @@ LIB_INSTALL_OWN ?= -o ${LIBOWN} -g ${LIBGRP} .include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jul 15 18:44:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E2BDAFFD91; Sat, 15 Jul 2017 18:44:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2371A7EEA8; Sat, 15 Jul 2017 18:44:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FIi3Pl097507; Sat, 15 Jul 2017 18:44:03 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FIi3A7097506; Sat, 15 Jul 2017 18:44:03 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201707151844.v6FIi3A7097506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Jul 2017 18:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321028 - vendor/NetBSD/bmake/20170711 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20170711 X-SVN-Commit-Revision: 321028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 18:44:04 -0000 Author: sjg Date: Sat Jul 15 18:44:03 2017 New Revision: 321028 URL: https://svnweb.freebsd.org/changeset/base/321028 Log: tag bmake-20170711 Added: vendor/NetBSD/bmake/20170711/ - copied from r321027, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Sat Jul 15 19:18:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15649B79F2C; Sat, 15 Jul 2017 19:18:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E310E819A8; Sat, 15 Jul 2017 19:18:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FJIcXL014492; Sat, 15 Jul 2017 19:18:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FJIb9p014487; Sat, 15 Jul 2017 19:18:37 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707151918.v6FJIb9p014487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 15 Jul 2017 19:18:37 +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: r321029 - in stable/11/sys/fs: nfs nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/11/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 321029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 19:18:39 -0000 Author: rmacklem Date: Sat Jul 15 19:18:37 2017 New Revision: 321029 URL: https://svnweb.freebsd.org/changeset/base/321029 Log: MFC: r320345 Add support to the NFSv4.1/pNFS client for commits through the DS. A NFSv4.1/pNFS server using File Layout can specify that Commit operations are to be done against the DS instead of MDS. Since no extant pNFS server did this, the code was untested and "#ifdef notyet". The FreeBSD pNFS server I am developing does specify that Commits be done through the DS, so the code has been enabled/tested. This patch should only affect the case of a pNFS server that specfies Commits through the DS. Relnotes: yes Modified: stable/11/sys/fs/nfs/nfs_var.h stable/11/sys/fs/nfsclient/nfs_clnode.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clvnops.c stable/11/sys/fs/nfsclient/nfsnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/11/sys/fs/nfs/nfs_var.h Sat Jul 15 18:44:03 2017 (r321028) +++ stable/11/sys/fs/nfs/nfs_var.h Sat Jul 15 19:18:37 2017 (r321029) @@ -490,7 +490,7 @@ int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, NFSPROC_T *, void *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); -int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, +int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t, struct nfsclflayout **); Modified: stable/11/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clnode.c Sat Jul 15 18:44:03 2017 (r321028) +++ stable/11/sys/fs/nfsclient/nfs_clnode.c Sat Jul 15 19:18:37 2017 (r321029) @@ -259,10 +259,12 @@ ncl_inactive(struct vop_inactive_args *ap) /* * NMODIFIED means that there might be dirty/stale buffers - * associated with the NFS vnode. None of the other flags are - * meaningful after the vnode is unused. + * associated with the NFS vnode. + * NDSCOMMIT means that the file is on a pNFS server and commits + * should be done to the DS. + * None of the other flags are meaningful after the vnode is unused. */ - np->n_flag &= NMODIFIED; + np->n_flag &= (NMODIFIED | NDSCOMMIT); mtx_unlock(&np->n_mtx); return (0); } Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 15 18:44:03 2017 (r321028) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 15 19:18:37 2017 (r321029) @@ -114,7 +114,8 @@ static int nfsrpc_fillsa(struct nfsmount *, struct soc static void nfscl_initsessionslots(struct nfsclsession *); static int nfscl_doflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, - struct nfsclflayout *, uint64_t, uint64_t, struct ucred *, NFSPROC_T *); + struct nfsclflayout *, uint64_t, uint64_t, int, struct ucred *, + NFSPROC_T *); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, struct nfsclds *, uint64_t, int, struct nfsfh *, struct ucred *, NFSPROC_T *); @@ -123,10 +124,8 @@ static int nfsrpc_writeds(vnode_t, struct uio *, int * struct nfsfh *, int, struct ucred *, NFSPROC_T *); static enum nfsclds_state nfscl_getsameserver(struct nfsmount *, struct nfsclds *, struct nfsclds **); -#ifdef notyet static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, - struct nfsfh *, struct ucred *, NFSPROC_T *, void *); -#endif + struct nfsfh *, struct ucred *, NFSPROC_T *); static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int); static int nfsrv_parselayoutget(struct nfsrv_descript *, nfsv4stateid_t *, @@ -5429,7 +5428,7 @@ nfscl_initsessionslots(struct nfsclsession *sep) */ int nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, - uint32_t rwaccess, struct ucred *cred, NFSPROC_T *p) + uint32_t rwaccess, int docommit, struct ucred *cred, NFSPROC_T *p) { struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); @@ -5513,7 +5512,8 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode if (dip != NULL) { error = nfscl_doflayoutio(vp, uiop, iomode, must_commit, &eof, &stateid, rwaccess, dip, - layp, rflp, off, xfer, newcred, p); + layp, rflp, off, xfer, docommit, newcred, + p); nfscl_reldevinfo(dip); lastbyte = off + xfer - 1; if (error == 0) { @@ -5589,10 +5589,10 @@ static int nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, int *eofp, nfsv4stateid_t *stateidp, int rwflag, struct nfscldevinfo *dp, struct nfscllayout *lyp, struct nfsclflayout *flp, uint64_t off, - uint64_t len, struct ucred *cred, NFSPROC_T *p) + uint64_t len, int docommit, struct ucred *cred, NFSPROC_T *p) { uint64_t io_off, rel_off, stripe_unit_size, transfer, xfer; - int commit_thru_mds, error = 0, stripe_index, stripe_pos; + int commit_thru_mds, error, stripe_index, stripe_pos; struct nfsnode *np; struct nfsfh *fhp; struct nfsclds **dspp; @@ -5603,12 +5603,13 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i stripe_pos = (rel_off / stripe_unit_size + flp->nfsfl_stripe1) % dp->nfsdi_stripecnt; transfer = stripe_unit_size - (rel_off % stripe_unit_size); + error = 0; /* Loop around, doing I/O for each stripe unit. */ while (len > 0 && error == 0) { stripe_index = nfsfldi_stripeindex(dp, stripe_pos); dspp = nfsfldi_addr(dp, stripe_index); - if (len > transfer) + if (len > transfer && docommit == 0) xfer = transfer; else xfer = len; @@ -5632,11 +5633,33 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i fhp = np->n_fhp; io_off = off; } - if ((flp->nfsfl_util & NFSFLAYUTIL_COMMIT_THRU_MDS) != 0) + if ((flp->nfsfl_util & NFSFLAYUTIL_COMMIT_THRU_MDS) != 0) { commit_thru_mds = 1; - else + if (docommit != 0) + error = EIO; + } else { commit_thru_mds = 0; - if (rwflag == FREAD) + mtx_lock(&np->n_mtx); + np->n_flag |= NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + if (docommit != 0) { + if (error == 0) + error = nfsrpc_commitds(vp, io_off, xfer, + *dspp, fhp, cred, p); + if (error == 0) { + /* + * Set both eof and uio_resid = 0 to end any + * loops. + */ + *eofp = 1; + uiop->uio_resid = 0; + } else { + mtx_lock(&np->n_mtx); + np->n_flag &= ~NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + } else if (rwflag == FREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, io_off, xfer, fhp, cred, p); else { @@ -5872,13 +5895,12 @@ nfscl_getsameserver(struct nfsmount *nmp, struct nfscl return (NFSDSP_NOTFOUND); } -#ifdef notyet /* - * NFS commit rpc to a DS. + * NFS commit rpc to a NFSv4.1 DS. */ static int nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, - struct nfsfh *fhp, struct ucred *cred, NFSPROC_T *p, void *stuff) + struct nfsfh *fhp, struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; @@ -5886,6 +5908,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfssockreq *nrp; int error; + nd->nd_mrep = NULL; nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + NFSX_UNSIGNED); @@ -5898,7 +5921,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, nrp = &nmp->nm_sockreq; error = newnfs_request(nd, nmp, NULL, nrp, vp, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, &dsp->nfsclds_sess); - if (error) + if (error != 0) return (error); if (nd->nd_repstat == 0) { NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); @@ -5915,7 +5938,6 @@ nfsmout: mbuf_freem(nd->nd_mrep); return (error); } -#endif /* * Set up the XDR arguments for the LayoutGet operation. Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 15 18:44:03 2017 (r321028) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 15 19:18:37 2017 (r321029) @@ -1369,7 +1369,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct attrflag = 0; if (NFSHASPNFS(nmp)) error = nfscl_doiods(vp, uiop, NULL, NULL, - NFSV4OPEN_ACCESSREAD, cred, uiop->uio_td); + NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); if (error != 0) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, @@ -1400,7 +1400,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struc attrflag = 0; if (NFSHASPNFS(nmp)) error = nfscl_doiods(vp, uiop, iomode, must_commit, - NFSV4OPEN_ACCESSWRITE, cred, uiop->uio_td); + NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); if (error != 0) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, @@ -2557,16 +2557,34 @@ ncl_commit(struct vnode *vp, u_quad_t offset, int cnt, { struct nfsvattr nfsva; struct nfsmount *nmp = VFSTONFS(vp->v_mount); + struct nfsnode *np; + struct uio uio; int error, attrflag; - mtx_lock(&nmp->nm_mtx); - if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) { + np = VTONFS(vp); + error = EIO; + attrflag = 0; + if (NFSHASPNFS(nmp) && (np->n_flag & NDSCOMMIT) != 0) { + uio.uio_offset = offset; + uio.uio_resid = cnt; + error = nfscl_doiods(vp, &uio, NULL, NULL, + NFSV4OPEN_ACCESSWRITE, 1, cred, td); + if (error != 0) { + mtx_lock(&np->n_mtx); + np->n_flag &= ~NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + } + if (error != 0) { + mtx_lock(&nmp->nm_mtx); + if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) { + mtx_unlock(&nmp->nm_mtx); + return (0); + } mtx_unlock(&nmp->nm_mtx); - return (0); + error = nfsrpc_commit(vp, offset, cnt, cred, td, &nfsva, + &attrflag, NULL); } - mtx_unlock(&nmp->nm_mtx); - error = nfsrpc_commit(vp, offset, cnt, cred, td, &nfsva, - &attrflag, NULL); if (attrflag != 0) (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); Modified: stable/11/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/11/sys/fs/nfsclient/nfsnode.h Sat Jul 15 18:44:03 2017 (r321028) +++ stable/11/sys/fs/nfsclient/nfsnode.h Sat Jul 15 19:18:37 2017 (r321029) @@ -158,6 +158,7 @@ struct nfsnode { #define NNOLAYOUT 0x00020000 /* Can't get a layout for this file */ #define NWRITEOPENED 0x00040000 /* Has been opened for writing */ #define NHASBEENLOCKED 0x00080000 /* Has been file locked. */ +#define NDSCOMMIT 0x00100000 /* Commit is done via the DS. */ /* * Convert between nfsnode pointers and vnode pointers From owner-svn-src-all@freebsd.org Sat Jul 15 19:22:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC9BB7A19D; Sat, 15 Jul 2017 19:22:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533A381D7B; Sat, 15 Jul 2017 19:22:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FJM8UQ018472; Sat, 15 Jul 2017 19:22:08 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FJM1Uq018398; Sat, 15 Jul 2017 19:22:01 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201707151922.v6FJM1Uq018398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 15 Jul 2017 19:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321030 - in head: etc/mtree sbin/pfctl sbin/pfctl/tests sbin/pfctl/tests/files targets/pseudo/tests X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: etc/mtree sbin/pfctl sbin/pfctl/tests sbin/pfctl/tests/files targets/pseudo/tests X-SVN-Commit-Revision: 321030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 19:22:09 -0000 Author: kp Date: Sat Jul 15 19:22:01 2017 New Revision: 321030 URL: https://svnweb.freebsd.org/changeset/base/321030 Log: pfctl parser tests Copy the most important test cases from OpenBSD's corresponding src/regress/sbin/pfctl, those that run pfctl on a test input file and check correctness of its output. We have also added some new tests using the same format. The tests consist of a collection of input files (pf*.in) and corresponding output files (pf*.ok). We run pfctl -nv on the input files and check that the output matches the output files. If any discrepancy is discovered during future development in the source tree, we know that a regression bug has been introduced into the tree. Submitted by: paggas Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11322 Added: head/sbin/pfctl/tests/ head/sbin/pfctl/tests/Makefile (contents, props changed) head/sbin/pfctl/tests/files/ head/sbin/pfctl/tests/files/Makefile (contents, props changed) head/sbin/pfctl/tests/files/pf0001.in (contents, props changed) head/sbin/pfctl/tests/files/pf0001.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0002.in (contents, props changed) head/sbin/pfctl/tests/files/pf0002.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0003.in (contents, props changed) head/sbin/pfctl/tests/files/pf0003.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0004.in (contents, props changed) head/sbin/pfctl/tests/files/pf0004.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0005.in (contents, props changed) head/sbin/pfctl/tests/files/pf0005.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0006.in (contents, props changed) head/sbin/pfctl/tests/files/pf0006.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0007.in (contents, props changed) head/sbin/pfctl/tests/files/pf0007.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0008.in (contents, props changed) head/sbin/pfctl/tests/files/pf0008.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0009.in (contents, props changed) head/sbin/pfctl/tests/files/pf0009.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0010.in (contents, props changed) head/sbin/pfctl/tests/files/pf0010.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0011.in (contents, props changed) head/sbin/pfctl/tests/files/pf0011.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0012.in (contents, props changed) head/sbin/pfctl/tests/files/pf0012.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0013.in (contents, props changed) head/sbin/pfctl/tests/files/pf0013.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0014.in (contents, props changed) head/sbin/pfctl/tests/files/pf0014.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0016.in (contents, props changed) head/sbin/pfctl/tests/files/pf0016.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0018.in (contents, props changed) head/sbin/pfctl/tests/files/pf0018.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0019.in (contents, props changed) head/sbin/pfctl/tests/files/pf0019.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0020.in (contents, props changed) head/sbin/pfctl/tests/files/pf0020.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0022.in (contents, props changed) head/sbin/pfctl/tests/files/pf0022.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0023.in (contents, props changed) head/sbin/pfctl/tests/files/pf0023.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0024.in (contents, props changed) head/sbin/pfctl/tests/files/pf0024.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0025.in (contents, props changed) head/sbin/pfctl/tests/files/pf0025.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0026.in (contents, props changed) head/sbin/pfctl/tests/files/pf0026.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0028.in (contents, props changed) head/sbin/pfctl/tests/files/pf0028.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0030.in (contents, props changed) head/sbin/pfctl/tests/files/pf0030.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0031.in (contents, props changed) head/sbin/pfctl/tests/files/pf0031.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0032.in (contents, props changed) head/sbin/pfctl/tests/files/pf0032.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0034.in (contents, props changed) head/sbin/pfctl/tests/files/pf0034.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0035.in (contents, props changed) head/sbin/pfctl/tests/files/pf0035.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0038.in (contents, props changed) head/sbin/pfctl/tests/files/pf0038.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0039.in (contents, props changed) head/sbin/pfctl/tests/files/pf0039.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0040.in (contents, props changed) head/sbin/pfctl/tests/files/pf0040.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0041.in (contents, props changed) head/sbin/pfctl/tests/files/pf0041.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0047.in (contents, props changed) head/sbin/pfctl/tests/files/pf0047.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0048.in (contents, props changed) head/sbin/pfctl/tests/files/pf0048.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0049.in (contents, props changed) head/sbin/pfctl/tests/files/pf0049.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0050.in (contents, props changed) head/sbin/pfctl/tests/files/pf0050.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0052.in (contents, props changed) head/sbin/pfctl/tests/files/pf0052.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0053.in (contents, props changed) head/sbin/pfctl/tests/files/pf0053.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0055.in (contents, props changed) head/sbin/pfctl/tests/files/pf0055.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0056.in (contents, props changed) head/sbin/pfctl/tests/files/pf0056.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0057.in (contents, props changed) head/sbin/pfctl/tests/files/pf0057.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0060.in (contents, props changed) head/sbin/pfctl/tests/files/pf0060.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0061.in (contents, props changed) head/sbin/pfctl/tests/files/pf0061.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0065.in (contents, props changed) head/sbin/pfctl/tests/files/pf0065.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0067.in (contents, props changed) head/sbin/pfctl/tests/files/pf0067.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0069.in (contents, props changed) head/sbin/pfctl/tests/files/pf0069.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0070.in (contents, props changed) head/sbin/pfctl/tests/files/pf0070.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0071.in (contents, props changed) head/sbin/pfctl/tests/files/pf0071.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0072.in (contents, props changed) head/sbin/pfctl/tests/files/pf0072.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0074.in (contents, props changed) head/sbin/pfctl/tests/files/pf0074.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0075.in (contents, props changed) head/sbin/pfctl/tests/files/pf0075.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0077.in (contents, props changed) head/sbin/pfctl/tests/files/pf0077.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0078.in (contents, props changed) head/sbin/pfctl/tests/files/pf0078.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0079.in (contents, props changed) head/sbin/pfctl/tests/files/pf0079.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0081.in (contents, props changed) head/sbin/pfctl/tests/files/pf0081.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0082.in (contents, props changed) head/sbin/pfctl/tests/files/pf0082.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0084.in (contents, props changed) head/sbin/pfctl/tests/files/pf0084.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0085.in (contents, props changed) head/sbin/pfctl/tests/files/pf0085.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0087.in (contents, props changed) head/sbin/pfctl/tests/files/pf0087.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0088.in (contents, props changed) head/sbin/pfctl/tests/files/pf0088.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0089.in (contents, props changed) head/sbin/pfctl/tests/files/pf0089.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0090.in (contents, props changed) head/sbin/pfctl/tests/files/pf0090.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0091.in (contents, props changed) head/sbin/pfctl/tests/files/pf0091.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0092.in (contents, props changed) head/sbin/pfctl/tests/files/pf0092.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0094.in (contents, props changed) head/sbin/pfctl/tests/files/pf0094.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0095.in (contents, props changed) head/sbin/pfctl/tests/files/pf0095.include (contents, props changed) head/sbin/pfctl/tests/files/pf0095.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0096.in (contents, props changed) head/sbin/pfctl/tests/files/pf0096.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0097.in (contents, props changed) head/sbin/pfctl/tests/files/pf0097.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0098.in (contents, props changed) head/sbin/pfctl/tests/files/pf0098.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0100.in (contents, props changed) head/sbin/pfctl/tests/files/pf0100.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0101.in (contents, props changed) head/sbin/pfctl/tests/files/pf0101.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0102.in (contents, props changed) head/sbin/pfctl/tests/files/pf0102.ok (contents, props changed) head/sbin/pfctl/tests/files/pf0104.in (contents, props changed) head/sbin/pfctl/tests/files/pf0104.ok (contents, props changed) head/sbin/pfctl/tests/files/pf1001.in (contents, props changed) head/sbin/pfctl/tests/files/pf1001.ok (contents, props changed) head/sbin/pfctl/tests/files/pf1002.in (contents, props changed) head/sbin/pfctl/tests/files/pf1002.ok (contents, props changed) head/sbin/pfctl/tests/files/pf1003.in (contents, props changed) head/sbin/pfctl/tests/files/pf1003.ok (contents, props changed) head/sbin/pfctl/tests/files/pf1004.in (contents, props changed) head/sbin/pfctl/tests/files/pf1004.ok (contents, props changed) head/sbin/pfctl/tests/files/pfctl_test_descr.sh (contents, props changed) head/sbin/pfctl/tests/pfctl_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/pfctl/Makefile head/targets/pseudo/tests/Makefile.depend Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sat Jul 15 19:18:37 2017 (r321029) +++ head/etc/mtree/BSD.tests.dist Sat Jul 15 19:22:01 2017 (r321030) @@ -378,6 +378,10 @@ .. mdconfig .. + pfctl + files + .. + .. .. secure lib Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Sat Jul 15 19:18:37 2017 (r321029) +++ head/sbin/pfctl/Makefile Sat Jul 15 19:22:01 2017 (r321030) @@ -31,4 +31,8 @@ YFLAGS= LIBADD= m md +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/sbin/pfctl/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/Makefile Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +ATF_TESTS_SH= pfctl_test + +SUBDIR+= files + +.include Added: head/sbin/pfctl/tests/files/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/Makefile Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/pfctl/files +BINDIR= ${TESTSDIR} + +# We use ${.CURDIR} as workaround so that the glob patterns work. +FILES= ${.CURDIR}/pf????.in +FILES+= ${.CURDIR}/pf????.include +FILES+= ${.CURDIR}/pf????.ok +FILES+= ${.CURDIR}/pfctl_test_descr.sh + +.include Added: head/sbin/pfctl/tests/files/pf0001.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0001.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,8 @@ +pass in all +pass in from any to any no state +pass in proto tcp from any port <= 1024 to any label foo_bar +pass in proto tcp from any to any port = 25 +pass in proto tcp from 10.0.0.0/8 port > 1024 to ! 10.1.2.3 port != 22 +pass in proto igmp from 10.0.0.0/8 to 10.1.1.1 allow-opts +pass in proto tcp from { 1.2.3.4, 1.2.3.5 } to any label \ +"$nr:$proto:$srcaddr:$srcport:$dstaddr:$dstport" Added: head/sbin/pfctl/tests/files/pf0001.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0001.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,8 @@ +pass in all flags S/SA keep state +pass in all no state +pass in proto tcp from any port <= 1024 to any flags S/SA keep state label "foo_bar" +pass in proto tcp from any to any port = smtp flags S/SA keep state +pass in inet proto tcp from 10.0.0.0/8 port > 1024 to ! 10.1.2.3 port != ssh flags S/SA keep state +pass in inet proto igmp from 10.0.0.0/8 to 10.1.1.1 keep state allow-opts +pass in inet proto tcp from 1.2.3.4 to any flags S/SA keep state label "6:tcp:1.2.3.4::any:" +pass in inet proto tcp from 1.2.3.5 to any flags S/SA keep state label "7:tcp:1.2.3.5::any:" Added: head/sbin/pfctl/tests/files/pf0002.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0002.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,34 @@ +# test + +block out log on tun1000000 all +block in log on tun1000000 all + +block return-rst out log on tun1000000 proto tcp all +block return-rst in log on tun1000000 proto tcp all +block return-icmp out log on tun1000000 proto udp all +block return-icmp in log on tun1000000 proto udp all + +block out log quick on tun1000000 from ! 157.161.48.183 to any + +block in quick on tun1000000 from any to 255.255.255.255 + +block in log quick on tun1000000 from 10.0.0.0/8 to any +block in log quick on tun1000000 from 172.16.0.0/12 to any +block in quick log on tun1000000 from 192.168.0.0/16 to any +block in quick log on tun1000000 from 255.255.255.255/32 to any + +block in log quick from no-route to any + +pass out on tun1000000 inet proto icmp all icmp-type 8 code 0 keep state +pass in on tun1000000 inet proto icmp all icmp-type 8 code 0 keep state + +pass out on tun1000000 proto udp all keep state + +pass in on tun1000000 proto udp from any to any port = domain keep state + +pass out on tun1000000 proto tcp all keep state + +pass in on tun1000000 proto tcp from any to any port = ssh keep state +pass in on tun1000000 proto tcp from any to any port = smtp keep state +pass in on tun1000000 proto tcp from any to any port = domain keep state +pass in on tun1000000 proto tcp from any to any port = auth keep state Added: head/sbin/pfctl/tests/files/pf0002.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0002.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,22 @@ +block drop out log on tun1000000 all +block drop in log on tun1000000 all +block return-rst out log on tun1000000 proto tcp all +block return-rst in log on tun1000000 proto tcp all +block return-icmp(port-unr, port-unr) out log on tun1000000 proto udp all +block return-icmp(port-unr, port-unr) in log on tun1000000 proto udp all +block drop out log quick on tun1000000 inet from ! 157.161.48.183 to any +block drop in quick on tun1000000 inet from any to 255.255.255.255 +block drop in log quick on tun1000000 inet from 10.0.0.0/8 to any +block drop in log quick on tun1000000 inet from 172.16.0.0/12 to any +block drop in log quick on tun1000000 inet from 192.168.0.0/16 to any +block drop in log quick on tun1000000 inet from 255.255.255.255 to any +block drop in log quick from no-route to any +pass out on tun1000000 inet proto icmp all icmp-type echoreq code 0 keep state +pass in on tun1000000 inet proto icmp all icmp-type echoreq code 0 keep state +pass out on tun1000000 proto udp all keep state +pass in on tun1000000 proto udp from any to any port = domain keep state +pass out on tun1000000 proto tcp all flags S/SA keep state +pass in on tun1000000 proto tcp from any to any port = ssh flags S/SA keep state +pass in on tun1000000 proto tcp from any to any port = smtp flags S/SA keep state +pass in on tun1000000 proto tcp from any to any port = domain flags S/SA keep state +pass in on tun1000000 proto tcp from any to any port = auth flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0003.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0003.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,13 @@ +pass in all +pass in from any to any + +block in proto tcp from any to any flags FUPEW/FSRPAUEW +block in proto tcp from any to any flags SF/SFRA +block in proto tcp from any to any flags /SFRAW + +pass in proto { udp, icmp, tcp } from any to any flags S/SA +pass in from any to any flags S/SA no state +pass in from any to any flags any no state +pass in from any to any flags any +pass in from any to any keep state +pass in from any to any Added: head/sbin/pfctl/tests/files/pf0003.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0003.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,13 @@ +pass in all flags S/SA keep state +pass in all flags S/SA keep state +block drop in proto tcp all flags FPUEW/FSRPAUEW +block drop in proto tcp all flags FS/FSRA +block drop in proto tcp all flags /FSRAW +pass in proto udp all keep state +pass in proto icmp all keep state +pass in proto tcp all flags S/SA keep state +pass in all flags S/SA no state +pass in all no state +pass in all flags any keep state +pass in all flags S/SA keep state +pass in all flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0004.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0004.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,16 @@ +block in all +block in proto tcp all +block in proto { tcp, udp } all + +block in from any to any +block in from 10.0.0.0/8 to any +block in from ! 10.0.0.0/8 to any +block in from { 10.0.0.0/8, 172.16.0.0/12 } to any + +block in proto tcp from any port = ssh to any +block in proto tcp from any port { ssh, ftp >< 2048, != 1234, >= www } \ + to any port 1024:2048 + +block in proto { tcp, udp } from { 10.0.0.0/8, 172.16.0.0/12 } port { ssh, ftp } \ + to { 192.168.0.0/16, 12.34.56.78 } port { 6667, 6668, 6669:65535 } + Added: head/sbin/pfctl/tests/files/pf0004.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0004.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,62 @@ +block drop in all +block drop in proto tcp all +block drop in proto tcp all +block drop in proto udp all +block drop in all +block drop in inet from 10.0.0.0/8 to any +block drop in inet from ! 10.0.0.0/8 to any +block drop in inet from 10.0.0.0/8 to any +block drop in inet from 172.16.0.0/12 to any +block drop in proto tcp from any port = ssh to any +block drop in proto tcp from any port = ssh to any port 1024:2048 +block drop in proto tcp from any port 21 >< 2048 to any port 1024:2048 +block drop in proto tcp from any port != 1234 to any port 1024:2048 +block drop in proto tcp from any port >= 80 to any port 1024:2048 +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port = ircd +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port = 6668 +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port 6669:65535 +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = ircd +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = 6668 +block drop in inet proto tcp from 10.0.0.0/8 port = ssh to 12.34.56.78 port 6669:65535 +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port = ircd +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port = 6668 +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port 6669:65535 +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = ircd +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = 6668 +block drop in inet proto tcp from 10.0.0.0/8 port = ftp to 12.34.56.78 port 6669:65535 +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port = ircd +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port = 6668 +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port 6669:65535 +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 12.34.56.78 port = ircd +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 12.34.56.78 port = 6668 +block drop in inet proto tcp from 172.16.0.0/12 port = ssh to 12.34.56.78 port 6669:65535 +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port = ircd +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port = 6668 +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port 6669:65535 +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 12.34.56.78 port = ircd +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 12.34.56.78 port = 6668 +block drop in inet proto tcp from 172.16.0.0/12 port = ftp to 12.34.56.78 port 6669:65535 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port = 6668 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 192.168.0.0/16 port 6669:65535 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = 6668 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 12.34.56.78 port 6669:65535 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port = 6668 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 192.168.0.0/16 port 6669:65535 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = 6668 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 12.34.56.78 port 6669:65535 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port = 6667 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port = 6668 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 192.168.0.0/16 port 6669:65535 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 12.34.56.78 port = 6667 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 12.34.56.78 port = 6668 +block drop in inet proto udp from 172.16.0.0/12 port = ssh to 12.34.56.78 port 6669:65535 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port = 6667 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port = 6668 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 192.168.0.0/16 port 6669:65535 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 12.34.56.78 port = 6667 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 12.34.56.78 port = 6668 +block drop in inet proto udp from 172.16.0.0/12 port = ftp to 12.34.56.78 port 6669:65535 Added: head/sbin/pfctl/tests/files/pf0005.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0005.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,6 @@ +foo = "ssh, ftp" +bar = "other thing" +inside="10.0.0.0/8" + +block in proto udp from $inside port { echo, $foo, ident } \ + to 12.34.56.78 port { 6667, 0x10 } Added: head/sbin/pfctl/tests/files/pf0005.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0005.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,11 @@ +foo = "ssh, ftp" +bar = "other thing" +inside = "10.0.0.0/8" +block drop in inet proto udp from 10.0.0.0/8 port = echo to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = echo to 12.34.56.78 port = 16 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ssh to 12.34.56.78 port = 16 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = ftp to 12.34.56.78 port = 16 +block drop in inet proto udp from 10.0.0.0/8 port = auth to 12.34.56.78 port = 6667 +block drop in inet proto udp from 10.0.0.0/8 port = auth to 12.34.56.78 port = 16 Added: head/sbin/pfctl/tests/files/pf0006.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0006.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +a=b +c=x +a_b_c=d Added: head/sbin/pfctl/tests/files/pf0006.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0006.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +a = "b" +c = "x" +a_b_c = "d" Added: head/sbin/pfctl/tests/files/pf0007.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0007.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,34 @@ +# test modulate state + +block out log on tun1000000 all +block in log on tun1000000 all + +block return-rst out log on tun1000000 proto tcp all +block return-rst in log on tun1000000 proto tcp all +block return-icmp out log on tun1000000 proto udp all +block return-icmp in log on tun1000000 proto udp all + +block out log quick on tun1000000 from ! 157.161.48.183 to any + +block in quick on tun1000000 from any to 255.255.255.255 + +block in log quick on tun1000000 from 10.0.0.0/8 to any +block in log quick on tun1000000 from 172.16.0.0/12 to any +block in log quick on tun1000000 from 192.168.0.0/16 to any +block in log quick on tun1000000 from 255.255.255.255/32 to any + +pass out on tun1000000 inet proto icmp all icmp-type 8 code 0 keep state +pass in on tun1000000 inet proto icmp all icmp-type 8 code 0 keep state + +pass out on tun1000000 proto udp all keep state + +pass in on tun1000000 proto udp from any to any port = domain keep state + +pass out on tun1000000 proto tcp all modulate state +pass in on tun1000000 proto { tcp udp icmp } all modulate state +pass in on tun1000000 proto { udp tcp icmp } all flags S/SA synproxy state + +pass in on tun1000000 proto tcp from any to any port = ssh modulate state +pass in on tun1000000 proto tcp from any to any port = smtp modulate state +pass in on tun1000000 proto tcp from any to any port = domain modulate state +pass in on tun1000000 proto tcp from any to any port = auth modulate state Added: head/sbin/pfctl/tests/files/pf0007.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0007.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,27 @@ +block drop out log on tun1000000 all +block drop in log on tun1000000 all +block return-rst out log on tun1000000 proto tcp all +block return-rst in log on tun1000000 proto tcp all +block return-icmp(port-unr, port-unr) out log on tun1000000 proto udp all +block return-icmp(port-unr, port-unr) in log on tun1000000 proto udp all +block drop out log quick on tun1000000 inet from ! 157.161.48.183 to any +block drop in quick on tun1000000 inet from any to 255.255.255.255 +block drop in log quick on tun1000000 inet from 10.0.0.0/8 to any +block drop in log quick on tun1000000 inet from 172.16.0.0/12 to any +block drop in log quick on tun1000000 inet from 192.168.0.0/16 to any +block drop in log quick on tun1000000 inet from 255.255.255.255 to any +pass out on tun1000000 inet proto icmp all icmp-type echoreq code 0 keep state +pass in on tun1000000 inet proto icmp all icmp-type echoreq code 0 keep state +pass out on tun1000000 proto udp all keep state +pass in on tun1000000 proto udp from any to any port = domain keep state +pass out on tun1000000 proto tcp all flags S/SA modulate state +pass in on tun1000000 proto tcp all flags S/SA modulate state +pass in on tun1000000 proto udp all keep state +pass in on tun1000000 proto icmp all keep state +pass in on tun1000000 proto udp all keep state +pass in on tun1000000 proto tcp all flags S/SA synproxy state +pass in on tun1000000 proto icmp all keep state +pass in on tun1000000 proto tcp from any to any port = ssh flags S/SA modulate state +pass in on tun1000000 proto tcp from any to any port = smtp flags S/SA modulate state +pass in on tun1000000 proto tcp from any to any port = domain flags S/SA modulate state +pass in on tun1000000 proto tcp from any to any port = auth flags S/SA modulate state Added: head/sbin/pfctl/tests/files/pf0008.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0008.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,2 @@ +extern = "{ ! 10.0.0.0/8, 10.1.2.3 }" +block out log on tun1000001 from $extern to any Added: head/sbin/pfctl/tests/files/pf0008.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0008.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +extern = "{ ! 10.0.0.0/8, 10.1.2.3 }" +block drop out log on tun1000001 inet from ! 10.0.0.0/8 to any +block drop out log on tun1000001 inet from 10.1.2.3 to any Added: head/sbin/pfctl/tests/files/pf0009.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0009.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +interfaces = "{ enc0, tun1000000 }" + +block in on $interfaces all Added: head/sbin/pfctl/tests/files/pf0009.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0009.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +interfaces = "{ enc0, tun1000000 }" +block drop in on enc0 all +block drop in on tun1000000 all Added: head/sbin/pfctl/tests/files/pf0010.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0010.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,31 @@ +# return variants +pass in inet proto icmp all +pass in inet6 proto icmp6 all +block in inet proto icmp all +block in inet6 proto icmp6 all +block return-rst in inet proto tcp all +block return-rst in inet6 proto tcp all +block return-rst(ttl 10) in inet proto tcp all +block return-rst(ttl 10) in inet6 proto tcp all +block return-icmp in inet proto icmp all +block return-icmp(0) in inet proto icmp all +block return-icmp(net-unr) in inet proto icmp all +block return-icmp(5) in inet proto icmp all +block return-icmp(srcfail) in inet proto icmp all +block return-icmp(10) in inet proto icmp all +block return-icmp(host-prohib) in inet proto icmp all +block return-icmp(15) in inet proto icmp all +block return-icmp(cutoff-preced) in inet proto icmp all +block return-icmp6 in inet6 proto icmp6 all +block return-icmp6(0) in inet6 proto icmp6 all +block return-icmp6(noroute-unr) in inet6 proto icmp6 all +block return-icmp6(1) in inet6 proto icmp6 all +block return-icmp6(admin-unr) in inet6 proto icmp6 all +block return-icmp6(2) in inet6 proto icmp6 all +block return-icmp6(notnbr-unr) in inet6 proto icmp6 all +block return-icmp6(3) in inet6 proto icmp6 all +block return-icmp6(addr-unr) in inet6 proto icmp6 all +block return-icmp6(4) in inet6 proto icmp6 all +block return-icmp6(port-unr) in inet6 proto icmp6 all +block return-icmp(5, 1) in all +block return-icmp(srcfail, admin-unr) in all Added: head/sbin/pfctl/tests/files/pf0010.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0010.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,30 @@ +pass in inet proto icmp all keep state +pass in inet6 proto ipv6-icmp all keep state +block drop in inet proto icmp all +block drop in inet6 proto ipv6-icmp all +block return-rst in inet proto tcp all +block return-rst in inet6 proto tcp all +block return-rst(ttl 10) in inet proto tcp all +block return-rst(ttl 10) in inet6 proto tcp all +block return-icmp(port-unr) in inet proto icmp all +block return-icmp(net-unr) in inet proto icmp all +block return-icmp(net-unr) in inet proto icmp all +block return-icmp(srcfail) in inet proto icmp all +block return-icmp(srcfail) in inet proto icmp all +block return-icmp(host-prohib) in inet proto icmp all +block return-icmp(host-prohib) in inet proto icmp all +block return-icmp(cutoff-preced) in inet proto icmp all +block return-icmp(cutoff-preced) in inet proto icmp all +block return-icmp6(port-unr) in inet6 proto ipv6-icmp all +block return-icmp6(noroute-unr) in inet6 proto ipv6-icmp all +block return-icmp6(noroute-unr) in inet6 proto ipv6-icmp all +block return-icmp6(admin-unr) in inet6 proto ipv6-icmp all +block return-icmp6(admin-unr) in inet6 proto ipv6-icmp all +block return-icmp6(notnbr-unr) in inet6 proto ipv6-icmp all +block return-icmp6(notnbr-unr) in inet6 proto ipv6-icmp all +block return-icmp6(addr-unr) in inet6 proto ipv6-icmp all +block return-icmp6(addr-unr) in inet6 proto ipv6-icmp all +block return-icmp6(port-unr) in inet6 proto ipv6-icmp all +block return-icmp6(port-unr) in inet6 proto ipv6-icmp all +block return-icmp(srcfail, admin-unr) in all +block return-icmp(srcfail, admin-unr) in all Added: head/sbin/pfctl/tests/files/pf0011.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0011.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,18 @@ +pass in inet proto icmp all icmp-type 0 +pass in inet proto icmp all icmp-type 0 code 0 +pass in inet proto icmp all icmp-type 1 +pass in inet proto icmp all icmp-type 1 code 1 +pass in inet6 proto ipv6-icmp all icmp6-type 0 +pass in inet6 proto ipv6-icmp all icmp6-type 0 code 0 +pass in inet6 proto ipv6-icmp all icmp6-type 1 +pass in inet6 proto ipv6-icmp all icmp6-type 1 code 1 +block in inet proto icmp all icmp-type 0 +block in inet proto icmp all icmp-type 0 code 0 +block in inet proto icmp all icmp-type 1 +block in inet proto icmp all icmp-type 1 code 1 +block in inet6 proto ipv6-icmp all icmp6-type 0 +block in inet6 proto ipv6-icmp all icmp6-type 0 code 0 +block in inet6 proto ipv6-icmp all icmp6-type 1 +block in inet6 proto ipv6-icmp all icmp6-type 1 code 1 +pass in inet proto icmp all icmp-type unreach code needfrag +pass in inet6 proto ipv6-icmp all icmp6-type timex code reassemb Added: head/sbin/pfctl/tests/files/pf0011.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0011.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,18 @@ +pass in inet proto icmp all icmp-type echorep keep state +pass in inet proto icmp all icmp-type echorep code 0 keep state +pass in inet proto icmp all icmp-type 1 keep state +pass in inet proto icmp all icmp-type 1 code 1 keep state +pass in inet6 proto ipv6-icmp all icmp6-type 0 keep state +pass in inet6 proto ipv6-icmp all icmp6-type 0 code 0 keep state +pass in inet6 proto ipv6-icmp all icmp6-type unreach keep state +pass in inet6 proto ipv6-icmp all icmp6-type unreach code admin-unr keep state +block drop in inet proto icmp all icmp-type echorep +block drop in inet proto icmp all icmp-type echorep code 0 +block drop in inet proto icmp all icmp-type 1 +block drop in inet proto icmp all icmp-type 1 code 1 +block drop in inet6 proto ipv6-icmp all icmp6-type 0 +block drop in inet6 proto ipv6-icmp all icmp6-type 0 code 0 +block drop in inet6 proto ipv6-icmp all icmp6-type unreach +block drop in inet6 proto ipv6-icmp all icmp6-type unreach code admin-unr +pass in inet proto icmp all icmp-type unreach code needfrag keep state +pass in inet6 proto ipv6-icmp all icmp6-type timex code reassemb keep state Added: head/sbin/pfctl/tests/files/pf0012.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0012.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +pass in from 127.0.0.1 to 127.0.0.1/8 no state +pass in from 127.0.0.1/16 to 127.0.0.1/24 no state +pass in from 127.0.0.1/25 to ! 127.0.0.1/26 +pass in inet from ! localhost to localhost/16 +pass in inet from ! lo0 to ! lo0/8 Added: head/sbin/pfctl/tests/files/pf0012.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0012.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +pass in inet from 127.0.0.1 to 127.0.0.0/8 no state +pass in inet from 127.0.0.0/16 to 127.0.0.0/24 no state +pass in inet from 127.0.0.0/25 to ! 127.0.0.0/26 flags S/SA keep state +pass in inet from ! 127.0.0.1 to 127.0.0.0/16 flags S/SA keep state +pass in inet from ! 127.0.0.1 to ! 127.0.0.0/8 flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0013.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0013.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,22 @@ +pass in quick on enc0 from any to any +pass in quick on enc0 inet from any to any +pass in quick on enc0 inet6 from any to any + +#pass out quick on tun1000000 inet from any to any route-to tun1000001 +#pass out quick on tun1000000 from any to 192.168.1.1 route-to tun1000001 +#pass out quick on tun1000000 from any to fec0::1 route-to tun1000001 + +#pass in on tun1000000 proto tcp from any to any port = 21 dup-to (tun1000001 192.168.1.1) +#pass in on tun1000000 proto tcp from any to any port = 21 dup-to (tun1000001 fec0::1) + +#pass in quick on tun1000000 from 192.168.1.1/32 to 10.1.1.1/32 route-to tun1000001 +#pass in quick on tun1000000 from fec0::1/64 to fec1::2/128 route-to tun1000001 + +#pass in on tun1000000 proto tcp from any to any port = 21 reply-to (tun1000001 192.168.1.1) +#pass in on tun1000000 proto tcp from any to any port = 21 reply-to (tun1000001 fec0::1) + +#pass in quick on tun1000000 from 192.168.1.1/32 to 10.1.1.1/32 reply-to tun1000001 +#pass in quick on tun1000000 from fec0::1/64 to fec1::2/128 reply-to tun1000001 + +#pass in quick on tun1000000 from 192.168.1.1/32 to 10.1.1.1/32 dup-to (tun1000001 192.168.1.100) +#pass in quick on tun1000000 from fec0::1/64 to fec1::2/128 dup-to (tun1000001 fec1::2) Added: head/sbin/pfctl/tests/files/pf0013.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0013.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +pass in quick on enc0 all flags S/SA keep state +pass in quick on enc0 inet all flags S/SA keep state +pass in quick on enc0 inet6 all flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0014.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0014.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,6 @@ +pass in quick on lo0 from fe80::1%lo0 to fe80::1%lo0 +pass in quick from fe80::1%lo0 to fe80::1%lo0 +pass in quick from fe80::1%lo0 to any +pass in quick from any to fe80::1%lo0 +pass in quick on lo0 from fe80::1%lo0 to any +pass in quick on lo0 from any to fe80::1%lo0 Added: head/sbin/pfctl/tests/files/pf0014.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0014.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,6 @@ +pass in quick on lo0 inet6 from fe80::1 to fe80::1 flags S/SA keep state +pass in quick on lo0 inet6 from fe80::1 to fe80::1 flags S/SA keep state +pass in quick on lo0 inet6 from fe80::1 to any flags S/SA keep state +pass in quick on lo0 inet6 from any to fe80::1 flags S/SA keep state +pass in quick on lo0 inet6 from fe80::1 to any flags S/SA keep state +pass in quick on lo0 inet6 from any to fe80::1 flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0016.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0016.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +# Test rule order processing: should fail unless nat -> filter +#match out on lo0 from 192.168.1.1 to any nat-to 10.0.0.1 +#match in on lo0 proto tcp from any to 1.2.3.4/32 port 2222 rdr-to 10.0.0.10 port 22 +#match on lo0 from 192.168.1.1 to any binat-to 10.0.0.1 +pass in on lo1000000 from any to any no state Added: head/sbin/pfctl/tests/files/pf0016.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0016.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1 @@ +pass in on lo1000000 all no state Added: head/sbin/pfctl/tests/files/pf0018.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0018.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,19 @@ +# test nat + +TEST_LIST1 = "{ 192.168.1.5, 192.168.1.6, 192.168.1.7 }" +TEST_LIST2 = "{ 172.6.1.1, 172.14.1.2/32, 172.16.2.0/24 }" + +#match out on lo0 from 192.168.1.1 to any nat-to 10.0.0.1 +#match out on lo0 proto tcp from 192.168.1.2 to any nat-to 10.0.0.2 +#match out on lo0 proto udp from 192.168.1.3 to any nat-to 10.0.0.3 +#match out on lo0 proto icmp from 192.168.1.4 to any nat-to 10.0.0.4 + +#match out on lo0 inet from $TEST_LIST1 to $TEST_LIST2 nat-to lo0 + +#match out on lo0 inet from 192.168.0.1/24 to any nat-to (lo0) + +#match out on lo0 from 192.168.1.8 to ! 172.17.0.0/16 nat-to 10.0.0.8 + +#match out on ! lo0 proto { udp, tcp } from any to any nat-to 10.0.0.8 static-port + +#match out on { lo0, tun1000000 } from any to any nat-to 10.0.0.8 Added: head/sbin/pfctl/tests/files/pf0018.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0018.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,2 @@ +TEST_LIST1 = "{ 192.168.1.5, 192.168.1.6, 192.168.1.7 }" +TEST_LIST2 = "{ 172.6.1.1, 172.14.1.2/32, 172.16.2.0/24 }" Added: head/sbin/pfctl/tests/files/pf0019.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0019.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,9 @@ +EVIL = "lo0" +GOOD = "{ lo0, lo1000000 }" +GOOD_NET = "{ 127.0.0.0/24, 10.0.1.0/24 }" +DEST_NET = "{ 1.2.3.4/25, 2.4.6.8/30 }" + +#match in on lo0 proto tcp from any to 1.2.3.4/32 port 2222 rdr-to 10.0.0.10 port 22 + +# Test list processing +#match in on $GOOD proto tcp from $GOOD_NET to $DEST_NET port 21 rdr-to 127.0.0.1 port 8021 Added: head/sbin/pfctl/tests/files/pf0019.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0019.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,4 @@ +EVIL = "lo0" +GOOD = "{ lo0, lo1000000 }" +GOOD_NET = "{ 127.0.0.0/24, 10.0.1.0/24 }" +DEST_NET = "{ 1.2.3.4/25, 2.4.6.8/30 }" Added: head/sbin/pfctl/tests/files/pf0020.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0020.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,9 @@ +# Test whether list expansion in NAT/RDR works correctly + +EVIL = "lo0" +GOOD = "{ lo0, lo1000000 }" +GOOD_NET = "{ 127.0.0.0/24, 10.0.1.0/24 }" +DEST_NET = "{ 1.2.3.4/25, 2.4.6.8/30 }" + +#match out on $EVIL inet from $GOOD_NET to $DEST_NET nat-to $EVIL +#match in on $GOOD proto tcp from $GOOD_NET to $DEST_NET port 21 rdr-to 127.0.0.1 port 8021 Added: head/sbin/pfctl/tests/files/pf0020.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0020.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,4 @@ +EVIL = "lo0" +GOOD = "{ lo0, lo1000000 }" +GOOD_NET = "{ 127.0.0.0/24, 10.0.1.0/24 }" +DEST_NET = "{ 1.2.3.4/25, 2.4.6.8/30 }" Added: head/sbin/pfctl/tests/files/pf0022.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0022.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,8 @@ +set optimization aggressive +set timeout { tcp.closing 6, tcp.opening 6 } +set timeout tcp.first 6 +set limit states 500 +set limit {states 1000,frags 1000} +set loginterface lo0 +set loginterface none +set hostid 1 Added: head/sbin/pfctl/tests/files/pf0022.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0022.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,10 @@ +set optimization aggressive +set timeout tcp.closing 6 +set timeout tcp.opening 6 +set timeout tcp.first 6 +set limit states 500 +set limit states 1000 +set limit frags 1000 +set loginterface lo0 +set loginterface none +set hostid 0x00000001 Added: head/sbin/pfctl/tests/files/pf0023.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0023.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,2 @@ +#test negated interface matching +block in on ! lo0 all Added: head/sbin/pfctl/tests/files/pf0023.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0023.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1 @@ +block drop in on ! lo0 all Added: head/sbin/pfctl/tests/files/pf0024.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0024.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,8 @@ +#test variable concat +a="ssh" +b="ftp" +c=$a $b +d=$a $b $a $b +e=$a $b $b "test" $a $b + +pass in proto tcp from any to any port { $c } Added: head/sbin/pfctl/tests/files/pf0024.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0024.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,7 @@ +a = "ssh" +b = "ftp" +c = "ssh ftp" +d = "ssh ftp ssh ftp" +e = "ssh ftp ftp test ssh ftp" +pass in proto tcp from any to any port = ssh flags S/SA keep state +pass in proto tcp from any to any port = ftp flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0025.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0025.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,4 @@ +antispoof for lo0 +antispoof log quick for lo0 inet +antispoof for (lo0) +antispoof log quick for (lo0) inet Added: head/sbin/pfctl/tests/files/pf0025.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0025.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +block drop in on ! lo0 inet6 from ::1 to any +block drop in on ! lo0 inet from 127.0.0.0/8 to any +block drop in log quick on ! lo0 inet from 127.0.0.0/8 to any +block drop in on ! lo0 from (lo0:network) to any +block drop in log quick on ! lo0 inet from (lo0:network) to any Added: head/sbin/pfctl/tests/files/pf0026.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0026.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,2 @@ +block in on lo0 inet from ! (lo0) to any +block out on lo0 inet from any to ! (lo0) Added: head/sbin/pfctl/tests/files/pf0026.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0026.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,2 @@ +block drop in on lo0 inet from ! (lo0) to any +block drop out on lo0 inet from any to ! (lo0) Added: head/sbin/pfctl/tests/files/pf0028.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0028.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,7 @@ +# test logging keywords, and log quick/quick log order +block in log (all) quick on lo0 all +block in quick log on lo0 all +block in quick log (all) on lo0 all +block in log quick on lo0 all +block in log on lo0 all +block in log (all) on lo0 all Added: head/sbin/pfctl/tests/files/pf0028.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0028.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,6 @@ +block drop in log (all) quick on lo0 all +block drop in log quick on lo0 all +block drop in log (all) quick on lo0 all +block drop in log quick on lo0 all +block drop in log on lo0 all +block drop in log (all) on lo0 all Added: head/sbin/pfctl/tests/files/pf0030.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0030.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,7 @@ +#test line continuation + +block \ + in \ + on lo0 \ + from any \ + to any Added: head/sbin/pfctl/tests/files/pf0030.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0030.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1 @@ +block drop in on lo0 all Added: head/sbin/pfctl/tests/files/pf0031.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0031.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,21 @@ +set block-policy drop +block return in on lo0 all +block return in on lo0 inet all +block return in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all +block in on lo0 all +block in on lo0 inet all +block in on lo0 inet6 all +#set block-policy return +block return in on lo0 all +block return in on lo0 inet all +block return in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all +block in on lo0 all +block in on lo0 inet all +block in on lo0 inet6 all + Added: head/sbin/pfctl/tests/files/pf0031.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0031.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,19 @@ +set block-policy drop +block return in on lo0 all +block return in on lo0 inet all +block return in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all +block return in on lo0 all +block return in on lo0 inet all +block return in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all +block drop in on lo0 all +block drop in on lo0 inet all +block drop in on lo0 inet6 all Added: head/sbin/pfctl/tests/files/pf0032.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0032.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,7 @@ +pass in from 10/8 to any +pass in from 10.1/8 to any +pass in from 192.168.37.29/25 to any +pass in from 192.168.37.29/24 to any +pass in from 192.168.37.29/16 to any +pass in from 192.168.37.29/8 to any + Added: head/sbin/pfctl/tests/files/pf0032.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0032.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,6 @@ +pass in inet from 10.0.0.0/8 to any flags S/SA keep state +pass in inet from 10.0.0.0/8 to any flags S/SA keep state +pass in inet from 192.168.37.0/25 to any flags S/SA keep state +pass in inet from 192.168.37.0/24 to any flags S/SA keep state +pass in inet from 192.168.0.0/16 to any flags S/SA keep state +pass in inet from 192.0.0.0/8 to any flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0034.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0034.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +#mixed af, probability +pass in from any to { 127.0.0.1, 2000::1 } +pass in probability 0.5 +pass in probability 50% +pass in inet6 proto tcp from ::1 probability 0.8% Added: head/sbin/pfctl/tests/files/pf0034.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0034.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +pass in inet from any to 127.0.0.1 flags S/SA keep state +pass in inet6 from any to 2000::1 flags S/SA keep state +pass in all flags S/SA keep state probability 50% +pass in all flags S/SA keep state probability 50% +pass in inet6 proto tcp from ::1 to any flags S/SA keep state probability 0.8% Added: head/sbin/pfctl/tests/files/pf0035.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0035.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +#test matching on tos + +intf = "lo0" +pass out on $intf inet proto tcp from any to any port 22 tos 0x10 +pass out on $intf inet proto tcp from any to any port 22 tos 0x08 Added: head/sbin/pfctl/tests/files/pf0035.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0035.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,3 @@ +intf = "lo0" +pass out on lo0 inet proto tcp from any to any port = ssh flags S/SA tos 0x10 keep state +pass out on lo0 inet proto tcp from any to any port = ssh flags S/SA tos 0x08 keep state Added: head/sbin/pfctl/tests/files/pf0038.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0038.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,5 @@ +# test + +pass in on tun1000000 proto tcp from any to any user bin +pass in on tun1000000 proto tcp from any to any group bin +pass in on tun1000000 proto tcp from any to any group wheel user root user bin Added: head/sbin/pfctl/tests/files/pf0038.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0038.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,4 @@ +pass in on tun1000000 proto tcp all user = 3 flags S/SA keep state +pass in on tun1000000 proto tcp all group = 7 flags S/SA keep state +pass in on tun1000000 proto tcp all user = 3 group = 0 flags S/SA keep state +pass in on tun1000000 proto tcp all user = 0 group = 0 flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0039.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0039.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,25 @@ +#test random ordered opts + +body1="pass in log quick on lo0 inet proto icmp all " +body2="pass in log quick on lo0 inet proto tcp all " +o_user="user root " +o_user2="user bin " +o_group="group wheel " +o_group2="group nobody " +o_flags="flags S/SA " +o_icmpspec="icmp-type 0 code 0 " +o_tos="tos 0x08 " +o_keep="keep state " +o_fragment="fragment " +o_allowopts="allow-opts " +o_label="label blah" +o_prio="set prio 2" + +$body2 $o_fragment $o_keep $o_label $o_tos +$body2 $o_user $o_prio $o_tos $o_keep $o_group $o_label $o_allowopts \ +$o_user2 $o_group2 +$body1 $o_icmpspec $o_keep $o_label $o_prio +$body2 $o_keep +$body2 $o_label $o_keep $o_prio $o_tos +$body1 $o_icmpspec $o_tos +$body2 $o_flags $o_allowopts Added: head/sbin/pfctl/tests/files/pf0039.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0039.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,24 @@ +body1 = "pass in log quick on lo0 inet proto icmp all " +body2 = "pass in log quick on lo0 inet proto tcp all " +o_user = "user root " +o_user2 = "user bin " +o_group = "group wheel " +o_group2 = "group nobody " +o_flags = "flags S/SA " +o_icmpspec = "icmp-type 0 code 0 " +o_tos = "tos 0x08 " +o_keep = "keep state " +o_fragment = "fragment " +o_allowopts = "allow-opts " +o_label = "label blah" +o_prio = "set prio 2" +pass in log quick on lo0 inet proto tcp all tos 0x08 keep state fragment label "blah" +pass in log quick on lo0 inet proto tcp all user = 3 group = 65534 flags S/SA tos 0x08 set ( prio 2 ) keep state allow-opts label "blah" +pass in log quick on lo0 inet proto tcp all user = 3 group = 0 flags S/SA tos 0x08 set ( prio 2 ) keep state allow-opts label "blah" +pass in log quick on lo0 inet proto tcp all user = 0 group = 65534 flags S/SA tos 0x08 set ( prio 2 ) keep state allow-opts label "blah" +pass in log quick on lo0 inet proto tcp all user = 0 group = 0 flags S/SA tos 0x08 set ( prio 2 ) keep state allow-opts label "blah" +pass in log quick on lo0 inet proto icmp all icmp-type echorep code 0 set ( prio 2 ) keep state label "blah" +pass in log quick on lo0 inet proto tcp all flags S/SA keep state +pass in log quick on lo0 inet proto tcp all flags S/SA tos 0x08 set ( prio 2 ) keep state label "blah" +pass in log quick on lo0 inet proto icmp all icmp-type echorep code 0 tos 0x08 keep state +pass in log quick on lo0 inet proto tcp all flags S/SA keep state allow-opts Added: head/sbin/pfctl/tests/files/pf0040.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0040.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,20 @@ +block +block return +block return-rst proto tcp +pass +pass in no state +pass out no state +pass all no state +block in all +block out all +block from any to any +pass in from any to any +pass out from any to any +block on lo0 +pass on lo0 all +block on lo0 from any to any +pass proto tcp flags S/SA +pass proto udp keep state +pass in proto udp all keep state +pass out proto udp from any to any keep state +pass out on lo0 proto tcp from any to any port 25 keep state Added: head/sbin/pfctl/tests/files/pf0040.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0040.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,20 @@ +block drop all +block return all +block return-rst proto tcp all +pass all flags S/SA keep state +pass in all no state +pass out all no state +pass all no state +block drop in all +block drop out all +block drop all +pass in all flags S/SA keep state +pass out all flags S/SA keep state +block drop on lo0 all +pass on lo0 all flags S/SA keep state +block drop on lo0 all +pass proto tcp all flags S/SA keep state +pass proto udp all keep state +pass in proto udp all keep state +pass out proto udp all keep state +pass out on lo0 proto tcp from any to any port = smtp flags S/SA keep state Added: head/sbin/pfctl/tests/files/pf0041.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0041.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,12 @@ +anchor foo +anchor bar all +anchor bar from any to any +anchor foo inet +anchor foo inet6 +anchor foo inet all +anchor foo proto tcp +anchor foo inet proto tcp from 10.1.2.3 port smtp to 10.2.3.4 port ssh +anchor foobar inet6 proto udp from ::1 port 1 to ::1 port 2 +anchor filteropt out proto tcp to any port 22 user root +anchor filteropt in proto tcp to (self) port 22 group sshd +anchor filteropt out inet proto icmp all icmp-type echoreq Added: head/sbin/pfctl/tests/files/pf0041.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0041.ok Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,12 @@ +anchor "foo" all +anchor "bar" all +anchor "bar" all +anchor "foo" inet all +anchor "foo" inet6 all +anchor "foo" inet all +anchor "foo" proto tcp all +anchor "foo" inet proto tcp from 10.1.2.3 port = smtp to 10.2.3.4 port = ssh +anchor "foobar" inet6 proto udp from ::1 port = tcpmux to ::1 port = compressnet +anchor "filteropt" out proto tcp from any to any port = ssh user = 0 +anchor "filteropt" in proto tcp from any to (self) port = ssh group = 22 +anchor "filteropt" out inet proto icmp all icmp-type echoreq Added: head/sbin/pfctl/tests/files/pf0047.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf0047.in Sat Jul 15 19:22:01 2017 (r321030) @@ -0,0 +1,67 @@ +pass in on lo0 all label "" + +pass in all label "$if" +pass in on lo0 all label "$if" +pass in on lo0 all label "$if$if" + +pass in on lo0 all label "$srcaddr" +pass in on lo0 from 0/0 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1 to any label "$srcaddr$srcaddr" +pass in on lo0 from 127.0.0.1 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 from 127.0.0.1/8 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1/16 to any label "$srcaddr$srcaddr" +pass in on lo0 from 127.0.0.1/31 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 inet6 from fe80::1 to any label "$srcaddr" +pass in on lo0 inet6 from fe80::1 to any label "$srcaddr$srcaddr" +pass in on lo0 inet6 from fe80::1 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 inet6 from lo0/8 to any label "$srcaddr" +pass in on lo0 inet6 from lo0/64 to any label "$srcaddr$srcaddr" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jul 15 19:24:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 288AFB7A42E; Sat, 15 Jul 2017 19:24:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF5D882015; Sat, 15 Jul 2017 19:24:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FJOsoq018612; Sat, 15 Jul 2017 19:24:54 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FJOsAM018607; Sat, 15 Jul 2017 19:24:54 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707151924.v6FJOsAM018607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 15 Jul 2017 19:24:54 +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: r321031 - in stable/10/sys/fs: nfs nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/10/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 321031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 19:24:56 -0000 Author: rmacklem Date: Sat Jul 15 19:24:54 2017 New Revision: 321031 URL: https://svnweb.freebsd.org/changeset/base/321031 Log: MFC: r320345 Add support to the NFSv4.1/pNFS client for commits through the DS. A NFSv4.1/pNFS server using File Layout can specify that Commit operations are to be done against the DS instead of MDS. Since no extant pNFS server did this, the code was untested and "#ifdef notyet". The FreeBSD pNFS server I am developing does specify that Commits be done through the DS, so the code has been enabled/tested. This patch should only affect the case of a pNFS server that specfies Commits through the DS. Relnotes: yes Modified: stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfsclient/nfs_clnode.c stable/10/sys/fs/nfsclient/nfs_clrpcops.c stable/10/sys/fs/nfsclient/nfs_clvnops.c stable/10/sys/fs/nfsclient/nfsnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Sat Jul 15 19:22:01 2017 (r321030) +++ stable/10/sys/fs/nfs/nfs_var.h Sat Jul 15 19:24:54 2017 (r321031) @@ -490,7 +490,7 @@ int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, NFSPROC_T *, void *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); -int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, +int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t, struct nfsclflayout **); Modified: stable/10/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clnode.c Sat Jul 15 19:22:01 2017 (r321030) +++ stable/10/sys/fs/nfsclient/nfs_clnode.c Sat Jul 15 19:24:54 2017 (r321031) @@ -261,10 +261,12 @@ ncl_inactive(struct vop_inactive_args *ap) /* * NMODIFIED means that there might be dirty/stale buffers - * associated with the NFS vnode. None of the other flags are - * meaningful after the vnode is unused. + * associated with the NFS vnode. + * NDSCOMMIT means that the file is on a pNFS server and commits + * should be done to the DS. + * None of the other flags are meaningful after the vnode is unused. */ - np->n_flag &= NMODIFIED; + np->n_flag &= (NMODIFIED | NDSCOMMIT); mtx_unlock(&np->n_mtx); return (0); } Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 15 19:22:01 2017 (r321030) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 15 19:24:54 2017 (r321031) @@ -114,7 +114,8 @@ static int nfsrpc_fillsa(struct nfsmount *, struct soc static void nfscl_initsessionslots(struct nfsclsession *); static int nfscl_doflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, - struct nfsclflayout *, uint64_t, uint64_t, struct ucred *, NFSPROC_T *); + struct nfsclflayout *, uint64_t, uint64_t, int, struct ucred *, + NFSPROC_T *); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, struct nfsclds *, uint64_t, int, struct nfsfh *, struct ucred *, NFSPROC_T *); @@ -123,10 +124,8 @@ static int nfsrpc_writeds(vnode_t, struct uio *, int * struct nfsfh *, int, struct ucred *, NFSPROC_T *); static enum nfsclds_state nfscl_getsameserver(struct nfsmount *, struct nfsclds *, struct nfsclds **); -#ifdef notyet static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, - struct nfsfh *, struct ucred *, NFSPROC_T *, void *); -#endif + struct nfsfh *, struct ucred *, NFSPROC_T *); /* * nfs null call from vfs. @@ -5531,7 +5530,7 @@ nfscl_initsessionslots(struct nfsclsession *sep) */ int nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, - uint32_t rwaccess, struct ucred *cred, NFSPROC_T *p) + uint32_t rwaccess, int docommit, struct ucred *cred, NFSPROC_T *p) { struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); @@ -5615,7 +5614,8 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode if (dip != NULL) { error = nfscl_doflayoutio(vp, uiop, iomode, must_commit, &eof, &stateid, rwaccess, dip, - layp, rflp, off, xfer, newcred, p); + layp, rflp, off, xfer, docommit, newcred, + p); nfscl_reldevinfo(dip); lastbyte = off + xfer - 1; if (error == 0) { @@ -5691,10 +5691,10 @@ static int nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, int *eofp, nfsv4stateid_t *stateidp, int rwflag, struct nfscldevinfo *dp, struct nfscllayout *lyp, struct nfsclflayout *flp, uint64_t off, - uint64_t len, struct ucred *cred, NFSPROC_T *p) + uint64_t len, int docommit, struct ucred *cred, NFSPROC_T *p) { uint64_t io_off, rel_off, stripe_unit_size, transfer, xfer; - int commit_thru_mds, error = 0, stripe_index, stripe_pos; + int commit_thru_mds, error, stripe_index, stripe_pos; struct nfsnode *np; struct nfsfh *fhp; struct nfsclds **dspp; @@ -5705,12 +5705,13 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i stripe_pos = (rel_off / stripe_unit_size + flp->nfsfl_stripe1) % dp->nfsdi_stripecnt; transfer = stripe_unit_size - (rel_off % stripe_unit_size); + error = 0; /* Loop around, doing I/O for each stripe unit. */ while (len > 0 && error == 0) { stripe_index = nfsfldi_stripeindex(dp, stripe_pos); dspp = nfsfldi_addr(dp, stripe_index); - if (len > transfer) + if (len > transfer && docommit == 0) xfer = transfer; else xfer = len; @@ -5734,11 +5735,33 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i fhp = np->n_fhp; io_off = off; } - if ((flp->nfsfl_util & NFSFLAYUTIL_COMMIT_THRU_MDS) != 0) + if ((flp->nfsfl_util & NFSFLAYUTIL_COMMIT_THRU_MDS) != 0) { commit_thru_mds = 1; - else + if (docommit != 0) + error = EIO; + } else { commit_thru_mds = 0; - if (rwflag == FREAD) + mtx_lock(&np->n_mtx); + np->n_flag |= NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + if (docommit != 0) { + if (error == 0) + error = nfsrpc_commitds(vp, io_off, xfer, + *dspp, fhp, cred, p); + if (error == 0) { + /* + * Set both eof and uio_resid = 0 to end any + * loops. + */ + *eofp = 1; + uiop->uio_resid = 0; + } else { + mtx_lock(&np->n_mtx); + np->n_flag &= ~NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + } else if (rwflag == FREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, io_off, xfer, fhp, cred, p); else { @@ -5974,13 +5997,12 @@ nfscl_getsameserver(struct nfsmount *nmp, struct nfscl return (NFSDSP_NOTFOUND); } -#ifdef notyet /* - * NFS commit rpc to a DS. + * NFS commit rpc to a NFSv4.1 DS. */ static int nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, - struct nfsfh *fhp, struct ucred *cred, NFSPROC_T *p, void *stuff) + struct nfsfh *fhp, struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; @@ -5988,6 +6010,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfssockreq *nrp; int error; + nd->nd_mrep = NULL; nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, fhp->nfh_len, NULL, &dsp->nfsclds_sess); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + NFSX_UNSIGNED); @@ -6000,7 +6023,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, nrp = &nmp->nm_sockreq; error = newnfs_request(nd, nmp, NULL, nrp, vp, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, &dsp->nfsclds_sess); - if (error) + if (error != 0) return (error); if (nd->nd_repstat == 0) { NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); @@ -6017,5 +6040,4 @@ nfsmout: mbuf_freem(nd->nd_mrep); return (error); } -#endif Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 15 19:22:01 2017 (r321030) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 15 19:24:54 2017 (r321031) @@ -1376,7 +1376,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct attrflag = 0; if (NFSHASPNFS(nmp)) error = nfscl_doiods(vp, uiop, NULL, NULL, - NFSV4OPEN_ACCESSREAD, cred, uiop->uio_td); + NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); if (error != 0) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, @@ -1407,7 +1407,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struc attrflag = 0; if (NFSHASPNFS(nmp)) error = nfscl_doiods(vp, uiop, iomode, must_commit, - NFSV4OPEN_ACCESSWRITE, cred, uiop->uio_td); + NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); if (error != 0) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, @@ -2562,16 +2562,34 @@ ncl_commit(struct vnode *vp, u_quad_t offset, int cnt, { struct nfsvattr nfsva; struct nfsmount *nmp = VFSTONFS(vp->v_mount); + struct nfsnode *np; + struct uio uio; int error, attrflag; - mtx_lock(&nmp->nm_mtx); - if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) { + np = VTONFS(vp); + error = EIO; + attrflag = 0; + if (NFSHASPNFS(nmp) && (np->n_flag & NDSCOMMIT) != 0) { + uio.uio_offset = offset; + uio.uio_resid = cnt; + error = nfscl_doiods(vp, &uio, NULL, NULL, + NFSV4OPEN_ACCESSWRITE, 1, cred, td); + if (error != 0) { + mtx_lock(&np->n_mtx); + np->n_flag &= ~NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + } + if (error != 0) { + mtx_lock(&nmp->nm_mtx); + if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) { + mtx_unlock(&nmp->nm_mtx); + return (0); + } mtx_unlock(&nmp->nm_mtx); - return (0); + error = nfsrpc_commit(vp, offset, cnt, cred, td, &nfsva, + &attrflag, NULL); } - mtx_unlock(&nmp->nm_mtx); - error = nfsrpc_commit(vp, offset, cnt, cred, td, &nfsva, - &attrflag, NULL); if (attrflag != 0) (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); Modified: stable/10/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/10/sys/fs/nfsclient/nfsnode.h Sat Jul 15 19:22:01 2017 (r321030) +++ stable/10/sys/fs/nfsclient/nfsnode.h Sat Jul 15 19:24:54 2017 (r321031) @@ -158,6 +158,7 @@ struct nfsnode { #define NNOLAYOUT 0x00020000 /* Can't get a layout for this file */ #define NWRITEOPENED 0x00040000 /* Has been opened for writing */ #define NHASBEENLOCKED 0x00080000 /* Has been file locked. */ +#define NDSCOMMIT 0x00100000 /* Commit is done via the DS. */ /* * Convert between nfsnode pointers and vnode pointers From owner-svn-src-all@freebsd.org Sat Jul 15 19:43:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE2C7B7AB12; Sat, 15 Jul 2017 19:43:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F503828BA; Sat, 15 Jul 2017 19:43:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FJh2mh026736; Sat, 15 Jul 2017 19:43:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FJh2nH026735; Sat, 15 Jul 2017 19:43:02 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707151943.v6FJh2nH026735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 15 Jul 2017 19:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321032 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 321032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 19:43:04 -0000 Author: rmacklem Date: Sat Jul 15 19:43:02 2017 New Revision: 321032 URL: https://svnweb.freebsd.org/changeset/base/321032 Log: MFC: r320458 Fix an NFSv3 client case that probably never happens. If an NFSv3 server were to reply with weak cache consistency attributes, but not post operation attributes, the client would use garbage attributes from memory. This was spotted during work on the code for the NFSv4.1 client. I have never seen evidence that this happens and it wouldn't make sense for an NFSv3 server to do this, so this patch is basically "theoretical", but does fix the problem if a server were to do the above. Modified: stable/11/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clport.c Sat Jul 15 19:24:54 2017 (r321031) +++ stable/11/sys/fs/nfsclient/nfs_clport.c Sat Jul 15 19:43:02 2017 (r321032) @@ -743,6 +743,8 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode } } error = nfscl_postop_attr(nd, nap, flagp, stuff); + if (wccflagp != NULL && *flagp == 0) + *wccflagp = 0; } else if ((nd->nd_flag & (ND_NOMOREDATA | ND_NFSV4 | ND_V4WCCATTR)) == (ND_NFSV4 | ND_V4WCCATTR)) { error = nfsv4_loadattr(nd, NULL, &nfsva, NULL, From owner-svn-src-all@freebsd.org Sat Jul 15 19:54:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDFB6B7AE35; Sat, 15 Jul 2017 19:54:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7FEFE82E70; Sat, 15 Jul 2017 19:54:04 +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 v6FJs3ct030822; Sat, 15 Jul 2017 19:54:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FJs36p030820; Sat, 15 Jul 2017 19:54:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707151954.v6FJs36p030820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 15 Jul 2017 19:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321034 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 19:54:04 -0000 Author: tuexen Date: Sat Jul 15 19:54:03 2017 New Revision: 321034 URL: https://svnweb.freebsd.org/changeset/base/321034 Log: Fix the handling of Explicit EOR mode. While there, appropriately handle the overhead depending on the usage of DATA or I-DATA chunks. Take the overhead only into account, when required. Joint work with rrs@ MFC after: 1 week Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Jul 15 19:52:59 2017 (r321033) +++ head/sys/netinet/sctp_output.c Sat Jul 15 19:54:03 2017 (r321034) @@ -6250,11 +6250,7 @@ sctp_get_frag_point(struct sctp_tcb *stcb, } else { ovh = SCTP_MIN_V4_OVERHEAD; } - if (stcb->asoc.idata_supported) { - ovh += sizeof(struct sctp_idata_chunk); - } else { - ovh += sizeof(struct sctp_data_chunk); - } + ovh += SCTP_DATA_CHUNK_OVERHEAD(stcb); if (stcb->asoc.sctp_frag_point > asoc->smallest_mtu) siz = asoc->smallest_mtu - ovh; else @@ -6759,7 +6755,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s } } un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + (stcb->asoc.stream_queue_cnt * SCTP_DATA_CHUNK_OVERHEAD(stcb))); if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && @@ -7459,11 +7455,7 @@ dont_do_it: } else { atomic_subtract_int(&sp->length, to_move); } - if (stcb->asoc.idata_supported == 0) { - leading = sizeof(struct sctp_data_chunk); - } else { - leading = sizeof(struct sctp_idata_chunk); - } + leading = SCTP_DATA_CHUNK_OVERHEAD(stcb); if (M_LEADINGSPACE(chk->data) < leading) { /* Not enough room for a chunk header, get some */ struct mbuf *m; @@ -7505,11 +7497,7 @@ dont_do_it: M_ALIGN(chk->data, 4); } } - if (stcb->asoc.idata_supported == 0) { - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_NOWAIT); - } else { - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_idata_chunk), M_NOWAIT); - } + SCTP_BUF_PREPEND(chk->data, SCTP_DATA_CHUNK_OVERHEAD(stcb), M_NOWAIT); if (chk->data == NULL) { /* HELP, TSNH since we assured it would not above? */ #ifdef INVARIANTS @@ -7522,13 +7510,8 @@ dont_do_it: to_move = 0; goto out_of; } - if (stcb->asoc.idata_supported == 0) { - sctp_snd_sb_alloc(stcb, sizeof(struct sctp_data_chunk)); - chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_data_chunk)); - } else { - sctp_snd_sb_alloc(stcb, sizeof(struct sctp_idata_chunk)); - chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_idata_chunk)); - } + sctp_snd_sb_alloc(stcb, SCTP_DATA_CHUNK_OVERHEAD(stcb)); + chk->book_size = chk->send_size = (uint16_t)(to_move + SCTP_DATA_CHUNK_OVERHEAD(stcb)); chk->book_size_scale = 0; chk->sent = SCTP_DATAGRAM_UNSENT; @@ -7728,11 +7711,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, break; } /* Need an allowance for the data chunk header too */ - if (stcb->asoc.idata_supported == 0) { - space_left -= sizeof(struct sctp_data_chunk); - } else { - space_left -= sizeof(struct sctp_idata_chunk); - } + space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); /* must make even word boundary */ space_left &= 0xfffffffc; @@ -7749,18 +7728,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); total_moved += moved; space_left -= moved; - if (stcb->asoc.idata_supported == 0) { - if (space_left >= sizeof(struct sctp_data_chunk)) { - space_left -= sizeof(struct sctp_data_chunk); - } else { - space_left = 0; - } + if (space_left >= SCTP_DATA_CHUNK_OVERHEAD(stcb)) { + space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); } else { - if (space_left >= sizeof(struct sctp_idata_chunk)) { - space_left -= sizeof(struct sctp_idata_chunk); - } else { - space_left = 0; - } + space_left = 0; } space_left &= 0xfffffffc; } @@ -10209,8 +10180,7 @@ do_it_again: * and we have data in flight we stop, except if we * are handling a fragmented user message. */ - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD)) && (stcb->asoc.total_flight > 0)) { /* && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) {*/ @@ -12448,7 +12418,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->sender_all_done = 0; sp->some_taken = 0; sp->put_last_out = 0; - resv_in_first = sizeof(struct sctp_data_chunk); + resv_in_first = SCTP_DATA_CHUNK_OVERHEAD(stcb); sp->data = sp->tail_mbuf = NULL; if (sp->length == 0) { *error = 0; @@ -12865,12 +12835,19 @@ sctp_lower_sosend(struct socket *so, } /* would we block? */ if (non_blocking) { + uint32_t amount; + if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); - if ((SCTP_SB_LIMIT_SND(so) < (sndlen + inqueue_bytes + stcb->asoc.sb_send_resv)) || + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (user_marks_eor == 0) { + amount = sndlen; + } else { + amount = 1; + } + if ((SCTP_SB_LIMIT_SND(so) < (amount + inqueue_bytes + stcb->asoc.sb_send_resv)) || (stcb->asoc.chunks_on_out_queue >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EWOULDBLOCK); if (sndlen > SCTP_SB_LIMIT_SND(so)) @@ -13036,7 +13013,7 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } /* Calculate the maximum we can send */ - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { if (non_blocking) { /* we already checked for non-blocking above. */ @@ -13093,7 +13070,7 @@ sctp_lower_sosend(struct socket *so, ((stcb->asoc.chunks_on_out_queue + stcb->asoc.stream_queue_cnt) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { /* No room right now ! */ SOCKBUF_LOCK(&so->so_snd); - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); while ((SCTP_SB_LIMIT_SND(so) < (inqueue_bytes + local_add_more)) || ((stcb->asoc.stream_queue_cnt + stcb->asoc.chunks_on_out_queue) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u <(inq:%d + %d) || (%d+%d > %d)\n", @@ -13129,7 +13106,7 @@ sctp_lower_sosend(struct socket *so, SOCKBUF_UNLOCK(&so->so_snd); goto out_unlocked; } - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); } if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; @@ -13222,8 +13199,9 @@ skip_preblock: /* How much room do we have? */ struct mbuf *new_tail, *mm; - if (SCTP_SB_LIMIT_SND(so) > stcb->asoc.total_output_queue_size) - max_len = SCTP_SB_LIMIT_SND(so) - stcb->asoc.total_output_queue_size; + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) + max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; else max_len = 0; @@ -13299,8 +13277,8 @@ skip_preblock: hold_tcblock = 1; } sctp_prune_prsctp(stcb, asoc, srcv, sndlen); - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); - if (SCTP_SB_LIMIT_SND(so) > stcb->asoc.total_output_queue_size) + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; else max_len = 0; @@ -13341,8 +13319,7 @@ skip_preblock: } asoc->ifp_had_enobuf = 0; } - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) && @@ -13416,7 +13393,8 @@ skip_preblock: * size we KNOW we will get to sleep safely with the * wakeup flag in place. */ - if (SCTP_SB_LIMIT_SND(so) <= (stcb->asoc.total_output_queue_size + + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) <= (inqueue_bytes + min(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTP_SB_LIMIT_SND(so)))) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_INTO_BLK, @@ -13613,8 +13591,7 @@ skip_out_eof: } asoc->ifp_had_enobuf = 0; } - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) && Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Jul 15 19:52:59 2017 (r321033) +++ head/sys/netinet/sctp_output.h Sat Jul 15 19:54:03 2017 (r321034) @@ -135,6 +135,11 @@ void sctp_fix_ecn_echo(struct sctp_association *); void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); + +#define SCTP_DATA_CHUNK_OVERHEAD(stcb) ((stcb)->asoc.idata_supported ? \ + sizeof(struct sctp_idata_chunk) : \ + sizeof(struct sctp_data_chunk)) + int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); From owner-svn-src-all@freebsd.org Sat Jul 15 20:53:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60409B7BD1C; Sat, 15 Jul 2017 20:53:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9C58475C; Sat, 15 Jul 2017 20:53:09 +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 v6FKr8I4055466; Sat, 15 Jul 2017 20:53:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FKr8CJ055464; Sat, 15 Jul 2017 20:53:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707152053.v6FKr8CJ055464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 15 Jul 2017 20:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321035 - in head: sbin/savecore sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/savecore sys/kern X-SVN-Commit-Revision: 321035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 20:53:09 -0000 Author: markj Date: Sat Jul 15 20:53:08 2017 New Revision: 321035 URL: https://svnweb.freebsd.org/changeset/base/321035 Log: Revert r320918 and have mkdumpheader() handle version string truncation. Reported by: jhb MFC after: 1 week Modified: head/sbin/savecore/savecore.c head/sys/kern/kern_shutdown.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sat Jul 15 19:54:03 2017 (r321034) +++ head/sbin/savecore/savecore.c Sat Jul 15 20:53:08 2017 (r321035) @@ -119,7 +119,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); - xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}\n", h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Jul 15 19:54:03 2017 (r321034) +++ head/sys/kern/kern_shutdown.c Sat Jul 15 20:53:08 2017 (r321035) @@ -1229,6 +1229,7 @@ void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, uint64_t dumplen, uint32_t dumpkeysize, uint32_t blksz) { + size_t dstsize; bzero(kdh, sizeof(*kdh)); strlcpy(kdh->magic, magic, sizeof(kdh->magic)); @@ -1240,7 +1241,9 @@ mkdumpheader(struct kerneldumpheader *kdh, char *magic kdh->dumpkeysize = htod32(dumpkeysize); kdh->blocksize = htod32(blksz); strlcpy(kdh->hostname, prison0.pr_hostname, sizeof(kdh->hostname)); - strlcpy(kdh->versionstring, version, sizeof(kdh->versionstring)); + dstsize = sizeof(kdh->versionstring); + if (strlcpy(kdh->versionstring, version, dstsize) >= dstsize) + kdh->versionstring[dstsize - 2] = '\n'; if (panicstr != NULL) strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->parity = kerneldump_parity(kdh); From owner-svn-src-all@freebsd.org Sat Jul 15 21:19:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6110B7C0ED; Sat, 15 Jul 2017 21:19:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A56284F48; Sat, 15 Jul 2017 21:19:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6FLJTw5064278; Sat, 15 Jul 2017 21:19:29 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6FLJSNX064263; Sat, 15 Jul 2017 21:19:28 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201707152119.v6FLJSNX064263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Jul 2017 21:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321036 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Commit-Revision: 321036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 21:19:30 -0000 Author: sjg Date: Sat Jul 15 21:19:27 2017 New Revision: 321036 URL: https://svnweb.freebsd.org/changeset/base/321036 Log: Import bmake-20170711 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/buf.h head/contrib/bmake/dir.h head/contrib/bmake/hash.h head/contrib/bmake/main.c head/contrib/bmake/make.1 head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta.sys.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/own.mk head/contrib/bmake/sprite.h head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/ChangeLog Sat Jul 15 21:19:27 2017 (r321036) @@ -1,3 +1,16 @@ +2017-07-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170711 + forgot to update after merge on 20170708 ;-) + o main.c: refactor to reduce size of main function. + add -v option to always fully expand values. + o meta.c: ensure command output in meta file has ending newline + even when filemon not being used. + When matching ${.MAKE.META.IGNORE_PATTERNS} do not use + pathname via ':L' since any ':' in pathname breaks that. + Instead set a '${.p.}' to pathname in the target context and + use that. + 2017-05-10 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170510 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/Makefile Sat Jul 15 21:19:27 2017 (r321036) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.92 2017/05/10 22:29:04 sjg Exp $ +# $Id: Makefile,v 1.94 2017/07/15 18:22:14 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170510 +_MAKE_VERSION= 20170711 PROG= bmake Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/bmake.1 Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 1, 2017 +.Dd June 22, 2017 .Dt BMAKE 1 .Os .Sh NAME @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -691,9 +713,9 @@ in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -776,6 +798,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -1287,7 +1313,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1751,7 +1777,7 @@ may be any one of the following: .Bl -tag -width "Cm XX" .It Cm \&|\&| Logical OR. -.It Cm \&\*[Am]\*[Am] +.It Cm \&&& Logical .Tn AND ; of higher precedence than @@ -1768,7 +1794,7 @@ The boolean operator may be used to logically negate an entire conditional. It is of higher precedence than -.Ql Ic \&\*[Am]\*[Am] . +.Ql Ic \&&& . .Pp The value of .Ar expression Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/bmake.cat1 Sat Jul 15 21:19:27 2017 (r321036) @@ -6,8 +6,8 @@ NNAAMMEE SSYYNNOOPPSSIISS bbmmaakkee [--BBeeiikkNNnnqqrrssttWWwwXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s] [--ff _m_a_k_e_f_i_l_e] [--II _d_i_r_e_c_t_o_r_y] [--JJ _p_r_i_v_a_t_e] [--jj _m_a_x___j_o_b_s] - [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [_v_a_r_i_a_b_l_e_=_v_a_l_u_e] - [_t_a_r_g_e_t _._._.] + [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [--vv _v_a_r_i_a_b_l_e] + [_v_a_r_i_a_b_l_e_=_v_a_l_u_e] [_t_a_r_g_e_t _._._.] DDEESSCCRRIIPPTTIIOONN bbmmaakkee is a program designed to simplify the maintenance of other pro- @@ -118,7 +118,9 @@ DDEESSCCRRIIPPTTIIOONN _t Print debugging information about target list mainte- nance. - _V Force the --VV option to print raw values of variables. + _V Force the --VV option to print raw values of variables, + overriding the default behavior set via + _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S. _v Print debugging information about variable assignment. @@ -209,13 +211,26 @@ DDEESSCCRRIIPPTTIIOONN to-date. --VV _v_a_r_i_a_b_l_e - Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global con- - text. Do not build any targets. Multiple instances of this - option may be specified; the variables will be printed one per - line, with a blank line for each null or undefined variable. If - _v_a_r_i_a_b_l_e contains a `$' then the value will be expanded before - printing. + Print the value of _v_a_r_i_a_b_l_e. Do not build any targets. Multiple + instances of this option may be specified; the variables will be + printed one per line, with a blank line for each null or unde- + fined variable. The value printed is extracted from the global + context after all makefiles have been read. By default, the raw + variable contents (which may include additional unexpanded vari- + able references) are shown. If _v_a_r_i_a_b_l_e contains a `$' then the + value will be recursively expanded to its complete resultant text + before printing. The expanded value will also be printed if + _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S is set to true and the --ddVV option has not + been used to override it. Note that loop-local and target-local + variables, as well as values taken temporarily by global vari- + ables during makefile processing, are not accessible via this + option. The --ddvv debug mode can be used to see these at the cost + of generating substantial extraneous output. + --vv _v_a_r_i_a_b_l_e + Like --VV but the variable is always expanded to its complete + value. + --WW Treat any warnings during makefile parsing as errors. --ww Print entering and leaving directory messages, pre and post pro- @@ -488,7 +503,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S A boolean that controls the default behavior of the --VV - option. + option. If true, variable values printed with --VV are + fully expanded; if false, the raw variable contents + (which may include additional unexpanded variable refer- + ences) are shown. _._M_A_K_E_._E_X_P_O_R_T_E_D The list of variables exported by bbmmaakkee. @@ -1523,4 +1541,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 7.1_RC1 February 1, 2017 NetBSD 7.1_RC1 +NetBSD 7.1_RC1 June 22, 2017 NetBSD 7.1_RC1 Modified: head/contrib/bmake/buf.h ============================================================================== --- head/contrib/bmake/buf.h Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/buf.h Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.17 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.h,v 1.19 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * Header for users of the buf library. */ -#ifndef _BUF_H -#define _BUF_H +#ifndef MAKE_BUF_H +#define MAKE_BUF_H typedef char Byte; @@ -116,4 +116,4 @@ void Buf_Init(Buffer *, int); Byte *Buf_Destroy(Buffer *, Boolean); Byte *Buf_DestroyCompact(Buffer *); -#endif /* _BUF_H */ +#endif /* MAKE_BUF_H */ Modified: head/contrib/bmake/dir.h ============================================================================== --- head/contrib/bmake/dir.h Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/dir.h Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.15 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: dir.h,v 1.18 2017/05/31 22:02:06 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,8 +75,8 @@ /* dir.h -- */ -#ifndef _DIR -#define _DIR +#ifndef MAKE_DIR_H +#define MAKE_DIR_H typedef struct Path { char *name; /* Name of directory */ @@ -105,4 +105,4 @@ void Dir_PrintPath(Lst); void Dir_Destroy(void *); void * Dir_CopyDir(void *); -#endif /* _DIR */ +#endif /* MAKE_DIR_H */ Modified: head/contrib/bmake/hash.h ============================================================================== --- head/contrib/bmake/hash.h Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/hash.h Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: hash.h,v 1.12 2017/05/31 21:07:03 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -78,8 +78,8 @@ * which maintains hash tables. */ -#ifndef _HASH -#define _HASH +#ifndef _HASH_H +#define _HASH_H /* * The following defines one entry in the hash table. @@ -146,4 +146,4 @@ void Hash_DeleteEntry(Hash_Table *, Hash_Entry *); Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); Hash_Entry *Hash_EnumNext(Hash_Search *); -#endif /* _HASH */ +#endif /* _HASH_H */ Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/main.c Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $ */ +/* $NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.272 2017/06/19 19:58:24 christos Exp $"); #endif #endif /* not lint */ #endif @@ -159,7 +159,9 @@ Boolean deleteOnError; /* .DELETE_ON_ERROR: set */ static Boolean noBuiltins; /* -r flag */ static Lst makefiles; /* ordered list of makefiles to read */ -static Boolean printVars; /* print value of one or more vars */ +static int printVars; /* -[vV] argument */ +#define COMPAT_VARS 1 +#define EXPAND_VARS 2 static Lst variables; /* list of variables to print */ int maxJobs; /* -j argument */ static int maxJobTokens; /* -j argument */ @@ -421,7 +423,7 @@ MainParseArgs(int argc, char **argv) Boolean inOption, dashDash = FALSE; char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */ -#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstw" +#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w" /* Can't actually use getopt(3) because rescanning is not portable */ getopt_def = OPTFLAGS; @@ -546,8 +548,9 @@ rearg: Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); break; case 'V': + case 'v': if (argvalue == NULL) goto noarg; - printVars = TRUE; + printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS; (void)Lst_AtEnd(variables, argvalue); Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); @@ -877,6 +880,89 @@ MakeMode(const char *mode) free(mp); } +static void +doPrintVars(void) +{ + LstNode ln; + Boolean expandVars; + + if (printVars == EXPAND_VARS) + expandVars = TRUE; + else if (debugVflag) + expandVars = FALSE; + else + expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); + + for (ln = Lst_First(variables); ln != NULL; + ln = Lst_Succ(ln)) { + char *var = (char *)Lst_Datum(ln); + char *value; + char *p1; + + if (strchr(var, '$')) { + value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, + VARF_WANTRES); + } else if (expandVars) { + char tmp[128]; + int len = snprintf(tmp, sizeof(tmp), "${%s}", var); + + if (len >= (int)sizeof(tmp)) + Fatal("%s: variable name too big: %s", + progname, var); + value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, + VARF_WANTRES); + } else { + value = Var_Value(var, VAR_GLOBAL, &p1); + } + printf("%s\n", value ? value : ""); + free(p1); + } +} + +static Boolean +runTargets(void) +{ + Lst targs; /* target nodes to create -- passed to Make_Init */ + Boolean outOfDate; /* FALSE if all targets up to date */ + + /* + * Have now read the entire graph and need to make a list of + * targets to create. If none was given on the command line, + * we consult the parsing module to find the main target(s) + * to create. + */ + if (Lst_IsEmpty(create)) + targs = Parse_MainName(); + else + targs = Targ_FindList(create, TARG_CREATE); + + if (!compatMake) { + /* + * Initialize job module before traversing the graph + * now that any .BEGIN and .END targets have been read. + * This is done only if the -q flag wasn't given + * (to prevent the .BEGIN from being executed should + * it exist). + */ + if (!queryFlag) { + Job_Init(); + jobsRunning = TRUE; + } + + /* Traverse the graph, checking on all the targets */ + outOfDate = Make_Run(targs); + } else { + /* + * Compat_Init will take care of creating all the + * targets as well as initializing the module. + */ + Compat_Run(targs); + outOfDate = FALSE; + } + Lst_Destroy(targs, NULL); + return outOfDate; +} + /*- * main -- * The main function, for obvious reasons. Initializes variables @@ -897,8 +983,7 @@ MakeMode(const char *mode) int main(int argc, char **argv) { - Lst targs; /* target nodes to create -- passed to Make_Init */ - Boolean outOfDate = FALSE; /* FALSE if all targets up to date */ + Boolean outOfDate; /* FALSE if all targets up to date */ struct stat sb, sa; char *p1, *path; char mdpath[MAXPATHLEN]; @@ -1027,7 +1112,7 @@ main(int argc, char **argv) create = Lst_Init(FALSE); makefiles = Lst_Init(FALSE); - printVars = FALSE; + printVars = 0; debugVflag = FALSE; variables = Lst_Init(FALSE); beSilent = FALSE; /* Print commands as executed */ @@ -1406,73 +1491,13 @@ main(int argc, char **argv) /* print the values of any variables requested by the user */ if (printVars) { - LstNode ln; - Boolean expandVars; - - if (debugVflag) - expandVars = FALSE; - else - expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); - for (ln = Lst_First(variables); ln != NULL; - ln = Lst_Succ(ln)) { - char *var = (char *)Lst_Datum(ln); - char *value; - - if (strchr(var, '$')) { - value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, - VARF_WANTRES); - } else if (expandVars) { - char tmp[128]; - - if (snprintf(tmp, sizeof(tmp), "${%s}", var) >= (int)(sizeof(tmp))) - Fatal("%s: variable name too big: %s", - progname, var); - value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, - VARF_WANTRES); - } else { - value = Var_Value(var, VAR_GLOBAL, &p1); - } - printf("%s\n", value ? value : ""); - free(p1); - } + doPrintVars(); + outOfDate = FALSE; } else { - /* - * Have now read the entire graph and need to make a list of - * targets to create. If none was given on the command line, - * we consult the parsing module to find the main target(s) - * to create. - */ - if (Lst_IsEmpty(create)) - targs = Parse_MainName(); - else - targs = Targ_FindList(create, TARG_CREATE); - - if (!compatMake) { - /* - * Initialize job module before traversing the graph - * now that any .BEGIN and .END targets have been read. - * This is done only if the -q flag wasn't given - * (to prevent the .BEGIN from being executed should - * it exist). - */ - if (!queryFlag) { - Job_Init(); - jobsRunning = TRUE; - } - - /* Traverse the graph, checking on all the targets */ - outOfDate = Make_Run(targs); - } else { - /* - * Compat_Init will take care of creating all the - * targets as well as initializing the module. - */ - Compat_Run(targs); - } + outOfDate = runTargets(); } #ifdef CLEANUP - Lst_Destroy(targs, NULL); Lst_Destroy(variables, NULL); Lst_Destroy(makefiles, NULL); Lst_Destroy(create, (FreeProc *)free); @@ -1931,7 +1956,8 @@ usage(void) "usage: %s [-BeikNnqrstWwX] \n\ [-C directory] [-D variable] [-d flags] [-f makefile]\n\ [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n\ - [-V variable] [variable=value] [target ...]\n", progname); + [-V variable] [-v variable] [variable=value] [target ...]\n", + progname); exit(2); } Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/make.1 Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 1, 2017 +.Dd June 22, 2017 .Dt MAKE 1 .Os .Sh NAME @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -691,9 +713,9 @@ in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -787,6 +809,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -1298,7 +1324,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1762,7 +1788,7 @@ may be any one of the following: .Bl -tag -width "Cm XX" .It Cm \&|\&| Logical OR. -.It Cm \&\*[Am]\*[Am] +.It Cm \&&& Logical .Tn AND ; of higher precedence than @@ -1779,7 +1805,7 @@ The boolean operator may be used to logically negate an entire conditional. It is of higher precedence than -.Ql Ic \&\*[Am]\*[Am] . +.Ql Ic \&&& . .Pp The value of .Ar expression Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/meta.c Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.67 2016/08/17 15:52:42 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.68 2017/07/09 04:54:00 sjg Exp $ */ /* * Implement 'meta' mode. @@ -727,7 +727,7 @@ meta_job_error(Job *job, GNode *gn, int flags, int sta pbm = &Mybm; } if (pbm->mfp != NULL) { - fprintf(pbm->mfp, "*** Error code %d%s\n", + fprintf(pbm->mfp, "\n*** Error code %d%s\n", status, (flags & JOB_IGNERR) ? "(ignored)" : ""); @@ -782,13 +782,13 @@ int meta_cmd_finish(void *pbmp) { int error = 0; -#ifdef USE_FILEMON BuildMon *pbm = pbmp; int x; if (!pbm) pbm = &Mybm; +#ifdef USE_FILEMON if (pbm->filemon_fd >= 0) { if (close(pbm->filemon_fd) < 0) error = errno; @@ -796,8 +796,9 @@ meta_cmd_finish(void *pbmp) if (error == 0 && x != 0) error = x; pbm->filemon_fd = pbm->mon_fd = -1; - } + } else #endif + fprintf(pbm->mfp, "\n"); /* ensure end with newline */ return error; } @@ -861,6 +862,8 @@ fgetLine(char **bufp, size_t *szp, int o, FILE *fp) newsz = ROUNDUP((fs.st_size / 2), BUFSIZ); if (newsz <= bufsz) newsz = ROUNDUP(fs.st_size, BUFSIZ); + if (newsz <= bufsz) + return x; /* truncated */ if (DEBUG(META)) fprintf(debug_file, "growing buffer %u -> %u\n", (unsigned)bufsz, (unsigned)newsz); @@ -948,10 +951,10 @@ meta_ignore(GNode *gn, const char *p) if (metaIgnorePatterns) { char *pm; - snprintf(fname, sizeof(fname), - "${%s:@m@${%s:L:M$m}@}", - MAKE_META_IGNORE_PATTERNS, p); - pm = Var_Subst(NULL, fname, gn, VARF_WANTRES); + Var_Set(".p.", p, gn, 0); + pm = Var_Subst(NULL, + "${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}", + gn, VARF_WANTRES); if (*pm) { #ifdef DEBUG_META_MODE if (DEBUG(META)) Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/mk/ChangeLog Sat Jul 15 21:19:27 2017 (r321036) @@ -1,3 +1,22 @@ +2017-06-30 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170630 + + * meta.stage.mk: avoid triggering stage_* targets with nothing to do. + +2017-05-23 Simon J. Gerraty + + * meta2deps.py: take special care of '..' + +2017-05-15 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170515 + + * dirdeps.mk (DEP_EXPORT_VARS): on rare occasions it is + useful/necessary for a Makefile.depend file to export some knobs. + This is complicated when we are doing DIRDEPS_CACHE, so we will + handle export of any variables listed in DEP_EXPORT_VARS. + 2017-05-08 Simon J. Gerraty * install-mk (MK_VERSION): 20170505 Modified: head/contrib/bmake/mk/dirdeps.mk ============================================================================== --- head/contrib/bmake/mk/dirdeps.mk Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/mk/dirdeps.mk Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.88 2017/04/24 20:34:59 sjg Exp $ +# $Id: dirdeps.mk,v 1.89 2017/05/17 17:41:47 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -636,6 +636,11 @@ _build_all_dirs := ${_build_all_dirs:O:u} x!= { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ echo 'dirdeps: ${_build_all_dirs:${M_oneperline}}'; echo; } >&3; echo x!= { ${_build_all_dirs:@x@${target($x):?:echo '$x: _DIRDEP_USE';}@} echo; } >&3; echo +.if !empty(DEP_EXPORT_VARS) +# Discouraged, but there are always exceptions. +# Handle it here rather than explain how. +x!= { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3; echo +.endif .else # this makes it all happen dirdeps: ${_build_all_dirs} @@ -644,6 +649,11 @@ ${_build_all_dirs}: _DIRDEP_USE .if ${_debug_reldir} .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs} +.endif + +.if !empty(DEP_EXPORT_VARS) +.export ${DEP_EXPORT_VARS} +DEP_EXPORT_VARS= .endif # this builds the dependency graph Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/mk/install-mk Sat Jul 15 21:19:27 2017 (r321036) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.145 2017/05/09 04:05:32 sjg Exp $ +# $Id: install-mk,v 1.148 2017/06/30 23:46:15 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170505 +MK_VERSION=20170630 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/lib.mk ============================================================================== --- head/contrib/bmake/mk/lib.mk Sat Jul 15 20:53:08 2017 (r321035) +++ head/contrib/bmake/mk/lib.mk Sat Jul 15 21:19:27 2017 (r321036) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.61 2017/05/06 17:30:09 sjg Exp $ +# $Id: lib.mk,v 1.62 2017/06/11 03:24:04 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -268,8 +268,7 @@ ${CXX_SUFFIXES:%=%.o}: ${COMPILE.cc} ${.IMPSRC} .S.o .s.o: - @echo ${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} - @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} + ${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} .if (${LD_X} == "") .c.po: @@ -282,21 +281,18 @@ ${CXX_SUFFIXES:%=%.po}: ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} .else .c.po: - @echo ${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET}.o + ${COMPILE.c} ${CC_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET}.o @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o ${CXX_SUFFIXES:%=%.po}: - @echo ${COMPILE.cc} ${CXX_PG} ${PROFFLAGS} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.cc} ${CXX_PG} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.cc} ${CXX_PG} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S${PICO} .s${PICO}: - @echo ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .endif @@ -312,21 +308,18 @@ ${CXX_SUFFIXES:%=%${PICO}}: .else .c${PICO}: - @echo ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o ${CXX_SUFFIXES:%=%${PICO}}: - @echo ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.po .s.po: - @echo ${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} - @${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o - @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} + ${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o + ${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .endif @@ -418,7 +411,7 @@ lib${LIB}.${LD_so}:: lib${LIB}.a .else # MK_LIBTOOL=yes lib${LIB}.a:: ${OBJS} - @echo building standard ${LIB} library + @${META_NOECHO} building standard ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_objs} ${RANLIB} ${.TARGET} @@ -426,7 +419,7 @@ lib${LIB}.a:: ${OBJS} POBJS+= ${OBJS:.o=.po} .NOPATH: ${POBJS} lib${LIB}_p.a:: ${POBJS} - @echo building profiled ${LIB} library + @${META_NOECHO} building profiled ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_pobjs} ${RANLIB} ${.TARGET} @@ -434,7 +427,7 @@ lib${LIB}_p.a:: ${POBJS} SOBJS+= ${OBJS:.o=${PICO}} .NOPATH: ${SOBJS} lib${LIB}_pic.a:: ${SOBJS} - @echo building shared object ${LIB} library + @${META_NOECHO} building shared object ${LIB} library @rm -f ${.TARGET} @${AR} ${AR_cq} ${.TARGET} ${LD_sobjs} ${RANLIB} ${.TARGET} @@ -444,7 +437,7 @@ lib${LIB}_pic.a:: ${SOBJS} # bound to be non-portable... # this is known to work for NetBSD 1.6 and FreeBSD 4.2 lib${LIB}.${LD_so}: ${SOLIB} ${DPADD} - @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) + @${META_NOECHO} building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) @rm -f ${.TARGET} .if ${TARGET_OSNAME} == "NetBSD" || ${TARGET_OSNAME} == "FreeBSD" .if ${OBJECT_FMT} == "ELF" @@ -468,7 +461,7 @@ LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} .NOPATH: ${LOBJS} LLIBS?= -lc llib-l${LIB}.ln: ${LOBJS} - @echo building llib-l${LIB}.ln + @${META_NOECHO} building llib-l${LIB}.ln @rm -f llib-l${LIB}.ln @${LINT} -C${LIB} ${LOBJS} ${LLIBS} @@ -508,10 +501,8 @@ LIB_INSTALL_OWN ?= -o ${LIBOWN} -g ${LIBGRP} .include *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***