From owner-svn-src-all@freebsd.org Sun Jul 16 00:25: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 B790FB7EEAF; Sun, 16 Jul 2017 00:25: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 844B563E53; Sun, 16 Jul 2017 00:25:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6G0P0wO043126; Sun, 16 Jul 2017 00:25:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6G0P0Uf043125; Sun, 16 Jul 2017 00:25:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707160025.v6G0P0Uf043125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Jul 2017 00:25: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: r321039 - stable/11/sys/arm/include X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/arm/include X-SVN-Commit-Revision: 321039 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 00:25:01 -0000 Author: markj Date: Sun Jul 16 00:25:00 2017 New Revision: 321039 URL: https://svnweb.freebsd.org/changeset/base/321039 Log: MFC r311204: Add some missing atomic_*_ptr #defines for arm. Modified: stable/11/sys/arm/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/atomic.h ============================================================================== --- stable/11/sys/arm/include/atomic.h Sat Jul 15 21:43:40 2017 (r321038) +++ stable/11/sys/arm/include/atomic.h Sun Jul 16 00:25:00 2017 (r321039) @@ -78,15 +78,22 @@ atomic_store_long(volatile u_long *dst, u_long src) } #define atomic_clear_ptr atomic_clear_32 +#define atomic_clear_acq_ptr atomic_clear_acq_32 +#define atomic_clear_rel_ptr atomic_clear_rel_32 #define atomic_set_ptr atomic_set_32 +#define atomic_set_acq_ptr atomic_set_acq_32 +#define atomic_set_rel_ptr atomic_set_rel_32 #define atomic_fcmpset_ptr atomic_fcmpset_32 #define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_32 #define atomic_fcmpset_acq_ptr atomic_fcmpset_acq_32 #define atomic_cmpset_ptr atomic_cmpset_32 -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 #define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 +#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 +#define atomic_load_acq_ptr atomic_load_acq_32 #define atomic_store_ptr atomic_store_32 #define atomic_store_rel_ptr atomic_store_rel_32 +#define atomic_swap_ptr atomic_swap_32 +#define atomic_readandclear_ptr atomic_readandclear_32 #define atomic_add_int atomic_add_32 #define atomic_add_acq_int atomic_add_acq_32 From owner-svn-src-all@freebsd.org Sun Jul 16 07:11: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 F0390BF810C; Sun, 16 Jul 2017 07:11: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 B606A6FC96; Sun, 16 Jul 2017 07:11:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6G7BTGj010301; Sun, 16 Jul 2017 07:11:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6G7BTa4010300; Sun, 16 Jul 2017 07:11:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707160711.v6G7BTa4010300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Jul 2017 07:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321040 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 321040 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 07:11:31 -0000 Author: kib Date: Sun Jul 16 07:11:29 2017 New Revision: 321040 URL: https://svnweb.freebsd.org/changeset/base/321040 Log: A followup to r320453, correct removal of the blocks from UFS snapshots. Tested by: pho PR: 220693 Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jul 16 00:25:00 2017 (r321039) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jul 16 07:11:29 2017 (r321040) @@ -2603,7 +2603,8 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) *bpp = NULL; *cgpp = NULL; - error = bread(devvp, fsbtodb(fs, cgtod(fs, cg)), + error = bread(devvp, devvp->v_type == VREG ? + fragstoblks(fs, cgtod(fs, cg)) : fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Sun Jul 16 07:12: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 61168BF8177; Sun, 16 Jul 2017 07:12:05 +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 2EE866FE3A; Sun, 16 Jul 2017 07:12:05 +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 v6G7C4RA010384; Sun, 16 Jul 2017 07:12:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6G7C46n010383; Sun, 16 Jul 2017 07:12:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707160712.v6G7C46n010383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Jul 2017 07:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321041 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 321041 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 07:12:05 -0000 Author: kib Date: Sun Jul 16 07:12:04 2017 New Revision: 321041 URL: https://svnweb.freebsd.org/changeset/base/321041 Log: Remove write-only variable. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jul 16 07:11:29 2017 (r321040) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jul 16 07:12:04 2017 (r321041) @@ -2130,7 +2130,6 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) struct cg *cgp; struct buf *bp; ufs1_daddr_t fragno, cgbno; - ufs2_daddr_t cgblkno; int i, blk, frags, bbase, error; u_int cg; u_int8_t *blksfree; @@ -2141,11 +2140,9 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) /* devvp is a snapshot */ MPASS(devvp->v_mount->mnt_data == ump); dev = ump->um_devvp->v_rdev; - cgblkno = fragstoblks(fs, cgtod(fs, cg)); } else if (devvp->v_type == VCHR) { /* devvp is a normal disk device */ dev = devvp->v_rdev; - cgblkno = fsbtodb(fs, cgtod(fs, cg)); ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg"); } else return; From owner-svn-src-all@freebsd.org Sun Jul 16 08:56: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 38B37BFA31C; Sun, 16 Jul 2017 08:56:05 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D449A727F1; Sun, 16 Jul 2017 08:56:04 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id WfIrdTwApDJTWWfItdjIw3; Sun, 16 Jul 2017 02:53:27 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=G3gG6ho9WtcA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=8HUWJpTQAaxX3pF0hbAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 86F62199; Sun, 16 Jul 2017 01:19:21 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v6G6in3m005271; Sat, 15 Jul 2017 23:44:49 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201707160644.v6G6in3m005271@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ngie Cooper cc: Martin Matuska , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "freebsd-testing@freebsd.org" 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 In-Reply-To: Message from Ngie Cooper of "Wed, 12 Jul 2017 19:09:07 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 15 Jul 2017 23:44:49 -0700 X-CMAE-Envelope: MS4wfJEohSfIR7hjUIVdHC1/RNNJwPEWRxRas33lk5l7ZEDVLa/JoGmMIumdwHJ1Ux9F5LVQ3rFzbLtQBpy977PoiUixJE8t0qgU5MrK2XRgkE2yJoprT+II DlygDOYhtv8ajAYZcUyw2CPlqdorc/LOLBWmx3zlidseqgHSt+018J6zF2MHTuepS3371dYgljGdvxa/WA3rsKn76RReIuNqKWsqF2N5/8DjX9Xpcrug1KnJ iDLT7bcgzL27z7+EbAfAFAl9AdLxFyhaWIgI4cqY7hJ4olT52vwReg5m2WSwmitAxFed3Cw4W7lwbl+I93jejzy2UTawV7gAiCMuvIZ5Ps1h3alhbmM4sOvL lDacbAVa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2017 08:56:05 -0000 In message , Ngie Cooper writes: > 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/ I have a real world reproducible example of this: virtualbox-ose port build in poudriere and old-school biuld. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Jul 16 12:30: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 0A56FBFE8EF; Sun, 16 Jul 2017 12:30:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D33FD7C554; Sun, 16 Jul 2017 12:30:40 +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 v6GCUdvJ040332; Sun, 16 Jul 2017 12:30:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GCUdqB040330; Sun, 16 Jul 2017 12:30:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161230.v6GCUdqB040330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 12:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321045 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 321045 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 12:30:41 -0000 Author: emaste Date: Sun Jul 16 12:30:39 2017 New Revision: 321045 URL: https://svnweb.freebsd.org/changeset/base/321045 Log: readelf: fix printing of DT_FILTER and some other DT_* values Some non-processor-specific DT_* values overlap the range DT_LOPROC to DT_HIPROC. Handle common ones first, then the processor-specific ones. Obtained from: ELF Tool Chain r3563 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Sun Jul 16 08:56:41 2017 (r321044) +++ head/contrib/elftoolchain/readelf/readelf.c Sun Jul 16 12:30:39 2017 (r321045) @@ -783,6 +783,80 @@ dt_type(unsigned int mach, unsigned int dtype) { static char s_dtype[32]; + switch (dtype) { + case DT_NULL: return "NULL"; + case DT_NEEDED: return "NEEDED"; + case DT_PLTRELSZ: return "PLTRELSZ"; + case DT_PLTGOT: return "PLTGOT"; + case DT_HASH: return "HASH"; + case DT_STRTAB: return "STRTAB"; + case DT_SYMTAB: return "SYMTAB"; + case DT_RELA: return "RELA"; + case DT_RELASZ: return "RELASZ"; + case DT_RELAENT: return "RELAENT"; + case DT_STRSZ: return "STRSZ"; + case DT_SYMENT: return "SYMENT"; + case DT_INIT: return "INIT"; + case DT_FINI: return "FINI"; + case DT_SONAME: return "SONAME"; + case DT_RPATH: return "RPATH"; + case DT_SYMBOLIC: return "SYMBOLIC"; + case DT_REL: return "REL"; + case DT_RELSZ: return "RELSZ"; + case DT_RELENT: return "RELENT"; + case DT_PLTREL: return "PLTREL"; + case DT_DEBUG: return "DEBUG"; + case DT_TEXTREL: return "TEXTREL"; + case DT_JMPREL: return "JMPREL"; + case DT_BIND_NOW: return "BIND_NOW"; + case DT_INIT_ARRAY: return "INIT_ARRAY"; + case DT_FINI_ARRAY: return "FINI_ARRAY"; + case DT_INIT_ARRAYSZ: return "INIT_ARRAYSZ"; + case DT_FINI_ARRAYSZ: return "FINI_ARRAYSZ"; + case DT_RUNPATH: return "RUNPATH"; + case DT_FLAGS: return "FLAGS"; + case DT_PREINIT_ARRAY: return "PREINIT_ARRAY"; + case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ"; + case DT_MAXPOSTAGS: return "MAXPOSTAGS"; + case DT_SUNW_AUXILIARY: return "SUNW_AUXILIARY"; + case DT_SUNW_RTLDINF: return "SUNW_RTLDINF"; + case DT_SUNW_FILTER: return "SUNW_FILTER"; + case DT_SUNW_CAP: return "SUNW_CAP"; + case DT_CHECKSUM: return "CHECKSUM"; + case DT_PLTPADSZ: return "PLTPADSZ"; + case DT_MOVEENT: return "MOVEENT"; + case DT_MOVESZ: return "MOVESZ"; + case DT_FEATURE: return "FEATURE"; + case DT_POSFLAG_1: return "POSFLAG_1"; + case DT_SYMINSZ: return "SYMINSZ"; + case DT_SYMINENT: return "SYMINENT"; + case DT_GNU_HASH: return "GNU_HASH"; + case DT_TLSDESC_PLT: return "DT_TLSDESC_PLT"; + case DT_TLSDESC_GOT: return "DT_TLSDESC_GOT"; + case DT_GNU_CONFLICT: return "GNU_CONFLICT"; + case DT_GNU_LIBLIST: return "GNU_LIBLIST"; + case DT_CONFIG: return "CONFIG"; + case DT_DEPAUDIT: return "DEPAUDIT"; + case DT_AUDIT: return "AUDIT"; + case DT_PLTPAD: return "PLTPAD"; + case DT_MOVETAB: return "MOVETAB"; + case DT_SYMINFO: return "SYMINFO"; + case DT_VERSYM: return "VERSYM"; + case DT_RELACOUNT: return "RELACOUNT"; + case DT_RELCOUNT: return "RELCOUNT"; + case DT_FLAGS_1: return "FLAGS_1"; + case DT_VERDEF: return "VERDEF"; + case DT_VERDEFNUM: return "VERDEFNUM"; + case DT_VERNEED: return "VERNEED"; + case DT_VERNEEDNUM: return "VERNEEDNUM"; + case DT_AUXILIARY: return "AUXILIARY"; + case DT_USED: return "USED"; + case DT_FILTER: return "FILTER"; + case DT_GNU_PRELINKED: return "GNU_PRELINKED"; + case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ"; + case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ"; + } + if (dtype >= DT_LOPROC && dtype <= DT_HIPROC) { switch (mach) { case EM_ARM: @@ -903,86 +977,10 @@ dt_type(unsigned int mach, unsigned int dtype) default: break; } - snprintf(s_dtype, sizeof(s_dtype), "", dtype); - return (s_dtype); } - switch (dtype) { - case DT_NULL: return "NULL"; - case DT_NEEDED: return "NEEDED"; - case DT_PLTRELSZ: return "PLTRELSZ"; - case DT_PLTGOT: return "PLTGOT"; - case DT_HASH: return "HASH"; - case DT_STRTAB: return "STRTAB"; - case DT_SYMTAB: return "SYMTAB"; - case DT_RELA: return "RELA"; - case DT_RELASZ: return "RELASZ"; - case DT_RELAENT: return "RELAENT"; - case DT_STRSZ: return "STRSZ"; - case DT_SYMENT: return "SYMENT"; - case DT_INIT: return "INIT"; - case DT_FINI: return "FINI"; - case DT_SONAME: return "SONAME"; - case DT_RPATH: return "RPATH"; - case DT_SYMBOLIC: return "SYMBOLIC"; - case DT_REL: return "REL"; - case DT_RELSZ: return "RELSZ"; - case DT_RELENT: return "RELENT"; - case DT_PLTREL: return "PLTREL"; - case DT_DEBUG: return "DEBUG"; - case DT_TEXTREL: return "TEXTREL"; - case DT_JMPREL: return "JMPREL"; - case DT_BIND_NOW: return "BIND_NOW"; - case DT_INIT_ARRAY: return "INIT_ARRAY"; - case DT_FINI_ARRAY: return "FINI_ARRAY"; - case DT_INIT_ARRAYSZ: return "INIT_ARRAYSZ"; - case DT_FINI_ARRAYSZ: return "FINI_ARRAYSZ"; - case DT_RUNPATH: return "RUNPATH"; - case DT_FLAGS: return "FLAGS"; - case DT_PREINIT_ARRAY: return "PREINIT_ARRAY"; - case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ"; - case DT_MAXPOSTAGS: return "MAXPOSTAGS"; - case DT_SUNW_AUXILIARY: return "SUNW_AUXILIARY"; - case DT_SUNW_RTLDINF: return "SUNW_RTLDINF"; - case DT_SUNW_FILTER: return "SUNW_FILTER"; - case DT_SUNW_CAP: return "SUNW_CAP"; - case DT_CHECKSUM: return "CHECKSUM"; - case DT_PLTPADSZ: return "PLTPADSZ"; - case DT_MOVEENT: return "MOVEENT"; - case DT_MOVESZ: return "MOVESZ"; - case DT_FEATURE: return "FEATURE"; - case DT_POSFLAG_1: return "POSFLAG_1"; - case DT_SYMINSZ: return "SYMINSZ"; - case DT_SYMINENT: return "SYMINENT"; - case DT_GNU_HASH: return "GNU_HASH"; - case DT_TLSDESC_PLT: return "DT_TLSDESC_PLT"; - case DT_TLSDESC_GOT: return "DT_TLSDESC_GOT"; - case DT_GNU_CONFLICT: return "GNU_CONFLICT"; - case DT_GNU_LIBLIST: return "GNU_LIBLIST"; - case DT_CONFIG: return "CONFIG"; - case DT_DEPAUDIT: return "DEPAUDIT"; - case DT_AUDIT: return "AUDIT"; - case DT_PLTPAD: return "PLTPAD"; - case DT_MOVETAB: return "MOVETAB"; - case DT_SYMINFO: return "SYMINFO"; - case DT_VERSYM: return "VERSYM"; - case DT_RELACOUNT: return "RELACOUNT"; - case DT_RELCOUNT: return "RELCOUNT"; - case DT_FLAGS_1: return "FLAGS_1"; - case DT_VERDEF: return "VERDEF"; - case DT_VERDEFNUM: return "VERDEFNUM"; - case DT_VERNEED: return "VERNEED"; - case DT_VERNEEDNUM: return "VERNEEDNUM"; - case DT_AUXILIARY: return "AUXILIARY"; - case DT_USED: return "USED"; - case DT_FILTER: return "FILTER"; - case DT_GNU_PRELINKED: return "GNU_PRELINKED"; - case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ"; - case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ"; - default: - snprintf(s_dtype, sizeof(s_dtype), "", dtype); - return (s_dtype); - } + snprintf(s_dtype, sizeof(s_dtype), "", dtype); + return (s_dtype); } static const char * From owner-svn-src-all@freebsd.org Sun Jul 16 16:22: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 562FCC0821C; Sun, 16 Jul 2017 16:22:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D22483BA6; Sun, 16 Jul 2017 16:22: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 v6GGMqqO041621; Sun, 16 Jul 2017 16:22:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GGMqQO041620; Sun, 16 Jul 2017 16:22:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161622.v6GGMqQO041620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 16:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321046 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 321046 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 16:22:53 -0000 Author: emaste Date: Sun Jul 16 16:22:52 2017 New Revision: 321046 URL: https://svnweb.freebsd.org/changeset/base/321046 Log: readelf: correct printing of DT_FILTER and DT_AUXILIARY values Previously these were shown only for MIPS objects. Obtained from: ELF Tool Chain r3564 MFC after: 1 week MFC with: r321045 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Sun Jul 16 12:30:39 2017 (r321045) +++ head/contrib/elftoolchain/readelf/readelf.c Sun Jul 16 16:22:52 2017 (r321046) @@ -2636,10 +2636,8 @@ dyn_str(struct readelf *re, uint32_t stab, uint64_t d_ } static void -dump_arch_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab) +dump_arch_dyn_val(struct readelf *re, GElf_Dyn *dyn) { - const char *name; - switch (re->ehdr.e_machine) { case EM_MIPS: case EM_MIPS_RS3_LE: @@ -2692,11 +2690,6 @@ dump_arch_dyn_val(struct readelf *re, GElf_Dyn *dyn, u break; case DT_MIPS_IVERSION: case DT_MIPS_PERF_SUFFIX: - case DT_AUXILIARY: - case DT_FILTER: - name = dyn_str(re, stab, dyn->d_un.d_val); - printf(" %s\n", name); - break; case DT_MIPS_TIME_STAMP: printf(" %s\n", timestamp(dyn->d_un.d_val)); break; @@ -2713,14 +2706,16 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32 { const char *name; - if (dyn->d_tag >= DT_LOPROC && dyn->d_tag <= DT_HIPROC) { - dump_arch_dyn_val(re, dyn, stab); + if (dyn->d_tag >= DT_LOPROC && dyn->d_tag <= DT_HIPROC && + dyn->d_tag != DT_AUXILIARY && dyn->d_tag != DT_FILTER) { + dump_arch_dyn_val(re, dyn); return; } /* These entry values are index into the string table. */ name = NULL; - if (dyn->d_tag == DT_NEEDED || dyn->d_tag == DT_SONAME || + if (dyn->d_tag == DT_AUXILIARY || dyn->d_tag == DT_FILTER || + dyn->d_tag == DT_NEEDED || dyn->d_tag == DT_SONAME || dyn->d_tag == DT_RPATH || dyn->d_tag == DT_RUNPATH) name = dyn_str(re, stab, dyn->d_un.d_val); @@ -2764,6 +2759,12 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32 case DT_VERDEFNUM: case DT_VERNEEDNUM: printf(" %ju\n", (uintmax_t) dyn->d_un.d_val); + break; + case DT_AUXILIARY: + printf(" Auxiliary library: [%s]\n", name); + break; + case DT_FILTER: + printf(" Filter library: [%s]\n", name); break; case DT_NEEDED: printf(" Shared library: [%s]\n", name); From owner-svn-src-all@freebsd.org Sun Jul 16 16:51: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 06501C08837; Sun, 16 Jul 2017 16:51:40 +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 B6EFA8475A; Sun, 16 Jul 2017 16:51:39 +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 v6GGpc6Q054408; Sun, 16 Jul 2017 16:51:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GGpcx7054407; Sun, 16 Jul 2017 16:51:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707161651.v6GGpcx7054407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 16 Jul 2017 16:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321047 - stable/11/share/misc X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/share/misc X-SVN-Commit-Revision: 321047 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 16:51:40 -0000 Author: bapt Date: Sun Jul 16 16:51:38 2017 New Revision: 321047 URL: https://svnweb.freebsd.org/changeset/base/321047 Log: MFC r320988: Update pci_vendors to 2017.07.13 Modified: stable/11/share/misc/pci_vendors Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/pci_vendors ============================================================================== --- stable/11/share/misc/pci_vendors Sun Jul 16 16:22:52 2017 (r321046) +++ stable/11/share/misc/pci_vendors Sun Jul 16 16:51:38 2017 (r321047) @@ -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 Sun Jul 16 16: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 AF20DC089D9; Sun, 16 Jul 2017 16:54:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EAA584A42; Sun, 16 Jul 2017 16:54:04 +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 v6GGs3A6054539; Sun, 16 Jul 2017 16:54:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GGs3cg054538; Sun, 16 Jul 2017 16:54:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707161654.v6GGs3cg054538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jul 2017 16:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321048 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321048 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 16:54:04 -0000 Author: ian Date: Sun Jul 16 16:54:03 2017 New Revision: 321048 URL: https://svnweb.freebsd.org/changeset/base/321048 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. This is a do-over of r320997, hopefully this time with 100% more workiness. The first attempt had an off-by-one error, but instead of just adding another mysterious +1 adjustment, this rearranges the relationship between recent_base_year and recent_base_days so that the latter is the number of days that occurred before the start of the associated year (instead of the count thru the end of that year). This makes the recent_base stuff work more like the original loop logic that didn't need any +1 adjustments. Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Sun Jul 16 16:51:38 2017 (r321047) +++ head/sys/kern/subr_clock.c Sun Jul 16 16:54:03 2017 (r321048) @@ -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 + * some recent year avoids lots of unnecessary loop iterations in conversion. + * recent_base_days is the number of days before the start of recent_base_year. + */ +static const int recent_base_year = 2017; +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; + 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 Sun Jul 16 17:04: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 F4199C0904A; Sun, 16 Jul 2017 17:04:57 +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 C2AF6145; Sun, 16 Jul 2017 17:04:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GH4vW9058662; Sun, 16 Jul 2017 17:04:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GH4uIp058660; Sun, 16 Jul 2017 17:04:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161704.v6GH4uIp058660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 17:04: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: r321049 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 321049 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 17:04:58 -0000 Author: emaste Date: Sun Jul 16 17:04:56 2017 New Revision: 321049 URL: https://svnweb.freebsd.org/changeset/base/321049 Log: MFC r320056: arm: set appropriate section flags for .init_pagetable The arm kernel linker scripts place the .init_pagetable section in .bss, but .init_pagetable had no section flags set, and so did not match the expected flags for .bss. GNU ld silently ignores this case, but lld reports an error: ld: error: incompatible section flags for .bss >>> locore.o:(.init_pagetable): 0x0 >>> output section .bss: 0x3 PR: 220055 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/arm/arm/locore-v4.S stable/11/sys/arm/arm/locore-v6.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/locore-v4.S ============================================================================== --- stable/11/sys/arm/arm/locore-v4.S Sun Jul 16 16:54:03 2017 (r321048) +++ stable/11/sys/arm/arm/locore-v4.S Sun Jul 16 17:04:56 2017 (r321049) @@ -355,7 +355,7 @@ svcstk: * Memory for the initial pagetable. We are unable to place this in * the bss as this will be cleared after the table is loaded. */ - .section ".init_pagetable" + .section ".init_pagetable", "aw", %nobits .align 14 /* 16KiB aligned */ pagetable: .space L1_TABLE_SIZE Modified: stable/11/sys/arm/arm/locore-v6.S ============================================================================== --- stable/11/sys/arm/arm/locore-v6.S Sun Jul 16 16:54:03 2017 (r321048) +++ stable/11/sys/arm/arm/locore-v6.S Sun Jul 16 17:04:56 2017 (r321049) @@ -429,7 +429,7 @@ svcstk: * Memory for the initial pagetable. We are unable to place this in * the bss as this will be cleared after the table is loaded. */ - .section ".init_pagetable" + .section ".init_pagetable", "aw", %nobits .align 14 /* 16KiB aligned */ .globl boot_pt1 boot_pt1: From owner-svn-src-all@freebsd.org Sun Jul 16 17:29: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 9962EC09971; Sun, 16 Jul 2017 17:29:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66E171145; Sun, 16 Jul 2017 17:29:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GHTRoc067590; Sun, 16 Jul 2017 17:29:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GHTR03067589; Sun, 16 Jul 2017 17:29:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707161729.v6GHTR03067589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 16 Jul 2017 17:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r321050 - 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: 321050 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 17:29:28 -0000 Author: gjb Date: Sun Jul 16 17:29:27 2017 New Revision: 321050 URL: https://svnweb.freebsd.org/changeset/base/321050 Log: Document r307265, vfs.zfs.compressed_arc_enabled. Proxied by: allanjude, emaste 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 Sun Jul 16 17:04:56 2017 (r321049) +++ releng/11.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Jul 16 17:29:27 2017 (r321050) @@ -836,6 +836,13 @@ ZFS + A new &man.sysctl.8;, + vfs.zfs.compressed_arc_enabled, has been + added, which when enabled stores compressed, on-disk data in + the ZFS ARC, increasing + the amount of data that can be cached in physical memory. It + is enabled by default. + The vfs.zfs.debug_flags &man.sysctl.8; has been deprecated in favor of From owner-svn-src-all@freebsd.org Sun Jul 16 17:36: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 D79CFC09E38; Sun, 16 Jul 2017 17:36:24 +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 A62BE19F7; Sun, 16 Jul 2017 17:36:24 +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 v6GHaNkY071605; Sun, 16 Jul 2017 17:36:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GHaNTT071604; Sun, 16 Jul 2017 17:36:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707161736.v6GHaNTT071604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 16 Jul 2017 17:36:23 +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: r321051 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/sys/conf 11/sys/conf X-SVN-Commit-Revision: 321051 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 17:36:24 -0000 Author: gjb Date: Sun Jul 16 17:36:23 2017 New Revision: 321051 URL: https://svnweb.freebsd.org/changeset/base/321051 Log: MFC r320969: Fix a missing comment marker. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Sun Jul 16 17:29:27 2017 (r321050) +++ stable/10/sys/conf/NOTES Sun Jul 16 17:36:23 2017 (r321051) @@ -290,7 +290,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 Sun Jul 16 17:36: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 17BE2C09E3C; Sun, 16 Jul 2017 17:36:25 +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 DB15B19F8; Sun, 16 Jul 2017 17:36:24 +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 v6GHaOVR071611; Sun, 16 Jul 2017 17:36:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GHaO4Z071610; Sun, 16 Jul 2017 17:36:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707161736.v6GHaO4Z071610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 16 Jul 2017 17:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321051 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/sys/conf 11/sys/conf X-SVN-Commit-Revision: 321051 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 17:36:25 -0000 Author: gjb Date: Sun Jul 16 17:36:23 2017 New Revision: 321051 URL: https://svnweb.freebsd.org/changeset/base/321051 Log: MFC r320969: Fix a missing comment marker. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Sun Jul 16 17:29:27 2017 (r321050) +++ stable/11/sys/conf/NOTES Sun Jul 16 17:36:23 2017 (r321051) @@ -304,7 +304,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 Sun Jul 16 19:16: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 0A604C31DBF; Sun, 16 Jul 2017 19:16:04 +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 CBE2763828; Sun, 16 Jul 2017 19:16:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GJG2oa013476; Sun, 16 Jul 2017 19:16:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJG21K013475; Sun, 16 Jul 2017 19:16:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161916.v6GJG21K013475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:16: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: r321052 - stable/11/sys/dev/psci X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/psci X-SVN-Commit-Revision: 321052 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:16:04 -0000 Author: emaste Date: Sun Jul 16 19:16:02 2017 New Revision: 321052 URL: https://svnweb.freebsd.org/changeset/base/321052 Log: MFC r320065: arm: add .arch_extension sec for smc instruction Clang 4.0 accepts the smc instruction with or without specifying .arch_extension sec, but Clang 5.0 produces an error without it. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/psci/psci_arm.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/psci/psci_arm.S ============================================================================== --- stable/11/sys/dev/psci/psci_arm.S Sun Jul 16 17:36:23 2017 (r321051) +++ stable/11/sys/dev/psci/psci_arm.S Sun Jul 16 19:16:02 2017 (r321052) @@ -28,7 +28,8 @@ #include __FBSDID("$FreeBSD$"); -.arch_extension virt /* For hvc */ +.arch_extension sec /* For smc */ +.arch_extension virt /* For hvc */ /* * int psci_hvc_despatch(register_t psci_fnid, register_t...) From owner-svn-src-all@freebsd.org Sun Jul 16 19:20: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 8E59BC780AE; Sun, 16 Jul 2017 19:20:16 +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 5D0C863A27; Sun, 16 Jul 2017 19:20:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GJKFGP013705; Sun, 16 Jul 2017 19:20:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJKFd9013704; Sun, 16 Jul 2017 19:20:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161920.v6GJKFd9013704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321053 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 321053 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:20:16 -0000 Author: emaste Date: Sun Jul 16 19:20:15 2017 New Revision: 321053 URL: https://svnweb.freebsd.org/changeset/base/321053 Log: MFC r319219: add a sanity check before installworld on the running system FreeBSD does not guarantee kernel forward compatibility (that is, running a newer userland on an older kernel). The documented upgrade procedure specifies that installkernel should be performed, followed by a reboot and then installworld. As a sanity check when installing onto the running system (DESTDIR is / or unset), attempt to run "sh echo OK" using rescue from the objdir. If rescue fails (e.g., because the system has not been rebooted and the "old" kernel lacks a system call required by the to-be-installed world), abort the installation. This was added to avoid ino64 foot-shooting in HEAD, but is generally useful for any upgrade case adding new syscalls. Sponsored by: The FreeBSD Foundation Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sun Jul 16 19:16:02 2017 (r321052) +++ stable/11/Makefile.inc1 Sun Jul 16 19:20:15 2017 (r321053) @@ -915,6 +915,22 @@ __installcheck_UGID: .PHONY fi .endfor .endif +# +# If installing over the running system (DESTDIR is / or unset) and the install +# includes rescue, try running rescue from the objdir as a sanity check. If +# rescue is not functional (e.g., because it depends on a system call not +# supported by the currently running kernel), abort the installation. +# +.if !make(distributeworld) && ${MK_RESCUE} != "no" && \ + (empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH) +_installcheck_world: __installcheck_sh_check +__installcheck_sh_check: .PHONY + @if [ "`${OBJTREE}${.CURDIR}/rescue/rescue/rescue sh -c 'echo OK'`" != \ + OK ]; then \ + echo "rescue/sh check failed, installation aborted" >&2; \ + false; \ + fi +.endif # # Required install tools to be saved in a scratch dir for safety. From owner-svn-src-all@freebsd.org Sun Jul 16 19:21: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 89DF2C7811A; Sun, 16 Jul 2017 19:21:34 +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 5861563CFC; Sun, 16 Jul 2017 19:21:34 +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 v6GJLXcp013808; Sun, 16 Jul 2017 19:21:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJLXZp013807; Sun, 16 Jul 2017 19:21:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161921.v6GJLXZp013807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321054 - stable/11/contrib/compiler-rt/lib/tsan/rtl X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/compiler-rt/lib/tsan/rtl X-SVN-Commit-Revision: 321054 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:21:34 -0000 Author: emaste Date: Sun Jul 16 19:21:33 2017 New Revision: 321054 URL: https://svnweb.freebsd.org/changeset/base/321054 Log: MFC r319516: tsan: set noexec stack on aarch64 Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S ============================================================================== --- stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sun Jul 16 19:20:15 2017 (r321053) +++ stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sun Jul 16 19:21:33 2017 (r321054) @@ -252,7 +252,7 @@ __sigsetjmp: CFI_ENDPROC .size __sigsetjmp, .-__sigsetjmp -#if defined(__linux__) +#if defined(__FreeBSD__) || defined(__linux__) /* We do not need executable stack. */ .section .note.GNU-stack,"",@progbits #endif From owner-svn-src-all@freebsd.org Sun Jul 16 19:24: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 04B2BC7829B; Sun, 16 Jul 2017 19:24:11 +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 C557363EDC; Sun, 16 Jul 2017 19:24:10 +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 v6GJO9Lr017484; Sun, 16 Jul 2017 19:24:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJO9RO017483; Sun, 16 Jul 2017 19:24:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161924.v6GJO9RO017483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:24:09 +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: r321055 - stable/11/sys/security/mac_bsdextended X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/security/mac_bsdextended X-SVN-Commit-Revision: 321055 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:24:11 -0000 Author: emaste Date: Sun Jul 16 19:24:09 2017 New Revision: 321055 URL: https://svnweb.freebsd.org/changeset/base/321055 Log: MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid() PR: 218039 CID: 1008934 Reported by: Coverity, PVS-Studio Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/security/mac_bsdextended/mac_bsdextended.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- stable/11/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:21:33 2017 (r321054) +++ stable/11/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:24:09 2017 (r321055) @@ -125,7 +125,7 @@ ugidfw_rule_valid(struct mac_bsdextended_rule *rule) return (EINVAL); if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS) return (EINVAL); - if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) && + if (((rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) != 0) && (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE) return (EINVAL); if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM) From owner-svn-src-all@freebsd.org Sun Jul 16 19:25: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 668B9C78383; Sun, 16 Jul 2017 19:25:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3040964037; Sun, 16 Jul 2017 19:25:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GJPIi4017596; Sun, 16 Jul 2017 19:25:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJPIpS017595; Sun, 16 Jul 2017 19:25:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161925.v6GJPIpS017595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:25: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: r321056 - stable/10/sys/security/mac_bsdextended X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/security/mac_bsdextended X-SVN-Commit-Revision: 321056 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:25:19 -0000 Author: emaste Date: Sun Jul 16 19:25:18 2017 New Revision: 321056 URL: https://svnweb.freebsd.org/changeset/base/321056 Log: MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid() PR: 218039 CID: 1008934 Reported by: Coverity, PVS-Studio Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:24:09 2017 (r321055) +++ stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:25:18 2017 (r321056) @@ -126,7 +126,7 @@ ugidfw_rule_valid(struct mac_bsdextended_rule *rule) return (EINVAL); if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS) return (EINVAL); - if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) && + if (((rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) != 0) && (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE) return (EINVAL); if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM) From owner-svn-src-all@freebsd.org Sun Jul 16 19:36: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 99E90C787D0; Sun, 16 Jul 2017 19:36:45 +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 5D832645E6; Sun, 16 Jul 2017 19:36:45 +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 v6GJaijR021851; Sun, 16 Jul 2017 19:36:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJaiOF021850; Sun, 16 Jul 2017 19:36:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707161936.v6GJaiOF021850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 16 Jul 2017 19:36: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: r321057 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 321057 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 19:36:45 -0000 Author: rmacklem Date: Sun Jul 16 19:36:44 2017 New Revision: 321057 URL: https://svnweb.freebsd.org/changeset/base/321057 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/10/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clport.c Sun Jul 16 19:25:18 2017 (r321056) +++ stable/10/sys/fs/nfsclient/nfs_clport.c Sun Jul 16 19:36:44 2017 (r321057) @@ -666,6 +666,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 Sun Jul 16 21:03: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 8810EC7A2C8; Sun, 16 Jul 2017 21:03:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5329067170; Sun, 16 Jul 2017 21:03:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GL3QZw058910; Sun, 16 Jul 2017 21:03:26 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GL3QUm058909; Sun, 16 Jul 2017 21:03:26 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201707162103.v6GL3QUm058909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 16 Jul 2017 21:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321060 - stable/11/sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/11/sys/dev/atkbdc X-SVN-Commit-Revision: 321060 X-SVN-Commit-Repository: base MIME-Version: 1.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, 16 Jul 2017 21:03:27 -0000 Author: wulf Date: Sun Jul 16 21:03:26 2017 New Revision: 321060 URL: https://svnweb.freebsd.org/changeset/base/321060 Log: MFC r319162: psm: add support for evdev protocol Approved by: gonzo (mentor) Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Sun Jul 16 20:56:41 2017 (r321059) +++ stable/11/sys/dev/atkbdc/psm.c Sun Jul 16 21:03:26 2017 (r321060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_psm.h" +#include "opt_evdev.h" #include #include @@ -90,6 +91,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #include #include @@ -325,8 +331,14 @@ typedef struct elantechhw { #define ELANTECH_REG_RDWR 0x00 #define ELANTECH_CUSTOM_CMD 0xf8 +#ifdef EVDEV_SUPPORT +#define ELANTECH_MAX_FINGERS 5 +#else #define ELANTECH_MAX_FINGERS PSM_FINGERS +#endif +#define ELANTECH_FINGER_MAX_P 255 +#define ELANTECH_FINGER_MAX_W 15 #define ELANTECH_FINGER_SET_XYP(pb) (finger_t) { \ .x = (((pb)->ipacket[1] & 0x0f) << 8) | (pb)->ipacket[2], \ .y = (((pb)->ipacket[4] & 0x0f) << 8) | (pb)->ipacket[5], \ @@ -418,6 +430,10 @@ struct psm_softc { /* Driver status information */ int cmdcount; struct sigio *async; /* Processes waiting for SIGIO */ int extended_buttons; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev_a; /* Absolute reporting device */ + struct evdev_dev *evdev_r; /* Relative reporting device */ +#endif }; static devclass_t psm_devclass; @@ -427,6 +443,8 @@ static devclass_t psm_devclass; #define PSM_ASLP 2 /* Waiting for mouse data */ #define PSM_SOFTARMED 4 /* Software interrupt armed */ #define PSM_NEED_SYNCBITS 8 /* Set syncbits using next data pkt */ +#define PSM_EV_OPEN_R 0x10 /* Relative evdev device is open */ +#define PSM_EV_OPEN_A 0x20 /* Absolute evdev device is open */ /* driver configuration flags (config) */ #define PSM_CONFIG_RESOLUTION 0x000f /* resolution */ @@ -532,13 +550,23 @@ static int psmattach(device_t); static int psmdetach(device_t); static int psmresume(device_t); -static d_open_t psmopen; -static d_close_t psmclose; +static d_open_t psm_cdev_open; +static d_close_t psm_cdev_close; static d_read_t psmread; static d_write_t psmwrite; static d_ioctl_t psmioctl; static d_poll_t psmpoll; +static int psmopen(struct psm_softc *); +static int psmclose(struct psm_softc *); + +#ifdef EVDEV_SUPPORT +static evdev_open_t psm_ev_open_r; +static evdev_close_t psm_ev_close_r; +static evdev_open_t psm_ev_open_a; +static evdev_close_t psm_ev_close_a; +#endif + static int enable_aux_dev(KBDC); static int disable_aux_dev(KBDC); static int get_mouse_status(KBDC, int *, int, int); @@ -668,8 +696,8 @@ static driver_t psm_driver = { static struct cdevsw psm_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, - .d_open = psmopen, - .d_close = psmclose, + .d_open = psm_cdev_open, + .d_close = psm_cdev_close, .d_read = psmread, .d_write = psmwrite, .d_ioctl = psmioctl, @@ -677,6 +705,17 @@ static struct cdevsw psm_cdevsw = { .d_name = PSM_DRIVER_NAME, }; +#ifdef EVDEV_SUPPORT +static const struct evdev_methods psm_ev_methods_r = { + .ev_open = psm_ev_open_r, + .ev_close = psm_ev_close_r, +}; +static const struct evdev_methods psm_ev_methods_a = { + .ev_open = psm_ev_open_a, + .ev_close = psm_ev_close_a, +}; +#endif + /* device I/O routines */ static int enable_aux_dev(KBDC kbdc) @@ -1197,7 +1236,8 @@ reinitialize(struct psm_softc *sc, int doinit) splx(s); /* restore the driver state */ - if ((sc->state & PSM_OPEN) && (err == 0)) { + if ((sc->state & (PSM_OPEN | PSM_EV_OPEN_R | PSM_EV_OPEN_A)) && + (err == 0)) { /* enable the aux device and the port again */ err = doopen(sc, c); if (err != 0) @@ -1578,7 +1618,271 @@ psmprobe(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT +/* Values are taken from Linux drivers for userland software compatibility */ +#define PS2_MOUSE_VENDOR 0x0002 +#define PS2_MOUSE_GENERIC_PRODUCT 0x0001 +#define PS2_MOUSE_SYNAPTICS_NAME "SynPS/2 Synaptics TouchPad" +#define PS2_MOUSE_SYNAPTICS_PRODUCT 0x0007 +#define PS2_MOUSE_TRACKPOINT_NAME "TPPS/2 IBM TrackPoint" +#define PS2_MOUSE_TRACKPOINT_PRODUCT 0x000A +#define PS2_MOUSE_ELANTECH_NAME "ETPS/2 Elantech Touchpad" +#define PS2_MOUSE_ELANTECH_ST_NAME "ETPS/2 Elantech TrackPoint" +#define PS2_MOUSE_ELANTECH_PRODUCT 0x000E + +#define ABSINFO_END { ABS_CNT, 0, 0, 0 } + +static void +psm_support_abs_bulk(struct evdev_dev *evdev, const uint16_t info[][4]) +{ + size_t i; + + for (i = 0; info[i][0] != ABS_CNT; i++) + evdev_support_abs(evdev, info[i][0], 0, info[i][1], info[i][2], + 0, 0, info[i][3]); +} + +static void +psm_push_mt_finger(struct psm_softc *sc, int id, const finger_t *f) +{ + int y = sc->synhw.minimumYCoord + sc->synhw.maximumYCoord - f->y; + + evdev_push_abs(sc->evdev_a, ABS_MT_SLOT, id); + evdev_push_abs(sc->evdev_a, ABS_MT_TRACKING_ID, id); + evdev_push_abs(sc->evdev_a, ABS_MT_POSITION_X, f->x); + evdev_push_abs(sc->evdev_a, ABS_MT_POSITION_Y, y); + evdev_push_abs(sc->evdev_a, ABS_MT_PRESSURE, f->p); +} + +static void +psm_push_st_finger(struct psm_softc *sc, const finger_t *f) +{ + int y = sc->synhw.minimumYCoord + sc->synhw.maximumYCoord - f->y; + + evdev_push_abs(sc->evdev_a, ABS_X, f->x); + evdev_push_abs(sc->evdev_a, ABS_Y, y); + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, f->p); + if (sc->synhw.capPalmDetect) + evdev_push_abs(sc->evdev_a, ABS_TOOL_WIDTH, f->w); +} + +static void +psm_release_mt_slot(struct evdev_dev *evdev, int32_t slot) +{ + + evdev_push_abs(evdev, ABS_MT_SLOT, slot); + evdev_push_abs(evdev, ABS_MT_TRACKING_ID, -1); +} + static int +psm_register(device_t dev, int model_code) +{ + struct psm_softc *sc = device_get_softc(dev); + struct evdev_dev *evdev_r; + int error, i, nbuttons, nwheels, product; + bool is_pointing_stick; + const char *name; + + name = model_name(model_code); + nbuttons = sc->hw.buttons; + product = PS2_MOUSE_GENERIC_PRODUCT; + nwheels = 0; + is_pointing_stick = false; + + switch (model_code) { + case MOUSE_MODEL_TRACKPOINT: + name = PS2_MOUSE_TRACKPOINT_NAME; + product = PS2_MOUSE_TRACKPOINT_PRODUCT; + nbuttons = 3; + is_pointing_stick = true; + break; + + case MOUSE_MODEL_ELANTECH: + name = PS2_MOUSE_ELANTECH_ST_NAME; + product = PS2_MOUSE_ELANTECH_PRODUCT; + nbuttons = 3; + is_pointing_stick = true; + break; + + case MOUSE_MODEL_MOUSEMANPLUS: + case MOUSE_MODEL_4D: + nwheels = 2; + break; + + case MOUSE_MODEL_EXPLORER: + case MOUSE_MODEL_INTELLI: + case MOUSE_MODEL_NET: + case MOUSE_MODEL_NETSCROLL: + case MOUSE_MODEL_4DPLUS: + nwheels = 1; + break; + } + + evdev_r = evdev_alloc(); + evdev_set_name(evdev_r, name); + evdev_set_phys(evdev_r, device_get_nameunit(dev)); + evdev_set_id(evdev_r, BUS_I8042, PS2_MOUSE_VENDOR, product, 0); + evdev_set_methods(evdev_r, sc, &psm_ev_methods_r); + + evdev_support_prop(evdev_r, INPUT_PROP_POINTER); + if (is_pointing_stick) + evdev_support_prop(evdev_r, INPUT_PROP_POINTING_STICK); + evdev_support_event(evdev_r, EV_SYN); + evdev_support_event(evdev_r, EV_KEY); + evdev_support_event(evdev_r, EV_REL); + evdev_support_rel(evdev_r, REL_X); + evdev_support_rel(evdev_r, REL_Y); + switch (nwheels) { + case 2: + evdev_support_rel(evdev_r, REL_HWHEEL); + /* FALLTHROUGH */ + case 1: + evdev_support_rel(evdev_r, REL_WHEEL); + } + for (i = 0; i < nbuttons; i++) + evdev_support_key(evdev_r, BTN_MOUSE + i); + + error = evdev_register_mtx(evdev_r, &Giant); + if (error) + evdev_free(evdev_r); + else + sc->evdev_r = evdev_r; + return (error); +} + +static int +psm_register_synaptics(device_t dev) +{ + struct psm_softc *sc = device_get_softc(dev); + const uint16_t synaptics_absinfo_st[][4] = { + { ABS_X, sc->synhw.minimumXCoord, + sc->synhw.maximumXCoord, sc->synhw.infoXupmm }, + { ABS_Y, sc->synhw.minimumYCoord, + sc->synhw.maximumYCoord, sc->synhw.infoYupmm }, + { ABS_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + ABSINFO_END, + }; + const uint16_t synaptics_absinfo_mt[][4] = { + { ABS_MT_SLOT, 0, PSM_FINGERS-1, 0}, + { ABS_MT_TRACKING_ID, -1, PSM_FINGERS-1, 0}, + { ABS_MT_POSITION_X, sc->synhw.minimumXCoord, + sc->synhw.maximumXCoord, sc->synhw.infoXupmm }, + { ABS_MT_POSITION_Y, sc->synhw.minimumYCoord, + sc->synhw.maximumYCoord, sc->synhw.infoYupmm }, + { ABS_MT_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + ABSINFO_END, + }; + struct evdev_dev *evdev_a; + int error, i, guest_model; + + evdev_a = evdev_alloc(); + evdev_set_name(evdev_a, PS2_MOUSE_SYNAPTICS_NAME); + evdev_set_phys(evdev_a, device_get_nameunit(dev)); + evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, + PS2_MOUSE_SYNAPTICS_PRODUCT, 0); + evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + + evdev_support_event(evdev_a, EV_SYN); + evdev_support_event(evdev_a, EV_KEY); + evdev_support_event(evdev_a, EV_ABS); + evdev_support_prop(evdev_a, INPUT_PROP_POINTER); + if (sc->synhw.capAdvancedGestures) + evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); + if (sc->synhw.capClickPad) + evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + evdev_support_key(evdev_a, BTN_TOUCH); + evdev_support_nfingers(evdev_a, 3); + psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); + if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) + psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); + if (sc->synhw.capPalmDetect) + evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 0, 15, 0, 0, 0); + evdev_support_key(evdev_a, BTN_LEFT); + if (!sc->synhw.capClickPad) { + evdev_support_key(evdev_a, BTN_RIGHT); + if (sc->synhw.capExtended && sc->synhw.capMiddle) + evdev_support_key(evdev_a, BTN_MIDDLE); + } + if (sc->synhw.capExtended && sc->synhw.capFourButtons) { + evdev_support_key(evdev_a, BTN_BACK); + evdev_support_key(evdev_a, BTN_FORWARD); + } + if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) + for (i = 0; i < sc->synhw.nExtendedButtons; i++) + evdev_support_key(evdev_a, BTN_0 + i); + + error = evdev_register_mtx(evdev_a, &Giant); + if (!error && sc->synhw.capPassthrough) { + guest_model = sc->tpinfo.sysctl_tree != NULL ? + MOUSE_MODEL_TRACKPOINT : MOUSE_MODEL_GENERIC; + error = psm_register(dev, guest_model); + } + if (error) + evdev_free(evdev_a); + else + sc->evdev_a = evdev_a; + return (error); +} + +static int +psm_register_elantech(device_t dev) +{ + struct psm_softc *sc = device_get_softc(dev); + const uint16_t elantech_absinfo[][4] = { + { ABS_X, 0, sc->elanhw.sizex, + sc->elanhw.dpmmx }, + { ABS_Y, 0, sc->elanhw.sizey, + sc->elanhw.dpmmy }, + { ABS_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + { ABS_TOOL_WIDTH, 0, ELANTECH_FINGER_MAX_W, 0 }, + { ABS_MT_SLOT, 0, ELANTECH_MAX_FINGERS - 1, 0 }, + { ABS_MT_TRACKING_ID, -1, ELANTECH_MAX_FINGERS - 1, 0 }, + { ABS_MT_POSITION_X, 0, sc->elanhw.sizex, + sc->elanhw.dpmmx }, + { ABS_MT_POSITION_Y, 0, sc->elanhw.sizey, + sc->elanhw.dpmmy }, + { ABS_MT_PRESSURE, 0, ELANTECH_FINGER_MAX_P, 0 }, + { ABS_MT_TOUCH_MAJOR, 0, ELANTECH_FINGER_MAX_W * + sc->elanhw.dptracex, 0 }, + ABSINFO_END, + }; + struct evdev_dev *evdev_a; + int error; + + evdev_a = evdev_alloc(); + evdev_set_name(evdev_a, PS2_MOUSE_ELANTECH_NAME); + evdev_set_phys(evdev_a, device_get_nameunit(dev)); + evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, + PS2_MOUSE_ELANTECH_PRODUCT, 0); + evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + + evdev_support_event(evdev_a, EV_SYN); + evdev_support_event(evdev_a, EV_KEY); + evdev_support_event(evdev_a, EV_ABS); + evdev_support_prop(evdev_a, INPUT_PROP_POINTER); + if (sc->elanhw.issemimt) + evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); + if (sc->elanhw.isclickpad) + evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + evdev_support_key(evdev_a, BTN_TOUCH); + evdev_support_nfingers(evdev_a, ELANTECH_MAX_FINGERS); + evdev_support_key(evdev_a, BTN_LEFT); + if (!sc->elanhw.isclickpad) + evdev_support_key(evdev_a, BTN_RIGHT); + psm_support_abs_bulk(evdev_a, elantech_absinfo); + + error = evdev_register_mtx(evdev_a, &Giant); + if (!error && sc->elanhw.hastrackpoint) + error = psm_register(dev, MOUSE_MODEL_ELANTECH); + if (error) + evdev_free(evdev_a); + else + sc->evdev_a = evdev_a; + return (error); +} +#endif + +static int psmattach(device_t dev) { int unit = device_get_unit(dev); @@ -1609,6 +1913,24 @@ psmattach(device_t dev) sc->bdev = make_dev(&psm_cdevsw, 0, 0, 0, 0666, "bpsm%d", unit); sc->bdev->si_drv1 = sc; +#ifdef EVDEV_SUPPORT + switch (sc->hw.model) { + case MOUSE_MODEL_SYNAPTICS: + error = psm_register_synaptics(dev); + break; + + case MOUSE_MODEL_ELANTECH: + error = psm_register_elantech(dev); + break; + + default: + error = psm_register(dev, sc->hw.model); + } + + if (error) + return (error); +#endif + /* Some touchpad devices need full reinitialization after suspend. */ switch (sc->hw.model) { case MOUSE_MODEL_SYNAPTICS: @@ -1657,6 +1979,11 @@ psmdetach(device_t dev) if (sc->state & PSM_OPEN) return (EBUSY); +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev_r); + evdev_free(sc->evdev_a); +#endif + rid = KBDC_RID_AUX; bus_teardown_intr(dev, sc->intr, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); @@ -1670,13 +1997,83 @@ psmdetach(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT static int -psmopen(struct cdev *dev, int flag, int fmt, struct thread *td) +psm_ev_open_r(struct evdev_dev *evdev, void *ev_softc) { + struct psm_softc *sc = (struct psm_softc *)ev_softc; + int err = 0; + + /* Get device data */ + if ((sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_A))) + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_EV_OPEN_R; + + return (err); +} + +static void +psm_ev_close_r(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + + sc->state &= ~PSM_EV_OPEN_R; + + if (sc->state & (PSM_OPEN | PSM_EV_OPEN_A)) + return; + + if (sc->state & PSM_VALID) + psmclose(sc); +} + +static int +psm_ev_open_a(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + int err = 0; + + /* Get device data */ + if ((sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_R))) + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_EV_OPEN_A; + + return (err); +} + +static void +psm_ev_close_a(struct evdev_dev *evdev, void *ev_softc) +{ + struct psm_softc *sc = (struct psm_softc *)ev_softc; + + sc->state &= ~PSM_EV_OPEN_A; + + if (sc->state & (PSM_OPEN | PSM_EV_OPEN_R)) + return; + + if (sc->state & PSM_VALID) + psmclose(sc); +} +#endif + +static int +psm_cdev_open(struct cdev *dev, int flag, int fmt, struct thread *td) +{ struct psm_softc *sc; - int command_byte; - int err; - int s; + int err = 0; /* Get device data */ sc = dev->si_drv1; @@ -1691,6 +2088,59 @@ psmopen(struct cdev *dev, int flag, int fmt, struct th device_busy(devclass_get_device(psm_devclass, sc->unit)); +#ifdef EVDEV_SUPPORT + /* Already opened by evdev */ + if (!(sc->state & (PSM_EV_OPEN_R | PSM_EV_OPEN_A))) +#endif + err = psmopen(sc); + + if (err == 0) + sc->state |= PSM_OPEN; + else + device_unbusy(devclass_get_device(psm_devclass, sc->unit)); + + return (err); +} + +static int +psm_cdev_close(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct psm_softc *sc; + int err = 0; + + /* Get device data */ + sc = dev->si_drv1; + if ((sc == NULL) || (sc->state & PSM_VALID) == 0) { + /* the device is no longer valid/functioning */ + return (ENXIO); + } + +#ifdef EVDEV_SUPPORT + /* Still opened by evdev */ + if (!(sc->state & (PSM_EV_OPEN_R | PSM_EV_OPEN_A))) +#endif + err = psmclose(sc); + + if (err == 0) { + sc->state &= ~PSM_OPEN; + /* clean up and sigio requests */ + if (sc->async != NULL) { + funsetown(&sc->async); + sc->async = NULL; + } + device_unbusy(devclass_get_device(psm_devclass, sc->unit)); + } + + return (err); +} + +static int +psmopen(struct psm_softc *sc) +{ + int command_byte; + int err; + int s; + /* Initialize state */ sc->mode.level = sc->dflt_mode.level; sc->mode.protocol = sc->dflt_mode.protocol; @@ -1750,16 +2200,13 @@ psmopen(struct cdev *dev, int flag, int fmt, struct th err = doopen(sc, command_byte); /* done */ - if (err == 0) - sc->state |= PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); return (err); } static int -psmclose(struct cdev *dev, int flag, int fmt, struct thread *td) +psmclose(struct psm_softc *sc) { - struct psm_softc *sc = dev->si_drv1; int stat[3]; int command_byte; int s; @@ -1836,16 +2283,8 @@ psmclose(struct cdev *dev, int flag, int fmt, struct t /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); - /* clean up and sigio requests */ - if (sc->async != NULL) { - funsetown(&sc->async); - sc->async = NULL; - } - /* close is almost always successful */ - sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); - device_unbusy(devclass_get_device(psm_devclass, sc->unit)); return (0); } @@ -2496,7 +2935,7 @@ psmintr(void *arg) pb = &sc->pqueue[sc->pqueue_end]; /* discard the byte if the device is not open */ - if ((sc->state & PSM_OPEN) == 0) + if (!(sc->state & (PSM_OPEN | PSM_EV_OPEN_R | PSM_EV_OPEN_A))) continue; getmicrouptime(&now); @@ -2854,7 +3293,15 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, guest_buttons |= MOUSE_BUTTON2DOWN; if (pb->ipacket[1] & 0x02) guest_buttons |= MOUSE_BUTTON3DOWN; - +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, + guest_buttons); + evdev_sync(sc->evdev_r); + } +#endif ms->button = touchpad_buttons | guest_buttons | sc->extended_buttons; } @@ -2965,6 +3412,24 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, int mask = 0; maskedbits = (sc->synhw.nExtendedButtons + 1) >> 1; mask = (1 << maskedbits) - 1; +#ifdef EVDEV_SUPPORT + int i; + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + if (sc->synhw.capPassthrough) { + evdev_push_mouse_btn(sc->evdev_r, + extended_buttons); + evdev_sync(sc->evdev_r); + } + for (i = 0; i < maskedbits; i++) { + evdev_push_key(sc->evdev_a, + BTN_0 + i * 2, + pb->ipacket[4] & (1 << i)); + evdev_push_key(sc->evdev_a, + BTN_0 + i * 2 + 1, + pb->ipacket[5] & (1 << i)); + } + } +#endif pb->ipacket[4] &= ~(mask); pb->ipacket[5] &= ~(mask); } else if (!sc->syninfo.directional_scrolls && @@ -3016,6 +3481,31 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, if (id >= nfingers) PSM_FINGER_RESET(f[id]); +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + for (id = 0; id < PSM_FINGERS; id++) { + if (PSM_FINGER_IS_SET(f[id])) + psm_push_mt_finger(sc, id, &f[id]); + else + psm_release_mt_slot(sc->evdev_a, id); + } + evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); + evdev_push_nfingers(sc->evdev_a, nfingers); + if (nfingers > 0) + psm_push_st_finger(sc, &f[0]); + else + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, 0); + evdev_push_mouse_btn(sc->evdev_a, touchpad_buttons); + if (sc->synhw.capExtended && sc->synhw.capFourButtons) { + evdev_push_key(sc->evdev_a, BTN_FORWARD, + touchpad_buttons & MOUSE_BUTTON4DOWN); + evdev_push_key(sc->evdev_a, BTN_BACK, + touchpad_buttons & MOUSE_BUTTON5DOWN); + } + evdev_sync(sc->evdev_a); + } +#endif + ms->button = touchpad_buttons; psmgestures(sc, &f[0], nfingers, ms); @@ -4015,7 +4505,12 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); - +#ifdef EVDEV_SUPPORT + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); + evdev_sync(sc->evdev_r); +#endif ms->button = touchpad_button | trackpoint_button; return (0); @@ -4042,6 +4537,31 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0); } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { + for (id = 0; id < ELANTECH_MAX_FINGERS; id++) { + if (PSM_FINGER_IS_SET(f[id])) { + psm_push_mt_finger(sc, id, &f[id]); + /* Convert touch width to surface units */ + evdev_push_abs(sc->evdev_a, ABS_MT_TOUCH_MAJOR, + f[id].w * sc->elanhw.dptracex); + } + if (sc->elanaction.mask & (1 << id) && + !(mask & (1 << id))) + psm_release_mt_slot(sc->evdev_a, id); + } + evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); + evdev_push_nfingers(sc->evdev_a, nfingers); + if (nfingers > 0) { + if (PSM_FINGER_IS_SET(f[0])) + psm_push_st_finger(sc, &f[0]); + } else + evdev_push_abs(sc->evdev_a, ABS_PRESSURE, 0); + evdev_push_mouse_btn(sc->evdev_a, touchpad_button); + evdev_sync(sc->evdev_a); + } +#endif + ms->button = touchpad_button | trackpoint_button; /* Send finger 1 position to gesture processor */ @@ -4382,6 +4902,41 @@ psmsoftintr(void *arg) break; } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE && + sc->hw.model != MOUSE_MODEL_ELANTECH && + sc->hw.model != MOUSE_MODEL_SYNAPTICS) { + evdev_push_rel(sc->evdev_r, EV_REL, x); + evdev_push_rel(sc->evdev_r, EV_REL, -y); + + switch (sc->hw.model) { + case MOUSE_MODEL_EXPLORER: + case MOUSE_MODEL_INTELLI: + case MOUSE_MODEL_NET: + case MOUSE_MODEL_NETSCROLL: + case MOUSE_MODEL_4DPLUS: + evdev_push_rel(sc->evdev_r, REL_WHEEL, -z); + break; + case MOUSE_MODEL_MOUSEMANPLUS: + case MOUSE_MODEL_4D: + switch (z) { + case 1: + case -1: + evdev_push_rel(sc->evdev_r, REL_WHEEL, -z); + break; + case 2: + case -2: + evdev_push_rel(sc->evdev_r, REL_HWHEEL, z / 2); + break; + } + break; + } + + evdev_push_mouse_btn(sc->evdev_r, ms.button); + evdev_sync(sc->evdev_r); + } +#endif + /* scale values */ if (sc->mode.accelfactor >= 1) { if (x != 0) { @@ -6494,6 +7049,9 @@ psmresume(device_t dev) } DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, 0, 0); +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(psm, evdev, 1, 1, 1); +#endif #ifdef DEV_ISA From owner-svn-src-all@freebsd.org Mon Jul 17 00:42: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 1CE2AC7D357; Mon, 17 Jul 2017 00:42:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE38A6C527; Mon, 17 Jul 2017 00:42:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6H0gE8W046911; Mon, 17 Jul 2017 00:42:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H0gDMU046907; Mon, 17 Jul 2017 00:42:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707170042.v6H0gDMU046907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 17 Jul 2017 00:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321063 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 321063 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 00:42:15 -0000 Author: np Date: Mon Jul 17 00:42:13 2017 New Revision: 321063 URL: https://svnweb.freebsd.org/changeset/base/321063 Log: cxgbe(4): Various link/media related improvements. - Deal with changes to port_type, and not just port_mod when a transceiver is changed. This fixes hot swapping of transceivers of different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or SFP28 in a SFP28 port, etc.). - Always refresh media information for ifconfig if the port is down. The firmware does not generate tranceiver-change interrupts unless at least one VI is enabled on the physical port. Before this change ifconfig diplayed potentially stale information for ports that were administratively down. - Always recalculate and reapply L1 config on a transceiver change. - Display PAUSE settings in ifconfig. The driver sysctls for this continue to work as well. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Jul 16 21:07:58 2017 (r321062) +++ head/sys/dev/cxgbe/adapter.h Mon Jul 17 00:42:13 2017 (r321063) @@ -1036,10 +1036,10 @@ adap2pinfo(struct adapter *sc, int idx) } static inline void -t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[]) +t4_os_set_hw_addr(struct port_info *pi, uint8_t hw_addr[]) { - bcopy(hw_addr, sc->port[idx]->vi[0].hw_addr, ETHER_ADDR_LEN); + bcopy(hw_addr, pi->vi[0].hw_addr, ETHER_ADDR_LEN); } static inline bool @@ -1089,24 +1089,6 @@ port_top_speed(const struct port_info *pi) } static inline int -port_top_speed_raw(const struct port_info *pi) -{ - - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) - return (FW_PORT_CAP_SPEED_100G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) - return (FW_PORT_CAP_SPEED_40G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) - return (FW_PORT_CAP_SPEED_25G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) - return (FW_PORT_CAP_SPEED_10G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) - return (FW_PORT_CAP_SPEED_1G); - - return (0); -} - -static inline int tx_resume_threshold(struct sge_eq *eq) { @@ -1142,8 +1124,8 @@ extern device_method_t cxgbe_methods[]; int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); -void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_portmod_changed(struct port_info *, int, int, struct link_config *); +void t4_os_link_changed(struct port_info *, struct link_config *); void t4_iterate(void (*)(struct adapter *, void *), void *); void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sun Jul 16 21:07:58 2017 (r321062) +++ head/sys/dev/cxgbe/common/common.h Mon Jul 17 00:42:13 2017 (r321063) @@ -399,16 +399,18 @@ struct trace_params { }; struct link_config { + /* OS-specific code owns all the requested_* fields */ + unsigned char requested_aneg; /* link aneg user has requested */ + unsigned char requested_fc; /* flow control user has requested */ + unsigned char requested_fec; /* FEC user has requested */ + unsigned int requested_speed; /* speed user has requested */ + unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ unsigned short lp_advertising; /* peer advertised capabilities */ - unsigned int requested_speed; /* speed user has requested */ unsigned int speed; /* actual link speed */ - unsigned char requested_fc; /* flow control user has requested */ unsigned char fc; /* actual link flow control */ - unsigned char requested_fec; /* FEC user has requested */ unsigned char fec; /* actual FEC */ - unsigned char autoneg; /* autonegotiating? */ unsigned char link_ok; /* link up? */ unsigned char link_down_rc; /* link down reason */ }; @@ -766,6 +768,7 @@ int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned i u32 *data); int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); const char *t4_link_down_rc_str(unsigned char link_down_rc); +int t4_update_port_info(struct port_info *pi); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); int t4_sched_config(struct adapter *adapter, int type, int minmaxen, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Jul 16 21:07:58 2017 (r321062) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Jul 17 00:42:13 2017 (r321063) @@ -3683,9 +3683,6 @@ void t4_ulprx_read_la(struct adapter *adap, u32 *la_bu } } -#define ADVERT_MASK (V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED) | \ - FW_PORT_CAP_ANEG) - /** * t4_link_l1cfg - apply link configuration to MAC/PHY * @phy: the PHY to setup @@ -3704,7 +3701,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m { struct fw_port_cmd c; unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); - unsigned int fc, fec; + unsigned int aneg, fc, fec, speed; fc = 0; if (lc->requested_fc & PAUSE_RX) @@ -3714,12 +3711,41 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m fec = 0; if (lc->requested_fec & FEC_RS) - fec |= FW_PORT_CAP_FEC_RS; - if (lc->requested_fec & FEC_BASER_RS) - fec |= FW_PORT_CAP_FEC_BASER_RS; - if (lc->requested_fec & FEC_RESERVED) - fec |= FW_PORT_CAP_FEC_RESERVED; + fec = FW_PORT_CAP_FEC_RS; + else if (lc->requested_fec & FEC_BASER_RS) + fec = FW_PORT_CAP_FEC_BASER_RS; + else if (lc->requested_fec & FEC_RESERVED) + fec = FW_PORT_CAP_FEC_RESERVED; + if (!(lc->supported & FW_PORT_CAP_ANEG) || + lc->requested_aneg == AUTONEG_DISABLE) { + aneg = 0; + switch (lc->requested_speed) { + case 100: + speed = FW_PORT_CAP_SPEED_100G; + break; + case 40: + speed = FW_PORT_CAP_SPEED_40G; + break; + case 25: + speed = FW_PORT_CAP_SPEED_25G; + break; + case 10: + speed = FW_PORT_CAP_SPEED_10G; + break; + case 1: + speed = FW_PORT_CAP_SPEED_1G; + break; + default: + return -EINVAL; + break; + } + } else { + aneg = FW_PORT_CAP_ANEG; + speed = lc->supported & + V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); + } + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3727,21 +3753,9 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m c.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) | FW_LEN16(c)); + c.u.l1cfg.rcap = cpu_to_be32(aneg | speed | fc | fec | mdi); - if (!(lc->supported & FW_PORT_CAP_ANEG)) { - c.u.l1cfg.rcap = cpu_to_be32((lc->supported & ADVERT_MASK) | - fc | fec); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else if (lc->autoneg == AUTONEG_DISABLE) { - c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | - fc | fec | mdi); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else - c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | fec | mdi); - - return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); + return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } /** @@ -7474,7 +7488,91 @@ const char *t4_link_down_rc_str(unsigned char link_dow return reason[link_down_rc]; } +/* + * Updates all fields owned by the common code in port_info and link_config + * based on information provided by the firmware. Does not touch any + * requested_* field. + */ +static void handle_port_info(struct port_info *pi, const struct fw_port_info *p) +{ + struct link_config *lc = &pi->link_cfg; + int speed; + unsigned char fc, fec; + u32 stat = be32_to_cpu(p->lstatus_to_modtype); + + pi->port_type = G_FW_PORT_CMD_PTYPE(stat); + pi->mod_type = G_FW_PORT_CMD_MODTYPE(stat); + pi->mdio_addr = stat & F_FW_PORT_CMD_MDIOCAP ? + G_FW_PORT_CMD_MDIOADDR(stat) : -1; + + lc->supported = be16_to_cpu(p->pcap); + lc->advertising = be16_to_cpu(p->acap); + lc->lp_advertising = be16_to_cpu(p->lpacap); + lc->link_ok = (stat & F_FW_PORT_CMD_LSTATUS) != 0; + lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC(stat); + + speed = 0; + if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M)) + speed = 100; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G)) + speed = 1000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) + speed = 10000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_25G)) + speed = 25000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) + speed = 40000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100G)) + speed = 100000; + lc->speed = speed; + + fc = 0; + if (stat & F_FW_PORT_CMD_RXPAUSE) + fc |= PAUSE_RX; + if (stat & F_FW_PORT_CMD_TXPAUSE) + fc |= PAUSE_TX; + lc->fc = fc; + + fec = 0; + if (lc->advertising & FW_PORT_CAP_FEC_RS) + fec |= FEC_RS; + if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) + fec |= FEC_BASER_RS; + if (lc->advertising & FW_PORT_CAP_FEC_RESERVED) + fec |= FEC_RESERVED; + lc->fec = fec; +} + /** + * t4_update_port_info - retrieve and update port information if changed + * @pi: the port_info + * + * We issue a Get Port Information Command to the Firmware and, if + * successful, we check to see if anything is different from what we + * last recorded and update things accordingly. + */ + int t4_update_port_info(struct port_info *pi) + { + struct fw_port_cmd port_cmd; + int ret; + + memset(&port_cmd, 0, sizeof port_cmd); + port_cmd.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_PORT_CMD_PORTID(pi->tx_chan)); + port_cmd.action_to_len16 = cpu_to_be32( + V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | + FW_LEN16(port_cmd)); + ret = t4_wr_mbox_ns(pi->adapter, pi->adapter->mbox, + &port_cmd, sizeof(port_cmd), &port_cmd); + if (ret) + return ret; + + handle_port_info(pi, &port_cmd.u.info); + return 0; +} + +/** * t4_handle_fw_rpl - process a FW reply message * @adap: the adapter * @rpl: start of the FW message @@ -7490,52 +7588,31 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be6 if (opcode == FW_PORT_CMD && action == FW_PORT_ACTION_GET_PORT_INFO) { /* link/module state change message */ - int speed = 0, fc = 0, i; + int i, old_ptype, old_mtype; int chan = G_FW_PORT_CMD_PORTID(be32_to_cpu(p->op_to_portid)); struct port_info *pi = NULL; - struct link_config *lc; - u32 stat = be32_to_cpu(p->u.info.lstatus_to_modtype); - int link_ok = (stat & F_FW_PORT_CMD_LSTATUS) != 0; - u32 mod = G_FW_PORT_CMD_MODTYPE(stat); + struct link_config *lc, old_lc; - if (stat & F_FW_PORT_CMD_RXPAUSE) - fc |= PAUSE_RX; - if (stat & F_FW_PORT_CMD_TXPAUSE) - fc |= PAUSE_TX; - if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M)) - speed = 100; - else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G)) - speed = 1000; - else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) - speed = 10000; - else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_25G)) - speed = 25000; - else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) - speed = 40000; - else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100G)) - speed = 100000; - for_each_port(adap, i) { pi = adap2pinfo(adap, i); if (pi->tx_chan == chan) break; } + lc = &pi->link_cfg; + old_lc = *lc; + old_ptype = pi->port_type; + old_mtype = pi->mod_type; - if (mod != pi->mod_type) { - pi->mod_type = mod; - t4_os_portmod_changed(adap, i); + handle_port_info(pi, &p->u.info); + if (old_ptype != pi->port_type || old_mtype != pi->mod_type) { + t4_os_portmod_changed(pi, old_ptype, old_mtype, + &old_lc); } - if (link_ok != lc->link_ok || speed != lc->speed || - fc != lc->fc) { /* something changed */ - if (!link_ok && lc->link_ok) - lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC(stat); - lc->link_ok = link_ok; - lc->speed = speed; - lc->fc = fc; - lc->supported = be16_to_cpu(p->u.info.pcap); - lc->lp_advertising = be16_to_cpu(p->u.info.lpacap); - t4_os_link_changed(adap, i, link_ok); + if (old_lc.link_ok != lc->link_ok || + old_lc.speed != lc->speed || + old_lc.fc != lc->fc) { + t4_os_link_changed(pi, &old_lc); } } else { CH_WARN_RATELIMIT(adap, "Unknown firmware reply %d\n", opcode); @@ -7566,48 +7643,6 @@ static void get_pci_mode(struct adapter *adapter, } } -/** - * init_link_config - initialize a link's SW state - * @lc: structure holding the link state - * @pcaps: supported link capabilities - * @acaps: advertised link capabilities - * - * Initializes the SW state maintained for each link, including the link's - * capabilities and default speed/flow-control/autonegotiation settings. - */ -static void init_link_config(struct link_config *lc, unsigned int pcaps, - unsigned int acaps) -{ - unsigned int fec; - - lc->supported = pcaps; - lc->lp_advertising = 0; - lc->requested_speed = 0; - lc->speed = 0; - lc->requested_fc = lc->fc = PAUSE_RX | PAUSE_TX; - lc->link_ok = 0; - lc->link_down_rc = 255; - - fec = 0; - if (acaps & FW_PORT_CAP_FEC_RS) - fec |= FEC_RS; - if (acaps & FW_PORT_CAP_FEC_BASER_RS) - fec |= FEC_BASER_RS; - if (acaps & FW_PORT_CAP_FEC_RESERVED) - fec |= FEC_RESERVED; - fec &= G_FW_PORT_CAP_FEC(lc->supported); - lc->requested_fec = lc->fec = fec; - - if (lc->supported & FW_PORT_CAP_ANEG) { - lc->advertising = lc->supported & ADVERT_MASK; - lc->autoneg = AUTONEG_ENABLE; - lc->requested_fc |= PAUSE_AUTONEG; - } else { - lc->advertising = 0; - lc->autoneg = AUTONEG_DISABLE; - } -} - struct flash_desc { u32 vendor_and_model_id; u32 size_mb; @@ -8144,24 +8179,7 @@ int t4_port_init(struct adapter *adap, int mbox, int p if (!(adap->flags & IS_VF) || adap->params.vfres.r_caps & FW_CMD_CAP_PORT) { - c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ | - V_FW_PORT_CMD_PORTID(j)); - c.action_to_len16 = htonl( - V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | - FW_LEN16(c)); - ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret) - return ret; - - ret = be32_to_cpu(c.u.info.lstatus_to_modtype); - p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? - G_FW_PORT_CMD_MDIOADDR(ret) : -1; - p->port_type = G_FW_PORT_CMD_PTYPE(ret); - p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); - - init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap), - be16_to_cpu(c.u.info.acap)); + t4_update_port_info(p); } ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); @@ -8177,7 +8195,7 @@ int t4_port_init(struct adapter *adap, int mbox, int p p->rx_chan_map = t4_get_mps_bg_map(adap, j); p->lport = j; p->vi[0].rss_size = rss_size; - t4_os_set_hw_addr(adap, p->port_id, addr); + t4_os_set_hw_addr(p, addr); param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Jul 16 21:07:58 2017 (r321062) +++ head/sys/dev/cxgbe/t4_main.c Mon Jul 17 00:42:13 2017 (r321063) @@ -487,6 +487,7 @@ static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); static void build_medialist(struct port_info *, struct ifmedia *); +static void init_l1cfg(struct port_info *); static int cxgbe_init_synchronized(struct vi_info *); static int cxgbe_uninit_synchronized(struct vi_info *); static void quiesce_txq(struct adapter *, struct sge_txq *); @@ -955,7 +956,6 @@ t4_attach(device_t dev) n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; - struct link_config *lc; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -984,28 +984,6 @@ t4_attach(device_t dev) goto done; } - lc = &pi->link_cfg; - lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); - lc->requested_fc |= t4_pause_settings; - if (t4_fec != -1) { - lc->requested_fec = t4_fec & - G_FW_PORT_CAP_FEC(lc->supported); - } - if (lc->supported & FW_PORT_CAP_ANEG && t4_autoneg != -1) { - lc->autoneg = t4_autoneg ? AUTONEG_ENABLE : - AUTONEG_DISABLE; - } - lc->requested_speed = port_top_speed_raw(pi); - - rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); - if (rc != 0) { - device_printf(dev, "port %d l1cfg failed: %d\n", i, rc); - free(pi->vi, M_CXGBE); - free(pi, M_CXGBE); - sc->port[i] = NULL; - goto done; - } - snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); @@ -1480,7 +1458,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) /* Initialize ifmedia for this VI */ ifmedia_init(&vi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); - build_medialist(vi->pi, &vi->media); vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp, EVENTHANDLER_PRI_ANY); @@ -2022,32 +1999,63 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediare struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; struct ifmedia_entry *cur; - int speed = pi->link_cfg.speed; + struct link_config *lc = &pi->link_cfg; + /* + * If all the interfaces are administratively down the firmware does not + * report transceiver changes. Refresh port info here so that ifconfig + * displays accurate information at all times. + */ + if (begin_synchronized_op(pi->adapter, NULL, SLEEP_OK | INTR_OK, + "t4med") == 0) { + PORT_LOCK(pi); + if (pi->up_vis == 0) { + t4_update_port_info(pi); + build_medialist(pi, &vi->media); + } + PORT_UNLOCK(pi); + end_synchronized_op(pi->adapter, 0); + } + cur = vi->media.ifm_cur; ifmr->ifm_status = IFM_AVALID; - if (!pi->link_cfg.link_ok) + if (lc->link_ok == 0) return; ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active &= ~(IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE); + if (lc->fc & PAUSE_RX) + ifmr->ifm_active |= IFM_ETH_RXPAUSE; + if (lc->fc & PAUSE_TX) + ifmr->ifm_active |= IFM_ETH_TXPAUSE; /* active and current will differ iff current media is autoselect. */ if (IFM_SUBTYPE(cur->ifm_media) != IFM_AUTO) return; ifmr->ifm_active = IFM_ETHER | IFM_FDX; - if (speed == 10000) + if (lc->fc & PAUSE_RX) + ifmr->ifm_active |= IFM_ETH_RXPAUSE; + if (lc->fc & PAUSE_TX) + ifmr->ifm_active |= IFM_ETH_TXPAUSE; + switch (lc->speed) { + case 10000: ifmr->ifm_active |= IFM_10G_T; - else if (speed == 1000) + break; + case 1000: ifmr->ifm_active |= IFM_1000_T; - else if (speed == 100) + break; + case 100: ifmr->ifm_active |= IFM_100_TX; - else if (speed == 10) + break; + case 10: ifmr->ifm_active |= IFM_10_T; - else - KASSERT(0, ("%s: link up but speed unknown (%u)", __func__, - speed)); + break; + default: + device_printf(vi->dev, "link up but speed unknown (%u)\n", + lc->speed); + } } static int @@ -3590,11 +3598,18 @@ build_medialist(struct port_info *pi, struct ifmedia * { int m; - PORT_LOCK(pi); + PORT_LOCK_ASSERT_OWNED(pi); ifmedia_removeall(media); - m = IFM_ETHER | IFM_FDX; + /* + * XXX: Would it be better to ifmedia_add all 4 combinations of pause + * settings for every speed instead of just txpause|rxpause? ifconfig + * media display looks much better if autoselect is the only case where + * ifm_current is different from ifm_active. If the user picks anything + * except txpause|rxpause the display is ugly. + */ + m = IFM_ETHER | IFM_FDX | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE; switch(pi->port_type) { case FW_PORT_TYPE_BT_XFI: @@ -3770,8 +3785,53 @@ build_medialist(struct port_info *pi, struct ifmedia * ifmedia_set(media, m | IFM_UNKNOWN); break; } +} - PORT_UNLOCK(pi); +/* + * Update all the requested_* fields in the link config and then send a mailbox + * command to apply the settings. + */ +static void +init_l1cfg(struct port_info *pi) +{ + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc; + + ASSERT_SYNCHRONIZED_OP(sc); + + if (t4_autoneg != 0 && lc->supported & FW_PORT_CAP_ANEG) { + lc->requested_aneg = AUTONEG_ENABLE; + lc->requested_speed = 0; + } else { + lc->requested_aneg = AUTONEG_DISABLE; + lc->requested_speed = port_top_speed(pi); /* in Gbps */ + } + + lc->requested_fc = t4_pause_settings & (PAUSE_TX | PAUSE_RX); + + if (t4_fec != -1) { + lc->requested_fec = t4_fec & (FEC_RS | FEC_BASER_RS | + FEC_RESERVED); + } else { + /* Use the suggested value provided by the firmware in acaps */ + if (lc->advertising & FW_PORT_CAP_FEC_RS) + lc->requested_fec = FEC_RS; + else if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) + lc->requested_fec = FEC_BASER_RS; + else if (lc->advertising & FW_PORT_CAP_FEC_RESERVED) + lc->requested_fec = FEC_RESERVED; + else + lc->requested_fec = 0; + } + + rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + if (rc != 0) { + device_printf(pi->dev, "l1cfg failed: %d\n", rc); + } else { + lc->fc = lc->requested_fc; + lc->fec = lc->requested_fec; + } } #define FW_MAC_EXACT_CHUNK 7 @@ -4053,8 +4113,12 @@ cxgbe_init_synchronized(struct vi_info *vi) /* all ok */ PORT_LOCK(pi); + if (pi->up_vis++ == 0) { + t4_update_port_info(pi); + build_medialist(vi->pi, &vi->media); + init_l1cfg(pi); + } ifp->if_drv_flags |= IFF_DRV_RUNNING; - pi->up_vis++; if (pi->nvi > 1 || sc->flags & IS_VF) callout_reset(&vi->tick, hz, vi_tick, vi); @@ -4127,7 +4191,7 @@ cxgbe_uninit_synchronized(struct vi_info *vi) pi->link_cfg.link_ok = 0; pi->link_cfg.speed = 0; pi->link_cfg.link_down_rc = 255; - t4_os_link_changed(sc, pi->port_id, 0); + t4_os_link_changed(pi, NULL); return (0); } @@ -5813,6 +5877,9 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS) lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); lc->requested_fc |= n; rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + if (rc == 0) { + lc->fc = lc->requested_fc; + } } end_synchronized_op(sc, 0); } @@ -5870,6 +5937,9 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) lc->requested_fec = n & G_FW_PORT_CAP_FEC(lc->supported); rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + if (rc == 0) { + lc->fec = lc->requested_fec; + } } end_synchronized_op(sc, 0); } @@ -5886,7 +5956,7 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) int rc, val, old; if (lc->supported & FW_PORT_CAP_ANEG) - val = lc->autoneg == AUTONEG_ENABLE ? 1 : 0; + val = lc->requested_aneg == AUTONEG_ENABLE ? 1 : 0; else val = -1; rc = sysctl_handle_int(oidp, &val, 0, req); @@ -5901,18 +5971,18 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) val = AUTONEG_ENABLE; else return (EINVAL); - if (lc->autoneg == val) + if (lc->requested_aneg == val) return (0); /* no change */ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4aneg"); if (rc) return (rc); - old = lc->autoneg; - lc->autoneg = val; + old = lc->requested_aneg; + lc->requested_aneg = val; rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc != 0) - lc->autoneg = old; + lc->requested_aneg = old; end_synchronized_op(sc, 0); return (rc); } @@ -8874,9 +8944,9 @@ t4_os_pci_restore_state(struct adapter *sc) } void -t4_os_portmod_changed(const struct adapter *sc, int idx) +t4_os_portmod_changed(struct port_info *pi, int old_ptype, int old_mtype, + struct link_config *old_lc) { - struct port_info *pi = sc->port[idx]; struct vi_info *vi; struct ifnet *ifp; int v; @@ -8884,9 +8954,15 @@ t4_os_portmod_changed(const struct adapter *sc, int id NULL, "LR", "SR", "ER", "TWINAX", "active TWINAX", "LRM" }; + PORT_LOCK(pi); for_each_vi(pi, v, vi) { build_medialist(pi, &vi->media); } + PORT_UNLOCK(pi); + if (begin_synchronized_op(pi->adapter, vi, HOLD_LOCK, "t4mod") == 0) { + init_l1cfg(pi); + end_synchronized_op(pi->adapter, LOCK_HELD); + } ifp = pi->vi[0].ifp; if (pi->mod_type == FW_PORT_MOD_TYPE_NONE) @@ -8896,8 +8972,8 @@ t4_os_portmod_changed(const struct adapter *sc, int id else if (pi->mod_type == FW_PORT_MOD_TYPE_NOTSUPPORTED) if_printf(ifp, "unsupported transceiver inserted.\n"); else if (pi->mod_type > 0 && pi->mod_type < nitems(mod_str)) { - if_printf(ifp, "%s transceiver inserted.\n", - mod_str[pi->mod_type]); + if_printf(ifp, "%dGbps %s transceiver inserted.\n", + port_top_speed(pi), mod_str[pi->mod_type]); } else { if_printf(ifp, "transceiver (type %d) inserted.\n", pi->mod_type); @@ -8905,11 +8981,11 @@ t4_os_portmod_changed(const struct adapter *sc, int id } void -t4_os_link_changed(struct adapter *sc, int idx, int link_stat) +t4_os_link_changed(struct port_info *pi, struct link_config *old_lc) { - struct port_info *pi = sc->port[idx]; struct vi_info *vi; struct ifnet *ifp; + struct link_config *lc; int v; for_each_vi(pi, v, vi) { @@ -8917,8 +8993,9 @@ t4_os_link_changed(struct adapter *sc, int idx, int li if (ifp == NULL) continue; - if (link_stat) { - ifp->if_baudrate = IF_Mbps(pi->link_cfg.speed); + lc = &pi->link_cfg; + if (lc->link_ok) { + ifp->if_baudrate = IF_Mbps(lc->speed); if_link_state_change(ifp, LINK_STATE_UP); } else { if_link_state_change(ifp, LINK_STATE_DOWN); From owner-svn-src-all@freebsd.org Mon Jul 17 02:52: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 D38B8C7F070; Mon, 17 Jul 2017 02:52:03 +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 9A9326F0E7; Mon, 17 Jul 2017 02:52:03 +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 v6H2q2Db002497; Mon, 17 Jul 2017 02:52:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H2q2C6002494; Mon, 17 Jul 2017 02:52:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170252.v6H2q2C6002494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 02:52: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: r321064 - in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 321064 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 02:52:03 -0000 Author: delphij Date: Mon Jul 17 02:52:02 2017 New Revision: 321064 URL: https://svnweb.freebsd.org/changeset/base/321064 Log: MFC r320986: 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: 黃清隆 Modified: stable/11/share/man/man4/arcmsr.4 stable/11/sys/dev/arcmsr/arcmsr.c stable/11/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/arcmsr.4 ============================================================================== --- stable/11/share/man/man4/arcmsr.4 Mon Jul 17 00:42:13 2017 (r321063) +++ stable/11/share/man/man4/arcmsr.4 Mon Jul 17 02:52:02 2017 (r321064) @@ -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: stable/11/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/11/sys/dev/arcmsr/arcmsr.c Mon Jul 17 00:42:13 2017 (r321063) +++ stable/11/sys/dev/arcmsr/arcmsr.c Mon Jul 17 02:52:02 2017 (r321064) @@ -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 Mon Jul 17 06:10: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 B7F51CFCED2; Mon, 17 Jul 2017 06:10:55 +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 846EA73A73; Mon, 17 Jul 2017 06:10:55 +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 v6H6AsqD083805; Mon, 17 Jul 2017 06:10:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6AsDr083804; Mon, 17 Jul 2017 06:10:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707170610.v6H6AsDr083804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Jul 2017 06:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321065 - 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: 321065 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:10:55 -0000 Author: kib Date: Mon Jul 17 06:10:54 2017 New Revision: 321065 URL: https://svnweb.freebsd.org/changeset/base/321065 Log: MFC r320989: Language improvements. Modified: stable/11/libexec/rtld-elf/rtld.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.1 ============================================================================== --- stable/11/libexec/rtld-elf/rtld.1 Mon Jul 17 02:52:02 2017 (r321064) +++ stable/11/libexec/rtld-elf/rtld.1 Mon Jul 17 06:10:54 2017 (r321065) @@ -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 Mon Jul 17 06:14: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 10438CFD1B2; Mon, 17 Jul 2017 06:14: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 E0BA873E6F; Mon, 17 Jul 2017 06:14:49 +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 v6H6Ennt084854; Mon, 17 Jul 2017 06:14:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6EnCe084853; Mon, 17 Jul 2017 06:14:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707170614.v6H6EnCe084853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Jul 2017 06:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321066 - 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: 321066 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:14:50 -0000 Author: kib Date: Mon Jul 17 06:14:48 2017 New Revision: 321066 URL: https://svnweb.freebsd.org/changeset/base/321066 Log: MFC r320868: Fix warnings, adjust style. Modified: stable/11/lib/libc/gen/dlfcn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/dlfcn.c ============================================================================== --- stable/11/lib/libc/gen/dlfcn.c Mon Jul 17 06:10:54 2017 (r321065) +++ stable/11/lib/libc/gen/dlfcn.c Mon Jul 17 06:14:48 2017 (r321066) @@ -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 17 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 33621CFD810; Mon, 17 Jul 2017 06:25:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA77745DE; Mon, 17 Jul 2017 06:25:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA05357; Mon, 17 Jul 2017 09:25:27 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dWzTD-0006NH-Kh; Mon, 17 Jul 2017 09:25:27 +0300 Subject: Re: svn commit: r320452 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Peter Wemm Cc: svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org References: <201706281359.v5SDxKDB033681@repo.freebsd.org> <2865573.6VCVxXl8ZR@overcee.wemm.org> <2227668.mxUYtcVILl@overcee.wemm.org> <1620155.k5U0yJ7ekR@overcee.wemm.org> From: Andriy Gapon Message-ID: Date: Mon, 17 Jul 2017 09:24:06 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1620155.k5U0yJ7ekR@overcee.wemm.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US 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: Mon, 17 Jul 2017 06:25:31 -0000 On 12/07/2017 22:52, Peter Wemm wrote: > 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 pointer >>>> to its corresponding bio while the zio is active. >>> >>> fault virtual address = 0x28 >>> >>> >>> db> where >>> 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 >> >> Oops, truncated. >> >> >> 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 = 0, rsp = 0, rbp = 0 --- > > Likewise with a disk failing or being put offline. eg: the explicit offlining > case, making a vdev degrade: Peter, could you please see if the patch from the bug report you opened helps with the problems? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220691#c3 Sorry for the breakage and thank you for the report. > root@nope.ysv:/home/peter # zpool offline zroot mfid5p3 > > atal trap 12: page fault while in kernel mode > cpuid = 4; apic id = 04 > > Fatal trap 12: page fault while in kernel mode > fault virtual address = 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 = 7; apic id = 07 > cpuid = 1; apic id = 01 > fault virtual address = 0x28 > fault code = supervisor read data, page not present > cpuid = 3; cpuid = 5; apic id = 03 > Fatal trap 12: page fault while in kernel mode > apic id = 05 > fault virtual address = 0x28 > fault virtual address = 0x28 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff803aab56 > stack pointer = 0x28:0xfffffe085fb3aa90 > instruction pointer = 0x20:0xffffffff803aab56 > fault code = supervisor read data, page not present > cpuid = 6; fault virtual address = 0x28 > Fatal trap 12: page fault while in kernel mode > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff803aab56 > stack pointer = 0x28:0xfffffe085fb3fa90 > frame pointer = 0x28:0xfffffe085fb3aaa0 > fault code = supervisor read data, page not present > cpuid = 2; apic id = 02 > apic id = 06 > instruction pointer = 0x20:0xffffffff803aab56 > fault virtual address = 0x28 > fault code = supervisor read data, page not present > stack pointer = 0x28:0xfffffe085fb30a90 > instruction pointer = 0x20:0xffffffff803aab56 > stack pointer = 0x28:0xfffffe085fb35a90 > frame pointer = 0x28:0xfffffe085fb3faa0 > code segment = base 0x0, limit 0xfffff, type 0x1b > stack pointer = 0x28:0xfffffe085fb44a90 > frame pointer = 0x28:0xfffffe085fb44aa0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > fault virtual address = 0x28 > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, instruction pointer = 0x20:6 > frame pointer = 0x28:0xfffffe085fb30aa0 > code segment = base 0x0, limit 0xfffff, type 0x1b > code segment = base 0x0, limit 0xfffff, type 0x1b > frame pointer = 0x28:0xfffffe085fb35aa0 > code segment = base 0x0, limit 0xfffff, type 0x1b > resume, IOPL = 0 > stack pointer = 0x28:0xfffffe085fb26a90 > = DPL 0, pres 1, long 1, def32 0, gran 1 > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = fault code = supervisor read data, page not > frame pointer = 0x28:0xfffffe085fb26aa0 > instruction pointer = 0x20:0xffffffff803aab56 > processor eflags = interrupt enabled, code segment = base b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 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 0xfffffe085fb30b80 > taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe085fb30bb0 > fork_exit() at fork_exit+0x85/frame 0xfffffe085fb30bf0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe085fb30bf0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > db> > -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Jul 17 06:28: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 6D5D1CFD92F; Mon, 17 Jul 2017 06:28:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241F1748F0; Mon, 17 Jul 2017 06:28:35 +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 v6H6SYmw089266; Mon, 17 Jul 2017 06:28:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6SYvw089263; Mon, 17 Jul 2017 06:28:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170628.v6H6SYvw089263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:28: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: r321067 - in stable/10: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 321067 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:28:35 -0000 Author: delphij Date: Mon Jul 17 06:28:34 2017 New Revision: 321067 URL: https://svnweb.freebsd.org/changeset/base/321067 Log: MFC r320986: 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: 黃清隆 Modified: stable/10/share/man/man4/arcmsr.4 stable/10/sys/dev/arcmsr/arcmsr.c stable/10/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Mon Jul 17 06:14:48 2017 (r321066) +++ stable/10/share/man/man4/arcmsr.4 Mon Jul 17 06:28:34 2017 (r321067) @@ -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: stable/10/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/10/sys/dev/arcmsr/arcmsr.c Mon Jul 17 06:14:48 2017 (r321066) +++ stable/10/sys/dev/arcmsr/arcmsr.c Mon Jul 17 06:28:34 2017 (r321067) @@ -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; } } /* @@ -963,9 +1048,9 @@ static void arcmsr_iop_reset(struct AdapterControlBloc srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); - printf("arcmsr%d: scsi id=%d lun=%d srb='%p' aborted\n" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p' aborted\n" , acb->pci_unit, srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); } } /* enable all outbound interrupt */ @@ -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; } } /* @@ -1398,8 +1537,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struc struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; - u_int8_t *buf1 = 0; - u_int32_t *iop_data, *buf2 = 0; + u_int8_t *buf1 = NULL; + u_int32_t *iop_data, *buf2 = NULL; u_int32_t iop_len, data_len; iop_data = (u_int32_t *)prbuffer->data; @@ -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; @@ -1494,8 +1634,8 @@ static void arcmsr_Write_data_2iop_wqbuffer_D(struct A { u_int8_t *pQbuffer; struct QBUFFER *pwbuffer; - u_int8_t *buf1 = 0; - u_int32_t *iop_data, *buf2 = 0; + u_int8_t *buf1 = NULL; + u_int32_t *iop_data, *buf2 = NULL; u_int32_t allxfer_len = 0, data_len; if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { @@ -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) @@ -2754,10 +3012,10 @@ static u_int8_t arcmsr_seek_cmd2abort(union ccb *abort if(srb->srb_state == ARCMSR_SRB_START) { if(srb->pccb == abortccb) { srb->srb_state = ARCMSR_SRB_ABORTED; - printf("arcmsr%d:scsi id=%d lun=%d abort srb '%p'" + printf("arcmsr%d:scsi id=%d lun=%jx abort srb '%p'" "outstanding command \n" , acb->pci_unit, abortccb->ccb_h.target_id - , abortccb->ccb_h.target_lun, srb); + , (uintmax_t)abortccb->ccb_h.target_lun, srb); arcmsr_polling_srbdone(acb, srb); /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); @@ -2883,12 +3141,6 @@ static void arcmsr_action(struct cam_sim *psim, union } break; } - case XPT_TARGET_IO: { - /* target mode not yet support vendor specific commands. */ - pccb->ccb_h.status |= CAM_REQ_CMP; - xpt_done(pccb); - break; - } case XPT_PATH_INQ: { struct ccb_pathinq *cpi = &pccb->cpi; @@ -2913,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)) { @@ -2938,7 +3191,6 @@ static void arcmsr_action(struct cam_sim *psim, union pabort_ccb = pccb->cab.abort_ccb; switch (pabort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: case XPT_CONT_TARGET_IO: if(arcmsr_seek_cmd2abort(pabort_ccb)==TRUE) { pabort_ccb->ccb_h.status |= CAM_REQ_ABORTED; @@ -2998,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)) { @@ -3157,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) { @@ -3172,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; } } /* @@ -3210,11 +3480,11 @@ polling_ccb_retry: 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=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3269,11 +3539,11 @@ polling_ccb_retry: 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=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3324,8 +3594,8 @@ polling_ccb_retry: 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=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + 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; @@ -3380,8 +3650,8 @@ polling_ccb_retry: 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=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + 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; @@ -3395,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) { @@ -3416,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; } } /* @@ -3622,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) { @@ -3641,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; } } /* @@ -3702,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; } } /* @@ -3745,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; } } /* @@ -3851,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); } @@ -3860,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; } } /* @@ -3920,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); @@ -3928,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; } /* @@ -3999,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; @@ -4147,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) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 17 06:36: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 47D9DCFDC24; Mon, 17 Jul 2017 06:36:43 +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 16C6974E26; Mon, 17 Jul 2017 06:36:43 +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 v6H6agLg093403; Mon, 17 Jul 2017 06:36:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6agP9093402; Mon, 17 Jul 2017 06:36:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170636.v6H6agP9093402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:36: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: r321068 - stable/11/libexec/rshd X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/libexec/rshd X-SVN-Commit-Revision: 321068 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:36:43 -0000 Author: delphij Date: Mon Jul 17 06:36:42 2017 New Revision: 321068 URL: https://svnweb.freebsd.org/changeset/base/321068 Log: MFC r320433: Use strlcpy() instead of strncpy() and nul-terminating. Modified: stable/11/libexec/rshd/rshd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rshd/rshd.c ============================================================================== --- stable/11/libexec/rshd/rshd.c Mon Jul 17 06:28:34 2017 (r321067) +++ stable/11/libexec/rshd/rshd.c Mon Jul 17 06:36:42 2017 (r321068) @@ -338,8 +338,7 @@ doit(struct sockaddr *fromp) pam_err = pam_authenticate(pamh, 0); if (pam_err == PAM_SUCCESS) { if ((pam_err = pam_get_user(pamh, &cp, NULL)) == PAM_SUCCESS) { - strncpy(luser, cp, sizeof(luser)); - luser[sizeof(luser) - 1] = '\0'; + strlcpy(luser, cp, sizeof(luser)); /* XXX truncation! */ } pam_err = pam_acct_mgmt(pamh, 0); @@ -386,9 +385,7 @@ doit(struct sockaddr *fromp) if (lc != NULL && fromp->sa_family == AF_INET) { /*XXX*/ char remote_ip[MAXHOSTNAMELEN]; - strncpy(remote_ip, numericname, - sizeof(remote_ip) - 1); - remote_ip[sizeof(remote_ip) - 1] = 0; + strlcpy(remote_ip, numericname, sizeof(remote_ip)); /* XXX truncation! */ if (!auth_hostok(lc, rhost, remote_ip)) { syslog(LOG_INFO|LOG_AUTH, From owner-svn-src-all@freebsd.org Mon Jul 17 06:37: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 E220BCFDD95; Mon, 17 Jul 2017 06:37:47 +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 B09E875115; Mon, 17 Jul 2017 06:37:47 +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 v6H6bk9r093490; Mon, 17 Jul 2017 06:37:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6bkpT093489; Mon, 17 Jul 2017 06:37:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170637.v6H6bkpT093489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:37: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: r321069 - stable/10/libexec/rshd X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/libexec/rshd X-SVN-Commit-Revision: 321069 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:37:48 -0000 Author: delphij Date: Mon Jul 17 06:37:46 2017 New Revision: 321069 URL: https://svnweb.freebsd.org/changeset/base/321069 Log: MFC r320433: Use strlcpy() instead of strncpy() and nul-terminating. Modified: stable/10/libexec/rshd/rshd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rshd/rshd.c ============================================================================== --- stable/10/libexec/rshd/rshd.c Mon Jul 17 06:36:42 2017 (r321068) +++ stable/10/libexec/rshd/rshd.c Mon Jul 17 06:37:46 2017 (r321069) @@ -322,8 +322,7 @@ doit(struct sockaddr *fromp) pam_err = pam_authenticate(pamh, 0); if (pam_err == PAM_SUCCESS) { if ((pam_err = pam_get_user(pamh, &cp, NULL)) == PAM_SUCCESS) { - strncpy(luser, cp, sizeof(luser)); - luser[sizeof(luser) - 1] = '\0'; + strlcpy(luser, cp, sizeof(luser)); /* XXX truncation! */ } pam_err = pam_acct_mgmt(pamh, 0); @@ -364,9 +363,7 @@ doit(struct sockaddr *fromp) if (lc != NULL && fromp->sa_family == AF_INET) { /*XXX*/ char remote_ip[MAXHOSTNAMELEN]; - strncpy(remote_ip, numericname, - sizeof(remote_ip) - 1); - remote_ip[sizeof(remote_ip) - 1] = 0; + strlcpy(remote_ip, numericname, sizeof(remote_ip)); /* XXX truncation! */ if (!auth_hostok(lc, rhost, remote_ip)) { syslog(LOG_INFO|LOG_AUTH, From owner-svn-src-all@freebsd.org Mon Jul 17 06: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 CED6ECFDFEE; Mon, 17 Jul 2017 06:45:14 +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 9A824755C8; Mon, 17 Jul 2017 06:45: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 v6H6jD8G097444; Mon, 17 Jul 2017 06:45:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6jDLH097441; Mon, 17 Jul 2017 06:45:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170645.v6H6jDLH097441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321070 - stable/11/lib/libstand X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/lib/libstand X-SVN-Commit-Revision: 321070 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:45:14 -0000 Author: delphij Date: Mon Jul 17 06:45:13 2017 New Revision: 321070 URL: https://svnweb.freebsd.org/changeset/base/321070 Log: MFC r320468: Don't bother to set target for SEEK_END. While there also collapase SEEK_END into default case in lseek. Modified: stable/11/lib/libstand/bzipfs.c stable/11/lib/libstand/gzipfs.c stable/11/lib/libstand/lseek.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/bzipfs.c ============================================================================== --- stable/11/lib/libstand/bzipfs.c Mon Jul 17 06:37:46 2017 (r321069) +++ stable/11/lib/libstand/bzipfs.c Mon Jul 17 06:45:13 2017 (r321070) @@ -320,8 +320,6 @@ bzf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + bzf->bzf_bzstream.total_out_lo32; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/11/lib/libstand/gzipfs.c ============================================================================== --- stable/11/lib/libstand/gzipfs.c Mon Jul 17 06:37:46 2017 (r321069) +++ stable/11/lib/libstand/gzipfs.c Mon Jul 17 06:45:13 2017 (r321070) @@ -300,8 +300,6 @@ zf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + zf->zf_zstream.total_out; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/11/lib/libstand/lseek.c ============================================================================== --- stable/11/lib/libstand/lseek.c Mon Jul 17 06:37:46 2017 (r321069) +++ stable/11/lib/libstand/lseek.c Mon Jul 17 06:45:13 2017 (r321070) @@ -87,7 +87,6 @@ lseek(int fd, off_t offset, int where) case SEEK_CUR: f->f_offset += offset; break; - case SEEK_END: default: errno = EOFFSET; return (-1); From owner-svn-src-all@freebsd.org Mon Jul 17 06:46: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 997F3CFE091; Mon, 17 Jul 2017 06:46: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 634677571A; Mon, 17 Jul 2017 06:46: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 v6H6kvSd097565; Mon, 17 Jul 2017 06:46:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6kv1t097562; Mon, 17 Jul 2017 06:46:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170646.v6H6kv1t097562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321071 - stable/10/lib/libstand X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/lib/libstand X-SVN-Commit-Revision: 321071 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 06:46:58 -0000 Author: delphij Date: Mon Jul 17 06:46:57 2017 New Revision: 321071 URL: https://svnweb.freebsd.org/changeset/base/321071 Log: MFC r320468: Don't bother to set target for SEEK_END. While there also collapase SEEK_END into default case in lseek. Modified: stable/10/lib/libstand/bzipfs.c stable/10/lib/libstand/gzipfs.c stable/10/lib/libstand/lseek.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/bzipfs.c ============================================================================== --- stable/10/lib/libstand/bzipfs.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/bzipfs.c Mon Jul 17 06:46:57 2017 (r321071) @@ -320,8 +320,6 @@ bzf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + bzf->bzf_bzstream.total_out_lo32; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/10/lib/libstand/gzipfs.c ============================================================================== --- stable/10/lib/libstand/gzipfs.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/gzipfs.c Mon Jul 17 06:46:57 2017 (r321071) @@ -300,8 +300,6 @@ zf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + zf->zf_zstream.total_out; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/10/lib/libstand/lseek.c ============================================================================== --- stable/10/lib/libstand/lseek.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/lseek.c Mon Jul 17 06:46:57 2017 (r321071) @@ -87,7 +87,6 @@ lseek(int fd, off_t offset, int where) case SEEK_CUR: f->f_offset += offset; break; - case SEEK_END: default: errno = EOFFSET; return (-1); From owner-svn-src-all@freebsd.org Mon Jul 17 08:53: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 58539D145CD; Mon, 17 Jul 2017 08:53: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 279BF7CD8C; Mon, 17 Jul 2017 08:53:52 +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 v6H8rpAY050630; Mon, 17 Jul 2017 08:53:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H8rplh050628; Mon, 17 Jul 2017 08:53:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707170853.v6H8rplh050628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 17 Jul 2017 08:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321072 - in head: etc/defaults share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc/defaults share/man/man5 X-SVN-Commit-Revision: 321072 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 08:53:52 -0000 Author: manu Date: Mon Jul 17 08:53:51 2017 New Revision: 321072 URL: https://svnweb.freebsd.org/changeset/base/321072 Log: ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document usage in rc.conf(5) Reported by: markj Sponsored by: Gandi.net Modified: head/etc/defaults/rc.conf head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Jul 17 06:46:57 2017 (r321071) +++ head/etc/defaults/rc.conf Mon Jul 17 08:53:51 2017 (r321072) @@ -168,6 +168,7 @@ firewall_nat_enable="NO" # Enable kernel NAT (if firew firewall_nat_interface="" # Public interface or IPaddress to use firewall_nat_flags="" # Additional configuration parameters dummynet_enable="NO" # Load the dummynet(4) module +ipfw_netflow_enable="NO" # Enable netflow logging via ng_netflow ip_portrange_first="NO" # Set first dynamically allocated port ip_portrange_last="NO" # Set last dynamically allocated port ike_enable="NO" # Enable IKE daemon (usually racoon or isakmpd) Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Jul 17 06:46:57 2017 (r321071) +++ head/share/man/man5/rc.conf.5 Mon Jul 17 08:53:51 2017 (r321072) @@ -591,6 +591,39 @@ module if is also set to .Dq Li YES . .\" ------------------------------------------------------------------- +.It Va ipfw_netflow_enable +.Pq Vt bool +Setting this to +.Dq Li YES +will enable netflow logging via +.Xr ng_netflow 4 +.Pp +By default a ipfw rule is inserted and all packets are duplicated with +the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow +port using protocol version 5. +.It Va ipfw_netflow_hook +.Pq Vt str +netflow hook name, must be numerical +(default +.Pa 9995 ) . +.It Va ipfw_netflow_rule +.Pq Vt str +ipfw rule number +(default +.Pa 1000 ) . +.It Va ipfw_netflow_ip +.Pq Vt str +Destination server ip for receiving netflow data +(default +.Pa 127.0.0.1 ) . +.It Va ipfw_netflow_port +.Pq Vt str +Destination server port for receiving netflow data +(default +.Pa 9995 ) . +.It Va ipfw_netflow_version +.Pq Vt str +Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9. .It Va natd_program .Pq Vt str Path to From owner-svn-src-all@freebsd.org Mon Jul 17 09:26: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 19219D6D594; Mon, 17 Jul 2017 09:26:44 +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 D6B7E7E076; Mon, 17 Jul 2017 09:26:43 +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 v6H9QhGt062786; Mon, 17 Jul 2017 09:26:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H9Qhj2062785; Mon, 17 Jul 2017 09:26:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707170926.v6H9Qhj2062785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 17 Jul 2017 09:26: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: r321073 - stable/10/share/misc X-SVN-Group: stable-10 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/10/share/misc X-SVN-Commit-Revision: 321073 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 09:26:44 -0000 Author: bapt Date: Mon Jul 17 09:26:42 2017 New Revision: 321073 URL: https://svnweb.freebsd.org/changeset/base/321073 Log: MFC r320988: Update pci_vendors to 2017.07.13 Modified: stable/10/share/misc/pci_vendors Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/pci_vendors ============================================================================== --- stable/10/share/misc/pci_vendors Mon Jul 17 08:53:51 2017 (r321072) +++ stable/10/share/misc/pci_vendors Mon Jul 17 09:26:42 2017 (r321073) @@ -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 Mon Jul 17 14:09: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 2915DD88015; Mon, 17 Jul 2017 14:09:40 +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 B97812A68; Mon, 17 Jul 2017 14:09:39 +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 v6HE9c7e078401; Mon, 17 Jul 2017 14:09:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HE9ZKR078359; Mon, 17 Jul 2017 14:09:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707171409.v6HE9ZKR078359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Jul 2017 14:09:35 +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: r321074 - in stable/10/lib/libc: include stdio X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10/lib/libc: include stdio X-SVN-Commit-Revision: 321074 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 14:09:40 -0000 Author: kib Date: Mon Jul 17 14:09:34 2017 New Revision: 321074 URL: https://svnweb.freebsd.org/changeset/base/321074 Log: MFC r320472,r320508,r320509: Make stdio deferred cancel-safe. Requested by: eugen Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/stdio/fclose.c stable/10/lib/libc/stdio/fflush.c stable/10/lib/libc/stdio/fgetc.c stable/10/lib/libc/stdio/fgetln.c stable/10/lib/libc/stdio/fgets.c stable/10/lib/libc/stdio/fgetwc.c stable/10/lib/libc/stdio/fgetwln.c stable/10/lib/libc/stdio/fgetws.c stable/10/lib/libc/stdio/fputc.c stable/10/lib/libc/stdio/fputs.c stable/10/lib/libc/stdio/fputwc.c stable/10/lib/libc/stdio/fputws.c stable/10/lib/libc/stdio/fread.c stable/10/lib/libc/stdio/freopen.c stable/10/lib/libc/stdio/fscanf.c stable/10/lib/libc/stdio/fseek.c stable/10/lib/libc/stdio/fwrite.c stable/10/lib/libc/stdio/getc.c stable/10/lib/libc/stdio/getchar.c stable/10/lib/libc/stdio/getdelim.c stable/10/lib/libc/stdio/gets.c stable/10/lib/libc/stdio/local.h stable/10/lib/libc/stdio/perror.c stable/10/lib/libc/stdio/putc.c stable/10/lib/libc/stdio/putchar.c stable/10/lib/libc/stdio/puts.c stable/10/lib/libc/stdio/putw.c stable/10/lib/libc/stdio/refill.c stable/10/lib/libc/stdio/scanf.c stable/10/lib/libc/stdio/setvbuf.c stable/10/lib/libc/stdio/stdio.c stable/10/lib/libc/stdio/ungetc.c stable/10/lib/libc/stdio/ungetwc.c stable/10/lib/libc/stdio/vfprintf.c stable/10/lib/libc/stdio/vfscanf.c stable/10/lib/libc/stdio/vfwprintf.c stable/10/lib/libc/stdio/vfwscanf.c stable/10/lib/libc/stdio/vscanf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/include/libc_private.h Mon Jul 17 14:09:34 2017 (r321074) @@ -405,4 +405,9 @@ 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); + #endif /* _LIBC_PRIVATE_H_ */ Modified: stable/10/lib/libc/stdio/fclose.c ============================================================================== --- stable/10/lib/libc/stdio/fclose.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fclose.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fflush.c ============================================================================== --- stable/10/lib/libc/stdio/fflush.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fflush.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgetc.c ============================================================================== --- stable/10/lib/libc/stdio/fgetc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgetln.c ============================================================================== --- stable/10/lib/libc/stdio/fgetln.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetln.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgets.c ============================================================================== --- stable/10/lib/libc/stdio/fgets.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgets.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgetwc.c ============================================================================== --- stable/10/lib/libc/stdio/fgetwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgetwln.c ============================================================================== --- stable/10/lib/libc/stdio/fgetwln.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetwln.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fgetws.c ============================================================================== --- stable/10/lib/libc/stdio/fgetws.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetws.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fputc.c ============================================================================== --- stable/10/lib/libc/stdio/fputc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fputs.c ============================================================================== --- stable/10/lib/libc/stdio/fputs.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputs.c Mon Jul 17 14:09:34 2017 (r321074) @@ -58,9 +58,9 @@ 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(); return (retval); } Modified: stable/10/lib/libc/stdio/fputwc.c ============================================================================== --- stable/10/lib/libc/stdio/fputwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fputws.c ============================================================================== --- stable/10/lib/libc/stdio/fputws.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputws.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fread.c ============================================================================== --- stable/10/lib/libc/stdio/fread.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fread.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/freopen.c ============================================================================== --- stable/10/lib/libc/stdio/freopen.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/freopen.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fscanf.c ============================================================================== --- stable/10/lib/libc/stdio/fscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fseek.c ============================================================================== --- stable/10/lib/libc/stdio/fseek.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fseek.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/fwrite.c ============================================================================== --- stable/10/lib/libc/stdio/fwrite.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fwrite.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/getc.c ============================================================================== --- stable/10/lib/libc/stdio/getc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/getchar.c ============================================================================== --- stable/10/lib/libc/stdio/getchar.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getchar.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/getdelim.c ============================================================================== --- stable/10/lib/libc/stdio/getdelim.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getdelim.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/gets.c ============================================================================== --- stable/10/lib/libc/stdio/gets.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/gets.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/local.h ============================================================================== --- stable/10/lib/libc/stdio/local.h Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/local.h Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/perror.c ============================================================================== --- stable/10/lib/libc/stdio/perror.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/perror.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/putc.c ============================================================================== --- stable/10/lib/libc/stdio/putc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/putchar.c ============================================================================== --- stable/10/lib/libc/stdio/putchar.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putchar.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/puts.c ============================================================================== --- stable/10/lib/libc/stdio/puts.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/puts.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/putw.c ============================================================================== --- stable/10/lib/libc/stdio/putw.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putw.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/refill.c ============================================================================== --- stable/10/lib/libc/stdio/refill.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/refill.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/scanf.c ============================================================================== --- stable/10/lib/libc/stdio/scanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/scanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/setvbuf.c ============================================================================== --- stable/10/lib/libc/stdio/setvbuf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/setvbuf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/stdio.c ============================================================================== --- stable/10/lib/libc/stdio/stdio.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/stdio.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/ungetc.c ============================================================================== --- stable/10/lib/libc/stdio/ungetc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/ungetc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/ungetwc.c ============================================================================== --- stable/10/lib/libc/stdio/ungetwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/ungetwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/vfprintf.c ============================================================================== --- stable/10/lib/libc/stdio/vfprintf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfprintf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/vfscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vfscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/vfwprintf.c ============================================================================== --- stable/10/lib/libc/stdio/vfwprintf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfwprintf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/vfwscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vfwscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfwscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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/10/lib/libc/stdio/vscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -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 Mon Jul 17 16:30: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 50F3ED9967E for ; Mon, 17 Jul 2017 16:30:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 D5FA46656E for ; Mon, 17 Jul 2017 16:30:49 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 1e7a244b-6b0d-11e7-b2f5-7fbc454a3a22 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.eu.mailhop.org (Halon) with ESMTPSA id 1e7a244b-6b0d-11e7-b2f5-7fbc454a3a22; Mon, 17 Jul 2017 16:29:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6HGTXKs006011; Mon, 17 Jul 2017 10:29:33 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1500308973.22314.89.camel@freebsd.org> Subject: Re: svn commit: r320901 - in head/sys: amd64/amd64 isa x86/isa From: Ian Lepore To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 17 Jul 2017 10:29:33 -0600 In-Reply-To: <20170712224803.G1991@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> 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: Mon, 17 Jul 2017 16:30:50 -0000 On Thu, 2017-07-13 at 01:42 +1000, Bruce Evans wrote: > 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. > I can't figure out what you're talking about here.  There is no userland code involved in any of this stuff. > 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. > I'm not sure what this is about either.  The current code for getting the atrtc has no retries. > > 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. > I've always assumed the locking of individual register access was because rtcin() and writertc() are global functions used by other parts of the kernel to access individual bytes of cmos nvram, and that locking the whole device for the duration of the larger operations involved might cause problems.  For example, the nvram driver does byte at a time accesses in a loop that includes uimove() calls, so holding a lock on all atrtc hardware access for the duration of that isn't a good option. It does seem like the atrtc code should have its own register-access mutex rather than using clock_lock.  As you mentioned, the fact that it's borrowing a mutex is pretty well obscured; I hadn't noticed it. > > > > +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. > I'm not sure what you're referring to when you say "the old mutex". > 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. > I assumed the reason the efirt code was using the same mutex that protected access to the at rtc was because under the hood, the efi rt clock is really the same hardware too, accessed via bios code. > > ... > > @@ -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. > And at resume from sleep/lowpower modes, I think.  This is not something I can test easily, but I see calls to inittodr() from apm and pmtimer code.  Even so, I think it qualifies as called very infrequently. That's why I think the right way to fix the coherent reading problem is not trying harder to stay within a 244us window, but rather to stop even trying to.  Instead, look at that flag only to prevent starting the operation while an update is in progress, and use the more usual "loop until you read the same values twice" logic to get a coherent read.  That's especially true considering that taking longer than 244us to do the reads is only a problem once per second; during the other 999756us you'll still get coherent values. -- Ian > 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 Mon Jul 17 16:43: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 603F9D99C62; Mon, 17 Jul 2017 16:43:16 +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 E9AA966DD7; Mon, 17 Jul 2017 16:43:15 +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 v6HGhARr074126 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Jul 2017 19:43:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6HGhARr074126 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6HGhA0I074125; Mon, 17 Jul 2017 19:43:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 17 Jul 2017 19:43:10 +0300 From: Konstantin Belousov To: Ian Lepore Cc: Bruce Evans , 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 Message-ID: <20170717164310.GM1935@kib.kiev.ua> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> <1500308973.22314.89.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500308973.22314.89.camel@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: Mon, 17 Jul 2017 16:43:16 -0000 On Mon, Jul 17, 2017 at 10:29:33AM -0600, Ian Lepore wrote: > I assumed the reason the efirt code was using the same mutex that > protected access to the at rtc was because under the hood, the efi rt > clock is really the same hardware too, accessed via bios code. EFI spec states it explicitely, e.g. in the description of the GetTime() function of the Time Services interface: During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize access to the device before calling GetTime(). From owner-svn-src-all@freebsd.org Mon Jul 17 16: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 E397CD9A64E; Mon, 17 Jul 2017 16:59:23 +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 B1C9F6778B; Mon, 17 Jul 2017 16:59:23 +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 v6HGxMDm048776; Mon, 17 Jul 2017 16:59:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HGxMFc048775; Mon, 17 Jul 2017 16:59:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707171659.v6HGxMFc048775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Jul 2017 16:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321075 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321075 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 16:59:24 -0000 Author: jhb Date: Mon Jul 17 16:59:22 2017 New Revision: 321075 URL: https://svnweb.freebsd.org/changeset/base/321075 Log: Set the current vnet pointer in the socket buffer AIO handler. This fixes panics when using AIO under VIMAGE. Reported by: kp MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Mon Jul 17 14:09:34 2017 (r321074) +++ head/sys/kern/sys_socket.c Mon Jul 17 16:59:22 2017 (r321075) @@ -693,6 +693,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb { struct kaiocb *job; + CURVNET_SET(so->so_vnet); SOCKBUF_LOCK(sb); while (!TAILQ_EMPTY(&sb->sb_aiojobq) && soaio_ready(so, sb)) { job = TAILQ_FIRST(&sb->sb_aiojobq); @@ -715,6 +716,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb SOCK_LOCK(so); sorele(so); + CURVNET_RESTORE(); } void From owner-svn-src-all@freebsd.org Mon Jul 17 17:33: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 E7E45D9B415; Mon, 17 Jul 2017 17:33:26 +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 C5B6C68BDF; Mon, 17 Jul 2017 17:33:26 +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 4D4FF10AF09; Mon, 17 Jul 2017 13:33:25 -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: Mon, 17 Jul 2017 09:48:53 -0700 Message-ID: <7394656.HeKS8RJobr@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170712234108.GA48612@wkstn-mjohnston.west.isilon.com> References: <201707121829.v6CITPxG012102@repo.freebsd.org> <1930640.IHpqZ2aWqS@ralph.baldwin.cx> <20170712234108.GA48612@wkstn-mjohnston.west.isilon.com> 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, 17 Jul 2017 13:33:25 -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, 17 Jul 2017 17:33:27 -0000 On Wednesday, July 12, 2017 04:41:09 PM Mark Johnston wrote: > 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? Sorry I didn't reply earlier. I think the patch below for crashinfo is fine (but have not tested it myself): > 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 > -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 17 17:36: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 A06BDD9B742; Mon, 17 Jul 2017 17:36:05 +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 6E71368FF1; Mon, 17 Jul 2017 17:36:05 +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 v6HHa46V064987; Mon, 17 Jul 2017 17:36:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HHa403064986; Mon, 17 Jul 2017 17:36:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171736.v6HHa403064986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 17:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321076 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 321076 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 17:36:05 -0000 Author: ngie Date: Mon Jul 17 17:36:04 2017 New Revision: 321076 URL: https://svnweb.freebsd.org/changeset/base/321076 Log: Don't emit "diff: diff arguments" when diffing files if -q is specified. This improves compatibility with GNU diff. Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`. MFC after: 2 months Relnotes: yes Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Mon Jul 17 16:59:22 2017 (r321075) +++ head/usr.bin/diff/diffreg.c Mon Jul 17 17:36:04 2017 (r321076) @@ -1115,7 +1115,7 @@ restart: return; } proceed: - if (*pflags & D_HEADER) { + if (*pflags & D_HEADER && diff_format != D_BRIEF) { diff_output("%s %s %s\n", diffargs, file1, file2); *pflags &= ~D_HEADER; } From owner-svn-src-all@freebsd.org Mon Jul 17 17:45:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C41BD9BC9A; Mon, 17 Jul 2017 17:45:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (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 2BAB56986B; Mon, 17 Jul 2017 17:45:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id z22so2854465qka.2; Mon, 17 Jul 2017 10:45:32 -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=TGGagnh0IwmE7u5l4LlTfANFqvwFEI0wqmc4OhGRfI8=; b=XH2JG6DS0YXNLeNCNOUkH0GqVqh/HidZ2dat1zXHa5WVCDlsLd/6+iZ88CDQZlDUvS Zg0VmBkgAox7mfGzf1DFUk07G3SwlSB/GwdqV5SemwDb4Ot9QjDriMGmydAz/z6z3HhB +QyJY+DWRyAEYdlKZ7StfR121L3JXVDI0nx2sCT8iBg6MGUEJ6oEWSAXPaxygLfuQJ3V UK66VsVUtu+ukXPzQa8vjl7Gnr1FigosjrmTjQpZuev8rc+ZXn3JHFR+S986V36kb8CK ahPlrtSZzE+XCF8PP0aUUfIcIKvxw9q8E9NcXvXJ0yUhh28WgCWIve/ytmnmqViRKDe9 gfgA== 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=TGGagnh0IwmE7u5l4LlTfANFqvwFEI0wqmc4OhGRfI8=; b=LjmAvYGFGwOyuJbdOTjZo86wZA+u9QOrQqniRiH3WZ37GZ5vORdTZjPD7nXlUZOi9D bLvGpAjeMdF1Y0FzKpBcyQEQP8gPBN7frm90qdVfLk1qa9f+OG5yvm5TJM16vSpve0r5 ar1i+hgcvwSPYX215YQkA/suVI/L41M1/x3hUbNZqO6cDGLmKzN4EYfdbgqxHcbXiiHF w9HQbsrVTvzZcaV9VtjAubqH+1M9XwR84kExpKmxRbWNSNceNwJQoKEBDA1AL0eIlK3w z/Ptfo/sz1Y5scV3YFZzThyKuSJmAME73tSas7+FLmn3kUhcj5LBfjH+o1YgXGuLEbdY zvEA== X-Gm-Message-State: AIVw11098vm4k3Ierj4Lk4at3UnLV3Q0qIaPslGCqSTZ68UEnPDQDEVz Gwp7GhSfGCJ4q9IX X-Received: by 10.55.175.3 with SMTP id y3mr26570161qke.185.1500313531038; Mon, 17 Jul 2017 10:45:31 -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 c5sm10696568qkd.27.2017.07.17.10.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 10:45:30 -0700 (PDT) Sender: Mark Johnston Date: Mon, 17 Jul 2017 10:46:18 -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: <20170717174618.GE95367@wkstn-mjohnston.west.isilon.com> References: <201707121829.v6CITPxG012102@repo.freebsd.org> <1930640.IHpqZ2aWqS@ralph.baldwin.cx> <20170712234108.GA48612@wkstn-mjohnston.west.isilon.com> <7394656.HeKS8RJobr@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7394656.HeKS8RJobr@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: Mon, 17 Jul 2017 17:45:32 -0000 On Mon, Jul 17, 2017 at 09:48:53AM -0700, John Baldwin wrote: > On Wednesday, July 12, 2017 04:41:09 PM Mark Johnston wrote: > > 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? > > Sorry I didn't reply earlier. I think the patch below for crashinfo is fine > (but have not tested it myself): I did test it with both truncated and non-truncated version strings (with r321035 applied). The bit that gets truncated first is the objdir path, so I think it'd be unlikely that we match the wrong kernel: the build time and build number are also both contained in the version string. > > > 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 > > > > > -- > John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 17 17:50: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 A2882D9BE49; Mon, 17 Jul 2017 17:50:51 +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 6C6E069BB1; Mon, 17 Jul 2017 17:50:51 +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 v6HHooK4071939; Mon, 17 Jul 2017 17:50:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HHooAF071938; Mon, 17 Jul 2017 17:50:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171750.v6HHooAF071938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 17:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321077 - head/usr.bin/diff/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/diff/tests X-SVN-Commit-Revision: 321077 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 17:50:51 -0000 Author: ngie Date: Mon Jul 17 17:50:50 2017 New Revision: 321077 URL: https://svnweb.freebsd.org/changeset/base/321077 Log: Add some tests for brief (--brief/-q) format MFC after: 2 months MFC with: r321076 Modified: head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Mon Jul 17 17:36:04 2017 (r321076) +++ head/usr.bin/diff/tests/diff_test.sh Mon Jul 17 17:50:50 2017 (r321077) @@ -7,6 +7,7 @@ atf_test_case header_ns atf_test_case ifdef atf_test_case group_format atf_test_case side_by_side +atf_test_case brief_format simple_body() { @@ -109,6 +110,23 @@ side_by_side_body() diff -W 65 -y --suppress-common-lines A B } +brief_format_body() +{ + atf_check mkdir A B + + atf_check -x "echo 1 > A/test-file" + atf_check -x "echo 2 > B/test-file" + + atf_check cp -Rf A C + + atf_check \ + -s exit:1 \ + -o inline:"Files A/test-file and B/test-file differ\n" \ + diff -Nrq A B + + atf_check diff -Nrq A C +} + atf_init_test_cases() { atf_add_test_case simple @@ -118,4 +136,5 @@ atf_init_test_cases() atf_add_test_case ifdef atf_add_test_case group_format atf_add_test_case side_by_side + atf_add_test_case brief_format } From owner-svn-src-all@freebsd.org Mon Jul 17 18:06: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 A4846D9CA52; Mon, 17 Jul 2017 18:06:43 +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 73BF26A6ED; Mon, 17 Jul 2017 18:06:43 +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 v6HI6gVi078257; Mon, 17 Jul 2017 18:06:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HI6gea078256; Mon, 17 Jul 2017 18:06:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171806.v6HI6gea078256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 18:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321078 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 321078 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 18:06:43 -0000 Author: ngie Date: Mon Jul 17 18:06:42 2017 New Revision: 321078 URL: https://svnweb.freebsd.org/changeset/base/321078 Log: Fix exit status with -rq when there is a file in one directory but not another, i.e., when print_only is called. Prior to this change, -rq was always returning 0. After this change it will return 1 if there is a difference between two directories. This fixes compatibility with GNU diff and unbreaks backwards compatibility expectations. Found when trying to extend diff_test:brief_format_test. MFC after: 2 months MFC with: r321076, r321077 Modified: head/usr.bin/diff/diffdir.c Modified: head/usr.bin/diff/diffdir.c ============================================================================== --- head/usr.bin/diff/diffdir.c Mon Jul 17 17:50:50 2017 (r321077) +++ head/usr.bin/diff/diffdir.c Mon Jul 17 18:06:42 2017 (r321078) @@ -134,16 +134,20 @@ diffdir(char *p1, char *p2, int flags) if (Nflag) diffit(dent1, path1, dirlen1, path2, dirlen2, flags); - else + else { print_only(path1, dirlen1, dent1->d_name); + status = 1; + } dp1++; } else { /* file only in second dir, only diff if -N or -P */ if (Nflag || Pflag) diffit(dent2, path1, dirlen1, path2, dirlen2, flags); - else + else { print_only(path2, dirlen2, dent2->d_name); + status = 1; + } dp2++; } } From owner-svn-src-all@freebsd.org Mon Jul 17 18:07: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 1F343D9CAC3; Mon, 17 Jul 2017 18:07:55 +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 E2D4B6A83C; Mon, 17 Jul 2017 18:07:54 +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 v6HI7s4x078335; Mon, 17 Jul 2017 18:07:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HI7sax078334; Mon, 17 Jul 2017 18:07:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171807.v6HI7sax078334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 18:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321079 - head/usr.bin/diff/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/diff/tests X-SVN-Commit-Revision: 321079 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 18:07:55 -0000 Author: ngie Date: Mon Jul 17 18:07:53 2017 New Revision: 321079 URL: https://svnweb.freebsd.org/changeset/base/321079 Log: Add tests that exercise -q, like -rq and add tests that test -q like -Nrq MFC after: 2 months MFC with: r321076, r321077, r321078 Modified: head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Mon Jul 17 18:06:42 2017 (r321078) +++ head/usr.bin/diff/tests/diff_test.sh Mon Jul 17 18:07:53 2017 (r321079) @@ -118,13 +118,26 @@ brief_format_body() atf_check -x "echo 2 > B/test-file" atf_check cp -Rf A C + atf_check cp -Rf A D + atf_check -x "echo 3 > D/another-test-file" + atf_check \ -s exit:1 \ -o inline:"Files A/test-file and B/test-file differ\n" \ - diff -Nrq A B + diff -rq A B - atf_check diff -Nrq A C + atf_check diff -rq A C + + atf_check \ + -s exit:1 \ + -o inline:"Only in D: another-test-file\n" \ + diff -rq A D + + atf_check \ + -s exit:1 \ + -o inline:"Files A/another-test-file and D/another-test-file differ\n" \ + diff -Nrq A D } atf_init_test_cases() From owner-svn-src-all@freebsd.org Mon Jul 17 18:12: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 24A28D9CCA9; Mon, 17 Jul 2017 18:12:10 +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 DE4A66AC32; Mon, 17 Jul 2017 18:12:09 +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 v6HIC9eE082060; Mon, 17 Jul 2017 18:12:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HIC9Cq082059; Mon, 17 Jul 2017 18:12:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171812.v6HIC9Cq082059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 18:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321080 - head/usr.bin/getconf X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/getconf X-SVN-Commit-Revision: 321080 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 18:12:10 -0000 Author: ngie Date: Mon Jul 17 18:12:08 2017 New Revision: 321080 URL: https://svnweb.freebsd.org/changeset/base/321080 Log: Expose the ILP32/LP64 programming environments based on __ILP32__/__LP64__ instead of by architecture. The list was incomplete (previous commits purged invalid architectures, like __alpha__, but failed to add new ones). It's best to base the symbol presence on whether or not the architecture is ILP32 / LP64 capable, per the compiler. This fixes the ILP32/LP64 program environments on some architectures like arm64, and by proxy fixes the tests on those architectures. MFC after: 1 month Reviewed by: no one (timed out on feedback from imp) Differential Revision: D10787 Modified: head/usr.bin/getconf/progenv.gperf Modified: head/usr.bin/getconf/progenv.gperf ============================================================================== --- head/usr.bin/getconf/progenv.gperf Mon Jul 17 18:07:53 2017 (r321079) +++ head/usr.bin/getconf/progenv.gperf Mon Jul 17 18:12:08 2017 (r321080) @@ -30,11 +30,11 @@ static const struct map *in_word_set(const char *str); * be updated. (We cheat here and define the supported environments * statically.) */ -#if defined(__sparc64__) || defined(__amd64__) +#ifdef __LP64__ #define have_LP64_OFF64 NULL #endif -#if defined(__i386__) || defined(__powerpc__) +#ifdef __ILP32__ #define have_ILP32_OFFBIG NULL #endif From owner-svn-src-all@freebsd.org Mon Jul 17 18:20: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 A48C1D9D0D7; Mon, 17 Jul 2017 18:20:55 +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 72E456B1F8; Mon, 17 Jul 2017 18:20:55 +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 v6HIKsiB082378; Mon, 17 Jul 2017 18:20:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HIKsla082377; Mon, 17 Jul 2017 18:20:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707171820.v6HIKsla082377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 18:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321081 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321081 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 18:20:55 -0000 Author: ngie Date: Mon Jul 17 18:20:54 2017 New Revision: 321081 URL: https://svnweb.freebsd.org/changeset/base/321081 Log: Sort the tests alphabetically before adding them to the Kyuafiles This is being done to aid in debugging test runs, in the event the output shifts due to refactored Makefiles, added tests, etc. MFC after: 1 month Modified: head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Mon Jul 17 18:12:08 2017 (r321080) +++ head/share/mk/bsd.test.mk Mon Jul 17 18:20:54 2017 (r321081) @@ -66,6 +66,10 @@ _TESTS= .include .include +# Sort the tests alphabetically, so the results are deterministically formed +# across runs. +_TESTS:= ${_TESTS:O} + # kyua automatically descends directories; only run make check on the # top-level directory .if !make(check) From owner-svn-src-all@freebsd.org Mon Jul 17 18:27: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 D9DD3D9D2BA for ; Mon, 17 Jul 2017 18:27:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A01C16B5F9 for ; Mon, 17 Jul 2017 18:27:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id k71so1195001iod.2 for ; Mon, 17 Jul 2017 11:27:05 -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=cHwT+35kXkPEmEPYyb5FAgODGABfEj2PFxNwJ0qCtl4=; b=Nyq4eKDWDl3ThqzCVKj3W6pkyIDa8uACOQtOGvM3CtLd+oTlUAYP/fXkQZ8Qce+FHc /kyyA786Pq++ndhfDsropB8YdX9V5VqiSzVwGzw845ktYBux/ShioIDqnOFjosenQg73 eeE/snkoEWtM75p31GzHiU1M65zFK91fBobgq61lkr8K5ttuAYcQfNjvssIchGSv/Sb9 I12V1ecXrj69wi1Int97Dx2IGGWEwVB2e3BqvhbRKiBhiygRK/rBiSkqoYdcSizDI1rE lLA3AGGFjKI14YjsU+41hNfg3kJOix4c9rgOgvdqmsFeBwslLEGvHxZ5dS6hkhUWGoOP FgyA== 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=cHwT+35kXkPEmEPYyb5FAgODGABfEj2PFxNwJ0qCtl4=; b=FEHEI5R7wspfyb8Axqy3UV8wfmh5H39eqriBhmDWQ0rtbmAIDv/Cu4LPJRlBEC/PqE A1EIujuozesWr6Jy8U97Brin63FNchRwGYLNq8djAC3eQeh1K66PzWbLA0E+XvfoNvG4 0LQ/8EKtagQLsy/G6oVwSrtNTCsk3DgTwVOMM9iPHFzGxFmk9rTakMDacV2TKIchTQsC /CxdcHSYjvoM49KhDak8I2FJP3/gwUq5UHWk6q2pshiPi/b+iJMHemgi43BMcasrfy5j 6dtCEgKir4KDApxS+LCvxHOUtIrP8xjsXSqdo+d/lgiGJrZMtnd25zowtaVDKIwKqyi7 XOCQ== X-Gm-Message-State: AIVw111/5oWVSdbs+z5vRW8kmmX+Vuj0Sy5moa6OYOfjK1/uEPqHcaoJ NMoHAsbkN4DoioqfIFAsTjKT1imFTQMv X-Received: by 10.107.176.11 with SMTP id z11mr21661325ioe.173.1500316024741; Mon, 17 Jul 2017 11:27:04 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.212.167 with HTTP; Mon, 17 Jul 2017 11:27:04 -0700 (PDT) X-Originating-IP: [65.151.16.249] In-Reply-To: <201707171812.v6HIC9Cq082059@repo.freebsd.org> References: <201707171812.v6HIC9Cq082059@repo.freebsd.org> From: Warner Losh Date: Mon, 17 Jul 2017 12:27:04 -0600 X-Google-Sender-Auth: OaA6vTek1-Ri3zojCfXPWCbYNnQ Message-ID: Subject: Re: svn commit: r321080 - head/usr.bin/getconf To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.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, 17 Jul 2017 18:27:06 -0000 On Mon, Jul 17, 2017 at 12:12 PM, Ngie Cooper wrote: > Author: ngie > Date: Mon Jul 17 18:12:08 2017 > New Revision: 321080 > URL: https://svnweb.freebsd.org/changeset/base/321080 > > Log: > Expose the ILP32/LP64 programming environments based on > __ILP32__/__LP64__ instead of by architecture. > > The list was incomplete (previous commits purged invalid architectures, > like __alpha__, but failed to add new ones). It's best to base the symbol > presence on whether or not the architecture is ILP32 / LP64 capable, per > the compiler. > > This fixes the ILP32/LP64 program environments on some architectures like > arm64, and by proxy fixes the tests on those architectures. > > MFC after: 1 month > Reviewed by: no one (timed out on feedback from imp) > You timed out because you never answered my question about other platforms. Warner > Differential Revision: D10787 > > Modified: > head/usr.bin/getconf/progenv.gperf > > Modified: head/usr.bin/getconf/progenv.gperf > ============================================================ > ================== > --- head/usr.bin/getconf/progenv.gperf Mon Jul 17 18:07:53 2017 > (r321079) > +++ head/usr.bin/getconf/progenv.gperf Mon Jul 17 18:12:08 2017 > (r321080) > @@ -30,11 +30,11 @@ static const struct map *in_word_set(const char *str); > * be updated. (We cheat here and define the supported environments > * statically.) > */ > -#if defined(__sparc64__) || defined(__amd64__) > +#ifdef __LP64__ > #define have_LP64_OFF64 NULL > #endif > > -#if defined(__i386__) || defined(__powerpc__) > +#ifdef __ILP32__ > #define have_ILP32_OFFBIG NULL > #endif > > > From owner-svn-src-all@freebsd.org Mon Jul 17 18:30: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 F1BACD9D3A6; Mon, 17 Jul 2017 18:30:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B23C56B77F; Mon, 17 Jul 2017 18:30:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id d193so20305277pgc.2; Mon, 17 Jul 2017 11:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=4Y/+E5QWrr0sVPx+VldzI6Rg6cgXF8V8xgLlMNyPlA4=; b=IokjMxIfkqiMg/iSxJLSPr8diCTYsZZnYZ5o3nmylgTLlrDm8CE1PjAb+1JvKCg3xT u+057QU9l2PGaZFQLaxqmEzollguogyFQIDdtKzl7aEx/GxXpJtukARm6UGwdKvm8ehc osZYElOG1X7+v3rIM8vN4UPBSjuJGR3ggJHGjh5JygFO43eU9u8l/Adnl2xHU0DivcOv CGPp6SPsjABUQw8yOIK+I/AaRWVyEIydX329vYfM4L1aJMe3FaE08W18tdK7+WJbQvxb WvKEvZGU17nPHlifahPzcVvFg3qFRwYeMathdy7+BShv5LxIzdzrL9eRdHS46KeZGvy6 GzFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=4Y/+E5QWrr0sVPx+VldzI6Rg6cgXF8V8xgLlMNyPlA4=; b=cFQR8ylhFbonjNp6sU/oJpB7qbEry8QyCPcJ8aQZwrSiq8c1SV4OAB0pNz/ldc46wb wwoW1Itexx3T/ZI8XAQD4Q35qwO7uHSTKgtaa+mI6BARienbe9zgq94mx8/kxwL3ZoHh gb7RX6a49JLYiEOQthyBRG/kk9nNC0rUh58sGTA708+edYcghfnF/3HrIci5f5hLonc1 ivBQznrJs9qN9ZLEJSiNSVJF2RHPi8NPtr1VkRLsVLd7FHp06WFTkK0dfgUIUBo4Imxe Noou3x/xAOP8uDYQVO9RRRKI1GMfPCSaat9ZMU6th+uYn1IvkVb1R5XjmO5H6CXSWG2c 4BDA== X-Gm-Message-State: AIVw110/RYKaKJCiElI2KhoMpyQSB8a6MCT71t1BKqqNrqFsKpETXtXn gQLbLcVNXU5CKcwqBvQ= X-Received: by 10.84.210.1 with SMTP id z1mr10107624plh.125.1500316211021; Mon, 17 Jul 2017 11:30:11 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m5sm32590598pfg.22.2017.07.17.11.30.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 11:30:10 -0700 (PDT) Subject: Re: svn commit: r320701 - in head: bin sbin usr.bin usr.sbin Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0CB39FF3-E06E-4AC1-ADAF-0FE903CC2A5E"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 17 Jul 2017 11:30:08 -0700 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6BAFC533-C884-4661-AECE-64FEE4985C6E@gmail.com> References: <201707060415.v664FU9n085204@repo.freebsd.org> <4ac448c4-af76-de43-5dbc-370492962d59@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 18:30:12 -0000 --Apple-Mail=_0CB39FF3-E06E-4AC1-ADAF-0FE903CC2A5E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 6, 2017, at 10:32, Ngie Cooper wrote: =E2=80=A6 > I have another change I'm going to propose soon which sorts SUBDIR = output (as a whole) again, as an opt-in feature in bsd.subdir.mk. > Cheers, Hi, I just opened up the CR to re-add the sorting functionality in a = generic way as an opt-in make variable: = https://reviews.freebsd.org/D11628 . Cheers! -Ngie --Apple-Mail=_0CB39FF3-E06E-4AC1-ADAF-0FE903CC2A5E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZbQIxAAoJEPWDqSZpMIYV1QgQAIN4TZ/sSLK0sZWzyS5eSJHT Hr9jEtK7vSRIWXc/+61zXnJ1UkzTQ24NSDTyESoG4hnQyDhx5bWEoDo7KuQEffmE zbi3strPURuOyxoAUVRu6Rwn11vV/40aR+HtW8z5be3Wn3gwBBeXhnvtyE0WnGNJ jJIoUKhNPD32pGWxT1hdftZBzlPVWIA6wzqo1er6gp7RKc0aRkTH+dYF7hEPXr9R E5tZ2HAMpH45dyKp/oLgnZoQbeRP0z4w4gi8lK2LTpMiKEtsOE+9vJwZFt5a9RvE RdF+c4dNhI37aKV/0piO63PIUrQ+5rxC9dYumnlj0+dhH+CUOpAGLr4RnjvlLSRz IteVNo2Ihf2C01pU1ggEN7qACiXXWI6QJCl9efSGppOHIVqMzAECXNeCDTNFub5o 57hlxXkevh76aTd9fYYVjvBrPtNUwtr8kHX3WTx+2DFeNYbyaub7pOvMPaeZ+cM9 BKSnYHFmQBSfelZDieNwBqz0UBMYYMcveHrBI+q2U5wzvLmaroJc1uKAjbkSeN4y GfAUOLhp2a+R11dJK2R92aNW2jXHmhlROVCXcd7uF0ny6QRnhHcBI90VDijTXU59 +vkUEabYer3WE9UUO8sdg0nFZOTAe2CDBLPli92GmCAPSOMP/CGZHx9OYJsmwkSf ZvW/2yIpWXitSB5JQd0/ =Odre -----END PGP SIGNATURE----- --Apple-Mail=_0CB39FF3-E06E-4AC1-ADAF-0FE903CC2A5E-- From owner-svn-src-all@freebsd.org Mon Jul 17 18:33:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F1CD9D67A; Mon, 17 Jul 2017 18:33:32 +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 D1A5A6BBC3; Mon, 17 Jul 2017 18:33:31 +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 v6HIXVEL090203; Mon, 17 Jul 2017 18:33:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HIXUEY090201; Mon, 17 Jul 2017 18:33:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707171833.v6HIXUEY090201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 17 Jul 2017 18:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321082 - 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: 321082 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 18:33:32 -0000 Author: asomers Date: Mon Jul 17 18:33:30 2017 New Revision: 321082 URL: https://svnweb.freebsd.org/changeset/base/321082 Log: Add regression tests for bugs 220459 and 220398 Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0 Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD PR: 220459 PR: 220398 Reviewed by: cem, jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11470 Added: head/tests/sys/aio/lio_test.c (contents, props changed) Modified: head/tests/sys/aio/Makefile Modified: head/tests/sys/aio/Makefile ============================================================================== --- head/tests/sys/aio/Makefile Mon Jul 17 18:20:54 2017 (r321081) +++ head/tests/sys/aio/Makefile Mon Jul 17 18:33:30 2017 (r321082) @@ -3,12 +3,15 @@ TESTSDIR= ${TESTSBASE}/sys/aio ATF_TESTS_C+= aio_test +ATF_TESTS_C+= lio_test TEST_METADATA.aio_test+= timeout="30" +TEST_METADATA.lio_test+= timeout="10" PLAIN_TESTS_C+= aio_kqueue_test PLAIN_TESTS_C+= lio_kqueue_test LIBADD.aio_test+= util rt +LIBADD.lio_test+= rt CFLAGS+= -I${.CURDIR:H:H} Added: head/tests/sys/aio/lio_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/aio/lio_test.c Mon Jul 17 18:33:30 2017 (r321082) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2017 Spectra Logic Corp + * 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 "freebsd_test_suite/macros.h" + +static sem_t completions; + + +static void +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)); +} + +/* With LIO_WAIT, an empty lio_listio should return immediately */ +ATF_TC_WITHOUT_HEAD(lio_listio_empty_wait); +ATF_TC_BODY(lio_listio_empty_wait, tc) +{ + struct aiocb *list = NULL; + + ATF_REQUIRE_EQ(0, lio_listio(LIO_WAIT, &list, 0, NULL)); +} + +/* + * With LIO_NOWAIT, an empty lio_listio should send completion notification + * immediately + */ +ATF_TC_WITHOUT_HEAD(lio_listio_empty_nowait_kevent); +ATF_TC_BODY(lio_listio_empty_nowait_kevent, tc) +{ + struct aiocb *list = NULL; + struct sigevent sev; + struct kevent kq_returned; + int kq, result; + void *udata = (void*)0xdeadbeefdeadbeef; + + atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" + " asynchronous notification if nent==0"); + kq = kqueue(); + ATF_REQUIRE(kq > 0); + sev.sigev_notify = SIGEV_KEVENT; + sev.sigev_notify_kqueue = kq; + sev.sigev_value.sival_ptr = udata; + ATF_REQUIRE_EQ(0, lio_listio(LIO_NOWAIT, &list, 0, &sev)); + result = kevent(kq, NULL, 0, &kq_returned, 1, NULL); + ATF_REQUIRE_MSG(result == 1, "Never got completion notification"); + ATF_REQUIRE_EQ((uintptr_t)list, kq_returned.ident); + ATF_REQUIRE_EQ(EVFILT_LIO, kq_returned.filter); + ATF_REQUIRE_EQ(udata, kq_returned.udata); +} + +/* + * With LIO_NOWAIT, an empty lio_listio should send completion notification + * immediately + */ +ATF_TC_WITHOUT_HEAD(lio_listio_empty_nowait_signal); +ATF_TC_BODY(lio_listio_empty_nowait_signal, tc) +{ + struct aiocb *list = NULL; + struct sigevent sev; + + atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" + "asynchronous notification if nent==0"); + ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIGUSR1; + ATF_REQUIRE(SIG_ERR != signal(SIGUSR1, handler)); + ATF_REQUIRE_EQ(0, lio_listio(LIO_NOWAIT, &list, 0, &sev)); + ATF_REQUIRE_EQ(0, sem_wait(&completions)); + ATF_REQUIRE_EQ(0, sem_destroy(&completions)); +} + +/* + * With LIO_NOWAIT, an empty lio_listio should send completion notification + * immediately + */ +ATF_TC_WITHOUT_HEAD(lio_listio_empty_nowait_thread); +ATF_TC_BODY(lio_listio_empty_nowait_thread, tc) +{ + struct aiocb *list = NULL; + struct sigevent sev; + + atf_tc_expect_fail("Bug 220459 - lio_listio(2) doesn't support" + " SIGEV_THREAD"); + ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); + bzero(&sev, sizeof(sev)); + sev.sigev_notify = SIGEV_THREAD; + sev.sigev_notify_function = thr_handler; + sev.sigev_notify_attributes = NULL; + ATF_REQUIRE_MSG(0 == lio_listio(LIO_NOWAIT, &list, 0, &sev), + "lio_listio: %s", strerror(errno)); + ATF_REQUIRE_EQ(0, sem_wait(&completions)); + ATF_REQUIRE_EQ(0, sem_destroy(&completions)); +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_kevent); + ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_signal); + ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_thread); + ATF_TP_ADD_TC(tp, lio_listio_empty_wait); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Mon Jul 17 18:35: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 72FEED9D893; Mon, 17 Jul 2017 18:35:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::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 3D8CC6BEB3; Mon, 17 Jul 2017 18:35:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id q85so20401409pfq.2; Mon, 17 Jul 2017 11:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=+D8qfoPtDkfN+mYwYbFj7AvMU+Er86UJxdCW2WNp9ro=; b=QfTRtUkU6KHCZLBKnoRsbWwKyQOdeiiGPlGPa0hraHBG7iFicigxim29wZoxfR1Y0Z PV1PzenX8/cNYBg+EEtzNcQn5kYxGRXq0p7gP9lHQ+3oTZ0hexzf4PoE+G4+TUYblFC4 LEVBJ7pjNTwz8DLkTktSQ3GkdDKmNrybuYCPAwsyE+8z0pmKy/hzsnxw2FGznslqb4ao JH2SLRcrF/Ji4FOcC7nze7d0Qm1Df4Q0Qs/d1yOunTNg4y77lzymJEGRFsU2+4QndJ2D O3rg1hQfGRhdtI/yERQQj68hJmknbXCodRoYkLeN6xAQJemMZpNoBNDQFizPSVDOXbTc k0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=+D8qfoPtDkfN+mYwYbFj7AvMU+Er86UJxdCW2WNp9ro=; b=Kxn1GZEMz/Ote/XFWL/fHyFlHgalnoYL5lBrpWTVnvhp/fxdF2sPNOXLniDCNHAnpb 1iXGr5z1h6se7123VYHVuzUD6PUHy++kecHt71P5qpCq5xPqq/be0nafeuw0C5kMe+rD arswWfoZV9V1rkTaNZg5AlZVyZHXdtpE3GZPgGjy0rOI4toiZIKKdgPB1FWv1kpfOv6R hhGigJ8qIpEPO5j+zr5YI1vUySI7irc1zXdulsXKSotNP/ErI+dOUxeNUHaeNH89aSGI J8WoAlKJ/hh3CgTWeO2UT6SoA4FSurEhkjaBHjV/apJSD3ccM3rUC0dTj83D+EYl7cqR si9w== X-Gm-Message-State: AIVw113sJtrohbu+8aBDJQVdbvNY7DHeIgnsgUVm2q58YX2jbNDE8E7Y bIcmRyg9yrHkJA== X-Received: by 10.99.185.25 with SMTP id z25mr30265493pge.273.1500316538863; Mon, 17 Jul 2017 11:35:38 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m186sm36176819pfc.54.2017.07.17.11.35.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 11:35:37 -0700 (PDT) Subject: Re: svn commit: r321080 - head/usr.bin/getconf Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7E388DCD-AAC6-4EBC-84A5-113E2D7019CA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 17 Jul 2017 11:35:37 -0700 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <7AF42C29-8DAC-4A5E-BCAF-3CEC496A3A4C@gmail.com> References: <201707171812.v6HIC9Cq082059@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 18:35:39 -0000 --Apple-Mail=_7E388DCD-AAC6-4EBC-84A5-113E2D7019CA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > You timed out because you never answered my question about other = platforms. Hi Warner, I thought I answered your questions here: = https://reviews.freebsd.org/D10787#224691 ? If not, I would be more than = happy to run the tests on other platforms once I gain access to them. I = only have access to x86 platforms and made an educated guess on what = should be done based on grep=E2=80=99ing around the source tree, = googling, and finding Linux mailing list posts suggesting our copy of = getconf(1) wasn=E2=80=99t supporting all of the platforms it should have = been. Thank you, -Ngie --Apple-Mail=_7E388DCD-AAC6-4EBC-84A5-113E2D7019CA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZbQN5AAoJEPWDqSZpMIYVcO0QAMQVpwidOIzHRvluIsAwpLXT mK30jajxYiw9g/lGQ1FEtDM7tU0jdv0jIZOiIBaQOQ0eo2wTqUQNIJSmpR9oFDkn R4ETJyWR+ZllosFkvBXqhXeGy6mAXde2xspeaaJ00jIYZ0dqjdb03XOpHNAjpnnW JoqHN6+V8OkyDfNn073YTbCBiOwvXLBs+elUByQ1kYcGRjn+A04rJsYX6Q4hoeDS 7qvReeXk0E1EURB6k4XgP67mpCtkzQiITIP2xMmzYpmC9APtNJEEGBDzRSaHliz/ LfZwPJgAZB8u0WmijXOohGj/0Iq30KBFQJtp3RrNlaTv1r+sf+iQTz2lHKMahGAu g4SBghElsokh4wjHIvMDjkYorTehx1p31LjBvJWu6Np410g0doN6NCxPSCotJqwz nIOgTB3mY1ZortN7tBtr6uTsLwjZNfYeGnAWrVSzVqAOudulWMGO60aWpfBkinPk uYLkEozJY47P/E4UDLpYtxum2hp8ZBOxHNh8dwKjz3J9NK03CnAFAlNcbyG2yd1a 3lZ/1VEK1kvW3j8mFSrlayn4LoEw+ro45yYjRu+BiUrSDjeHxz/O8eq4arxVmu2F QbtPmAxA1ujnxxbr20wFOOWuVUf1RxMRJjyoz6o/lCneMFtGxbLdLMjZJuUaBSm7 UWXZtuu2eH2ReK0pZeVv =MInE -----END PGP SIGNATURE----- --Apple-Mail=_7E388DCD-AAC6-4EBC-84A5-113E2D7019CA-- From owner-svn-src-all@freebsd.org Mon Jul 17 20:55: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 6896ADA06F1; Mon, 17 Jul 2017 20:55:00 +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 3735270FA1; Mon, 17 Jul 2017 20:55:00 +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 v6HKsxV3049616; Mon, 17 Jul 2017 20:54:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HKsxKm049614; Mon, 17 Jul 2017 20:54:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172054.v6HKsxKm049614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 20:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321083 - in stable/11: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Commit-Revision: 321083 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 20:55:00 -0000 Author: ngie Date: Mon Jul 17 20:54:59 2017 New Revision: 321083 URL: https://svnweb.freebsd.org/changeset/base/321083 Log: MFC r318325: Start writing up some basic feature tests for procstat These tests query a running process for information related to the -b, -c, -e, and -f flags; the -f testcase is largely stubbed out, pending additional work to determine a good, deterministic descriptor. Core file test support is coming soon--it requires a bit more effort due to the fact that: - coredumps can be disabled (kern.coredump=0). - corefiles can be put in different directories than the current directory, or be named something other than `.core` (`kern.corefile`). Added: stable/11/usr.bin/procstat/tests/ - copied from r318325, head/usr.bin/procstat/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/usr.bin/procstat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Mon Jul 17 18:33:30 2017 (r321082) +++ stable/11/etc/mtree/BSD.tests.dist Mon Jul 17 20:54:59 2017 (r321083) @@ -640,6 +640,8 @@ .. printf .. + procstat + .. sdiff .. sed Modified: stable/11/usr.bin/procstat/Makefile ============================================================================== --- stable/11/usr.bin/procstat/Makefile Mon Jul 17 18:33:30 2017 (r321082) +++ stable/11/usr.bin/procstat/Makefile Mon Jul 17 20:54:59 2017 (r321083) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= procstat MAN= procstat.1 SRCS= procstat.c \ @@ -18,5 +20,9 @@ SRCS= procstat.c \ procstat_vm.c LIBADD+= procstat xo util sbuf + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-all@freebsd.org Mon Jul 17 20:57: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 C64F6DA07E1; Mon, 17 Jul 2017 20:57:39 +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 9220A71198; Mon, 17 Jul 2017 20:57:39 +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 v6HKvcsi049791; Mon, 17 Jul 2017 20:57:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HKvcBh049789; Mon, 17 Jul 2017 20:57:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172057.v6HKvcBh049789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 20:57: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: r321084 - in stable/10: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Commit-Revision: 321084 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 20:57:39 -0000 Author: ngie Date: Mon Jul 17 20:57:38 2017 New Revision: 321084 URL: https://svnweb.freebsd.org/changeset/base/321084 Log: MFC r318325: Start writing up some basic feature tests for procstat These tests query a running process for information related to the -b, -c, -e, and -f flags; the -f testcase is largely stubbed out, pending additional work to determine a good, deterministic descriptor. Core file test support is coming soon--it requires a bit more effort due to the fact that: - coredumps can be disabled (kern.coredump=0). - corefiles can be put in different directories than the current directory, or be named something other than `.core` (`kern.corefile`). Added: stable/10/usr.bin/procstat/tests/ - copied from r318325, head/usr.bin/procstat/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/procstat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:54:59 2017 (r321083) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:57:38 2017 (r321084) @@ -616,6 +616,8 @@ .. printf .. + procstat + .. sed regress.multitest.out .. Modified: stable/10/usr.bin/procstat/Makefile ============================================================================== --- stable/10/usr.bin/procstat/Makefile Mon Jul 17 20:54:59 2017 (r321083) +++ stable/10/usr.bin/procstat/Makefile Mon Jul 17 20:57:38 2017 (r321084) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= procstat MAN= procstat.1 SRCS= procstat.c \ @@ -19,5 +21,9 @@ SRCS= procstat.c \ LDADD+= -lutil -lprocstat -lkvm DPADD+= ${LIBUTIL} ${LIBPROCSTAT} ${LIBKVM} + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-all@freebsd.org Mon Jul 17 21:01: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 4BBFDDA0A8E; Mon, 17 Jul 2017 21:01: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 22FA871433; Mon, 17 Jul 2017 21:01:09 +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 v6HL18id050121; Mon, 17 Jul 2017 21:01:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL173D050116; Mon, 17 Jul 2017 21:01:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172101.v6HL173D050116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:01:07 +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: r321085 - in stable/10: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Commit-Revision: 321085 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:01:09 -0000 Author: ngie Date: Mon Jul 17 21:01:07 2017 New Revision: 321085 URL: https://svnweb.freebsd.org/changeset/base/321085 Log: MFC r319834,r319841,r320723,r320724: r319834: Write up some basic tests for readlink(1) The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic). r319841: Add initial tests for stat(1) Testcases for -H, -L, and -f haven't been implemented yet, in part due to additional complexity needed to validate the features: * -H and -f will require an external "helper" program to display/modify the state/permissions for a given path. * -L is being covered partially via the -n testcase today. r320723: Use %e instead of %d with x_output_date(..) stat -x doesn't 0-fill days so %d is inappropriate. %e is correct. MFC with: r319841 r320724: :l_flag:: be more aggressive when normalizing whitespace Save output from ls -ldT and stat -l, then normalize all repeating whitespace using sed to single column spaces. This makes the test flexible with single-digit days, etc, similar to r320723. This approach is just a bit more of a hammer approach because of how the columns are ordered/spaced in both ls and stat. MFC with: r319841 Added: stable/10/usr.bin/stat/tests/ - copied from r319834, head/usr.bin/stat/tests/ stable/10/usr.bin/stat/tests/stat_test.sh - copied, changed from r319841, head/usr.bin/stat/tests/stat_test.sh Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/stat/Makefile stable/10/usr.bin/stat/stat.1 stable/10/usr.bin/stat/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:01:07 2017 (r321085) @@ -622,6 +622,8 @@ regress.multitest.out .. .. + stat + .. tail .. tar Modified: stable/10/usr.bin/stat/Makefile ============================================================================== --- stable/10/usr.bin/stat/Makefile Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/usr.bin/stat/Makefile Mon Jul 17 21:01:07 2017 (r321085) @@ -1,8 +1,14 @@ # $FreeBSD$ +.include + PROG= stat LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/usr.bin/stat/stat.1 ============================================================================== --- stable/10/usr.bin/stat/stat.1 Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:01:07 2017 (r321085) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2012 +.Dd June 22, 2017 .Dt STAT 1 .Os .Sh NAME Modified: stable/10/usr.bin/stat/tests/Makefile ============================================================================== --- head/usr.bin/stat/tests/Makefile Sun Jun 11 21:13:12 2017 (r319834) +++ stable/10/usr.bin/stat/tests/Makefile Mon Jul 17 21:01:07 2017 (r321085) @@ -1,5 +1,6 @@ # $FreeBSD$ ATF_TESTS_SH+= readlink_test +ATF_TESTS_SH+= stat_test .include Copied and modified: stable/10/usr.bin/stat/tests/stat_test.sh (from r319841, head/usr.bin/stat/tests/stat_test.sh) ============================================================================== --- head/usr.bin/stat/tests/stat_test.sh Mon Jun 12 00:21:55 2017 (r319841, copy source) +++ stable/10/usr.bin/stat/tests/stat_test.sh Mon Jul 17 21:01:07 2017 (r321085) @@ -60,14 +60,23 @@ l_flag_body() paths="a b c d" + ls_out=ls.output + stat_out=stat.output + # NOTE: # - Even though stat -l claims to be equivalent to `ls -lT`, the # whitespace is a bit more liberal in the `ls -lT` output. # - `ls -ldT` is used to not recursively list the contents of # directories. for path in $paths; do - atf_check -o inline:"$(ls -ldT $path | sed -e 's, , ,g')\n" \ - stat -l $path + atf_check -o save:$ls_out ls -ldT $path + cat $ls_out + atf_check -o save:$stat_out stat -l $path + cat $stat_out + echo "Comparing normalized whitespace" + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $ls_out + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $stat_out + atf_check cmp $ls_out $stat_out done } @@ -165,7 +174,7 @@ t_flag_body() x_output_date() { - local date_format='%a %b %d %H:%M:%S %Y' + local date_format='%a %b %e %H:%M:%S %Y' stat -t "$date_format" "$@" } From owner-svn-src-all@freebsd.org Mon Jul 17 21:01: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 4C1F3DA0AC2; Mon, 17 Jul 2017 21:01:12 +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 25EA67143E; Mon, 17 Jul 2017 21:01:12 +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 v6HL1BoM050172; Mon, 17 Jul 2017 21:01:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL1A9u050167; Mon, 17 Jul 2017 21:01:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172101.v6HL1A9u050167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:01: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: r321086 - in stable/11: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Commit-Revision: 321086 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:01:12 -0000 Author: ngie Date: Mon Jul 17 21:01:10 2017 New Revision: 321086 URL: https://svnweb.freebsd.org/changeset/base/321086 Log: MFC r319834,r319841,r320723,r320724: r319834: Write up some basic tests for readlink(1) The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic). r319841: Add initial tests for stat(1) Testcases for -H, -L, and -f haven't been implemented yet, in part due to additional complexity needed to validate the features: * -H and -f will require an external "helper" program to display/modify the state/permissions for a given path. * -L is being covered partially via the -n testcase today. r320723: Use %e instead of %d with x_output_date(..) stat -x doesn't 0-fill days so %d is inappropriate. %e is correct. MFC with: r319841 r320724: :l_flag:: be more aggressive when normalizing whitespace Save output from ls -ldT and stat -l, then normalize all repeating whitespace using sed to single column spaces. This makes the test flexible with single-digit days, etc, similar to r320723. This approach is just a bit more of a hammer approach because of how the columns are ordered/spaced in both ls and stat. MFC with: r319841 Added: stable/11/usr.bin/stat/tests/ - copied from r319834, head/usr.bin/stat/tests/ stable/11/usr.bin/stat/tests/stat_test.sh - copied, changed from r319841, head/usr.bin/stat/tests/stat_test.sh Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/usr.bin/stat/Makefile stable/11/usr.bin/stat/stat.1 stable/11/usr.bin/stat/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Mon Jul 17 21:01:07 2017 (r321085) +++ stable/11/etc/mtree/BSD.tests.dist Mon Jul 17 21:01:10 2017 (r321086) @@ -650,6 +650,8 @@ .. soelim .. + stat + .. tail .. tar Modified: stable/11/usr.bin/stat/Makefile ============================================================================== --- stable/11/usr.bin/stat/Makefile Mon Jul 17 21:01:07 2017 (r321085) +++ stable/11/usr.bin/stat/Makefile Mon Jul 17 21:01:10 2017 (r321086) @@ -1,8 +1,12 @@ # $FreeBSD$ +.include + PROG= stat LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 + +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/11/usr.bin/stat/stat.1 ============================================================================== --- stable/11/usr.bin/stat/stat.1 Mon Jul 17 21:01:07 2017 (r321085) +++ stable/11/usr.bin/stat/stat.1 Mon Jul 17 21:01:10 2017 (r321086) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2012 +.Dd June 22, 2017 .Dt STAT 1 .Os .Sh NAME Modified: stable/11/usr.bin/stat/tests/Makefile ============================================================================== --- head/usr.bin/stat/tests/Makefile Sun Jun 11 21:13:12 2017 (r319834) +++ stable/11/usr.bin/stat/tests/Makefile Mon Jul 17 21:01:10 2017 (r321086) @@ -1,5 +1,6 @@ # $FreeBSD$ ATF_TESTS_SH+= readlink_test +ATF_TESTS_SH+= stat_test .include Copied and modified: stable/11/usr.bin/stat/tests/stat_test.sh (from r319841, head/usr.bin/stat/tests/stat_test.sh) ============================================================================== --- head/usr.bin/stat/tests/stat_test.sh Mon Jun 12 00:21:55 2017 (r319841, copy source) +++ stable/11/usr.bin/stat/tests/stat_test.sh Mon Jul 17 21:01:10 2017 (r321086) @@ -60,14 +60,23 @@ l_flag_body() paths="a b c d" + ls_out=ls.output + stat_out=stat.output + # NOTE: # - Even though stat -l claims to be equivalent to `ls -lT`, the # whitespace is a bit more liberal in the `ls -lT` output. # - `ls -ldT` is used to not recursively list the contents of # directories. for path in $paths; do - atf_check -o inline:"$(ls -ldT $path | sed -e 's, , ,g')\n" \ - stat -l $path + atf_check -o save:$ls_out ls -ldT $path + cat $ls_out + atf_check -o save:$stat_out stat -l $path + cat $stat_out + echo "Comparing normalized whitespace" + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $ls_out + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $stat_out + atf_check cmp $ls_out $stat_out done } @@ -165,7 +174,7 @@ t_flag_body() x_output_date() { - local date_format='%a %b %d %H:%M:%S %Y' + local date_format='%a %b %e %H:%M:%S %Y' stat -t "$date_format" "$@" } From owner-svn-src-all@freebsd.org Mon Jul 17 21:05: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 F03D4DA0C8F; Mon, 17 Jul 2017 21:05:16 +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 BF2DC71BC3; Mon, 17 Jul 2017 21:05:16 +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 v6HL5F1b054118; Mon, 17 Jul 2017 21:05:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL5FdD054117; Mon, 17 Jul 2017 21:05:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172105.v6HL5FdD054117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321087 - stable/11/sys/dev/vt/hw/vga X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 321087 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:05:17 -0000 Author: ngie Date: Mon Jul 17 21:05:15 2017 New Revision: 321087 URL: https://svnweb.freebsd.org/changeset/base/321087 Log: MFC r319928: Use nitems(..) when computing `max` instead of the longhand version of the same logic Modified: stable/11/sys/dev/vt/hw/vga/vt_vga.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/11/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:01:10 2017 (r321086) +++ stable/11/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:05:15 2017 (r321087) @@ -288,7 +288,7 @@ vga_get_cp437(term_char_t c) int min, mid, max; min = 0; - max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + max = nitems(cp437table) - 1; if (c < cp437table[0].unicode_base || c > cp437table[max].unicode_base + cp437table[max].length) From owner-svn-src-all@freebsd.org Mon Jul 17 21:08: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 5D2B5DA0D60; Mon, 17 Jul 2017 21:08:25 +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 2EF5C71D77; Mon, 17 Jul 2017 21:08:25 +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 v6HL8OKR054365; Mon, 17 Jul 2017 21:08:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL8OPP054364; Mon, 17 Jul 2017 21:08:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172108.v6HL8OPP054364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321088 - stable/11/bin/ln/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/bin/ln/tests X-SVN-Commit-Revision: 321088 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:08:25 -0000 Author: ngie Date: Mon Jul 17 21:08:24 2017 New Revision: 321088 URL: https://svnweb.freebsd.org/changeset/base/321088 Log: MFC r319855,r319856,r319858: r319855: Use readlink(1)/stat(1) to query symlinks instead of file(1) file(1) can be compiled out of the system via MK_FILE == no, and the output isn't guaranteed to be stable. It's better to use stat(1)/readlink(1) instead to query symlink/file paths. MFC with: r319714, r319854 r319856: Add a testcase for `ln -sF` The testcase fails today, so mark it with atf_expect_fail: in particular, the target (B) isn't being unlinked and the documentation doesn't suggest special handling for directories. Thus, there's either a doc or an implementation bug in ln(1) that needs to be resolved. MFC with: r319714, r319854, r319855 PR: 219943 r319858: Style fixes: clean up leading whitespace (8 single column spaces -> \t) MFC with: r319714, r319854, r319855, r319856 Modified: stable/11/bin/ln/tests/ln_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ln/tests/ln_test.sh ============================================================================== --- stable/11/bin/ln/tests/ln_test.sh Mon Jul 17 21:05:15 2017 (r321087) +++ stable/11/bin/ln/tests/ln_test.sh Mon Jul 17 21:08:24 2017 (r321088) @@ -28,193 +28,217 @@ set_umask() { - if ! umask 022; then - atf_fail "setting umask failed" - fi + if ! umask 022; then + atf_fail "setting umask failed" + fi } atf_test_case L_flag L_flag_head() { - atf_set "descr" "Verify that when creating a hard link to a " \ - "symbolic link, '-L' option creates a hard" \ - "link to the target of the symbolic link" + atf_set "descr" "Verify that when creating a hard link to a " \ + "symbolic link, '-L' option creates a hard" \ + "link to the target of the symbolic link" } L_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check ln -L B C - stat_A=$(stat -f %i A) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_A" "$stat_C" - atf_check -o inline:'B: symbolic link to A\n' file B + set_umask + atf_check touch A + atf_check ln -s A B + atf_check ln -L B C + stat_A=$(stat -f %i A) + stat_C=$(stat -f %i C) + atf_check_equal "$stat_A" "$stat_C" + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case P_flag P_flag_head() { - atf_set "descr" "Verify that when creating a hard link to a " \ - "symbolic link, '-P' option creates a hard " \ - "link to the symbolic link itself" + atf_set "descr" "Verify that when creating a hard link to a " \ + "symbolic link, '-P' option creates a hard " \ + "link to the symbolic link itself" } P_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check ln -P B C - stat_B=$(stat -f %i B) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_B" "$stat_C" + set_umask + atf_check touch A + atf_check ln -s A B + atf_check ln -P B C + stat_B=$(stat -f %i B) + stat_C=$(stat -f %i C) + atf_check_equal "$stat_B" "$stat_C" } atf_test_case f_flag f_flag_head() { - atf_set "descr" "Verify that if the target file already exists, " \ - "'-f' option unlinks it so that link may occur" + atf_set "descr" "Verify that if the target file already exists, " \ + "'-f' option unlinks it so that link may occur" } f_flag_body() { - set_umask - atf_check touch A B - atf_check ln -f A B - stat_A=$(stat -f %i A) - stat_B=$(stat -f %i B) - atf_check_equal "$stat_A" "$stat_B" + set_umask + atf_check touch A B + atf_check ln -f A B + stat_A=$(stat -f %i A) + stat_B=$(stat -f %i B) + atf_check_equal "$stat_A" "$stat_B" } atf_test_case target_exists_hard target_exists_hard_head() { - atf_set "descr" "Verify whether creating a hard link fails if the " \ - "target file already exists" + atf_set "descr" "Verify whether creating a hard link fails if the " \ + "target file already exists" } target_exists_hard_body() { - set_umask - atf_check touch A B - atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln A B + set_umask + atf_check touch A B + atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ + ln A B } atf_test_case target_exists_symbolic target_exists_symbolic_head() { - atf_set "descr" "Verify whether creating a symbolic link fails if " \ - "the target file already exists" + atf_set "descr" "Verify whether creating a symbolic link fails if " \ + "the target file already exists" } target_exists_symbolic_body() { - set_umask - atf_check touch A B - atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ - ln -s A B + set_umask + atf_check touch A B + atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ + ln -s A B } atf_test_case shf_flag_dir shf_flag_dir_head() { - atf_set "descr" "Verify that if the target directory is a symbolic " \ - "link, '-shf' option prevents following the link" + atf_set "descr" "Verify that if the target directory is a symbolic " \ + "link, '-shf' option prevents following the link" } shf_flag_dir_body() { - atf_check mkdir -m 0777 A B - atf_check ln -s A C - atf_check ln -shf B C - atf_check -o inline:'C: symbolic link to B\n' file C + atf_check mkdir -m 0777 A B + atf_check ln -s A C + atf_check ln -shf B C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } atf_test_case snf_flag_dir snf_flag_dir_head() { - atf_set "descr" "Verify that if the target directory is a symbolic " \ - "link, '-snf' option prevents following the link" + atf_set "descr" "Verify that if the target directory is a symbolic " \ + "link, '-snf' option prevents following the link" } snf_flag_dir_body() { - atf_check mkdir -m 0777 A B - atf_check ln -s A C - atf_check ln -snf B C - atf_check -o inline:'C: symbolic link to B\n' file C + atf_check mkdir -m 0777 A B + atf_check ln -s A C + atf_check ln -snf B C + atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check -o inline:'B\n' readlink C } +atf_test_case sF_flag +sF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a directory, then '-sF' option removes " \ + "it so that the link may occur" +} + +sF_flag_body() +{ + atf_expect_fail "B isn't being unlinked (bug 219943)" + atf_check mkdir A B + atf_check ln -sF A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B +} + atf_test_case sf_flag sf_flag_head() { - atf_set "descr" "Verify that if the target file already exists, " \ - "'-sf' option unlinks it and creates a symbolic link " \ - "to the source file" + atf_set "descr" "Verify that if the target file already exists, " \ + "'-sf' option unlinks it and creates a symbolic link " \ + "to the source file" } sf_flag_body() { - set_umask - atf_check touch A B - atf_check ln -sf A B - atf_check -o inline:'B: symbolic link to A\n' file B + set_umask + atf_check touch A B + atf_check ln -sf A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag s_flag_head() { - atf_set "descr" "Verify that '-s' option creates a symbolic link" + atf_set "descr" "Verify that '-s' option creates a symbolic link" } s_flag_body() { - set_umask - atf_check touch A - atf_check ln -s A B - atf_check -o inline:'B: symbolic link to A\n' file B + set_umask + atf_check touch A + atf_check ln -s A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case s_flag_broken s_flag_broken_head() { - atf_set "descr" "Verify that if the source file does not exists, '-s' " \ - "option creates a broken symbolic link to the source file" + atf_set "descr" "Verify that if the source file does not exists, '-s' " \ + "option creates a broken symbolic link to the source file" } s_flag_broken_body() { - atf_check ln -s A B - atf_check -o inline:'B: broken symbolic link to A\n' file B + atf_check ln -s A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case sw_flag sw_flag_head() { - atf_set "descr" "Verify that '-sw' option produces a warning if the " \ - "source of a symbolic link does not currently exist" + atf_set "descr" "Verify that '-sw' option produces a warning if the " \ + "source of a symbolic link does not currently exist" } sw_flag_body() { - atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ - ln -sw A B - atf_check -o inline:'B: broken symbolic link to A\n' file B + atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ + ln -sw A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_init_test_cases() { - atf_add_test_case L_flag - atf_add_test_case P_flag - atf_add_test_case f_flag - atf_add_test_case target_exists_hard - atf_add_test_case target_exists_symbolic - atf_add_test_case shf_flag_dir - atf_add_test_case snf_flag_dir - atf_add_test_case sf_flag - atf_add_test_case s_flag - atf_add_test_case s_flag_broken - atf_add_test_case sw_flag + atf_add_test_case L_flag + atf_add_test_case P_flag + atf_add_test_case f_flag + atf_add_test_case target_exists_hard + atf_add_test_case target_exists_symbolic + atf_add_test_case shf_flag_dir + atf_add_test_case snf_flag_dir + atf_add_test_case sF_flag + atf_add_test_case sf_flag + atf_add_test_case s_flag + atf_add_test_case s_flag_broken + atf_add_test_case sw_flag } From owner-svn-src-all@freebsd.org Mon Jul 17 21:09:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E32DA0DE0; Mon, 17 Jul 2017 21:09:32 +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 7586E71EBD; Mon, 17 Jul 2017 21:09:32 +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 v6HL9V9R054482; Mon, 17 Jul 2017 21:09:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL9VEN054481; Mon, 17 Jul 2017 21:09:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172109.v6HL9VEN054481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321089 - stable/11/bin/ln X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/bin/ln X-SVN-Commit-Revision: 321089 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:09:32 -0000 Author: ngie Date: Mon Jul 17 21:09:31 2017 New Revision: 321089 URL: https://svnweb.freebsd.org/changeset/base/321089 Log: MFC r319857: ln(1): wordsmith -F option description Modified: stable/11/bin/ln/ln.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ln/ln.1 ============================================================================== --- stable/11/bin/ln/ln.1 Mon Jul 17 21:08:24 2017 (r321088) +++ stable/11/bin/ln/ln.1 Mon Jul 17 21:09:31 2017 (r321089) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd November 2, 2012 +.Dd June 12, 2017 .Dt LN 1 .Os .Sh NAME @@ -87,14 +87,18 @@ option should be used with either or .Fl i options. -If none is specified, +If neither .Fl f +nor +.Fl i +is specified, +.Fl f is implied. The .Fl F option is a no-op unless .Fl s -option is specified. +is specified. .It Fl L When creating a hard link to a symbolic link, create a hard link to the target of the symbolic link. From owner-svn-src-all@freebsd.org Mon Jul 17 21:09: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 D5BCADA0E1E; Mon, 17 Jul 2017 21:09:36 +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 9E29A71ECA; Mon, 17 Jul 2017 21:09:36 +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 v6HL9ZMx054532; Mon, 17 Jul 2017 21:09:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL9ZO5054531; Mon, 17 Jul 2017 21:09:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172109.v6HL9ZO5054531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:09:35 +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: r321090 - stable/10/sys/dev/vt/hw/vga X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 321090 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:09:37 -0000 Author: ngie Date: Mon Jul 17 21:09:35 2017 New Revision: 321090 URL: https://svnweb.freebsd.org/changeset/base/321090 Log: MFC r319928: Use nitems(..) when computing `max` instead of the longhand version of the same logic Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:09:31 2017 (r321089) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:09:35 2017 (r321090) @@ -283,7 +283,7 @@ vga_get_cp437(term_char_t c) int min, mid, max; min = 0; - max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + max = nitems(cp437table) - 1; if (c < cp437table[0].unicode_base || c > cp437table[max].unicode_base + cp437table[max].length) From owner-svn-src-all@freebsd.org Mon Jul 17 21:10: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 4796BDA0EBA; Mon, 17 Jul 2017 21:10:10 +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 1174F72116; Mon, 17 Jul 2017 21:10:09 +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 v6HLA9f2054636; Mon, 17 Jul 2017 21:10:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLA91U054635; Mon, 17 Jul 2017 21:10:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172110.v6HLA91U054635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:10: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: r321091 - stable/10/bin/ln X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/bin/ln X-SVN-Commit-Revision: 321091 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:10:10 -0000 Author: ngie Date: Mon Jul 17 21:10:08 2017 New Revision: 321091 URL: https://svnweb.freebsd.org/changeset/base/321091 Log: MFC r319857: ln(1): wordsmith -F option description Modified: stable/10/bin/ln/ln.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/ln.1 ============================================================================== --- stable/10/bin/ln/ln.1 Mon Jul 17 21:09:35 2017 (r321090) +++ stable/10/bin/ln/ln.1 Mon Jul 17 21:10:08 2017 (r321091) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd November 2, 2012 +.Dd June 12, 2017 .Dt LN 1 .Os .Sh NAME @@ -87,14 +87,18 @@ option should be used with either or .Fl i options. -If none is specified, +If neither .Fl f +nor +.Fl i +is specified, +.Fl f is implied. The .Fl F option is a no-op unless .Fl s -option is specified. +is specified. .It Fl L When creating a hard link to a symbolic link, create a hard link to the target of the symbolic link. From owner-svn-src-all@freebsd.org Mon Jul 17 21:11: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 BAC23DA1088; Mon, 17 Jul 2017 21:11:22 +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 872E9722FD; Mon, 17 Jul 2017 21:11:22 +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 v6HLBLoY057578; Mon, 17 Jul 2017 21:11:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLBLfj057575; Mon, 17 Jul 2017 21:11:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172111.v6HLBLfj057575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321092 - in stable/11/bin/ln: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/bin/ln: . tests X-SVN-Commit-Revision: 321092 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:11:22 -0000 Author: ngie Date: Mon Jul 17 21:11:21 2017 New Revision: 321092 URL: https://svnweb.freebsd.org/changeset/base/321092 Log: MFC r320172,r320173: r320172: ln(1): fix -F behavior When '-F' option is used, the target directory needs to be unlinked. Currently, the modified target ("target/source") is being unlinked, and since it doesn't yet exist, the original target isn't removed. This is fixed by skipping the block where target is modified to "target/source" when '-F' option is set. Hence, a symbolic link (with the same name as of the original target) to the source_file is produced. Update the test for ln(1) to reflect fix for option '-F' PR: 219943 r320173: Don't expect :sF_flag to fail anymore While here, also add a check to verify that the link target is updated in the testcase MFC with: r320172 PR: 219943 Modified: stable/11/bin/ln/ln.c stable/11/bin/ln/tests/ln_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ln/ln.c ============================================================================== --- stable/11/bin/ln/ln.c Mon Jul 17 21:10:08 2017 (r321091) +++ stable/11/bin/ln/ln.c Mon Jul 17 21:11:21 2017 (r321092) @@ -245,11 +245,11 @@ linkit(const char *source, const char *target, int isd /* * If the target is a directory (and not a symlink if hflag), - * append the source's name. + * append the source's name, unless Fflag is set. */ - if (isdir || + if (!Fflag && (isdir || (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || - (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { + (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) { if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) || (p = basename(bbuf)) == NULL || snprintf(path, sizeof(path), "%s/%s", target, p) >= Modified: stable/11/bin/ln/tests/ln_test.sh ============================================================================== --- stable/11/bin/ln/tests/ln_test.sh Mon Jul 17 21:10:08 2017 (r321091) +++ stable/11/bin/ln/tests/ln_test.sh Mon Jul 17 21:11:21 2017 (r321092) @@ -160,10 +160,10 @@ sF_flag_head() sF_flag_body() { - atf_expect_fail "B isn't being unlinked (bug 219943)" atf_check mkdir A B atf_check ln -sF A B atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B } atf_test_case sf_flag From owner-svn-src-all@freebsd.org Mon Jul 17 21:12: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 054BBDA1129; Mon, 17 Jul 2017 21:12:04 +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 C0C02725DC; Mon, 17 Jul 2017 21:12:03 +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 v6HLC2vU057798; Mon, 17 Jul 2017 21:12:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLC2In057796; Mon, 17 Jul 2017 21:12:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172112.v6HLC2In057796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:12: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: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: bin/ln bin/ln/tests etc/mtree X-SVN-Commit-Revision: 321093 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:12:04 -0000 Author: ngie Date: Mon Jul 17 21:12:02 2017 New Revision: 321093 URL: https://svnweb.freebsd.org/changeset/base/321093 Log: MFC r319857: ln(1): wordsmith -F option description Added: stable/10/bin/ln/tests/ - copied from r319714, head/bin/ln/tests/ Modified: stable/10/bin/ln/Makefile stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/Makefile ============================================================================== --- stable/10/bin/ln/Makefile Mon Jul 17 21:11:21 2017 (r321092) +++ stable/10/bin/ln/Makefile Mon Jul 17 21:12:02 2017 (r321093) @@ -1,10 +1,16 @@ # @(#)Makefile 8.2 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= ln MAN= ln.1 symlink.7 LINKS= ${BINDIR}/ln ${BINDIR}/link MLINKS= ln.1 link.1 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:11:21 2017 (r321092) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:12:02 2017 (r321093) @@ -18,6 +18,8 @@ .. expr .. + ln + .. ls .. mv From owner-svn-src-all@freebsd.org Mon Jul 17 21:13: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 D5466DA1220; Mon, 17 Jul 2017 21:13:44 +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 ACA9B7293A; Mon, 17 Jul 2017 21:13:44 +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 v6HLDhno059009; Mon, 17 Jul 2017 21:13:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLDhPE059007; Mon, 17 Jul 2017 21:13:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172113.v6HLDhPE059007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:13: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: r321094 - in stable/10/bin/ln: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/bin/ln: . tests X-SVN-Commit-Revision: 321094 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:13:44 -0000 Author: ngie Date: Mon Jul 17 21:13:43 2017 New Revision: 321094 URL: https://svnweb.freebsd.org/changeset/base/321094 Log: MFC r319856,r320172,r320173: r319856: Add a testcase for `ln -sF` The testcase fails today, so mark it with atf_expect_fail: in particular, the target (B) isn't being unlinked and the documentation doesn't suggest special handling for directories. Thus, there's either a doc or an implementation bug in ln(1) that needs to be resolved. MFC with: r319714, r319854, r319855 PR: 219943 r320172: ln(1): fix -F behavior When '-F' option is used, the target directory needs to be unlinked. Currently, the modified target ("target/source") is being unlinked, and since it doesn't yet exist, the original target isn't removed. This is fixed by skipping the block where target is modified to "target/source" when '-F' option is set. Hence, a symbolic link (with the same name as of the original target) to the source_file is produced. Update the test for ln(1) to reflect fix for option '-F' PR: 219943 r320173: Don't expect :sF_flag to fail anymore While here, also add a check to verify that the link target is updated in the testcase MFC with: r320172 PR: 219943 Modified: stable/10/bin/ln/ln.c stable/10/bin/ln/tests/ln_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/ln.c ============================================================================== --- stable/10/bin/ln/ln.c Mon Jul 17 21:12:02 2017 (r321093) +++ stable/10/bin/ln/ln.c Mon Jul 17 21:13:43 2017 (r321094) @@ -245,11 +245,11 @@ linkit(const char *source, const char *target, int isd /* * If the target is a directory (and not a symlink if hflag), - * append the source's name. + * append the source's name, unless Fflag is set. */ - if (isdir || + if (!Fflag && (isdir || (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || - (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { + (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) { if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) || (p = basename(bbuf)) == NULL || snprintf(path, sizeof(path), "%s/%s", target, p) >= Modified: stable/10/bin/ln/tests/ln_test.sh ============================================================================== --- stable/10/bin/ln/tests/ln_test.sh Mon Jul 17 21:12:02 2017 (r321093) +++ stable/10/bin/ln/tests/ln_test.sh Mon Jul 17 21:13:43 2017 (r321094) @@ -145,6 +145,22 @@ snf_flag_dir_body() atf_check -o inline:'C: symbolic link to B\n' file C } +atf_test_case sF_flag +sF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a directory, then '-sF' option removes " \ + "it so that the link may occur" +} + +sF_flag_body() +{ + atf_check mkdir A B + atf_check ln -sF A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B +} + atf_test_case sf_flag sf_flag_head() { @@ -210,6 +226,7 @@ atf_init_test_cases() atf_add_test_case target_exists_symbolic atf_add_test_case shf_flag_dir atf_add_test_case snf_flag_dir + atf_add_test_case sF_flag atf_add_test_case sf_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken From owner-svn-src-all@freebsd.org Mon Jul 17 21:17: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 29A16DA12C5; Mon, 17 Jul 2017 21:17:05 +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 E4C6872B18; Mon, 17 Jul 2017 21:17:04 +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 v6HLH3Z6059255; Mon, 17 Jul 2017 21:17:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLH35f059254; Mon, 17 Jul 2017 21:17:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172117.v6HLH35f059254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321095 - stable/11/tests/sys/aio X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/tests/sys/aio X-SVN-Commit-Revision: 321095 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:17:05 -0000 Author: ngie Date: Mon Jul 17 21:17:03 2017 New Revision: 321095 URL: https://svnweb.freebsd.org/changeset/base/321095 Log: MFC r318180: Mark all md tests as requiring unsafe AIO in order to function These tests have been flapping (failing<->passing) on Jenkins for months. It passes reliably for me if unsafe AIO is permitted, but it doesn't pass on Jenkins reliably if unsafe AIO is disabled (the current default). Mark the tests as requiring unsafe AIO to mitigate the intermittent failures when unsafe AIO isn't permitted. If the kernel code is changed to reliably function with md(4) devices using unsafe AIO, this commit can be reverted. PR: 217261 Modified: stable/11/tests/sys/aio/aio_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/aio/aio_test.c ============================================================================== --- stable/11/tests/sys/aio/aio_test.c Mon Jul 17 21:13:43 2017 (r321094) +++ stable/11/tests/sys/aio/aio_test.c Mon Jul 17 21:17:03 2017 (r321095) @@ -735,6 +735,7 @@ aio_md_test(completion comp) struct md_ioctl mdio; ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); mdctl_fd = open("/dev/" MDCTL_NAME, O_RDWR, 0); ATF_REQUIRE_MSG(mdctl_fd != -1, From owner-svn-src-all@freebsd.org Mon Jul 17 21:18: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 E9015DA136A; Mon, 17 Jul 2017 21:18:41 +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 B83D272C81; Mon, 17 Jul 2017 21:18:41 +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 v6HLIetc059407; Mon, 17 Jul 2017 21:18:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLIesT059406; Mon, 17 Jul 2017 21:18:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172118.v6HLIesT059406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:18: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: r321096 - stable/11/usr.bin/du X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/du X-SVN-Commit-Revision: 321096 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:18:42 -0000 Author: ngie Date: Mon Jul 17 21:18:40 2017 New Revision: 321096 URL: https://svnweb.freebsd.org/changeset/base/321096 Log: MFC r319846: du(1): trivial whitespace cleanup Modified: stable/11/usr.bin/du/du.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/du/du.c ============================================================================== --- stable/11/usr.bin/du/du.c Mon Jul 17 21:17:03 2017 (r321095) +++ stable/11/usr.bin/du/du.c Mon Jul 17 21:18:40 2017 (r321096) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include #include @@ -514,7 +513,7 @@ static void ignoreclean(void) { struct ignentry *ign; - + while (!SLIST_EMPTY(&ignores)) { ign = SLIST_FIRST(&ignores); SLIST_REMOVE_HEAD(&ignores, next); From owner-svn-src-all@freebsd.org Mon Jul 17 21:18: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 51BD0DA13C4; Mon, 17 Jul 2017 21:18:45 +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 1EDD272C82; Mon, 17 Jul 2017 21:18:45 +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 v6HLIiRs059456; Mon, 17 Jul 2017 21:18:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLIiSx059455; Mon, 17 Jul 2017 21:18:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172118.v6HLIiSx059455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:18: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: r321097 - stable/10/usr.bin/du X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/du X-SVN-Commit-Revision: 321097 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:18:45 -0000 Author: ngie Date: Mon Jul 17 21:18:44 2017 New Revision: 321097 URL: https://svnweb.freebsd.org/changeset/base/321097 Log: MFC r319846: du(1): trivial whitespace cleanup Modified: stable/10/usr.bin/du/du.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/du/du.c ============================================================================== --- stable/10/usr.bin/du/du.c Mon Jul 17 21:18:40 2017 (r321096) +++ stable/10/usr.bin/du/du.c Mon Jul 17 21:18:44 2017 (r321097) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include #include @@ -517,7 +516,7 @@ static void ignoreclean(void) { struct ignentry *ign; - + while (!SLIST_EMPTY(&ignores)) { ign = SLIST_FIRST(&ignores); SLIST_REMOVE_HEAD(&ignores, next); From owner-svn-src-all@freebsd.org Mon Jul 17 21:19: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 08420DA14A0; Mon, 17 Jul 2017 21:19:31 +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 C9D8172EEB; Mon, 17 Jul 2017 21:19:30 +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 v6HLJUkZ059564; Mon, 17 Jul 2017 21:19:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLJU5G059563; Mon, 17 Jul 2017 21:19:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172119.v6HLJU5G059563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:19: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: r321098 - stable/10/usr.bin/stat X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/stat X-SVN-Commit-Revision: 321098 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:19:31 -0000 Author: ngie Date: Mon Jul 17 21:19:29 2017 New Revision: 321098 URL: https://svnweb.freebsd.org/changeset/base/321098 Log: MFC r319836: stat(1): sort flags in the DESCRIPTION section -x's description should come after -t's description. Modified: stable/10/usr.bin/stat/stat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/stat/stat.1 ============================================================================== --- stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:18:44 2017 (r321097) +++ stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:19:29 2017 (r321098) @@ -172,15 +172,15 @@ Display information in .Dq shell output format, suitable for initializing variables. -.It Fl x -Display information in a more verbose way as known from some -.Tn Linux -distributions. .It Fl t Ar timefmt Display timestamps using the specified format. This format is passed directly to .Xr strftime 3 . +.It Fl x +Display information in a more verbose way as known from some +.Tn Linux +distributions. .El .Ss Formats Format strings are similar to From owner-svn-src-all@freebsd.org Mon Jul 17 21:19: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 02E54DA151E; Mon, 17 Jul 2017 21:19:42 +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 C484672F98; Mon, 17 Jul 2017 21:19:41 +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 v6HLJem7059778; Mon, 17 Jul 2017 21:19:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLJegG059775; Mon, 17 Jul 2017 21:19:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172119.v6HLJegG059775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:19: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: r321099 - stable/11/usr.bin/stat X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/stat X-SVN-Commit-Revision: 321099 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:19:42 -0000 Author: ngie Date: Mon Jul 17 21:19:40 2017 New Revision: 321099 URL: https://svnweb.freebsd.org/changeset/base/321099 Log: MFC r319836: stat(1): sort flags in the DESCRIPTION section -x's description should come after -t's description. Modified: stable/11/usr.bin/stat/stat.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/stat/stat.1 ============================================================================== --- stable/11/usr.bin/stat/stat.1 Mon Jul 17 21:19:29 2017 (r321098) +++ stable/11/usr.bin/stat/stat.1 Mon Jul 17 21:19:40 2017 (r321099) @@ -179,15 +179,15 @@ Display information in .Dq shell output format, suitable for initializing variables. -.It Fl x -Display information in a more verbose way as known from some -.Tn Linux -distributions. .It Fl t Ar timefmt Display timestamps using the specified format. This format is passed directly to .Xr strftime 3 . +.It Fl x +Display information in a more verbose way as known from some +.Tn Linux +distributions. .El .Ss Formats Format strings are similar to From owner-svn-src-all@freebsd.org Mon Jul 17 21:29: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 B3753DA1BB7; Mon, 17 Jul 2017 21:29:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8B17C73762; Mon, 17 Jul 2017 21:29:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLTI8Q064146; Mon, 17 Jul 2017 21:29:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLTIXq064145; Mon, 17 Jul 2017 21:29:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707172129.v6HLTIXq064145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Jul 2017 21:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321100 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321100 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:29:19 -0000 Author: adrian Date: Mon Jul 17 21:29:18 2017 New Revision: 321100 URL: https://svnweb.freebsd.org/changeset/base/321100 Log: [iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c. From the original commit: == * Actually look at the first channel in the list. If it's a 2.4GHz channel, set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we don't need to look further. * While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check. Taken-From: Linux iwlwifi == However, this only really does the latter. The sc_ic channel list isn't the scan channel list, it's the /whole list/ for the set of active channels, so I don't know what the right thing to do is here. So I'll commit this as an intermediary commit and we'll have to revisit whether to finish the refactor as-is. Tested: * Intel 7260, STA mode Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432 Modified: head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Mon Jul 17 21:19:40 2017 (r321099) +++ head/sys/dev/iwm/if_iwm_scan.c Mon Jul 17 21:29:18 2017 (r321100) @@ -179,7 +179,18 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc) return htole16(rx_chain); } +#if 0 static uint32_t +iwm_mvm_scan_rxon_flags(struct ieee80211_channel *c) +{ + if (IEEE80211_IS_CHAN_2GHZ(c)) + return htole32(IWM_PHY_BAND_24); + else + return htole32(IWM_PHY_BAND_5); +} +#endif + +static uint32_t iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int flags, int no_cck) { uint32_t tx_ant; @@ -202,6 +213,14 @@ iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int fl return htole32(IWM_RATE_6M_PLCP | tx_ant); } +static inline boolean_t +iwm_mvm_rrm_scan_needed(struct iwm_softc *sc) +{ + /* require rrm scan whenever the fw supports it */ + return fw_has_capa(&sc->ucode_capa, + IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT); +} + #ifdef IWM_DEBUG static const char * iwm_mvm_ebs_status_str(enum iwm_scan_ebs_status status) @@ -416,8 +435,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iw preq->band_data[0].len = htole16(frm - pos); remain -= frm - pos; - if (fw_has_capa(&sc->ucode_capa, - IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) { + if (iwm_mvm_rrm_scan_needed(sc)) { if (remain < 3) return ENOBUFS; *frm++ = IEEE80211_ELEMID_DSPARMS; @@ -639,8 +657,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) IWM_SCAN_CHANNEL_FLAG_EBS_ACCURATE | IWM_SCAN_CHANNEL_FLAG_CACHE_ADD; - if (fw_has_capa(&sc->ucode_capa, - IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) + if (iwm_mvm_rrm_scan_needed(sc)) req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED); @@ -708,13 +725,14 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags = htole32(IWM_MVM_LMAC_SCAN_FLAG_PASS_ALL | IWM_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE | IWM_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL); - if (fw_has_capa(&sc->ucode_capa, - IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) + if (iwm_mvm_rrm_scan_needed(sc)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); + /* Note - IWM_PHY_BAND_5 is 0 anyway */ req->flags = htole32(IWM_PHY_BAND_24); if (sc->nvm_data->sku_cap_band_52GHz_enable) req->flags |= htole32(IWM_PHY_BAND_5); + req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON); From owner-svn-src-all@freebsd.org Mon Jul 17 21:32: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 4A3C4DA1E88; Mon, 17 Jul 2017 21:32:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1822A73BC7; Mon, 17 Jul 2017 21:32:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLWZEK068050; Mon, 17 Jul 2017 21:32:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLWZRS068049; Mon, 17 Jul 2017 21:32:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707172132.v6HLWZRS068049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Jul 2017 21:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321101 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321101 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 21:32:36 -0000 Author: adrian Date: Mon Jul 17 21:32:35 2017 New Revision: 321101 URL: https://svnweb.freebsd.org/changeset/base/321101 Log: [iwm] actually use the new rxon function now. It turns out the /next/ dragonflybsd git actually uses the scan channel list, so just kick this along to make the next commit easier. Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432 Modified: head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Mon Jul 17 21:29:18 2017 (r321100) +++ head/sys/dev/iwm/if_iwm_scan.c Mon Jul 17 21:32:35 2017 (r321101) @@ -179,7 +179,6 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc) return htole16(rx_chain); } -#if 0 static uint32_t iwm_mvm_scan_rxon_flags(struct ieee80211_channel *c) { @@ -188,7 +187,6 @@ iwm_mvm_scan_rxon_flags(struct ieee80211_channel *c) else return htole32(IWM_PHY_BAND_5); } -#endif static uint32_t iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int flags, int no_cck) @@ -728,10 +726,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) if (iwm_mvm_rrm_scan_needed(sc)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); - /* Note - IWM_PHY_BAND_5 is 0 anyway */ - req->flags = htole32(IWM_PHY_BAND_24); - if (sc->nvm_data->sku_cap_band_52GHz_enable) - req->flags |= htole32(IWM_PHY_BAND_5); + req->flags = iwm_mvm_scan_rxon_flags(&sc->sc_ic.ic_channels[0]); req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON); From owner-svn-src-all@freebsd.org Mon Jul 17 23:16: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 A4A1ADA3C1D; Mon, 17 Jul 2017 23:16:34 +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 80B94769D6; Mon, 17 Jul 2017 23:16:34 +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 v6HNGXmb009594; Mon, 17 Jul 2017 23:16:33 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HNGXXD009593; Mon, 17 Jul 2017 23:16:33 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707172316.v6HNGXXD009593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 17 Jul 2017 23:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321102 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321102 X-SVN-Commit-Repository: base MIME-Version: 1.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, 17 Jul 2017 23:16:34 -0000 Author: alc Date: Mon Jul 17 23:16:33 2017 New Revision: 321102 URL: https://svnweb.freebsd.org/changeset/base/321102 Log: Tidy up before making another round of functional changes: Remove end- of-line whitespace, remove excessive whitespace and blank lines, remove dead code, follow our standard style for function definitions, and correct grammatical and factual errors in some of the comments. Submitted by: Doug Moore MFC after: 1 week Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon Jul 17 21:32:35 2017 (r321101) +++ head/sys/kern/subr_blist.c Mon Jul 17 23:16:33 2017 (r321102) @@ -28,18 +28,18 @@ * BLIST.C - Bitmap allocator/deallocator, using a radix tree with hinting * * This module implements a general bitmap allocator/deallocator. The - * allocator eats around 2 bits per 'block'. The module does not - * try to interpret the meaning of a 'block' other than to return + * allocator eats around 2 bits per 'block'. The module does not + * try to interpret the meaning of a 'block' other than to return * SWAPBLK_NONE on an allocation failure. * * A radix tree is used to maintain the bitmap. Two radix constants are * involved: One for the bitmaps contained in the leaf nodes (typically - * 32), and one for the meta nodes (typically 16). Both meta and leaf + * 64), and one for the meta nodes (typically 16). Both meta and leaf * nodes have a hint field. This field gives us a hint as to the largest * free contiguous range of blocks under the node. It may contain a - * value that is too high, but will never contain a value that is too + * value that is too high, but will never contain a value that is too * low. When the radix tree is searched, allocation failures in subtrees - * update the hint. + * update the hint. * * The radix tree also implements two collapsed states for meta nodes: * the ALL-ALLOCATED state and the ALL-FREE state. If a meta node is @@ -49,7 +49,7 @@ * * The hinting greatly increases code efficiency for allocations while * the general radix structure optimizes both allocations and frees. The - * radix tree should be able to operate well no matter how much + * radix tree should be able to operate well no matter how much * fragmentation there is and no matter how large a bitmap is used. * * The blist code wires all necessary memory at creation time. Neither @@ -61,18 +61,18 @@ * linear array. Each meta node is immediately followed (laid out * sequentially in memory) by BLIST_META_RADIX lower level nodes. This * is a recursive structure but one that can be easily scanned through - * a very simple 'skip' calculation. In order to support large radixes, - * portions of the tree may reside outside our memory allocation. We - * handle this with an early-termination optimization (when bighint is - * set to -1) on the scan. The memory allocation is only large enough + * a very simple 'skip' calculation. In order to support large radixes, + * portions of the tree may reside outside our memory allocation. We + * handle this with an early-termination optimization (when bighint is + * set to -1) on the scan. The memory allocation is only large enough * to cover the number of blocks requested at creation time even if it * must be encompassed in larger root-node radix. * - * NOTE: the allocator cannot currently allocate more than - * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too - * large' if you try. This is an area that could use improvement. The - * radix is large enough that this restriction does not effect the swap - * system, though. Currently only the allocation code is effected by + * NOTE: the allocator cannot currently allocate more than + * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too + * large' if you try. This is an area that could use improvement. The + * radix is large enough that this restriction does not effect the swap + * system, though. Currently only the allocation code is affected by * this algorithmic unfeature. The freeing code can handle arbitrary * ranges. * @@ -91,7 +91,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #else @@ -120,16 +120,15 @@ void panic(const char *ctl, ...); /* * static support functions */ - static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, daddr_t cursor); static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix, daddr_t skip, daddr_t cursor); static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count); -static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, +static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix, daddr_t skip, daddr_t blk); -static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, - daddr_t skip, blist_t dest, daddr_t count); +static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, + daddr_t skip, blist_t dest, daddr_t count); static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, daddr_t radix, daddr_t skip, daddr_t blk); @@ -151,11 +150,10 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); * blocks - must be greater than 0 * flags - malloc flags * - * The smallest blist consists of a single leaf node capable of + * The smallest blist consists of a single leaf node capable of * managing BLIST_BMAP_RADIX blocks. */ - -blist_t +blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; @@ -202,7 +200,7 @@ blist_create(daddr_t blocks, int flags) return (bl); } -void +void blist_destroy(blist_t bl) { free(bl->bl_root, M_SWAP); @@ -214,8 +212,7 @@ blist_destroy(blist_t bl) * of a contiguous region or SWAPBLK_NONE if space could * not be allocated. */ - -daddr_t +daddr_t blist_alloc(blist_t bl, daddr_t count) { daddr_t blk; @@ -245,7 +242,6 @@ blist_alloc(blist_t bl, daddr_t count) /* * blist_avail() - return the number of free blocks. */ - daddr_t blist_avail(blist_t bl) { @@ -261,8 +257,7 @@ blist_avail(blist_t bl) * of a contiguous region. Panic if an inconsistancy is * found. */ - -void +void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { if (bl) { @@ -280,7 +275,6 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) * existing allocations. Return the number of blocks * actually filled that were free before the call. */ - daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { @@ -304,7 +298,6 @@ blist_fill(blist_t bl, daddr_t blkno, daddr_t count) * one. When extending the tree you can specify whether * the new blocks are to left allocated or freed. */ - void blist_resize(blist_t *pbl, daddr_t count, int freenew, int flags) { @@ -330,7 +323,6 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, /* * blist_print() - dump radix tree */ - void blist_print(blist_t bl) { @@ -345,7 +337,7 @@ blist_print(blist_t bl) * ALLOCATION SUPPORT FUNCTIONS * ************************************************************************ * - * These support functions do all the actual work. They may seem + * These support functions do all the actual work. They may seem * rather longish, but that's because I've commented them up. The * actual code is straight forward. * @@ -358,7 +350,6 @@ blist_print(blist_t bl) * BLIST_BMAP_RADIX block allocation case. Otherwise, execution * time is proportional to log2(count) + log2(BLIST_BMAP_RADIX). */ - static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, daddr_t cursor) { @@ -450,7 +441,6 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count * calls that hit this node. We have to check for our collapse cases * and we have a few optimizations strewn in as well. */ - static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix, daddr_t skip, daddr_t cursor) @@ -541,13 +531,9 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c * BLST_LEAF_FREE() - free allocated block from leaf bitmap * */ - static void -blst_leaf_free( - blmeta_t *scan, - daddr_t blk, - int count -) { +blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) +{ /* * free some data in this bitmap * @@ -568,7 +554,7 @@ blst_leaf_free( /* * We could probably do a better job here. We are required to make - * bighint at least as large as the biggest contiguous block of + * bighint at least as large as the biggest contiguous block of * data. If we just shoehorn it, a little extra overhead will * be incured on the next allocation (but only that one typically). */ @@ -585,20 +571,13 @@ blst_leaf_free( * range whereas the allocation code cannot allocate an arbitrary * range). */ - -static void +static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix, daddr_t skip, daddr_t blk) { daddr_t i, next_skip, v; int child; -#if 0 - printf("free (%llx,%lld) FROM (%llx,%lld)\n", - (long long)freeBlk, (long long)count, - (long long)blk, (long long)radix - ); -#endif next_skip = skip / BLIST_META_RADIX; if (scan->u.bmu_avail == 0) { @@ -675,15 +654,10 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ * Locates free space in the source tree and frees it in the destination * tree. The space may not already be free in the destination. */ - -static void blst_copy( - blmeta_t *scan, - daddr_t blk, - daddr_t radix, - daddr_t skip, - blist_t dest, - daddr_t count -) { +static void +blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t skip, + blist_t dest, daddr_t count) +{ daddr_t i, next_skip; /* @@ -715,7 +689,7 @@ static void blst_copy( * Source all allocated, leave dest allocated */ return; - } + } if (scan->u.bmu_avail == radix) { /* * Source all free, free entire dest @@ -736,25 +710,13 @@ static void blst_copy( break; if (count >= radix) { - blst_copy( - &scan[i], - blk, - radix, - next_skip - 1, - dest, - radix - ); + blst_copy(&scan[i], blk, radix, next_skip - 1, dest, + radix); count -= radix; } else { if (count) { - blst_copy( - &scan[i], - blk, - radix, - next_skip - 1, - dest, - count - ); + blst_copy(&scan[i], blk, radix, next_skip - 1, + dest, count); } count = 0; } @@ -769,7 +731,6 @@ static void blst_copy( * regardless of any existing allocations in that range. Returns * the number of blocks allocated by the call. */ - static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) { @@ -879,8 +840,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr * be considerably less than the calculated radix due to the large * RADIX values we use. */ - -static daddr_t +static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip, daddr_t count) { daddr_t i, memindex, next_skip; @@ -896,7 +856,7 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t scan->bm_bighint = 0; scan->u.bmu_bitmap = 0; } - return(memindex); + return (memindex); } /* @@ -918,23 +878,17 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t /* * Allocate the entire object */ - memindex = i + blst_radix_init( - ((scan) ? &scan[i] : NULL), - radix, - next_skip - 1, - radix - ); + memindex = i + + blst_radix_init(((scan) ? &scan[i] : NULL), radix, + next_skip - 1, radix); count -= radix; } else if (count > 0) { /* * Allocate a partial object */ - memindex = i + blst_radix_init( - ((scan) ? &scan[i] : NULL), - radix, - next_skip - 1, - count - ); + memindex = i + + blst_radix_init(((scan) ? &scan[i] : NULL), radix, + next_skip - 1, count); count = 0; } else { /* @@ -947,12 +901,12 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t } if (memindex < i) memindex = i; - return(memindex); + return (memindex); } #ifdef BLIST_DEBUG -static void +static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t skip, int tab) { @@ -960,7 +914,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t if (radix == BLIST_BMAP_RADIX) { printf( - "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", + "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", tab, tab, "", (long long)blk, (long long)radix, (long long)scan->u.bmu_bitmap, @@ -1010,13 +964,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t ); break; } - blst_radix_print( - &scan[i], - blk, - radix, - next_skip - 1, - tab - ); + blst_radix_print(&scan[i], blk, radix, next_skip - 1, tab); blk += radix; } tab -= 4; @@ -1126,4 +1074,3 @@ panic(const char *ctl, ...) } #endif - From owner-svn-src-all@freebsd.org Tue Jul 18 00:50: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 D5B20C0834A; Tue, 18 Jul 2017 00:50:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A30AA7CCC3; Tue, 18 Jul 2017 00:50:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I0owhY046330; Tue, 18 Jul 2017 00:50:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I0owkU046328; Tue, 18 Jul 2017 00:50:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707180050.v6I0owkU046328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 18 Jul 2017 00:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321103 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 321103 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 00:50:59 -0000 Author: np Date: Tue Jul 18 00:50:58 2017 New Revision: 321103 URL: https://svnweb.freebsd.org/changeset/base/321103 Log: cxgbe(4): New ioctls to flash bootrom and boot config to the card. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Mon Jul 17 23:16:33 2017 (r321102) +++ head/sys/dev/cxgbe/t4_ioctl.h Tue Jul 18 00:50:58 2017 (r321103) @@ -57,6 +57,8 @@ enum { T4_GET_TRACER, /* get information about a tracer */ T4_SET_TRACER, /* program a tracer */ T4_LOAD_CFG, /* copy a config file to card's flash */ + T4_LOAD_BOOT, /* flash boot rom */ + T4_LOAD_BOOTCFG, /* flash bootcfg */ }; struct t4_reg { @@ -78,6 +80,13 @@ struct t4_data { uint8_t *data; }; +struct t4_bootrom { + uint32_t pf_offset; + uint32_t pfidx_addr; + uint32_t len; + uint8_t *data; +}; + struct t4_i2c_data { uint8_t port_id; uint8_t dev_addr; @@ -346,4 +355,6 @@ struct t4_tracer { #define CHELSIO_T4_GET_TRACER _IOWR('f', T4_GET_TRACER, struct t4_tracer) #define CHELSIO_T4_SET_TRACER _IOW('f', T4_SET_TRACER, struct t4_tracer) #define CHELSIO_T4_LOAD_CFG _IOW('f', T4_LOAD_CFG, struct t4_data) +#define CHELSIO_T4_LOAD_BOOT _IOW('f', T4_LOAD_BOOT, struct t4_bootrom) +#define CHELSIO_T4_LOAD_BOOTCFG _IOW('f', T4_LOAD_BOOTCFG, struct t4_data) #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jul 17 23:16:33 2017 (r321102) +++ head/sys/dev/cxgbe/t4_main.c Tue Jul 18 00:50:58 2017 (r321103) @@ -571,6 +571,8 @@ static int set_tcb_rpl(struct sge_iq *, const struct r static int get_sge_context(struct adapter *, struct t4_sge_context *); static int load_fw(struct adapter *, struct t4_data *); static int load_cfg(struct adapter *, struct t4_data *); +static int load_boot(struct adapter *, struct t4_bootrom *); +static int load_bootcfg(struct adapter *, struct t4_data *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); #ifdef TCP_OFFLOAD @@ -8852,6 +8854,87 @@ done: return (rc); } +static int +load_boot(struct adapter *sc, struct t4_bootrom *br) +{ + int rc; + uint8_t *br_data = NULL; + u_int offset; + + if (br->len > 1024 * 1024) + return (EFBIG); + + if (br->pf_offset == 0) { + /* pfidx */ + if (br->pfidx_addr > 7) + return (EINVAL); + offset = G_OFFSET(t4_read_reg(sc, PF_REG(br->pfidx_addr, + A_PCIE_PF_EXPROM_OFST))); + } else if (br->pf_offset == 1) { + /* offset */ + offset = G_OFFSET(br->pfidx_addr); + } else { + return (EINVAL); + } + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ldbr"); + if (rc) + return (rc); + + if (br->len == 0) { + /* clear */ + rc = -t4_load_boot(sc, NULL, offset, 0); + goto done; + } + + br_data = malloc(br->len, M_CXGBE, M_WAITOK); + if (br_data == NULL) { + rc = ENOMEM; + goto done; + } + + rc = copyin(br->data, br_data, br->len); + if (rc == 0) + rc = -t4_load_boot(sc, br_data, offset, br->len); + + free(br_data, M_CXGBE); +done: + end_synchronized_op(sc, 0); + return (rc); +} + +static int +load_bootcfg(struct adapter *sc, struct t4_data *bc) +{ + int rc; + uint8_t *bc_data = NULL; + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ldcf"); + if (rc) + return (rc); + + if (bc->len == 0) { + /* clear */ + rc = -t4_load_bootcfg(sc, NULL, 0); + goto done; + } + + bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); + if (bc_data == NULL) { + rc = ENOMEM; + goto done; + } + + rc = copyin(bc->data, bc_data, bc->len); + if (rc == 0) + rc = -t4_load_bootcfg(sc, bc_data, bc->len); + + free(bc_data, M_CXGBE); +done: + end_synchronized_op(sc, 0); + return (rc); +} + #define MAX_READ_BUF_SIZE (128 * 1024) static int read_card_mem(struct adapter *sc, int win, struct t4_mem_range *mr) @@ -9193,6 +9276,12 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t break; case CHELSIO_T4_LOAD_CFG: rc = load_cfg(sc, (struct t4_data *)data); + break; + case CHELSIO_T4_LOAD_BOOT: + rc = load_boot(sc, (struct t4_bootrom *)data); + break; + case CHELSIO_T4_LOAD_BOOTCFG: + rc = load_bootcfg(sc, (struct t4_data *)data); break; default: rc = ENOTTY; From owner-svn-src-all@freebsd.org Tue Jul 18 01:08: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 9346EC08E5A; Tue, 18 Jul 2017 01:08:46 +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 54CA47D8C9; Tue, 18 Jul 2017 01:08:46 +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 v6I18jRO053631; Tue, 18 Jul 2017 01:08:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I18jXQ053630; Tue, 18 Jul 2017 01:08:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201707180108.v6I18jXQ053630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 18 Jul 2017 01:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321104 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 321104 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 01:08:46 -0000 Author: jhibbits Date: Tue Jul 18 01:08:45 2017 New Revision: 321104 URL: https://svnweb.freebsd.org/changeset/base/321104 Log: Make ZFS not crash on mount on 32-bit systems ZPL_VERSION is unsigned long long, not an int. With this change, a zpool can be created on a 32-bit system (tested on powerpcspe) and mounted correctly. Reviewed by: allanjude Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Tue Jul 18 00:50:58 2017 (r321103) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Tue Jul 18 01:08:45 2017 (r321104) @@ -539,7 +539,7 @@ void spa_history_log_version(spa_t *spa, const char *operation) { spa_history_log_internal(spa, operation, NULL, - "pool version %llu; software version %llu/%d; uts %s %s %s %s", + "pool version %llu; software version %llu/%llu; uts %s %s %s %s", (u_longlong_t)spa_version(spa), SPA_VERSION, ZPL_VERSION, utsname.nodename, utsname.release, utsname.version, utsname.machine); From owner-svn-src-all@freebsd.org Tue Jul 18 03:59: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 BEEB8C7BFDA; Tue, 18 Jul 2017 03:59:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989058361B; Tue, 18 Jul 2017 03:59:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I3wxtt022826; Tue, 18 Jul 2017 03:58:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I3wxZV022825; Tue, 18 Jul 2017 03:58:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707180358.v6I3wxZV022825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 18 Jul 2017 03:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321105 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 321105 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 03:59:00 -0000 Author: np Date: Tue Jul 18 03:58:59 2017 New Revision: 321105 URL: https://svnweb.freebsd.org/changeset/base/321105 Log: cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or remove bootrom and boot config. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Tue Jul 18 01:08:45 2017 (r321104) +++ head/usr.sbin/cxgbetool/cxgbetool.c Tue Jul 18 03:58:59 2017 (r321105) @@ -95,6 +95,10 @@ usage(FILE *fp) "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\ti2c [] read from i2c device\n" + "\tloadboot [pf|offset ] install boot image\n" + "\tloadboot clear [pf|offset ] remove boot image\n" + "\tloadboot-cfg install boot config\n" + "\tloadboot-cfg clear remove boot config\n" "\tloadcfg install configuration file\n" "\tloadcfg clear remove configuration file\n" "\tloadfw install firmware\n" @@ -1905,6 +1909,107 @@ done: return (rc); } +static int +loadboot(int argc, const char *argv[]) +{ + int rc, fd; + long l; + char *p; + struct t4_bootrom br = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc == 1) { + br.pf_offset = 0; + br.pfidx_addr = 0; + } else if (argc == 3) { + if (!strcmp(argv[1], "pf")) + br.pf_offset = 0; + else if (!strcmp(argv[1], "offset")) + br.pf_offset = 1; + else + return (EINVAL); + + p = str_to_number(argv[2], &l, NULL); + if (*p) + return (EINVAL); + br.pfidx_addr = l; + } else { + warnx("loadboot: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOT, &br)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + br.len = st.st_size; + br.data = mmap(0, br.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (br.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOT, &br); + munmap(br.data, br.len); + close(fd); + return (rc); +} + +static int +loadbootcfg(int argc, const char *argv[]) +{ + int rc, fd; + struct t4_data bc = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc != 1) { + warnx("loadbootcfg: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOTCFG, &bc)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + bc.len = st.st_size; + bc.data = mmap(0, bc.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (bc.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOTCFG, &bc); + munmap(bc.data, bc.len); + close(fd); + return (rc); +} + /* * Display memory as list of 'n' 4-byte values per line. */ @@ -2779,6 +2884,10 @@ run_cmd(int argc, const char *argv[]) rc = sched_queue(argc, argv); else if (!strcmp(cmd, "loadcfg")) rc = loadcfg(argc, argv); + else if (!strcmp(cmd, "loadboot")) + rc = loadboot(argc, argv); + else if (!strcmp(cmd, "loadboot-cfg")) + rc = loadbootcfg(argc, argv); else { rc = EINVAL; warnx("invalid command \"%s\"", cmd); From owner-svn-src-all@freebsd.org Tue Jul 18 06:15:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4978C7D7F5; Tue, 18 Jul 2017 06:15:06 +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 9111114AF; Tue, 18 Jul 2017 06:15:06 +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 v6I6F5Xi078519; Tue, 18 Jul 2017 06:15:05 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6F5VN078514; Tue, 18 Jul 2017 06:15:05 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707180615.v6I6F5VN078514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 18 Jul 2017 06:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321106 - in head/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe X-SVN-Commit-Revision: 321106 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 06:15:06 -0000 Author: rlibby Date: Tue Jul 18 06:15:05 2017 New Revision: 321106 URL: https://svnweb.freebsd.org/changeset/base/321106 Log: qlnx: gcc build errors Propagate warning flags from kern.opts.mk and then fix minor -Werror issues when building with gcc from -Wredundant-decls, -Wnested-externs, -Wuninitialized. Reviewed by: davidcs Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11413 Modified: head/sys/dev/qlnx/qlnxe/ecore_hw.h head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/modules/qlnx/Makefile head/sys/modules/qlnx/qlnxe/Makefile Modified: head/sys/dev/qlnx/qlnxe/ecore_hw.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/ecore_hw.h Tue Jul 18 03:58:59 2017 (r321105) +++ head/sys/dev/qlnx/qlnxe/ecore_hw.h Tue Jul 18 06:15:05 2017 (r321106) @@ -90,15 +90,6 @@ enum _dmae_cmd_crc_mask { #define DMAE_MAX_CLIENTS 32 /** -* @brief ecore_gtt_init - Initialize GTT windows -* -* @param p_hwfn -* @param p_ptt -*/ -void ecore_gtt_init(struct ecore_hwfn *p_hwfn, - struct ecore_ptt *p_ptt); - -/** * @brief ecore_ptt_invalidate - Forces all ptt entries to be re-configured * * @param p_hwfn Modified: head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c Tue Jul 18 03:58:59 2017 (r321105) +++ head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c Tue Jul 18 06:15:05 2017 (r321106) @@ -534,12 +534,13 @@ qlnx_get_regs(qlnx_host_t *ha, qlnx_get_regs_t *regs) return (rval); } +extern char qlnx_name_str[]; +extern char qlnx_ver_str[]; + static int qlnx_drv_info(qlnx_host_t *ha, qlnx_drvinfo_t *drv_info) { int i; - extern char qlnx_name_str[]; - extern char qlnx_ver_str[]; bzero(drv_info, sizeof(qlnx_drvinfo_t)); Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue Jul 18 03:58:59 2017 (r321105) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue Jul 18 06:15:05 2017 (r321106) @@ -396,7 +396,7 @@ qlnx_fp_taskqueue(void *context, int pending) qlnx_host_t *ha; struct ifnet *ifp; struct mbuf *mp; - int ret; + int ret = -1; int lro_enable; int rx_int = 0, total_rx_count = 0; struct thread *cthread; Modified: head/sys/modules/qlnx/Makefile ============================================================================== --- head/sys/modules/qlnx/Makefile Tue Jul 18 03:58:59 2017 (r321105) +++ head/sys/modules/qlnx/Makefile Tue Jul 18 06:15:05 2017 (r321106) @@ -32,6 +32,8 @@ # $FreeBSD$ # +SYSDIR?=${SRCTOP}/sys +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR=qlnxe Modified: head/sys/modules/qlnx/qlnxe/Makefile ============================================================================== --- head/sys/modules/qlnx/qlnxe/Makefile Tue Jul 18 03:58:59 2017 (r321105) +++ head/sys/modules/qlnx/qlnxe/Makefile Tue Jul 18 06:15:05 2017 (r321106) @@ -50,7 +50,7 @@ SRCS+= device_if.h SRCS+= bus_if.h SRCS+= pci_if.h -CWARNEXTRA += -Wno-cast-qual +.include CFLAGS += -DQLNX_DEBUG CFLAGS += -DECORE_PACKAGE @@ -66,6 +66,4 @@ CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/includ #CFLAGS += -DQLNX_QSORT_LRO #CFLAGS += -DQLNX_MAX_COALESCE - -.include - +CWARNFLAGS+= -Wno-cast-qual From owner-svn-src-all@freebsd.org Tue Jul 18 06:45: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 2985FC7DF6A; Tue, 18 Jul 2017 06:45:15 +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 EBF8622C3; Tue, 18 Jul 2017 06:45:14 +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 v6I6jEwd090755; Tue, 18 Jul 2017 06:45:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6jD6q090750; Tue, 18 Jul 2017 06:45:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180645.v6I6jD6q090750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 06:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321107 - in stable/11: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321107 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 06:45:15 -0000 Author: ngie Date: Tue Jul 18 06:45:13 2017 New Revision: 321107 URL: https://svnweb.freebsd.org/changeset/base/321107 Log: MFC r307873,r314397,r314399,r314419,r314420,r314533,r316553: r307873 (by marcel): Include instead of when compiled as part of libsbuf. The former is the standard header, and allows us to compile libsbuf on macOS/linux. r314397 (by scottl): Implement sbuf_prf(), which takes an sbuf and outputs it to stdout in the non-kernel case and to the console+log in the kernel case. For the kernel case it hooks the putbuf() machinery underneath printf(9) so that the buffer is written completely atomically and without a copy into another temporary buffer. This is useful for fixing compound console/log messages that become broken and interleaved when multiple threads are competing for the console. r314399 (by scottl): Add prototype for sbuf_putbuf() r314419 (by jkim): Include stdio.h to fix libsbuf build. r314420 (by scottl): Provide a comment on why stdio.h needs to be included. r314533 (by scottl): Expose the sbuf_putbuf() symbol to libsbuf. There are a few other symbols that are present but not exposed, like get/set/clear flags, not sure if they need to be exposed at this point. r316553: sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbuf These functions were added to sbuf(9) in r279992, but never exposed to userspace. Expose them now so they can be used/tested. Modified: stable/11/lib/libsbuf/Symbol.map stable/11/lib/libsbuf/Version.def stable/11/share/man/man9/sbuf.9 stable/11/sys/kern/subr_prf.c stable/11/sys/sys/sbuf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsbuf/Symbol.map ============================================================================== --- stable/11/lib/libsbuf/Symbol.map Tue Jul 18 06:15:05 2017 (r321106) +++ stable/11/lib/libsbuf/Symbol.map Tue Jul 18 06:45:13 2017 (r321107) @@ -21,6 +21,9 @@ FBSD_1.2 { sbuf_len; sbuf_done; sbuf_delete; + sbuf_clear_flags; + sbuf_get_flags; + sbuf_set_flags; }; FBSD_1.3 { @@ -31,3 +34,8 @@ FBSD_1.3 { FBSD_1.4 { sbuf_hexdump; }; + +FBSD_1.5 { + sbuf_putbuf; +}; + Modified: stable/11/lib/libsbuf/Version.def ============================================================================== --- stable/11/lib/libsbuf/Version.def Tue Jul 18 06:15:05 2017 (r321106) +++ stable/11/lib/libsbuf/Version.def Tue Jul 18 06:45:13 2017 (r321107) @@ -8,3 +8,6 @@ FBSD_1.3 { FBSD_1.4 { } FBSD_1.3; + +FBSD_1.5 { +} FBSD_1.4; Modified: stable/11/share/man/man9/sbuf.9 ============================================================================== --- stable/11/share/man/man9/sbuf.9 Tue Jul 18 06:15:05 2017 (r321106) +++ stable/11/share/man/man9/sbuf.9 Tue Jul 18 06:45:13 2017 (r321107) @@ -57,7 +57,8 @@ .Nm sbuf_delete , .Nm sbuf_start_section , .Nm sbuf_end_section , -.Nm sbuf_hexdump +.Nm sbuf_hexdump , +.Nm sbuf_putbuf .Nd safe string composition .Sh SYNOPSIS .In sys/types.h @@ -124,6 +125,8 @@ .Fa "const char *hdr" .Fa "int flags" .Fc +.Ft void +.Fn sbuf_putbuf "struct sbuf *s" .In sys/sysctl.h .Ft struct sbuf * .Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" @@ -472,6 +475,12 @@ representation of the bytes if possible. See the .Xr hexdump 3 man page for more details on the interface. +.Pp +The +.Fn sbuf_putbuf +function printfs the sbuf to stdout if in userland, and to the console +and log if in the kernel. +It does not drain the buffer or update any pointers. .Sh NOTES If an operation caused an .Fa sbuf Modified: stable/11/sys/kern/subr_prf.c ============================================================================== --- stable/11/sys/kern/subr_prf.c Tue Jul 18 06:15:05 2017 (r321106) +++ stable/11/sys/kern/subr_prf.c Tue Jul 18 06:45:13 2017 (r321107) @@ -72,8 +72,20 @@ __FBSDID("$FreeBSD$"); * Note that stdarg.h and the ANSI style va_start macro is used for both * ANSI and traditional C compilers. */ +#ifdef _KERNEL #include +#else +#include +#endif +/* + * This is needed for sbuf_putbuf() when compiled into userland. Due to the + * shared nature of this file, it's the only place to put it. + */ +#ifndef _KERNEL +#include +#endif + #ifdef _KERNEL #define TOCONS 0x01 @@ -406,6 +418,23 @@ vprintf(const char *fmt, va_list ap) } static void +prf_putbuf(char *bufr, int flags, int pri) +{ + + if (flags & TOLOG) + msglogstr(bufr, pri, /*filter_cr*/1); + + if (flags & TOCONS) { + if ((panicstr == NULL) && (constty != NULL)) + msgbuf_addstr(&consmsgbuf, -1, + bufr, /*filter_cr*/ 0); + + if ((constty == NULL) ||(always_console_output)) + cnputs(bufr); + } +} + +static void putbuf(int c, struct putchar_arg *ap) { /* Check if no console output buffer was provided. */ @@ -426,19 +455,8 @@ putbuf(int c, struct putchar_arg *ap) /* Check if the buffer needs to be flushed. */ if (ap->remain == 2 || c == '\n') { + prf_putbuf(ap->p_bufr, ap->flags, ap->pri); - if (ap->flags & TOLOG) - msglogstr(ap->p_bufr, ap->pri, /*filter_cr*/1); - - if (ap->flags & TOCONS) { - if ((panicstr == NULL) && (constty != NULL)) - msgbuf_addstr(&consmsgbuf, -1, - ap->p_bufr, /*filter_cr*/ 0); - - if ((constty == NULL) ||(always_console_output)) - cnputs(ap->p_bufr); - } - ap->p_next = ap->p_bufr; ap->remain = ap->n_bufr; *ap->p_next = '\0'; @@ -1214,5 +1232,21 @@ counted_warning(unsigned *counter, const char *msg) break; } } +} +#endif + +#ifdef _KERNEL +void +sbuf_putbuf(struct sbuf *sb) +{ + + prf_putbuf(sbuf_data(sb), TOLOG | TOCONS, -1); +} +#else +void +sbuf_putbuf(struct sbuf *sb) +{ + + printf("%s", sbuf_data(sb)); } #endif Modified: stable/11/sys/sys/sbuf.h ============================================================================== --- stable/11/sys/sys/sbuf.h Tue Jul 18 06:15:05 2017 (r321106) +++ stable/11/sys/sys/sbuf.h Tue Jul 18 06:45:13 2017 (r321107) @@ -99,6 +99,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +void sbuf_putbuf(struct sbuf *); #ifdef _KERNEL struct uio; From owner-svn-src-all@freebsd.org Tue Jul 18 06:45: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 2DC2AC7DFD2; Tue, 18 Jul 2017 06:45:43 +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 07ADB24D6; Tue, 18 Jul 2017 06:45:42 +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 v6I6jg1P090854; Tue, 18 Jul 2017 06:45:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6jfTR090848; Tue, 18 Jul 2017 06:45:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180645.v6I6jfTR090848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 06:45:41 +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: r321108 - in stable/10: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321108 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 06:45:43 -0000 Author: ngie Date: Tue Jul 18 06:45:41 2017 New Revision: 321108 URL: https://svnweb.freebsd.org/changeset/base/321108 Log: MFC r307873,r314397,r314399,r314419,r314420,r314533,r316553: r307873 (by marcel): Include instead of when compiled as part of libsbuf. The former is the standard header, and allows us to compile libsbuf on macOS/linux. r314397 (by scottl): Implement sbuf_prf(), which takes an sbuf and outputs it to stdout in the non-kernel case and to the console+log in the kernel case. For the kernel case it hooks the putbuf() machinery underneath printf(9) so that the buffer is written completely atomically and without a copy into another temporary buffer. This is useful for fixing compound console/log messages that become broken and interleaved when multiple threads are competing for the console. r314399 (by scottl): Add prototype for sbuf_putbuf() r314419 (by jkim): Include stdio.h to fix libsbuf build. r314420 (by scottl): Provide a comment on why stdio.h needs to be included. r314533 (by scottl): Expose the sbuf_putbuf() symbol to libsbuf. There are a few other symbols that are present but not exposed, like get/set/clear flags, not sure if they need to be exposed at this point. r316553: sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbuf These functions were added to sbuf(9) in r279992, but never exposed to userspace. Expose them now so they can be used/tested. Modified: stable/10/lib/libsbuf/Symbol.map stable/10/lib/libsbuf/Version.def stable/10/share/man/man9/sbuf.9 stable/10/sys/kern/subr_prf.c stable/10/sys/sys/sbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libsbuf/Symbol.map ============================================================================== --- stable/10/lib/libsbuf/Symbol.map Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/lib/libsbuf/Symbol.map Tue Jul 18 06:45:41 2017 (r321108) @@ -21,6 +21,9 @@ FBSD_1.2 { sbuf_len; sbuf_done; sbuf_delete; + sbuf_clear_flags; + sbuf_get_flags; + sbuf_set_flags; }; FBSD_1.3 { @@ -31,3 +34,8 @@ FBSD_1.3 { FBSD_1.4 { sbuf_hexdump; }; + +FBSD_1.5 { + sbuf_putbuf; +}; + Modified: stable/10/lib/libsbuf/Version.def ============================================================================== --- stable/10/lib/libsbuf/Version.def Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/lib/libsbuf/Version.def Tue Jul 18 06:45:41 2017 (r321108) @@ -8,3 +8,6 @@ FBSD_1.3 { FBSD_1.4 { } FBSD_1.3; + +FBSD_1.5 { +} FBSD_1.4; Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 06:45:41 2017 (r321108) @@ -54,7 +54,8 @@ .Nm sbuf_delete , .Nm sbuf_start_section , .Nm sbuf_end_section , -.Nm sbuf_hexdump +.Nm sbuf_hexdump , +.Nm sbuf_putbuf .Nd safe string composition .Sh SYNOPSIS .In sys/types.h @@ -115,6 +116,8 @@ .Fa "const char *hdr" .Fa "int flags" .Fc +.Ft void +.Fn sbuf_putbuf "struct sbuf *s" .In sys/sysctl.h .Ft struct sbuf * .Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" @@ -449,6 +452,12 @@ representation of the bytes if possible. See the .Xr hexdump 3 man page for more details on the interface. +.Pp +The +.Fn sbuf_putbuf +function printfs the sbuf to stdout if in userland, and to the console +and log if in the kernel. +It does not drain the buffer or update any pointers. .Sh NOTES If an operation caused an .Fa sbuf Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/sys/kern/subr_prf.c Tue Jul 18 06:45:41 2017 (r321108) @@ -72,8 +72,20 @@ __FBSDID("$FreeBSD$"); * Note that stdarg.h and the ANSI style va_start macro is used for both * ANSI and traditional C compilers. */ +#ifdef _KERNEL #include +#else +#include +#endif +/* + * This is needed for sbuf_putbuf() when compiled into userland. Due to the + * shared nature of this file, it's the only place to put it. + */ +#ifndef _KERNEL +#include +#endif + #ifdef _KERNEL #define TOCONS 0x01 @@ -403,6 +415,23 @@ vprintf(const char *fmt, va_list ap) } static void +prf_putbuf(char *bufr, int flags, int pri) +{ + + if (flags & TOLOG) + msglogstr(bufr, pri, /*filter_cr*/1); + + if (flags & TOCONS) { + if ((panicstr == NULL) && (constty != NULL)) + msgbuf_addstr(&consmsgbuf, -1, + bufr, /*filter_cr*/ 0); + + if ((constty == NULL) ||(always_console_output)) + cnputs(bufr); + } +} + +static void putbuf(int c, struct putchar_arg *ap) { /* Check if no console output buffer was provided. */ @@ -423,19 +452,8 @@ putbuf(int c, struct putchar_arg *ap) /* Check if the buffer needs to be flushed. */ if (ap->remain == 2 || c == '\n') { + prf_putbuf(ap->p_bufr, ap->flags, ap->pri); - if (ap->flags & TOLOG) - msglogstr(ap->p_bufr, ap->pri, /*filter_cr*/1); - - if (ap->flags & TOCONS) { - if ((panicstr == NULL) && (constty != NULL)) - msgbuf_addstr(&consmsgbuf, -1, - ap->p_bufr, /*filter_cr*/ 0); - - if ((constty == NULL) ||(always_console_output)) - cnputs(ap->p_bufr); - } - ap->p_next = ap->p_bufr; ap->remain = ap->n_bufr; *ap->p_next = '\0'; @@ -1203,5 +1221,21 @@ counted_warning(unsigned *counter, const char *msg) break; } } +} +#endif + +#ifdef _KERNEL +void +sbuf_putbuf(struct sbuf *sb) +{ + + prf_putbuf(sbuf_data(sb), TOLOG | TOCONS, -1); +} +#else +void +sbuf_putbuf(struct sbuf *sb) +{ + + printf("%s", sbuf_data(sb)); } #endif Modified: stable/10/sys/sys/sbuf.h ============================================================================== --- stable/10/sys/sys/sbuf.h Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/sys/sys/sbuf.h Tue Jul 18 06:45:41 2017 (r321108) @@ -95,6 +95,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +void sbuf_putbuf(struct sbuf *); #ifdef _KERNEL struct uio; From owner-svn-src-all@freebsd.org Tue Jul 18 06:51: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 A32BEC7E18A; Tue, 18 Jul 2017 06:51:28 +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 66B942829; Tue, 18 Jul 2017 06:51:28 +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 v6I6pRjg091933; Tue, 18 Jul 2017 06:51:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6pRPj091932; Tue, 18 Jul 2017 06:51:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180651.v6I6pRPj091932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 06:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321109 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321109 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 06:51:28 -0000 Author: ngie Date: Tue Jul 18 06:51:27 2017 New Revision: 321109 URL: https://svnweb.freebsd.org/changeset/base/321109 Log: Fix whitespace regression accidentally checked in via ^/head@r280149 MFC after: now Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Tue Jul 18 06:45:41 2017 (r321108) +++ head/sys/kern/subr_sbuf.c Tue Jul 18 06:51:27 2017 (r321109) @@ -104,7 +104,7 @@ _assert_sbuf_integrity(const char *fun, struct sbuf *s ("%s called with a NULL sbuf pointer", fun)); KASSERT(s->s_buf != NULL, ("%s called with uninitialized or corrupt sbuf", fun)); - if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { + if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { KASSERT(s->s_len <= s->s_size, ("wrote past end of sbuf (%jd >= %jd)", (intmax_t)s->s_len, (intmax_t)s->s_size)); From owner-svn-src-all@freebsd.org Tue Jul 18 06:57: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 12F2EC7E3FE; Tue, 18 Jul 2017 06:57:52 +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 D407B2BE0; Tue, 18 Jul 2017 06:57:51 +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 v6I6vorm095393; Tue, 18 Jul 2017 06:57:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6voYa095392; Tue, 18 Jul 2017 06:57:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180657.v6I6voYa095392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 06:57: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: r321110 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 321110 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 06:57:52 -0000 Author: ngie Date: Tue Jul 18 06:57:50 2017 New Revision: 321110 URL: https://svnweb.freebsd.org/changeset/base/321110 Log: MFC r321109: Fix whitespace regression accidentally checked in via ^/head@r280149 Modified: stable/11/sys/kern/subr_sbuf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_sbuf.c ============================================================================== --- stable/11/sys/kern/subr_sbuf.c Tue Jul 18 06:51:27 2017 (r321109) +++ stable/11/sys/kern/subr_sbuf.c Tue Jul 18 06:57:50 2017 (r321110) @@ -104,7 +104,7 @@ _assert_sbuf_integrity(const char *fun, struct sbuf *s ("%s called with a NULL sbuf pointer", fun)); KASSERT(s->s_buf != NULL, ("%s called with uninitialized or corrupt sbuf", fun)); - if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { + if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { KASSERT(s->s_len <= s->s_size, ("wrote past end of sbuf (%jd >= %jd)", (intmax_t)s->s_len, (intmax_t)s->s_size)); From owner-svn-src-all@freebsd.org Tue Jul 18 07: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 10256C7ED9F; Tue, 18 Jul 2017 07:41:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1C433D37; Tue, 18 Jul 2017 07:41:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I7fcS3014938; Tue, 18 Jul 2017 07:41:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I7fcMR014937; Tue, 18 Jul 2017 07:41:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201707180741.v6I7fcMR014937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 18 Jul 2017 07:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321111 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 321111 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 07:41:40 -0000 Author: avg Date: Tue Jul 18 07:41:38 2017 New Revision: 321111 URL: https://svnweb.freebsd.org/changeset/base/321111 Log: fix a regression in r320452, ZFS ABD import I overlooked the fact that vdev_op_io_done hook is called even if the actual I/O is skipped, for example, in the case of a missing vdev. Arguably, this could be considered an issue in the zio pipeline engine, but for now I am adding defensive code to check for io_bp being NULL along with assertions that that happens only when it can be really expected. PR: 220691 Reported by: peter, cy Tested by: cy MFC after: 1 week X-MFC with: r320156, r320452 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Jul 18 06:57:50 2017 (r321110) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Jul 18 07:41:38 2017 (r321111) @@ -1090,6 +1090,14 @@ vdev_geom_io_done(zio_t *zio) { struct bio *bp = zio->io_bio; + if (bp == NULL) { + ASSERT3S(zio->io_error, !=, 0); + IMPLY(zio->io_type == ZIO_TYPE_READ || + zio->io_type == ZIO_TYPE_WRITE, + zio->io_error == ENXIO); + return; + } + if (zio->io_type == ZIO_TYPE_READ) { abd_return_buf_copy(zio->io_abd, bp->bio_data, zio->io_size); } else if (zio->io_type == ZIO_TYPE_WRITE) { From owner-svn-src-all@freebsd.org Tue Jul 18 08:08: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 50BEEC7F62A; Tue, 18 Jul 2017 08:08:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id A277963D56; Tue, 18 Jul 2017 08:08:48 +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 mail107.syd.optusnet.com.au (Postfix) with ESMTPS id D6DC0D4BCEB; Tue, 18 Jul 2017 18:08:15 +1000 (AEST) Date: Tue, 18 Jul 2017 18:08:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bruce Evans , 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: <1500308973.22314.89.camel@freebsd.org> Message-ID: <20170718153823.K1105@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> <1500308973.22314.89.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=zAQ1xbnx_tDGOvFRejcA: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: Tue, 18 Jul 2017 08:08:49 -0000 On Mon, 17 Jul 2017, Ian Lepore wrote: > On Thu, 2017-07-13 at 01:42 +1000, Bruce Evans wrote: >> 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. >> I could barely read the reply, due to corruption of whitespace to spaces and \xa0. Formatting fixed, except all tabs are corrupted to spaces, and there are extra blank lines after quotes. > > I can't figure out what you're talking about here. There is no > userland code involved in any of this stuff. I seemed to have edited out examples with pseudo-code. Times are normally set by userland, and there is a larger race for the userland part than the kernel part: decide_time_to_set(); --> Preempt to run another thread. // Back here much later. Could be several quanta of 10 msec each // later. The time to set is now wrong by a large amount. clock_settime(CLOCK_REALTIME, ...); // further races here // Should check here to see if the above took too long, and retry // from the top if so. But on slow and/or loaded systems, this // might give endless retries. We should hold a mutex or something // around the whole operation to try to limit preemption. ntpd can be configured to run at high priority (-N flag, which gives realtime priority 0 on FreeBSD), but I haven't noticed any systems where this is used (except mine of course). ntpd mostly uses delta- micor-adjustments which are not affected much by the time taken to make the adjustment. At least old versions of ntpd don't do anything like the above when they set or step the time using clock_settime(). They just do the syscall. If this gives an error of only several milliseconds, then ntpd will correct the error eventually using delta-micro-adjustments. The kernel could also increase the thread's priority, but never did. Mutexes would help a bit. Parts of the operation are now in a critical section, which works similarly to increasing the priority to realtime 0. But nothing in the kernel can protect agains the race in the userland part. Kernel code using mutexes (of any sort) should look like the above retry loop if the mutex has to be dropped: // Have time to set. again: mtx_lock_spin(&time_mtx); ... r = set_time(); mtx_unlock_spin(&time_mtx); if (r != 0 || operation_took_too_long()) goto again; If set_time() has to drop the mutex, then it might abort and return nonzero to reach the retry at the top level, or retry or continue itself and depend on the top level retrying if necessary. >> 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. >> > > I'm not sure what this is about either. The current code for getting > the atrtc has no retries. It is too incorrect to retry. >>> 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. >> > > I've always assumed the locking of individual register access was > because rtcin() and writertc() are global functions used by other parts > of the kernel to access individual bytes of cmos nvram, and that > locking the whole device for the duration of the larger operations > involved might cause problems. > > For example, the nvram driver does byte at a time accesses in a loop > that includes uimove() calls, so holding a lock on all atrtc hardware > access for the duration of that isn't a good option. > > It does seem like the atrtc code should have its own register-access > mutex rather than using clock_lock. As you mentioned, the fact that > it's borrowing a mutex is pretty well obscured; I hadn't noticed it. Forcing all accesses to go through rtcin() and writertc() was originally the only method of access control. writertc() was actually open-coded using outb(). This worked on non-preemptive kernels except for problems with interrupts. In 386BSD and and FreeBSD-1, the rtc didn't have an interrupt handler so there were no actual problems with interrupts. This depended on interrupt handlers not calling rtcin() or resettodr(). rtcin() was only called by inittodr() and the non-interrupt parts of the fd driver. This was broken when the rtc interrupt handler was added. The handler calls rtcin(), so everything that calls rtcin() must lock out the rtc interrupt handler or rtcin() itself must do this. This was broken as late as FreeBSD-3. The handler runs at splclock(), but rtcin() and its callers don't call splclock(). This didn't cause many problems since there aren't many callers. IIRC, the fd driver only calls rtcin() for initialization, and there was no cmos driver. The main race was for settimeofday() calling resettodr(). This is a very rare operation (it should be once per boot, with only micro-adjustments by ntpd after that). FreeBSD-4 has the necessary splclock() locking. SMPng broke this again. The splclock() locking became null. The main race is still with resettodr(). This became Giant-locked. But rtcintr() became a (broken) fast interrupt handler, so it is fundamentally Giant-unsafe and the Giant locking of resettodr() doesn't help. Most other subsystems avoided similar problems by using Giant locking for everything including interrupt handlers. This was eventually fixed by abusing the i8254 mutex for the rtc. >>> >>> +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. >> > > I'm not sure what you're referring to when you say "the old mutex". clock_lock, after separating it from the i8254. >> 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. >> > > I assumed the reason the efirt code was using the same mutex that > protected access to the at rtc was because under the hood, the efi rt > clock is really the same hardware too, accessed via bios code. See kib's reply. I didn't know about any accesses in bios code. If that is written in asm (perhaps for resume code), then it wouldn't automatically get the common locking provided by rtcin() and writertc(). If the accesses are in the bios itself (vm86 or emulated or SMM), then who knows what happens. > >>> ... >>> @@ -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. >> > > And at resume from sleep/lowpower modes, I think. This is not > something I can test easily, but I see calls to inittodr() from apm and > pmtimer code. Even so, I think it qualifies as called very > infrequently. Right. I finally got jkim to update the corresponding acpi code just last year (I don't understand acpi and try not to touch it). The acpi timer code is better obfuscated than the pmtimer code and still attempts to do less, but the ambitious parts of the pmtimer code don't work anyway and are mostly turned off. The corresponding acpi code was turned off for i386. > That's why I think the right way to fix the coherent reading problem is > not trying harder to stay within a 244us window, but rather to stop > even trying to. Instead, look at that flag only to prevent starting > the operation while an update is in progress, and use the more usual > "loop until you read the same values twice" logic to get a coherent > read. That's especially true considering that taking longer than 244us > to do the reads is only a problem once per second; during the other > 999756us you'll still get coherent values. Good idea. My inittodr() waits for the seconds register to change. This increases boot time by an average of 0.5 seconds, but is needed to get a result that is not out of date by an average of 0.5 seconds. After the seconds register changes, the window for reading the other registers is almost 1 second, but the reads must complete in a few microseconds anyway else the result is still too out of date. Debugging printf()s show that the reads usually complete in 10-50 usec with low latency (faster on old systems with faster ISA buses). Accuracy for reading is not very important because accuracy for writing is very low (1-2 seconds). My resettodr() only writes if the difference is more than 2 seconds. Bruce From owner-svn-src-all@freebsd.org Tue Jul 18 08:15: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 57D23C7F84C; Tue, 18 Jul 2017 08:15:04 +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 31A0D64225; Tue, 18 Jul 2017 08:15:04 +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 v6I8F3Fb028002; Tue, 18 Jul 2017 08:15:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8F3cE027998; Tue, 18 Jul 2017 08:15:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180815.v6I8F3cE027998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:15: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: r321112 - in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321112 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:15:04 -0000 Author: ngie Date: Tue Jul 18 08:15:02 2017 New Revision: 321112 URL: https://svnweb.freebsd.org/changeset/base/321112 Log: MFC r279992,r280149,r280193,r288223,r288484,r321109: r279992 (by ian): Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags. The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string to be counted in the length of the data. If copying the data using the sbuf_data() and sbuf_len() functions, or if writing it automatically with a drain function, the net effect is that the nulterm byte is copied along with the rest of the data. r280149 (by ian): Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag. If INCLUDENUL is set and sbuf_finish() has been called, the length has been incremented to count the nulterm byte, and in that case current length is allowed to be equal to buffer size, otherwise it must be less than. Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to be consistant with the style in the rest of this file. r280193 (by ian): The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that. Values smaller than two lead to strange asserts that have nothing to do with the actual problem (in the case of size=0), or to writing beyond the end of the allocated buffer in sbuf_finish() (in the case of size=1). r288223 (by cem): sbuf: Process more than one char at a time Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and fixup callers. Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly changes to some callers. Obtained from: Dan Sledz r288484 (by phk): Fail the sbuf if vsnprintf(3) fails. r321109: Fix whitespace regression accidentally checked in via ^/head@r280149 Modified: stable/10/share/man/man9/sbuf.9 stable/10/sys/kern/subr_sbuf.c stable/10/sys/sys/sbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:15:02 2017 (r321112) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2013 +.Dd March 14, 2015 .Dt SBUF 9 .Os .Sh NAME @@ -34,6 +34,9 @@ .Nm sbuf_new_auto , .Nm sbuf_new_for_sysctl , .Nm sbuf_clear , +.Nm sbuf_get_flags , +.Nm sbuf_set_flags , +.Nm sbuf_clear_flags , .Nm sbuf_setpos , .Nm sbuf_bcat , .Nm sbuf_bcopyin , @@ -69,6 +72,12 @@ .Ft void .Fn sbuf_clear "struct sbuf *s" .Ft int +.Fn sbuf_get_flags "struct sbuf *s" +.Ft void +.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Ft void +.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Ft int .Fn sbuf_setpos "struct sbuf *s" "int pos" .Ft int .Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" @@ -171,6 +180,8 @@ Attempting to extend the sbuf beyond this size results .It Dv SBUF_AUTOEXTEND This indicates that the storage buffer may be extended as necessary, so long as resources allow, to hold additional data. +.It Dv SBUF_INCLUDENUL +This causes the final nulterm byte to be counted in the length of the data. .El .Pp Note that if @@ -221,6 +232,18 @@ The function invalidates the contents of the .Fa sbuf and resets its position to zero. +.Pp +The +.Fn sbuf_get_flags +function returns the current user flags. +The +.Fn sbuf_set_flags +and +.Fn sbuf_get_flags +functions set or clear one or more user flags, respectively. +The user flags are described under the +.Fn sbuf_new +function. .Pp The .Fn sbuf_setpos Modified: stable/10/sys/kern/subr_sbuf.c ============================================================================== --- stable/10/sys/kern/subr_sbuf.c Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/sys/kern/subr_sbuf.c Tue Jul 18 08:15:02 2017 (r321112) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ __FBSDID("$FreeBSD$"); #else /* _KERNEL */ #include #include +#include #include #include #include @@ -70,6 +72,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) #define SBUF_ISSECTION(s) ((s)->s_flags & SBUF_INSECTION) +#define SBUF_NULINCLUDED(s) ((s)->s_flags & SBUF_INCLUDENUL) /* * Set / clear flags @@ -77,6 +80,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_SETFLAG(s, f) do { (s)->s_flags |= (f); } while (0) #define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0) +#define SBUF_MINSIZE 2 /* Min is 1 byte + nulterm. */ #define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */ #ifdef PAGE_SIZE @@ -100,9 +104,15 @@ _assert_sbuf_integrity(const char *fun, struct sbuf *s ("%s called with a NULL sbuf pointer", fun)); KASSERT(s->s_buf != NULL, ("%s called with uninitialized or corrupt sbuf", fun)); - KASSERT(s->s_len < s->s_size, - ("wrote past end of sbuf (%jd >= %jd)", - (intmax_t)s->s_len, (intmax_t)s->s_size)); + if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { + KASSERT(s->s_len <= s->s_size, + ("wrote past end of sbuf (%jd >= %jd)", + (intmax_t)s->s_len, (intmax_t)s->s_size)); + } else { + KASSERT(s->s_len < s->s_size, + ("wrote past end of sbuf (%jd >= %jd)", + (intmax_t)s->s_len, (intmax_t)s->s_size)); + } } static void @@ -185,8 +195,9 @@ sbuf_newbuf(struct sbuf *s, char *buf, int length, int s->s_buf = buf; if ((s->s_flags & SBUF_AUTOEXTEND) == 0) { - KASSERT(s->s_size >= 0, - ("attempt to create a too small sbuf")); + KASSERT(s->s_size >= SBUF_MINSIZE, + ("attempt to create an sbuf smaller than %d bytes", + SBUF_MINSIZE)); } if (s->s_buf != NULL) @@ -262,6 +273,28 @@ sbuf_uionew(struct sbuf *s, struct uio *uio, int *erro } #endif +int +sbuf_get_flags(struct sbuf *s) +{ + + return (s->s_flags & SBUF_USRFLAGMSK); +} + +void +sbuf_clear_flags(struct sbuf *s, int flags) +{ + + s->s_flags &= ~(flags & SBUF_USRFLAGMSK); +} + +void +sbuf_set_flags(struct sbuf *s, int flags) +{ + + + s->s_flags |= (flags & SBUF_USRFLAGMSK); +} + /* * Clear an sbuf and reset its position. */ @@ -352,55 +385,63 @@ sbuf_drain(struct sbuf *s) } /* - * Append a byte to an sbuf. This is the core function for appending + * Append bytes to an sbuf. This is the core function for appending * to an sbuf and is the main place that deals with extending the * buffer and marking overflow. */ static void -sbuf_put_byte(struct sbuf *s, int c) +sbuf_put_bytes(struct sbuf *s, const char *buf, size_t len) { + size_t n; assert_sbuf_integrity(s); assert_sbuf_state(s, 0); if (s->s_error != 0) return; - if (SBUF_FREESPACE(s) <= 0) { - /* - * If there is a drain, use it, otherwise extend the - * buffer. - */ - if (s->s_drain_func != NULL) - (void)sbuf_drain(s); - else if (sbuf_extend(s, 1) < 0) - s->s_error = ENOMEM; - if (s->s_error != 0) - return; + while (len > 0) { + if (SBUF_FREESPACE(s) <= 0) { + /* + * If there is a drain, use it, otherwise extend the + * buffer. + */ + if (s->s_drain_func != NULL) + (void)sbuf_drain(s); + else if (sbuf_extend(s, len > INT_MAX ? INT_MAX : len) + < 0) + s->s_error = ENOMEM; + if (s->s_error != 0) + return; + } + n = SBUF_FREESPACE(s); + if (len < n) + n = len; + memcpy(&s->s_buf[s->s_len], buf, n); + s->s_len += n; + if (SBUF_ISSECTION(s)) + s->s_sect_len += n; + len -= n; + buf += n; } - s->s_buf[s->s_len++] = c; - if (SBUF_ISSECTION(s)) - s->s_sect_len++; } +static void +sbuf_put_byte(struct sbuf *s, char c) +{ + + sbuf_put_bytes(s, &c, 1); +} + /* * Append a byte string to an sbuf. */ int sbuf_bcat(struct sbuf *s, const void *buf, size_t len) { - const char *str = buf; - const char *end = str + len; - assert_sbuf_integrity(s); - assert_sbuf_state(s, 0); - + sbuf_put_bytes(s, buf, len); if (s->s_error != 0) return (-1); - for (; str < end; str++) { - sbuf_put_byte(s, *str); - if (s->s_error != 0) - return (-1); - } return (0); } @@ -454,18 +495,12 @@ sbuf_bcpy(struct sbuf *s, const void *buf, size_t len) int sbuf_cat(struct sbuf *s, const char *str) { + size_t n; - assert_sbuf_integrity(s); - assert_sbuf_state(s, 0); - + n = strlen(str); + sbuf_put_bytes(s, str, n); if (s->s_error != 0) return (-1); - - while (*str != '\0') { - sbuf_put_byte(s, *str++); - if (s->s_error != 0) - return (-1); - } return (0); } @@ -588,6 +623,10 @@ sbuf_vprintf(struct sbuf *s, const char *fmt, va_list va_copy(ap_copy, ap); len = vsnprintf(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1, fmt, ap_copy); + if (len < 0) { + s->s_error = errno; + return (-1); + } va_end(ap_copy); if (SBUF_FREESPACE(s) >= len) @@ -697,11 +736,13 @@ sbuf_finish(struct sbuf *s) assert_sbuf_integrity(s); assert_sbuf_state(s, 0); + s->s_buf[s->s_len] = '\0'; + if (SBUF_NULINCLUDED(s)) + s->s_len++; if (s->s_drain_func != NULL) { while (s->s_len > 0 && s->s_error == 0) s->s_error = sbuf_drain(s); } - s->s_buf[s->s_len] = '\0'; SBUF_SETFLAG(s, SBUF_FINISHED); #ifdef _KERNEL return (s->s_error); @@ -743,6 +784,10 @@ sbuf_len(struct sbuf *s) if (s->s_error != 0) return (-1); + + /* If finished, nulterm is already in len, else add one. */ + if (SBUF_NULINCLUDED(s) && !SBUF_ISFINISHED(s)) + return (s->s_len + 1); return (s->s_len); } Modified: stable/10/sys/sys/sbuf.h ============================================================================== --- stable/10/sys/sys/sbuf.h Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/sys/sys/sbuf.h Tue Jul 18 08:15:02 2017 (r321112) @@ -48,6 +48,7 @@ struct sbuf { ssize_t s_len; /* current length of string */ #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ +#define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ @@ -72,6 +73,9 @@ __BEGIN_DECLS struct sbuf *sbuf_new(struct sbuf *, char *, int, int); #define sbuf_new_auto() \ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) +int sbuf_get_flags(struct sbuf *); +void sbuf_clear_flags(struct sbuf *, int); +void sbuf_set_flags(struct sbuf *, int); void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, ssize_t); int sbuf_bcat(struct sbuf *, const void *, size_t); From owner-svn-src-all@freebsd.org Tue Jul 18 08:23: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 12FB7C7FA43; Tue, 18 Jul 2017 08:23:23 +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 D55AB64691; Tue, 18 Jul 2017 08:23:22 +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 v6I8NMe4031980; Tue, 18 Jul 2017 08:23:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8NL9Y031977; Tue, 18 Jul 2017 08:23:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180823.v6I8NL9Y031977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:23:21 +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: r321113 - in stable/10: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Commit-Revision: 321113 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:23:23 -0000 Author: ngie Date: Tue Jul 18 08:23:21 2017 New Revision: 321113 URL: https://svnweb.freebsd.org/changeset/base/321113 Log: MFC r316557: sbuf(3): add some basic functional tests for the library Areas not covered still [positive functionality wise] are: - sbuf_{clear,get,set}_flags - sbuf_new (in particular, with fixed buffers, etc). Some basic negative testing has been added, but more will be added in the future. This work was in part to validate work done by cem in r288223, and ian before that. Added: stable/10/lib/libsbuf/tests/ - copied from r316557, head/lib/libsbuf/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libsbuf/Makefile stable/10/lib/libsbuf/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 08:15:02 2017 (r321112) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 08:23:21 2017 (r321113) @@ -324,6 +324,8 @@ .. librt .. + libsbuf + .. libthr dlopen .. Modified: stable/10/lib/libsbuf/Makefile ============================================================================== --- stable/10/lib/libsbuf/Makefile Tue Jul 18 08:15:02 2017 (r321112) +++ stable/10/lib/libsbuf/Makefile Tue Jul 18 08:23:21 2017 (r321113) @@ -9,6 +9,12 @@ SHLIB_MAJOR = 6 SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_DEF= ${.CURDIR}/Version.def +.include + .PATH: ${SRCTOP}/sys/kern + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/lib/libsbuf/tests/Makefile ============================================================================== --- head/lib/libsbuf/tests/Makefile Thu Apr 6 05:29:28 2017 (r316557) +++ stable/10/lib/libsbuf/tests/Makefile Tue Jul 18 08:23:21 2017 (r321113) @@ -4,7 +4,7 @@ ATF_TESTS_C+= sbuf_core_test ATF_TESTS_C+= sbuf_stdio_test ATF_TESTS_C+= sbuf_string_test -LIBADD+= sbuf util +LDADD+= -lsbuf -lutil WARNS?= 6 From owner-svn-src-all@freebsd.org Tue Jul 18 08:23: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 5A300C7FAAD; Tue, 18 Jul 2017 08:23:48 +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 28EAA647C0; Tue, 18 Jul 2017 08:23:48 +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 v6I8Nl2H032040; Tue, 18 Jul 2017 08:23:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8NlQa032038; Tue, 18 Jul 2017 08:23:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180823.v6I8NlQa032038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:23:47 +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: r321114 - in stable/11: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Commit-Revision: 321114 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:23:48 -0000 Author: ngie Date: Tue Jul 18 08:23:47 2017 New Revision: 321114 URL: https://svnweb.freebsd.org/changeset/base/321114 Log: MFC r316557: sbuf(3): add some basic functional tests for the library Areas not covered still [positive functionality wise] are: - sbuf_{clear,get,set}_flags - sbuf_new (in particular, with fixed buffers, etc). Some basic negative testing has been added, but more will be added in the future. This work was in part to validate work done by cem in r288223, and ian before that. Added: stable/11/lib/libsbuf/tests/ - copied from r316557, head/lib/libsbuf/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/lib/libsbuf/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 08:23:21 2017 (r321113) +++ stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 08:23:47 2017 (r321114) @@ -332,6 +332,8 @@ .. librt .. + libsbuf + .. libthr dlopen .. Modified: stable/11/lib/libsbuf/Makefile ============================================================================== --- stable/11/lib/libsbuf/Makefile Tue Jul 18 08:23:21 2017 (r321113) +++ stable/11/lib/libsbuf/Makefile Tue Jul 18 08:23:47 2017 (r321114) @@ -10,6 +10,10 @@ SHLIB_MAJOR = 6 SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_DEF= ${.CURDIR}/Version.def +.include + .PATH: ${SRCTOP}/sys/kern + +SUBDIR.${MK_TESTS}+= tests .include From owner-svn-src-all@freebsd.org Tue Jul 18 08:28: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 385C5C7FB91; Tue, 18 Jul 2017 08:28:16 +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 13DEE649ED; Tue, 18 Jul 2017 08:28:16 +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 v6I8SFud032336; Tue, 18 Jul 2017 08:28:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8SFRQ032334; Tue, 18 Jul 2017 08:28:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180828.v6I8SFRQ032334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:28: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: r321115 - stable/10/share/man/man9 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man9 X-SVN-Commit-Revision: 321115 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:28:16 -0000 Author: ngie Date: Tue Jul 18 08:28:14 2017 New Revision: 321115 URL: https://svnweb.freebsd.org/changeset/base/321115 Log: MFC r316549,r316550,r316551,r316554: r316549: Add sys/types.h #include to EXAMPLE to provide a complete functional standalone example program r316550: sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries This shortens the column count on many lines considerably. While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9) recommendations. r316551: sbuf(9): clarify kernel-only APIs - move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as all three functions are kernel-only APIs. - add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to make it visually clear that they are kernel-only APIs. r316554: sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9) These functions were added in r279992. Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/sbuf.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Jul 18 08:23:47 2017 (r321114) +++ stable/10/share/man/man9/Makefile Tue Jul 18 08:28:14 2017 (r321115) @@ -1149,6 +1149,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_bcpy.9 \ sbuf.9 sbuf_cat.9 \ sbuf.9 sbuf_clear.9 \ + sbuf.9 sbuf_clear_flags.9 \ sbuf.9 sbuf_copyin.9 \ sbuf.9 sbuf_cpy.9 \ sbuf.9 sbuf_data.9 \ @@ -1156,6 +1157,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_get_flags.9 \ sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ @@ -1163,6 +1165,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ + sbuf.9 sbuf_set_flags.9 \ sbuf.9 sbuf_setpos.9 \ sbuf.9 sbuf_trim.9 \ sbuf.9 sbuf_vprintf.9 Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:23:47 2017 (r321114) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:28:14 2017 (r321115) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2015 +.Dd April 5, 2017 .Dt SBUF 9 .Os .Sh NAME @@ -66,57 +66,123 @@ .Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ; .Pp .Ft struct sbuf * -.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" +.Fo sbuf_new +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "int flags" +.Fc .Ft struct sbuf * -.Fn sbuf_new_auto +.Fo sbuf_new_auto +.Fa "void" +.Fc .Ft void -.Fn sbuf_clear "struct sbuf *s" +.Fo sbuf_clear +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_get_flags "struct sbuf *s" +.Fo sbuf_get_flags +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Fo sbuf_set_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft void -.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Fo sbuf_clear_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft int -.Fn sbuf_setpos "struct sbuf *s" "int pos" +.Fo sbuf_setpos +.Fa "struct sbuf *s" +.Fa "int pos" +.Fc .Ft int -.Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_bcat +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcopyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_bcpy +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcpy "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_cat +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_cat "struct sbuf *s" "const char *str" +.Fo sbuf_cpy +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_copyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_printf +.Fa "struct sbuf *s" +.Fa "const char *fmt" "..." +.Fc .Ft int -.Fn sbuf_cpy "struct sbuf *s" "const char *str" +.Fo sbuf_vprintf +.Fa "struct sbuf *s" +.Fa "const char *fmt" +.Fa "va_list ap" +.Fc .Ft int -.Fn sbuf_printf "struct sbuf *s" "const char *fmt" "..." -.Ft int -.Fn sbuf_vprintf "struct sbuf *s" "const char *fmt" "va_list ap" -.Ft int -.Fn sbuf_putc "struct sbuf *s" "int c" +.Fo sbuf_putc +.Fa "struct sbuf *s" +.Fa "int c" +.Fc .Ft void -.Fn sbuf_set_drain "struct sbuf *s" "sbuf_drain_func *func" "void *arg" +.Fo sbuf_set_drain +.Fa "struct sbuf *s" +.Fa "sbuf_drain_func *func" +.Fa "void *arg" +.Fc .Ft int -.Fn sbuf_trim "struct sbuf *s" +.Fo sbuf_trim +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_error "struct sbuf *s" +.Fo sbuf_error +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_finish "struct sbuf *s" +.Fo sbuf_finish +.Fa "struct sbuf *s" +.Fc .Ft char * -.Fn sbuf_data "struct sbuf *s" +.Fo sbuf_data +.Fa "struct sbuf *s" +.Fc .Ft ssize_t -.Fn sbuf_len "struct sbuf *s" +.Fo sbuf_len +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_done "struct sbuf *s" +.Fo sbuf_done +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_delete "struct sbuf *s" +.Fo sbuf_delete +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp" +.Fo sbuf_start_section +.Fa "struct sbuf *s" +.Fa "ssize_t *old_lenp" +.Fc .Ft ssize_t -.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c" +.Fo sbuf_end_section +.Fa "struct sbuf *s" +.Fa "ssize_t old_len" +.Fa "size_t pad" +.Fa "int c" +.Fc .Ft void .Fo sbuf_hexdump .Fa "struct sbuf *sb" @@ -126,10 +192,33 @@ .Fa "int flags" .Fc .Ft void -.Fn sbuf_putbuf "struct sbuf *s" +.Fo sbuf_putbuf +.Fa "struct sbuf *s" +.Fc +.Fd #ifdef _KERNEL +.In sys/types.h +.In sys/sbuf.h +.Ft int +.Fo sbuf_bcopyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc +.Ft int +.Fo sbuf_copyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc .In sys/sysctl.h .Ft struct sbuf * -.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" +.Fo sbuf_new_for_sysctl +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "struct sysctl_req *req" +.Fc +.Fd #endif /* _KERNEL */ .Sh DESCRIPTION The .Nm @@ -567,6 +656,7 @@ function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES .Bd -literal -compact +#include #include struct sbuf *sb; From owner-svn-src-all@freebsd.org Tue Jul 18 08: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 6699FC7FBE2; Tue, 18 Jul 2017 08:28: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 421B564B0E; Tue, 18 Jul 2017 08:28: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 v6I8SbKt032393; Tue, 18 Jul 2017 08:28:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8SbBP032391; Tue, 18 Jul 2017 08:28:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180828.v6I8SbBP032391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:28: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: r321116 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 321116 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:28:38 -0000 Author: ngie Date: Tue Jul 18 08:28:37 2017 New Revision: 321116 URL: https://svnweb.freebsd.org/changeset/base/321116 Log: MFC r316549,r316550,r316551,r316554: r316549: Add sys/types.h #include to EXAMPLE to provide a complete functional standalone example program r316550: sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries This shortens the column count on many lines considerably. While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9) recommendations. r316551: sbuf(9): clarify kernel-only APIs - move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as all three functions are kernel-only APIs. - add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to make it visually clear that they are kernel-only APIs. r316554: sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9) These functions were added in r279992. Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/sbuf.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Tue Jul 18 08:28:14 2017 (r321115) +++ stable/11/share/man/man9/Makefile Tue Jul 18 08:28:37 2017 (r321116) @@ -1461,6 +1461,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_bcpy.9 \ sbuf.9 sbuf_cat.9 \ sbuf.9 sbuf_clear.9 \ + sbuf.9 sbuf_clear_flags.9 \ sbuf.9 sbuf_copyin.9 \ sbuf.9 sbuf_cpy.9 \ sbuf.9 sbuf_data.9 \ @@ -1468,6 +1469,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_get_flags.9 \ sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ @@ -1476,6 +1478,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ + sbuf.9 sbuf_set_flags.9 \ sbuf.9 sbuf_setpos.9 \ sbuf.9 sbuf_start_section.9 \ sbuf.9 sbuf_end_section.9 \ Modified: stable/11/share/man/man9/sbuf.9 ============================================================================== --- stable/11/share/man/man9/sbuf.9 Tue Jul 18 08:28:14 2017 (r321115) +++ stable/11/share/man/man9/sbuf.9 Tue Jul 18 08:28:37 2017 (r321116) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2015 +.Dd April 5, 2017 .Dt SBUF 9 .Os .Sh NAME @@ -66,57 +66,123 @@ .Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ; .Pp .Ft struct sbuf * -.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" +.Fo sbuf_new +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "int flags" +.Fc .Ft struct sbuf * -.Fn sbuf_new_auto +.Fo sbuf_new_auto +.Fa "void" +.Fc .Ft void -.Fn sbuf_clear "struct sbuf *s" +.Fo sbuf_clear +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_get_flags "struct sbuf *s" +.Fo sbuf_get_flags +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Fo sbuf_set_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft void -.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Fo sbuf_clear_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft int -.Fn sbuf_setpos "struct sbuf *s" "int pos" +.Fo sbuf_setpos +.Fa "struct sbuf *s" +.Fa "int pos" +.Fc .Ft int -.Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_bcat +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcopyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_bcpy +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcpy "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_cat +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_cat "struct sbuf *s" "const char *str" +.Fo sbuf_cpy +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_copyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_printf +.Fa "struct sbuf *s" +.Fa "const char *fmt" "..." +.Fc .Ft int -.Fn sbuf_cpy "struct sbuf *s" "const char *str" +.Fo sbuf_vprintf +.Fa "struct sbuf *s" +.Fa "const char *fmt" +.Fa "va_list ap" +.Fc .Ft int -.Fn sbuf_printf "struct sbuf *s" "const char *fmt" "..." -.Ft int -.Fn sbuf_vprintf "struct sbuf *s" "const char *fmt" "va_list ap" -.Ft int -.Fn sbuf_putc "struct sbuf *s" "int c" +.Fo sbuf_putc +.Fa "struct sbuf *s" +.Fa "int c" +.Fc .Ft void -.Fn sbuf_set_drain "struct sbuf *s" "sbuf_drain_func *func" "void *arg" +.Fo sbuf_set_drain +.Fa "struct sbuf *s" +.Fa "sbuf_drain_func *func" +.Fa "void *arg" +.Fc .Ft int -.Fn sbuf_trim "struct sbuf *s" +.Fo sbuf_trim +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_error "struct sbuf *s" +.Fo sbuf_error +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_finish "struct sbuf *s" +.Fo sbuf_finish +.Fa "struct sbuf *s" +.Fc .Ft char * -.Fn sbuf_data "struct sbuf *s" +.Fo sbuf_data +.Fa "struct sbuf *s" +.Fc .Ft ssize_t -.Fn sbuf_len "struct sbuf *s" +.Fo sbuf_len +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_done "struct sbuf *s" +.Fo sbuf_done +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_delete "struct sbuf *s" +.Fo sbuf_delete +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp" +.Fo sbuf_start_section +.Fa "struct sbuf *s" +.Fa "ssize_t *old_lenp" +.Fc .Ft ssize_t -.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c" +.Fo sbuf_end_section +.Fa "struct sbuf *s" +.Fa "ssize_t old_len" +.Fa "size_t pad" +.Fa "int c" +.Fc .Ft void .Fo sbuf_hexdump .Fa "struct sbuf *sb" @@ -126,10 +192,33 @@ .Fa "int flags" .Fc .Ft void -.Fn sbuf_putbuf "struct sbuf *s" +.Fo sbuf_putbuf +.Fa "struct sbuf *s" +.Fc +.Fd #ifdef _KERNEL +.In sys/types.h +.In sys/sbuf.h +.Ft int +.Fo sbuf_bcopyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc +.Ft int +.Fo sbuf_copyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc .In sys/sysctl.h .Ft struct sbuf * -.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" +.Fo sbuf_new_for_sysctl +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "struct sysctl_req *req" +.Fc +.Fd #endif /* _KERNEL */ .Sh DESCRIPTION The .Nm @@ -567,6 +656,7 @@ function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES .Bd -literal -compact +#include #include struct sbuf *sb; From owner-svn-src-all@freebsd.org Tue Jul 18 08:30: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 D41D9C7FE2A; Tue, 18 Jul 2017 08:30:52 +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 AE8BF64D4B; Tue, 18 Jul 2017 08:30:52 +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 v6I8UpqU032566; Tue, 18 Jul 2017 08:30:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8UpJv032561; Tue, 18 Jul 2017 08:30:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180830.v6I8UpJv032561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321117 - in stable/11/lib: libcam/tests libsbuf/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/lib: libcam/tests libsbuf/tests X-SVN-Commit-Revision: 321117 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:30:52 -0000 Author: ngie Date: Tue Jul 18 08:30:51 2017 New Revision: 321117 URL: https://svnweb.freebsd.org/changeset/base/321117 Log: MFC r316558: Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keyword Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a past Phabricator review. Modified: stable/11/lib/libcam/tests/libcam_test.c stable/11/lib/libsbuf/tests/sbuf_core_test.c stable/11/lib/libsbuf/tests/sbuf_stdio_test.c stable/11/lib/libsbuf/tests/sbuf_string_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/11/lib/libcam/tests/libcam_test.c Tue Jul 18 08:28:37 2017 (r321116) +++ stable/11/lib/libcam/tests/libcam_test.c Tue Jul 18 08:30:51 2017 (r321117) @@ -22,9 +22,10 @@ * 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 Modified: stable/11/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:28:37 2017 (r321116) +++ stable/11/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:30:51 2017 (r321117) @@ -22,9 +22,10 @@ * 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 Modified: stable/11/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:28:37 2017 (r321116) +++ stable/11/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:30:51 2017 (r321117) @@ -22,9 +22,10 @@ * 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 Modified: stable/11/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:28:37 2017 (r321116) +++ stable/11/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:30:51 2017 (r321117) @@ -22,9 +22,10 @@ * 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 From owner-svn-src-all@freebsd.org Tue Jul 18 08:31: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 04BACC7FE7C; Tue, 18 Jul 2017 08:31:00 +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 D04F364D77; Tue, 18 Jul 2017 08:30:59 +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 v6I8UwIm032618; Tue, 18 Jul 2017 08:30:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8UwWF032613; Tue, 18 Jul 2017 08:30:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180830.v6I8UwWF032613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:30:58 +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: r321118 - in stable/10/lib: libcam/tests libsbuf/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/lib: libcam/tests libsbuf/tests X-SVN-Commit-Revision: 321118 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:31:00 -0000 Author: ngie Date: Tue Jul 18 08:30:58 2017 New Revision: 321118 URL: https://svnweb.freebsd.org/changeset/base/321118 Log: MFC r316558: Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keyword Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a past Phabricator review. Modified: stable/10/lib/libcam/tests/libcam_test.c stable/10/lib/libsbuf/tests/sbuf_core_test.c stable/10/lib/libsbuf/tests/sbuf_stdio_test.c stable/10/lib/libsbuf/tests/sbuf_string_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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 Modified: stable/10/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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 Modified: stable/10/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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 Modified: stable/10/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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 From owner-svn-src-all@freebsd.org Tue Jul 18 08:33: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 E94F7CFC0B6; Tue, 18 Jul 2017 08:33:08 +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 C083B651C2; Tue, 18 Jul 2017 08:33: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 v6I8X7UI036631; Tue, 18 Jul 2017 08:33:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8X7fv036629; Tue, 18 Jul 2017 08:33:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180833.v6I8X7fv036629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08: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: r321119 - stable/11/lib/libc/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/stdio X-SVN-Commit-Revision: 321119 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:33:09 -0000 Author: ngie Date: Tue Jul 18 08:33:07 2017 New Revision: 321119 URL: https://svnweb.freebsd.org/changeset/base/321119 Log: MFC r318705,r318711: r318705: fopen(3): make manlint fixes - Break on new lines. - Use .Dv with NULL. - Rewrap lines as necessary/when possible. r318711: fopencookie(3): declare function pointers in SYNOPSIS correctly Add obligatory `*` in declarations. Modified: stable/11/lib/libc/stdio/fopen.3 stable/11/lib/libc/stdio/fopencookie.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/fopen.3 ============================================================================== --- stable/11/lib/libc/stdio/fopen.3 Tue Jul 18 08:30:58 2017 (r321118) +++ stable/11/lib/libc/stdio/fopen.3 Tue Jul 18 08:33:07 2017 (r321119) @@ -230,15 +230,20 @@ argument, .Fn fmemopen allocates .Fa size -bytes of memory. This buffer is automatically freed when the -stream is closed. Buffers can be opened in text-mode (default) or binary-mode +bytes of memory. +This buffer is automatically freed when the stream is closed. +Buffers can be opened in text-mode (default) or binary-mode (if .Dq Li b is present in the second or third position of the .Fa mode -argument). Buffers opened in text-mode make sure that writes are terminated with -a NULL byte, if the last write hasn't filled up the whole buffer. Buffers -opened in binary-mode never append a NULL byte. +argument). +Buffers opened in text-mode make sure that writes are terminated with a +.Dv NULL +byte, if the last write hasn't filled up the whole buffer. +Buffers opened in binary-mode never append a +.Dv NULL +byte. .Sh RETURN VALUES Upon successful completion .Fn fopen , Modified: stable/11/lib/libc/stdio/fopencookie.3 ============================================================================== --- stable/11/lib/libc/stdio/fopencookie.3 Tue Jul 18 08:30:58 2017 (r321118) +++ stable/11/lib/libc/stdio/fopencookie.3 Tue Jul 18 08:33:07 2017 (r321119) @@ -35,13 +35,13 @@ .Sh SYNOPSIS .In stdio.h .Ft typedef ssize_t -.Fn (cookie_read_function_t) "void *cookie" "char *buf" "size_t size" +.Fn (*cookie_read_function_t) "void *cookie" "char *buf" "size_t size" .Ft typedef ssize_t -.Fn (cookie_write_function_t) "void *cookie" "const char *buf" "size_t size" +.Fn (*cookie_write_function_t) "void *cookie" "const char *buf" "size_t size" .Ft typedef int -.Fn (cookie_seek_function_t) "void *cookie" "off64_t *offset" "int whence" +.Fn (*cookie_seek_function_t) "void *cookie" "off64_t *offset" "int whence" .Ft typedef int -.Fn (cookie_close_function_t) "void *cookie" +.Fn (*cookie_close_function_t) "void *cookie" .Bd -literal typedef struct { cookie_read_function_t *read; From owner-svn-src-all@freebsd.org Tue Jul 18 08:33: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 557CACFC11E; Tue, 18 Jul 2017 08:33:31 +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 14747652B3; Tue, 18 Jul 2017 08:33:30 +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 v6I8XTKM036693; Tue, 18 Jul 2017 08:33:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8XT26036692; Tue, 18 Jul 2017 08:33:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180833.v6I8XT26036692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:33: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: r321120 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/stdio X-SVN-Commit-Revision: 321120 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:33:31 -0000 Author: ngie Date: Tue Jul 18 08:33:29 2017 New Revision: 321120 URL: https://svnweb.freebsd.org/changeset/base/321120 Log: MFC r318705: fopen(3): make manlint fixes - Break on new lines. - Use .Dv with NULL. - Rewrap lines as necessary/when possible. Modified: stable/10/lib/libc/stdio/fopen.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/fopen.3 ============================================================================== --- stable/10/lib/libc/stdio/fopen.3 Tue Jul 18 08:33:07 2017 (r321119) +++ stable/10/lib/libc/stdio/fopen.3 Tue Jul 18 08:33:29 2017 (r321120) @@ -230,15 +230,20 @@ argument, .Fn fmemopen allocates .Fa size -bytes of memory. This buffer is automatically freed when the -stream is closed. Buffers can be opened in text-mode (default) or binary-mode +bytes of memory. +This buffer is automatically freed when the stream is closed. +Buffers can be opened in text-mode (default) or binary-mode (if .Dq Li b is present in the second or third position of the .Fa mode -argument). Buffers opened in text-mode make sure that writes are terminated with -a NULL byte, if the last write hasn't filled up the whole buffer. Buffers -opened in binary-mode never append a NULL byte. +argument). +Buffers opened in text-mode make sure that writes are terminated with a +.Dv NULL +byte, if the last write hasn't filled up the whole buffer. +Buffers opened in binary-mode never append a +.Dv NULL +byte. .Sh RETURN VALUES Upon successful completion .Fn fopen , From owner-svn-src-all@freebsd.org Tue Jul 18 08: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 57825CFC24B; Tue, 18 Jul 2017 08:35:24 +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 341EE65458; Tue, 18 Jul 2017 08:35:24 +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 v6I8ZN6j036857; Tue, 18 Jul 2017 08:35:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8ZNJZ036854; Tue, 18 Jul 2017 08:35:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180835.v6I8ZNJZ036854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:35: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: r321121 - stable/11/usr.bin/localedef X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/localedef X-SVN-Commit-Revision: 321121 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:35:24 -0000 Author: ngie Date: Tue Jul 18 08:35:22 2017 New Revision: 321121 URL: https://svnweb.freebsd.org/changeset/base/321121 Log: MFC r318257,r318278: r318257: style(9): sort headers r318278: Mark errf _Noreturn, and mark errf and warn __printflike The _Noreturn attribute was added to placate Coverity and other static analysis tools. The __printflike attribute was added to catch issues with the calls related to printf(3) abuse. - Modify the code to facilitate the __printflike attribute addition. - Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so the calls will return instead of exiting, as the code suggests it should. Modified: stable/11/usr.bin/localedef/localedef.c stable/11/usr.bin/localedef/localedef.h stable/11/usr.bin/localedef/wide.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/localedef/localedef.c ============================================================================== --- stable/11/usr.bin/localedef/localedef.c Tue Jul 18 08:33:29 2017 (r321120) +++ stable/11/usr.bin/localedef/localedef.c Tue Jul 18 08:35:22 2017 (r321121) @@ -119,7 +119,7 @@ open_category(void) */ file = fopen(category_file(), "w"); if (file == NULL) { - errf(strerror(errno)); + errf("%s", strerror(errno)); return (NULL); } return (file); @@ -131,11 +131,11 @@ close_category(FILE *f) if (fchmod(fileno(f), 0644) < 0) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); } if (fclose(f) < 0) { (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); } if (verbose) { (void) fprintf(stdout, "done.\n"); @@ -195,13 +195,13 @@ putl_category(const char *s, FILE *f) if (s && fputs(s, f) == EOF) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } if (fputc('\n', f) == EOF) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } return (0); @@ -216,7 +216,7 @@ wr_category(void *buf, size_t sz, FILE *f) if (fwrite(buf, sz, 1, f) < 1) { (void) fclose(f); (void) unlink(category_file()); - errf(strerror(errno)); + errf("%s", strerror(errno)); return (EOF); } return (0); @@ -331,7 +331,7 @@ main(int argc, char **argv) while ((dir = opendir(locname)) == NULL) { if ((errno != ENOENT) || (mkdir(locname, 0755) < 0)) { - errf(strerror(errno)); + errf("%s", strerror(errno)); } } (void) closedir(dir); Modified: stable/11/usr.bin/localedef/localedef.h ============================================================================== --- stable/11/usr.bin/localedef/localedef.h Tue Jul 18 08:33:29 2017 (r321120) +++ stable/11/usr.bin/localedef/localedef.h Tue Jul 18 08:35:22 2017 (r321121) @@ -35,10 +35,11 @@ */ /* Common header files. */ +#include +#include +#include #include #include -#include -#include extern int com_char; extern int esc_char; @@ -54,8 +55,8 @@ extern int warnings; int yylex(void); void yyerror(const char *); -void errf(const char *, ...); -void warn(const char *, ...); +_Noreturn void errf(const char *, ...) __printflike(1, 2); +void warn(const char *, ...) __printflike(1, 2); int putl_category(const char *, FILE *); int wr_category(void *, size_t, FILE *); Modified: stable/11/usr.bin/localedef/wide.c ============================================================================== --- stable/11/usr.bin/localedef/wide.c Tue Jul 18 08:33:29 2017 (r321120) +++ stable/11/usr.bin/localedef/wide.c Tue Jul 18 08:35:22 2017 (r321121) @@ -598,7 +598,7 @@ to_mb(char *mb, wchar_t wc) int rv; if ((rv = _tomb(mb, wc)) < 0) { - errf(widemsg); + warn("%s", widemsg); free(widemsg); widemsg = NULL; } @@ -614,7 +614,7 @@ to_mb_string(const wchar_t *wcs) mbs = malloc((wcslen(wcs) * mb_cur_max) + 1); if (mbs == NULL) { - errf("out of memory"); + warn("out of memory"); return (NULL); } ptr = mbs; From owner-svn-src-all@freebsd.org Tue Jul 18 08:44: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 AB62DCFC499; Tue, 18 Jul 2017 08:44:39 +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 8485F6584D; Tue, 18 Jul 2017 08:44:39 +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 v6I8ic7d040960; Tue, 18 Jul 2017 08:44:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8ic1O040959; Tue, 18 Jul 2017 08:44:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180844.v6I8ic1O040959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:44: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: r321122 - stable/10/lib/libcam/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libcam/tests X-SVN-Commit-Revision: 321122 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:44:39 -0000 Author: ngie Date: Tue Jul 18 08:44:38 2017 New Revision: 321122 URL: https://svnweb.freebsd.org/changeset/base/321122 Log: MFC r319844,r319845: r319844: Add positive and negative testcases for cam_get_device(3) r319845: Remove stdlib.h #include added in r319844 A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of heap allocated ones, making the #include unnecessary. MFC with: r319844 Modified: stable/10/lib/libcam/tests/libcam_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:35:22 2017 (r321121) +++ stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:44:38 2017 (r321122) @@ -58,6 +58,75 @@ cam_has_error(void) return (strlen(cam_errbuf) != 0); } +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_NULL_path); +ATF_TC_BODY(cam_get_device_negative_test_NULL_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device(NULL, parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_bad_path); +ATF_TC_BODY(cam_get_device_negative_test_bad_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("1ada", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_nul_path); +ATF_TC_BODY(cam_get_device_negative_test_nul_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_root); +ATF_TC_BODY(cam_get_device_negative_test_root, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("/", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_positive_test); +ATF_TC_BODY(cam_get_device_positive_test, tc) +{ + char expected_dev_name[] = "foo"; + char parsed_dev_name[DEV_IDLEN + 1]; + int expected_unit, parsed_unit; + + expected_unit = 1; + + ATF_REQUIRE_MSG(cam_get_device("/dev/foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); + + strcpy(parsed_dev_name, ""); + parsed_unit = -1; + + ATF_REQUIRE_MSG(cam_get_device("foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); +} + ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { @@ -206,6 +275,11 @@ ATF_TC_BODY(cam_freeccb_negative_test_NULL, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_NULL_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_bad_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); + ATF_TP_ADD_TC(tp, cam_get_device_positive_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); From owner-svn-src-all@freebsd.org Tue Jul 18 08:44: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 2E048CFC4D9; Tue, 18 Jul 2017 08:44:50 +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 E1EB1658D4; Tue, 18 Jul 2017 08:44:49 +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 v6I8imcJ041010; Tue, 18 Jul 2017 08:44:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8imM7041009; Tue, 18 Jul 2017 08:44:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180844.v6I8imM7041009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:44: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: r321123 - stable/11/lib/libcam/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libcam/tests X-SVN-Commit-Revision: 321123 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:44:50 -0000 Author: ngie Date: Tue Jul 18 08:44:48 2017 New Revision: 321123 URL: https://svnweb.freebsd.org/changeset/base/321123 Log: MFC r319844,r319845: r319844: Add positive and negative testcases for cam_get_device(3) r319845: Remove stdlib.h #include added in r319844 A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of heap allocated ones, making the #include unnecessary. MFC with: r319844 Modified: stable/11/lib/libcam/tests/libcam_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/11/lib/libcam/tests/libcam_test.c Tue Jul 18 08:44:38 2017 (r321122) +++ stable/11/lib/libcam/tests/libcam_test.c Tue Jul 18 08:44:48 2017 (r321123) @@ -58,6 +58,75 @@ cam_has_error(void) return (strlen(cam_errbuf) != 0); } +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_NULL_path); +ATF_TC_BODY(cam_get_device_negative_test_NULL_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device(NULL, parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_bad_path); +ATF_TC_BODY(cam_get_device_negative_test_bad_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("1ada", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_nul_path); +ATF_TC_BODY(cam_get_device_negative_test_nul_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_root); +ATF_TC_BODY(cam_get_device_negative_test_root, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("/", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_positive_test); +ATF_TC_BODY(cam_get_device_positive_test, tc) +{ + char expected_dev_name[] = "foo"; + char parsed_dev_name[DEV_IDLEN + 1]; + int expected_unit, parsed_unit; + + expected_unit = 1; + + ATF_REQUIRE_MSG(cam_get_device("/dev/foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); + + strcpy(parsed_dev_name, ""); + parsed_unit = -1; + + ATF_REQUIRE_MSG(cam_get_device("foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); +} + ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { @@ -206,6 +275,11 @@ ATF_TC_BODY(cam_freeccb_negative_test_NULL, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_NULL_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_bad_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); + ATF_TP_ADD_TC(tp, cam_get_device_positive_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); From owner-svn-src-all@freebsd.org Tue Jul 18 08:50: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 B5049CFC62C; Tue, 18 Jul 2017 08:50:37 +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 828BC65BAE; Tue, 18 Jul 2017 08:50:37 +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 v6I8oaLL041371; Tue, 18 Jul 2017 08:50:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8oaOs041370; Tue, 18 Jul 2017 08:50:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180850.v6I8oaOs041370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:50: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: r321124 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321124 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:50:37 -0000 Author: ngie Date: Tue Jul 18 08:50:36 2017 New Revision: 321124 URL: https://svnweb.freebsd.org/changeset/base/321124 Log: MFC r318695: err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0` This is being done to aid humans and static analysis checkers. Modified: stable/10/lib/libc/gen/err.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/err.c ============================================================================== --- stable/10/lib/libc/gen/err.c Tue Jul 18 08:44:48 2017 (r321123) +++ stable/10/lib/libc/gen/err.c Tue Jul 18 08:50:36 2017 (r321124) @@ -100,7 +100,7 @@ void verrc(int eval, int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -125,7 +125,7 @@ void verrx(int eval, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); @@ -165,7 +165,7 @@ void vwarnc(int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -187,7 +187,7 @@ void vwarnx(const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); From owner-svn-src-all@freebsd.org Tue Jul 18 08:50: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 EA44ACFC674; Tue, 18 Jul 2017 08:50:44 +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 B310D65C05; Tue, 18 Jul 2017 08:50:44 +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 v6I8ohFv041421; Tue, 18 Jul 2017 08:50:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8oh62041420; Tue, 18 Jul 2017 08:50:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180850.v6I8oh62041420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:50: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: r321125 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 321125 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:50:45 -0000 Author: ngie Date: Tue Jul 18 08:50:43 2017 New Revision: 321125 URL: https://svnweb.freebsd.org/changeset/base/321125 Log: MFC r318695: err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0` This is being done to aid humans and static analysis checkers. Modified: stable/11/lib/libc/gen/err.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/err.c ============================================================================== --- stable/11/lib/libc/gen/err.c Tue Jul 18 08:50:36 2017 (r321124) +++ stable/11/lib/libc/gen/err.c Tue Jul 18 08:50:43 2017 (r321125) @@ -97,7 +97,7 @@ void verrc(int eval, int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -122,7 +122,7 @@ void verrx(int eval, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); @@ -162,7 +162,7 @@ void vwarnc(int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -184,7 +184,7 @@ void vwarnx(const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); From owner-svn-src-all@freebsd.org Tue Jul 18 08: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 2E908CFC9F0; Tue, 18 Jul 2017 08:53:56 +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 EFFAB66287; Tue, 18 Jul 2017 08:53:55 +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 v6I8rscE045163; Tue, 18 Jul 2017 08:53:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8rsdM045161; Tue, 18 Jul 2017 08:53:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180853.v6I8rsdM045161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321126 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 321126 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:53:56 -0000 Author: ngie Date: Tue Jul 18 08:53:54 2017 New Revision: 321126 URL: https://svnweb.freebsd.org/changeset/base/321126 Log: MFC r318701,r319842: r318701: tcsendbreak(3): delete spurious blank line at the end of the man page r319842: getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE gets output via warnx(3) This helps set expectations for how one might deal with those messages, i.e., mute output from /dev/stderr today, since that's where vwarn(3) outputs messages to today. Modified: stable/11/lib/libc/gen/getbsize.3 stable/11/lib/libc/gen/tcsendbreak.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getbsize.3 ============================================================================== --- stable/11/lib/libc/gen/getbsize.3 Tue Jul 18 08:50:43 2017 (r321125) +++ stable/11/lib/libc/gen/getbsize.3 Tue Jul 18 08:53:54 2017 (r321126) @@ -28,7 +28,7 @@ .\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 16, 2012 +.Dd June 11, 2017 .Dt GETBSIZE 3 .Os .Sh NAME @@ -67,7 +67,8 @@ Sizes less than 512 bytes are rounded up to 512 bytes, greater than 1 GB are rounded down to 1 GB. In each case .Fn getbsize -produces a warning message. +produces a warning message via +.Xr warnx 3 . .Pp The .Fn getbsize Modified: stable/11/lib/libc/gen/tcsendbreak.3 ============================================================================== --- stable/11/lib/libc/gen/tcsendbreak.3 Tue Jul 18 08:50:43 2017 (r321125) +++ stable/11/lib/libc/gen/tcsendbreak.3 Tue Jul 18 08:53:54 2017 (r321126) @@ -177,4 +177,3 @@ without writing all output. The default value for .Va kern.tty_drainwait is 300 seconds. - From owner-svn-src-all@freebsd.org Tue Jul 18 08:54: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 35225CFCA6C; Tue, 18 Jul 2017 08:54:36 +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 047B8663B5; Tue, 18 Jul 2017 08:54:35 +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 v6I8sZtl045251; Tue, 18 Jul 2017 08:54:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8sZYE045250; Tue, 18 Jul 2017 08:54:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180854.v6I8sZYE045250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:54:35 +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: r321127 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321127 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 08:54:36 -0000 Author: ngie Date: Tue Jul 18 08:54:35 2017 New Revision: 321127 URL: https://svnweb.freebsd.org/changeset/base/321127 Log: MFC r319842: getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE gets output via warnx(3) This helps set expectations for how one might deal with those messages, i.e., mute output from /dev/stderr today, since that's where vwarn(3) outputs messages to today. Modified: stable/10/lib/libc/gen/getbsize.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getbsize.3 ============================================================================== --- stable/10/lib/libc/gen/getbsize.3 Tue Jul 18 08:53:54 2017 (r321126) +++ stable/10/lib/libc/gen/getbsize.3 Tue Jul 18 08:54:35 2017 (r321127) @@ -28,7 +28,7 @@ .\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 16, 2012 +.Dd June 11, 2017 .Dt GETBSIZE 3 .Os .Sh NAME @@ -67,7 +67,8 @@ Sizes less than 512 bytes are rounded up to 512 bytes, greater than 1 GB are rounded down to 1 GB. In each case .Fn getbsize -produces a warning message. +produces a warning message via +.Xr warnx 3 . .Pp The .Fn getbsize From owner-svn-src-all@freebsd.org Tue Jul 18 09:33: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 5C17BCFD5F8; Tue, 18 Jul 2017 09:33:12 +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 232D2677A6; Tue, 18 Jul 2017 09:33:11 +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 29DDB1024D4; Tue, 18 Jul 2017 19:33:04 +1000 (AEST) Date: Tue, 18 Jul 2017 19:33:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Ian Lepore , Bruce Evans , 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: <20170717164310.GM1935@kib.kiev.ua> Message-ID: <20170718180856.P1105@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> <1500308973.22314.89.camel@freebsd.org> <20170717164310.GM1935@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=9LpXibFZ7eA5Nq7F3o0A: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: Tue, 18 Jul 2017 09:33:12 -0000 On Mon, 17 Jul 2017, Konstantin Belousov wrote: > On Mon, Jul 17, 2017 at 10:29:33AM -0600, Ian Lepore wrote: >> I assumed the reason the efirt code was using the same mutex that >> protected access to the at rtc was because under the hood, the efi rt >> clock is really the same hardware too, accessed via bios code. > > EFI spec states it explicitely, e.g. in the description of the GetTime() > function of the Time Services interface: > > During runtime, if a PC-AT CMOS device is present in the platform the > caller must synchronize access to the device before calling GetTime(). The clock_lock mutex still protects individual cmos registers, provided efi uses rtcin() etc., which it apparently doesn't. The new atrtc_time_lock mutex doesn't protect even the rtc cmos registers as a group. Other subsystems can still access the registers holding only their own lock or just clock_lock. Only write accesses would be harmful. Read accesses do occur if rtcintr() is active, but these only change the index register. Even the rtc subsystem has (groups of) write accesses that are not properly locked. These are for (re)initializations. Reinitializations occur for changing the rtc rate for profiling and for resuming. There is no locking except possibly Giant for even the rtc_status[ab] images vs their registers. Giant locking might work for that, but it doesn't work for settime() calling rtc code, at least after removing Giant from settime(). If efi accesses the rtc directly, then that is just broken and sharing the new mutex doesn't help much. The new mutex only prevents contention between efi code that uses it and rtc code that use it -- that is, just the rtc timer parts of the rtc code (as the name of the new mutex suggests). The following remain unprotected: - rtc initialization code - more seriously, rtc interrupt code and rtcin()/writertc() generally. resettodr_mtx was no better. But further abuse of clock_lock might have worked. Holding clock_lock around efi_runtime->rt_gettime() calls would prevent both rtc timer code and rtc_intr() from contending. I can't find rt_gettime(). I think these sources of contention are normally inactive if efi is used, but efi can still race with rtc initialization, the cmos driver, and possibly acpi code. Bruce From owner-svn-src-all@freebsd.org Tue Jul 18 14:02: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 4590BD7E303; Tue, 18 Jul 2017 14:02:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7EA6F586; Tue, 18 Jul 2017 14:02: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 v6IE236f070419; Tue, 18 Jul 2017 14:02:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IE220r070417; Tue, 18 Jul 2017 14:02:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707181402.v6IE220r070417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 18 Jul 2017 14:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321128 - in head: etc/rc.d share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc/rc.d share/man/man5 X-SVN-Commit-Revision: 321128 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 14:02:04 -0000 Author: manu Date: Tue Jul 18 14:02:02 2017 New Revision: 321128 URL: https://svnweb.freebsd.org/changeset/base/321128 Log: ipfw_netflow: Add support for FIB If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB. While here correct some value in rc.conf(5) to be int and not str. Sponsored by: Gandi.net Modified: head/etc/rc.d/ipfw_netflow head/share/man/man5/rc.conf.5 Modified: head/etc/rc.d/ipfw_netflow ============================================================================== --- head/etc/rc.d/ipfw_netflow Tue Jul 18 08:54:35 2017 (r321127) +++ head/etc/rc.d/ipfw_netflow Tue Jul 18 14:02:02 2017 (r321128) @@ -54,7 +54,7 @@ ipfw_netflow_status() 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 + ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} ngctl -f - <<-EOF mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 name ipfw:${ipfw_netflow_hook} netflow Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Jul 18 08:54:35 2017 (r321127) +++ head/share/man/man5/rc.conf.5 Tue Jul 18 14:02:02 2017 (r321128) @@ -602,12 +602,12 @@ By default a ipfw rule is inserted and all packets are the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow port using protocol version 5. .It Va ipfw_netflow_hook -.Pq Vt str +.Pq Vt int netflow hook name, must be numerical (default .Pa 9995 ) . .It Va ipfw_netflow_rule -.Pq Vt str +.Pq Vt int ipfw rule number (default .Pa 1000 ) . @@ -617,13 +617,18 @@ Destination server ip for receiving netflow data (default .Pa 127.0.0.1 ) . .It Va ipfw_netflow_port -.Pq Vt str +.Pq Vt int Destination server port for receiving netflow data (default .Pa 9995 ) . .It Va ipfw_netflow_version -.Pq Vt str +.Pq Vt int Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9. +.It Va ipfw_netflow_fib +.Pq Vt int +Only match packet in FIB +.Pa ipfw_netflow_fib +(default is undefined meaning all FIBs). .It Va natd_program .Pq Vt str Path to From owner-svn-src-all@freebsd.org Tue Jul 18 14:59: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 A4979D7F374 for ; Tue, 18 Jul 2017 14:59:01 +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 200D6711C2 for ; Tue, 18 Jul 2017 14:59:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a380d1e7-6bc9-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 a380d1e7-6bc9-11e7-bfd0-afd4446ba3af; Tue, 18 Jul 2017 14:59:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6IEwqvA001136; Tue, 18 Jul 2017 08:58:53 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1500389932.22314.151.camel@freebsd.org> Subject: Re: svn commit: r320901 - in head/sys: amd64/amd64 isa x86/isa From: Ian Lepore To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 18 Jul 2017 08:58:52 -0600 In-Reply-To: <20170718153823.K1105@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> <1500308973.22314.89.camel@freebsd.org> <20170718153823.K1105@besplex.bde.org> 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, 18 Jul 2017 14:59:01 -0000 On Tue, 2017-07-18 at 18:08 +1000, Bruce Evans wrote: > On Mon, 17 Jul 2017, Ian Lepore wrote: > > > On Thu, 2017-07-13 at 01:42 +1000, Bruce Evans wrote: > >> On Wed, 12 Jul 2017, Ian Lepore wrote: > >> > >>> Log: > [...] > > I could barely read the reply, due to corruption of whitespace to > spaces > and \xa0.  Formatting fixed, except all tabs are corrupted to spaces, > and there are extra blank lines after quotes. > My mail client broke two updates ago.  I think nobody who works on gui apps does plain-text email anymore; if html mail looks good they're done.  ::sigh:: > > > [lots of stuff about locking and accurate time-setting] > > Good idea. > > My inittodr() waits for the seconds register to change.  This > increases > boot time by an average of 0.5 seconds, but is needed to get a result > that is not out of date by an average of 0.5 seconds.  After the > seconds > register changes, the window for reading the other registers is > almost > 1 second, but the reads must complete in a few microseconds anyway > else > the result is still too out of date.  Debugging printf()s show that > the reads usually complete in 10-50 usec with low latency (faster on > old systems with faster ISA buses). > I was considering adding a tunable to do that for people who don't mind the extra time to boot/wakeup.  It's interesting that you label an error of a few microseconds as "too out of date", I was thinking that reducing the average error from .5s to .005s was good enough. The .005s number comes from an idea of using a callout that begins as soon as interrupts are available that checks for rtc rollover every 10ms, with the hopes that it can catch the rollover between the time callouts start working and rootfs mount time when inittodr() gets called.  If it can catch the rollover happening in that window, it can latch the monotonic clock and then use that at inittodr() time to calculate the fractional part of the time.  Even if it doesn't catch the rollover in that time, it at least has a measurement that sets a floor value for the fractional part, reducing the error to something less than .5s. I have no idea yet how much time elapses between interrupts coming online and the first inittodr() call on a typical modern x86 system.  For all my arm systems with nfsroot it's several seconds.  If it averages a few milliseconds on x86 systems, it isn't useful enough to justify the extra work.  If it's typically half a second or more it probably is worth it. > Accuracy for reading is not very important because accuracy for > writing > is very low (1-2 seconds).  My resettodr() only writes if the > difference > is more than 2 seconds. > The gross inaccuracy when writing is fixable now.  I'm not worried about the microsecond inaccuracies of accessing the hardware, what I want to fix is the fact that clock_settime() may get called at x.995 and will record the time as x.0. Because settime is now called from a task thread, any clock driver is free to sleep as needed to set the clock hardware in a way that aligns its second rollover with kernel time.  Not efficient, but easy to do. Even better, most rtc hardware has unused storage.  Sometimes in the form of battery-backed ram, sometimes in the form of things like alarm registers that aren't used for anything and a driver can tuck away values in them for its own use.  If clock_settime() stores the fractional part of the second in such a location, clock_gettime() can use it to remove all of the inaccuracy that otherwise happens when the fraction is discarded.  If even a single bit is available the error is cut in half.  If a byte is available it drops to ~40ms. -- Ian From owner-svn-src-all@freebsd.org Tue Jul 18 16:03: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 CED2ED9661D; Tue, 18 Jul 2017 16:03:41 +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 A9001730C6; Tue, 18 Jul 2017 16:03:41 +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 v6IG3e1Z019833; Tue, 18 Jul 2017 16:03:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IG3e27019827; Tue, 18 Jul 2017 16:03:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181603.v6IG3e27019827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:03: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: r321129 - in stable/11: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown/tests X-SVN-Commit-Revision: 321129 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:03:41 -0000 Author: ngie Date: Tue Jul 18 16:03:39 2017 New Revision: 321129 URL: https://svnweb.freebsd.org/changeset/base/321129 Log: MFC r303212,r319642,r319830: r303212 (by bdrewery): Move chown tests to proper path r319642: Add some basic tests for chmod(1) r319830: Add more simple positive tests for chown(1) The tests are largely symmetric with the tests for chmod(1)--added in r319642. Remove chown-f_test (added in r268030) since the test coverage is now being provided by `chown_test`. Added: stable/11/bin/chmod/tests/ - copied from r319642, head/bin/chmod/tests/ stable/11/usr.sbin/chown/tests/chown_test.sh - copied unchanged from r319830, head/usr.sbin/chown/tests/chown_test.sh Deleted: stable/11/usr.sbin/chown/tests/chown-f_test.sh Modified: stable/11/ObsoleteFiles.inc stable/11/bin/chmod/Makefile stable/11/etc/mtree/BSD.tests.dist stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.sbin/chown/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Tue Jul 18 14:02:02 2017 (r321128) +++ stable/11/ObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) @@ -40,6 +40,8 @@ # 20170620: remove stale manpage OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz +# 20170610: chown-f_test replaced by chown_test +OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170531: remove pcap-int.h OLD_FILES+=usr/include/pcap-int.h # 20170402: new libc++ import which bumps version from 3.9.1 to 4.0.0. Modified: stable/11/bin/chmod/Makefile ============================================================================== --- stable/11/bin/chmod/Makefile Tue Jul 18 14:02:02 2017 (r321128) +++ stable/11/bin/chmod/Makefile Tue Jul 18 16:03:39 2017 (r321129) @@ -1,7 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PACKAGE=runtime PROG= chmod + +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 14:02:02 2017 (r321128) +++ stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 16:03:39 2017 (r321129) @@ -8,7 +8,7 @@ bin cat .. - chown + chmod .. date .. @@ -684,6 +684,8 @@ .. .. usr.sbin + chown + .. etcupdate .. extattr Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 14:02:02 2017 (r321128) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) @@ -7767,6 +7767,9 @@ OLD_FILES+=usr/share/aclocal/atf-c.m4 OLD_FILES+=usr/share/aclocal/atf-common.m4 OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal +OLD_DIRS+=usr/tests/bin/chown +OLD_FILES+=usr/tests/bin/chown/Kyuafile +OLD_FILES+=usr/tests/bin/chown/chown-f_test OLD_FILES+=usr/tests/bin/chown/units_basics OLD_FILES+=usr/tests/bin/date/legacy_test OLD_FILES+=usr/tests/bin/sh/legacy_test Modified: stable/11/usr.sbin/chown/tests/Makefile ============================================================================== --- stable/11/usr.sbin/chown/tests/Makefile Tue Jul 18 14:02:02 2017 (r321128) +++ stable/11/usr.sbin/chown/tests/Makefile Tue Jul 18 16:03:39 2017 (r321129) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -TESTSDIR= ${TESTSBASE}/bin/chown - -TAP_TESTS_SH= chown-f_test +ATF_TESTS_SH+= chown_test .include Copied: stable/11/usr.sbin/chown/tests/chown_test.sh (from r319830, head/usr.sbin/chown/tests/chown_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/chown/tests/chown_test.sh Tue Jul 18 16:03:39 2017 (r321129, copy of r319830, head/usr.sbin/chown/tests/chown_test.sh) @@ -0,0 +1,206 @@ +# +# Copyright (c) 2017 Dell EMC +# 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 RH_flag +RH_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -H " \ + "is specified" + atf_set "require.user" "root" +} +RH_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 126:126 A/C + atf_check -o inline:'84:84\n126:126\n84:84\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RL_flag +RL_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -L " \ + "is specified" + atf_set "require.user" "root" +} +RL_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 84:84 A + atf_check -o inline:'84:84\n84:84\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 126:126 A/C + atf_check -o inline:'84:84\n126:126\n42:42\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RP_flag +RP_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R " \ + "doesn't affect symlinks specified via the arguments " \ + "when -P is specified" + atf_set "require.user" "root" +} +RP_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 126:126 A/C + atf_check -o inline:'84:84\n84:84\n126:126\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case f_flag cleanup +f_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +f_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo bar + atf_check chflags uchg foo + atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check -s exit:0 chown -f 84:84 foo bar + atf_check -o inline:'0:0\n84:84\n' stat -f '%u:%g' foo bar +} + +f_flag_cleanup() +{ + atf_check chflags 0 foo +} + +atf_test_case h_flag +h_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +h_flag_body() +{ + atf_check truncate -s 0 foo + atf_check -o inline:'0:0\n' stat -f '%u:%g' foo + atf_check ln -s foo bar + atf_check -o inline:'0:0\n0:0\n' stat -f '%u:%g' foo bar + atf_check chown -h 42:42 bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check chown 84:84 bar + atf_check -o inline:'84:84\n42:42\n' stat -f '%u:%g' foo bar +} + +atf_test_case v_flag +v_flag_head() +{ + atf_set "descr" "Verify that setting ownership with -v emits the " \ + "file doesn't emit an error message/exit with a " \ + "non-zero code" + atf_set "require.user" "root" +} +v_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo + atf_check chown 42:42 bar + atf_check -o 'inline:bar\n' chown -v 0:0 foo bar + atf_check chown -v 0:0 foo bar + for f in foo bar; do + echo "$f: 0:0 -> 84:84"; + done > output.txt + atf_check -o file:output.txt chown -vv 84:84 foo bar + atf_check chown -vv 84:84 foo bar +} + +md_file="md.out" +atf_test_case x_flag cleanup +x_flag_head() +{ + atf_set "descr" "Verify that setting a mode with -x doesn't set " \ + "ownership across mountpoints" + atf_set "require.user" "root" +} +x_flag_body() +{ + atf_check -o save:$md_file mdconfig -a -t malloc -s 20m + if ! md_device=$(cat $md_file); then + atf_fail "cat $md_file failed" + fi + atf_check -o not-empty newfs /dev/$md_device + atf_check mkdir mnt + atf_check mount /dev/$md_device mnt + atf_check truncate -s 0 foo bar mnt/bazbaz + atf_check ln -s bar mnt/barbaz + atf_check ln -s ../foo mnt/foobaz + cd mnt + test_files="../foo ../bar barbaz bazbaz foobaz" + atf_check -o inline:'0:0\n0:0\n0:0\n0:0\n0:0\n' \ + stat -f '%u:%g' $test_files + atf_check chown -Rx 42:42 . + atf_check -o inline:'0:0\n0:0\n42:42\n42:42\n42:42\n' \ + stat -f '%u:%g' $test_files + atf_check chown -R 84:84 . + atf_check -o inline:'0:0\n0:0\n84:84\n84:84\n84:84\n' \ + stat -f '%u:%g' $test_files +} +x_flag_cleanup() +{ + if ! md_device=$(cat $md_file) || [ -z "$md_device" ]; then + echo "Couldn't get device from $md_file" + exit 0 + fi + umount mnt + mdconfig -d -u $md_device +} + +atf_init_test_cases() +{ + atf_add_test_case RH_flag + atf_add_test_case RL_flag + atf_add_test_case RP_flag + atf_add_test_case f_flag + atf_add_test_case h_flag + atf_add_test_case v_flag + atf_add_test_case x_flag +} From owner-svn-src-all@freebsd.org Tue Jul 18 16:27: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 E2590D96D8A; Tue, 18 Jul 2017 16:27:11 +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 BCD4973B3B; Tue, 18 Jul 2017 16:27:11 +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 v6IGRAl1028065; Tue, 18 Jul 2017 16:27:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGRAm4028058; Tue, 18 Jul 2017 16:27:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181627.v6IGRAm4028058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321130 - in stable/10: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown usr.sbin/chown/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown usr.sbin/chown/tests X-SVN-Commit-Revision: 321130 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:27:12 -0000 Author: ngie Date: Tue Jul 18 16:27:10 2017 New Revision: 321130 URL: https://svnweb.freebsd.org/changeset/base/321130 Log: MFC r268030,r268793,r303212,r319642,r319830: r268030 (by eadler): chown: add a test Add a test for the chown utility. This sets up chown(8) to be capable of being tested. As such, only add one test for now as an example. r268793 (by eadler): chown: Fix chown test number r303212 (by bdrewery): Move chown tests to proper path r319642: Add some basic tests for chmod(1) r319830: Add more simple positive tests for chown(1) The tests are largely symmetric with the tests for chmod(1)--added in r319642. Remove chown-f_test (added in r268030) since the test coverage is now being provided by `chown_test`. Added: stable/10/bin/chmod/tests/ - copied from r319642, head/bin/chmod/tests/ stable/10/usr.sbin/chown/tests/ - copied from r268030, head/usr.sbin/chown/tests/ stable/10/usr.sbin/chown/tests/chown_test.sh - copied unchanged from r319830, head/usr.sbin/chown/tests/chown_test.sh Deleted: stable/10/usr.sbin/chown/tests/chown-f_test.sh Modified: stable/10/ObsoleteFiles.inc stable/10/bin/chmod/Makefile stable/10/etc/mtree/BSD.tests.dist stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/chown/Makefile stable/10/usr.sbin/chown/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/ObsoleteFiles.inc Tue Jul 18 16:27:10 2017 (r321130) @@ -40,6 +40,8 @@ # 20170620: remove stale manpage OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz +# 20170610: chown-f_test replaced by chown_test +OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170322: rename to _test to match the FreeBSD test suite name scheme OLD_FILES+=usr/tests/usr.bin/col/col OLD_FILES+=usr/tests/usr.sbin/pw/pw_config Modified: stable/10/bin/chmod/Makefile ============================================================================== --- stable/10/bin/chmod/Makefile Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/bin/chmod/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= chmod + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:27:10 2017 (r321130) @@ -8,7 +8,7 @@ bin cat .. - chown + chmod .. date .. @@ -652,6 +652,8 @@ .. .. usr.sbin + chown + .. etcupdate .. extattr Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 16:27:10 2017 (r321130) @@ -4820,6 +4820,9 @@ OLD_FILES+=usr/share/aclocal/atf-c.m4 OLD_FILES+=usr/share/aclocal/atf-common.m4 OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal +OLD_DIRS+=usr/tests/bin/chown +OLD_FILES+=usr/tests/bin/chown/Kyuafile +OLD_FILES+=usr/tests/bin/chown/chown-f_test OLD_FILES+=usr/tests/bin/date/legacy_test OLD_FILES+=usr/tests/bin/sh/legacy_test OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test Modified: stable/10/usr.sbin/chown/Makefile ============================================================================== --- stable/10/usr.sbin/chown/Makefile Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/usr.sbin/chown/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= chown LINKS= ${BINDIR}/chown /usr/bin/chgrp MAN= chgrp.1 chown.8 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/usr.sbin/chown/tests/Makefile ============================================================================== --- head/usr.sbin/chown/tests/Makefile Mon Jun 30 05:33:52 2014 (r268030) +++ stable/10/usr.sbin/chown/tests/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -TESTSDIR= ${TESTSBASE}/bin/chown - -TAP_TESTS_SH= chown-f_test +ATF_TESTS_SH+= chown_test .include Copied: stable/10/usr.sbin/chown/tests/chown_test.sh (from r319830, head/usr.sbin/chown/tests/chown_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/chown/tests/chown_test.sh Tue Jul 18 16:27:10 2017 (r321130, copy of r319830, head/usr.sbin/chown/tests/chown_test.sh) @@ -0,0 +1,206 @@ +# +# Copyright (c) 2017 Dell EMC +# 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 RH_flag +RH_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -H " \ + "is specified" + atf_set "require.user" "root" +} +RH_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 126:126 A/C + atf_check -o inline:'84:84\n126:126\n84:84\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RL_flag +RL_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -L " \ + "is specified" + atf_set "require.user" "root" +} +RL_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 84:84 A + atf_check -o inline:'84:84\n84:84\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 126:126 A/C + atf_check -o inline:'84:84\n126:126\n42:42\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RP_flag +RP_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R " \ + "doesn't affect symlinks specified via the arguments " \ + "when -P is specified" + atf_set "require.user" "root" +} +RP_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 126:126 A/C + atf_check -o inline:'84:84\n84:84\n126:126\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case f_flag cleanup +f_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +f_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo bar + atf_check chflags uchg foo + atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check -s exit:0 chown -f 84:84 foo bar + atf_check -o inline:'0:0\n84:84\n' stat -f '%u:%g' foo bar +} + +f_flag_cleanup() +{ + atf_check chflags 0 foo +} + +atf_test_case h_flag +h_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +h_flag_body() +{ + atf_check truncate -s 0 foo + atf_check -o inline:'0:0\n' stat -f '%u:%g' foo + atf_check ln -s foo bar + atf_check -o inline:'0:0\n0:0\n' stat -f '%u:%g' foo bar + atf_check chown -h 42:42 bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check chown 84:84 bar + atf_check -o inline:'84:84\n42:42\n' stat -f '%u:%g' foo bar +} + +atf_test_case v_flag +v_flag_head() +{ + atf_set "descr" "Verify that setting ownership with -v emits the " \ + "file doesn't emit an error message/exit with a " \ + "non-zero code" + atf_set "require.user" "root" +} +v_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo + atf_check chown 42:42 bar + atf_check -o 'inline:bar\n' chown -v 0:0 foo bar + atf_check chown -v 0:0 foo bar + for f in foo bar; do + echo "$f: 0:0 -> 84:84"; + done > output.txt + atf_check -o file:output.txt chown -vv 84:84 foo bar + atf_check chown -vv 84:84 foo bar +} + +md_file="md.out" +atf_test_case x_flag cleanup +x_flag_head() +{ + atf_set "descr" "Verify that setting a mode with -x doesn't set " \ + "ownership across mountpoints" + atf_set "require.user" "root" +} +x_flag_body() +{ + atf_check -o save:$md_file mdconfig -a -t malloc -s 20m + if ! md_device=$(cat $md_file); then + atf_fail "cat $md_file failed" + fi + atf_check -o not-empty newfs /dev/$md_device + atf_check mkdir mnt + atf_check mount /dev/$md_device mnt + atf_check truncate -s 0 foo bar mnt/bazbaz + atf_check ln -s bar mnt/barbaz + atf_check ln -s ../foo mnt/foobaz + cd mnt + test_files="../foo ../bar barbaz bazbaz foobaz" + atf_check -o inline:'0:0\n0:0\n0:0\n0:0\n0:0\n' \ + stat -f '%u:%g' $test_files + atf_check chown -Rx 42:42 . + atf_check -o inline:'0:0\n0:0\n42:42\n42:42\n42:42\n' \ + stat -f '%u:%g' $test_files + atf_check chown -R 84:84 . + atf_check -o inline:'0:0\n0:0\n84:84\n84:84\n84:84\n' \ + stat -f '%u:%g' $test_files +} +x_flag_cleanup() +{ + if ! md_device=$(cat $md_file) || [ -z "$md_device" ]; then + echo "Couldn't get device from $md_file" + exit 0 + fi + umount mnt + mdconfig -d -u $md_device +} + +atf_init_test_cases() +{ + atf_add_test_case RH_flag + atf_add_test_case RL_flag + atf_add_test_case RP_flag + atf_add_test_case f_flag + atf_add_test_case h_flag + atf_add_test_case v_flag + atf_add_test_case x_flag +} From owner-svn-src-all@freebsd.org Tue Jul 18 16:36: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 2BA5BD991B3; Tue, 18 Jul 2017 16:36:34 +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 02FD074060; Tue, 18 Jul 2017 16:36:33 +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 v6IGaW41032295; Tue, 18 Jul 2017 16:36:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGaWqr032292; Tue, 18 Jul 2017 16:36:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707181636.v6IGaWqr032292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 18 Jul 2017 16:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321131 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 321131 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:36:34 -0000 Author: andrew Date: Tue Jul 18 16:36:32 2017 New Revision: 321131 URL: https://svnweb.freebsd.org/changeset/base/321131 Log: Add support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This will be used to call into UEFI from the kernel. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/vfp.c head/sys/arm64/include/pcb.h head/sys/arm64/include/vfp.h Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Tue Jul 18 16:27:10 2017 (r321130) +++ head/sys/arm64/arm64/vfp.c Tue Jul 18 16:36:32 2017 (r321131) @@ -262,9 +262,29 @@ fpu_kern_enter(struct thread *td, struct fpu_kern_ctx struct pcb *pcb; pcb = td->td_pcb; + KASSERT((flags & FPU_KERN_NOCTX) != 0 || ctx != NULL, + ("ctx is required when !FPU_KERN_NOCTX")); KASSERT(ctx == NULL || (ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("using inuse ctx")); + KASSERT((pcb->pcb_fpflags & PCB_FP_NOSAVE) == 0, + ("recursive fpu_kern_enter while in PCB_FP_NOSAVE state")); + if ((flags & FPU_KERN_NOCTX) != 0) { + critical_enter(); + if (curthread == PCPU_GET(fpcurthread)) { + vfp_save_state(curthread, pcb); + PCPU_SET(fpcurthread, NULL); + } else { + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("invalid fpcurthread")); + } + + vfp_enable(); + pcb->pcb_fpflags |= PCB_FP_KERN | PCB_FP_NOSAVE | + PCB_FP_STARTED; + return (0); + } + if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { ctx->flags = FPU_KERN_CTX_DUMMY | FPU_KERN_CTX_INUSE; return (0); @@ -293,19 +313,30 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx pcb = td->td_pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, - ("FPU context not inuse")); - ctx->flags &= ~FPU_KERN_CTX_INUSE; + if ((pcb->pcb_fpflags & PCB_FP_NOSAVE) != 0) { + KASSERT(ctx == NULL, ("non-null ctx after FPU_KERN_NOCTX")); + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("non-NULL fpcurthread for PCB_FP_NOSAVE")); + CRITICAL_ASSERT(td); - if (is_fpu_kern_thread(0) && - (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) - return (0); - KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); - critical_enter(); - vfp_discard(td); - critical_exit(); - pcb->pcb_fpflags &= ~PCB_FP_STARTED; - pcb->pcb_fpusaved = ctx->prev; + vfp_disable(); + pcb->pcb_fpflags &= ~(PCB_FP_NOSAVE | PCB_FP_STARTED); + critical_exit(); + } else { + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, + ("FPU context not inuse")); + ctx->flags &= ~FPU_KERN_CTX_INUSE; + + if (is_fpu_kern_thread(0) && + (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); + critical_enter(); + vfp_discard(td); + critical_exit(); + pcb->pcb_fpflags &= ~PCB_FP_STARTED; + pcb->pcb_fpusaved = ctx->prev; + } if (pcb->pcb_fpusaved == &pcb->pcb_fpustate) { pcb->pcb_fpflags &= ~PCB_FP_KERN; Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Tue Jul 18 16:27:10 2017 (r321130) +++ head/sys/arm64/include/pcb.h Tue Jul 18 16:36:32 2017 (r321131) @@ -56,6 +56,7 @@ struct pcb { int pcb_fpflags; #define PCB_FP_STARTED 0x01 #define PCB_FP_KERN 0x02 +#define PCB_FP_NOSAVE 0x04 /* The bits passed to userspace in get_fpcontext */ #define PCB_FP_USERMASK (PCB_FP_STARTED) u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Tue Jul 18 16:27:10 2017 (r321130) +++ head/sys/arm64/include/vfp.h Tue Jul 18 16:36:32 2017 (r321131) @@ -56,6 +56,7 @@ struct fpu_kern_ctx; #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 #define FPU_KERN_KTHR 0x0002 +#define FPU_KERN_NOCTX 0x0004 struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int); void fpu_kern_free_ctx(struct fpu_kern_ctx *); From owner-svn-src-all@freebsd.org Tue Jul 18 16:48: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 6253BD99A73; Tue, 18 Jul 2017 16:48:37 +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 2EB7F74902; Tue, 18 Jul 2017 16:48:37 +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 v6IGmaCr036716; Tue, 18 Jul 2017 16:48:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGmaKv036714; Tue, 18 Jul 2017 16:48:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181648.v6IGmaKv036714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321132 - in stable/11: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Commit-Revision: 321132 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:48:37 -0000 Author: ngie Date: Tue Jul 18 16:48:36 2017 New Revision: 321132 URL: https://svnweb.freebsd.org/changeset/base/321132 Log: MFC r319850: Add some initial basic tests for du(1) Tests that exercise the following flags are added in this commit: - -A - -H - -I - -g - -h - -k - -m Additional tests will be added soon. Added: stable/11/usr.bin/du/tests/ - copied from r319850, head/usr.bin/du/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/usr.bin/du/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 16:36:32 2017 (r321131) +++ stable/11/etc/mtree/BSD.tests.dist Tue Jul 18 16:48:36 2017 (r321132) @@ -612,6 +612,8 @@ .. dirname .. + du + .. file2c .. getconf Modified: stable/11/usr.bin/du/Makefile ============================================================================== --- stable/11/usr.bin/du/Makefile Tue Jul 18 16:36:32 2017 (r321131) +++ stable/11/usr.bin/du/Makefile Tue Jul 18 16:48:36 2017 (r321132) @@ -1,7 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= du LIBADD= util + +SUBDIR.${MK_TESTS}+= tests .include From owner-svn-src-all@freebsd.org Tue Jul 18 16:49: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 EA48AD99B01; Tue, 18 Jul 2017 16:49:25 +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 B86C674A32; Tue, 18 Jul 2017 16:49:25 +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 v6IGnOf4036794; Tue, 18 Jul 2017 16:49:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGnONS036792; Tue, 18 Jul 2017 16:49:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181649.v6IGnONS036792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:49:24 +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: r321133 - in stable/10: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Commit-Revision: 321133 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:49:26 -0000 Author: ngie Date: Tue Jul 18 16:49:24 2017 New Revision: 321133 URL: https://svnweb.freebsd.org/changeset/base/321133 Log: MFC r319850: Add some initial basic tests for du(1) Tests that exercise the following flags are added in this commit: - -A - -H - -I - -g - -h - -k - -m Additional tests will be added soon. Added: stable/10/usr.bin/du/tests/ - copied from r319850, head/usr.bin/du/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/du/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:48:36 2017 (r321132) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:49:24 2017 (r321133) @@ -594,6 +594,8 @@ .. dirname .. + du + .. file2c .. getconf Modified: stable/10/usr.bin/du/Makefile ============================================================================== --- stable/10/usr.bin/du/Makefile Tue Jul 18 16:48:36 2017 (r321132) +++ stable/10/usr.bin/du/Makefile Tue Jul 18 16:49:24 2017 (r321133) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= du DPADD= ${LIBUTIL} LDADD= -lutil + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-all@freebsd.org Tue Jul 18 16:58: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 F1B74D99FCC; Tue, 18 Jul 2017 16:58:53 +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 BDDFB7509E; Tue, 18 Jul 2017 16:58:53 +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 v6IGwqdD041089; Tue, 18 Jul 2017 16:58:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGwqoh041085; Tue, 18 Jul 2017 16:58:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181658.v6IGwqoh041085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321134 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/sys: netinet netinet6 X-SVN-Commit-Revision: 321134 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:58:54 -0000 Author: ngie Date: Tue Jul 18 16:58:52 2017 New Revision: 321134 URL: https://svnweb.freebsd.org/changeset/base/321134 Log: MFC r318255: Add missing braces around MCAST_EXCLUDE check when KTR support is compiled into the kernel This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly decremented for MLD-layer source datagrams when inspecting im*s_st[1] (the second state in the structure). PR: 217509 [1] Modified: stable/10/sys/netinet/in_mcast.c stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in_mcast.c ============================================================================== --- stable/10/sys/netinet/in_mcast.c Tue Jul 18 16:49:24 2017 (r321133) +++ stable/10/sys/netinet/in_mcast.c Tue Jul 18 16:58:52 2017 (r321134) @@ -1014,9 +1014,10 @@ inm_merge(struct in_multi *inm, /*const*/ struct in_mf /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->imf_st[1] != MCAST_EXCLUDE) || - (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__); --inm->inm_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Tue Jul 18 16:49:24 2017 (r321133) +++ stable/10/sys/netinet6/in6_mcast.c Tue Jul 18 16:58:52 2017 (r321134) @@ -1000,9 +1000,10 @@ in6m_merge(struct in6_multi *inm, /*const*/ struct in6 /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->im6f_st[1] != MCAST_EXCLUDE) || - (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__); --inm->in6m_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ From owner-svn-src-all@freebsd.org Tue Jul 18 16:58: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 31432D99FD4; Tue, 18 Jul 2017 16:58:56 +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 F24C8750A1; Tue, 18 Jul 2017 16:58:55 +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 v6IGwt7Z041148; Tue, 18 Jul 2017 16:58:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGwtYg041146; Tue, 18 Jul 2017 16:58:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181658.v6IGwtYg041146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:58: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: r321135 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 321135 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 16:58:56 -0000 Author: ngie Date: Tue Jul 18 16:58:54 2017 New Revision: 321135 URL: https://svnweb.freebsd.org/changeset/base/321135 Log: MFC r318255: Add missing braces around MCAST_EXCLUDE check when KTR support is compiled into the kernel This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly decremented for MLD-layer source datagrams when inspecting im*s_st[1] (the second state in the structure). PR: 217509 [1] Modified: stable/11/sys/netinet/in_mcast.c stable/11/sys/netinet6/in6_mcast.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_mcast.c ============================================================================== --- stable/11/sys/netinet/in_mcast.c Tue Jul 18 16:58:52 2017 (r321134) +++ stable/11/sys/netinet/in_mcast.c Tue Jul 18 16:58:54 2017 (r321135) @@ -1047,9 +1047,10 @@ inm_merge(struct in_multi *inm, /*const*/ struct in_mf /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->imf_st[1] != MCAST_EXCLUDE) || - (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__); --inm->inm_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ Modified: stable/11/sys/netinet6/in6_mcast.c ============================================================================== --- stable/11/sys/netinet6/in6_mcast.c Tue Jul 18 16:58:52 2017 (r321134) +++ stable/11/sys/netinet6/in6_mcast.c Tue Jul 18 16:58:54 2017 (r321135) @@ -999,9 +999,10 @@ in6m_merge(struct in6_multi *inm, /*const*/ struct in6 /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->im6f_st[1] != MCAST_EXCLUDE) || - (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__); --inm->in6m_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ From owner-svn-src-all@freebsd.org Tue Jul 18 17:16: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 8F2F2D9A688; Tue, 18 Jul 2017 17:16:56 +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 6B83675B97; Tue, 18 Jul 2017 17:16:56 +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 v6IHGth8049506; Tue, 18 Jul 2017 17:16:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHGtaQ049504; Tue, 18 Jul 2017 17:16:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181716.v6IHGtaQ049504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:16: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: r321136 - stable/11/tools/regression/geom_gpt X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/tools/regression/geom_gpt X-SVN-Commit-Revision: 321136 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:16:56 -0000 Author: ngie Date: Tue Jul 18 17:16:55 2017 New Revision: 321136 URL: https://svnweb.freebsd.org/changeset/base/321136 Log: MFC r319800,r319806: r319800: Don't explicitly get the class to PART in gctl_test_helper.c This will allow the tool to be used with arbitrary geom(4) classes, like GEOM. Specify class=PART explicitly in the tester to keep existing behavior. r319806: Improve handling with system state - Always unlink $cmd after exit via END block. - The tests don't function well if kern.geom.debugflags != 0. Save debugflags, then restore them at the end of the test. Modified: stable/11/tools/regression/geom_gpt/gctl_test.t stable/11/tools/regression/geom_gpt/gctl_test_helper.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- stable/11/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 16:58:54 2017 (r321135) +++ stable/11/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 17:16:55 2017 (r321136) @@ -35,48 +35,48 @@ my $disk = "/tmp/disk-$$"; my $mntpt_prefix = "/tmp/mount-$$"; my %steps = ( - "000" => "gctl", - "001" => "gctl verb=bogus", - "010" => "gctl verb=create", - "011" => "gctl verb=create provider=bogus", + "000" => "gctl class=PART", + "001" => "gctl class=PART verb=bogus", + "010" => "gctl class=PART verb=create", + "011" => "gctl class=PART verb=create provider=bogus", "020" => "mdcfg create pristine", - "021" => "gctl verb=create provider=%dev% entries=-1", - "022" => "gctl verb=create provider=%dev% entries=128", - "023" => "gctl verb=create provider=%dev%", - "024" => "gctl verb=modify geom=%dev%", + "021" => "gctl class=PART verb=create provider=%dev% entries=-1", + "022" => "gctl class=PART verb=create provider=%dev% entries=128", + "023" => "gctl class=PART verb=create provider=%dev%", + "024" => "gctl class=PART verb=modify geom=%dev%", "025" => "conf", - "030" => "gctl verb=add", - "031" => "gctl verb=add geom=bogus", - "032" => "gctl verb=add geom=%dev%", - "033" => "gctl verb=add geom=%dev% type=bogus", - "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", - "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", - "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", - "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", - "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", - "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", - "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", - "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", - "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", - "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", - "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", - "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", - "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", + "030" => "gctl class=PART verb=add", + "031" => "gctl class=PART verb=add geom=bogus", + "032" => "gctl class=PART verb=add geom=%dev%", + "033" => "gctl class=PART verb=add geom=%dev% type=bogus", + "034" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", + "035" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", + "036" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", + "037" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", + "038" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", + "039" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", + "040" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", + "041" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", + "042" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", + "043" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", + "044" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", + "045" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", + "046" => "gctl class=PART verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", "047" => "conf", - "050" => "gctl verb=remove geom=%dev% entry=5", - "051" => "gctl verb=remove geom=%dev% entry=2", - "052" => "gctl verb=remove geom=%dev% entry=1", - "053" => "gctl verb=remove geom=%dev% entry=1", + "050" => "gctl class=PART verb=remove geom=%dev% entry=5", + "051" => "gctl class=PART verb=remove geom=%dev% entry=2", + "052" => "gctl class=PART verb=remove geom=%dev% entry=1", + "053" => "gctl class=PART verb=remove geom=%dev% entry=1", "054" => "conf", - "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", + "060" => "gctl class=PART verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", "061" => "mount %dev%p1", - "062" => "gctl verb=delete geom=%dev% entry=1", + "062" => "gctl class=PART verb=delete geom=%dev% entry=1", "063" => "umount %dev%p1", - "064" => "gctl verb=delete geom=%dev% entry=1", + "064" => "gctl class=PART verb=delete geom=%dev% entry=1", "065" => "conf", "100" => "mdcfg destroy", "110" => "mdcfg create corrupted", - "111" => "gctl verb=add geom=%dev%", + "111" => "gctl class=PART verb=add geom=%dev%", "120" => "mdcfg destroy", ); @@ -144,10 +144,20 @@ my $out = basename($cmd) . ".out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { print "1..0 # SKIP insufficient permissions\n"; - unlink $cmd; exit 0; } +my $debugflags_oid = 'kern.geom.debugflags'; +chomp(my $old_geom_debugflags = `sysctl -n $debugflags_oid`); +if ($? != 0) { + print "1..0 # SKIP could not query $debugflags_oid\n"; + exit 0; +} +if (system("sysctl $debugflags_oid=0") != 0) { + print "1..0 # SKIP could not set $debugflags_oid=0\n"; + exit 0; +} + my $count = keys (%steps); print "1..$count\n"; @@ -227,4 +237,7 @@ foreach my $key (sort keys %steps) { } $nr += 1; } -exit 0; +END { + system("sysctl $debugflags_oid=$old_geom_debugflags"); + unlink($cmd); +} Modified: stable/11/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- stable/11/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 16:58:54 2017 (r321135) +++ stable/11/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 17:16:55 2017 (r321136) @@ -117,7 +117,6 @@ main(int argc, char *argv[]) req = gctl_get_handle(); assert(req != NULL); - gctl_ro_param(req, "class", -1, "PART"); while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { From owner-svn-src-all@freebsd.org Tue Jul 18 17:16: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 BDEDAD9A6AD; Tue, 18 Jul 2017 17:16:59 +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 95AA675B9E; Tue, 18 Jul 2017 17:16:59 +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 v6IHGwaw049555; Tue, 18 Jul 2017 17:16:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHGwvx049553; Tue, 18 Jul 2017 17:16:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181716.v6IHGwvx049553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:16:58 +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: r321137 - stable/10/tools/regression/geom_gpt X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/tools/regression/geom_gpt X-SVN-Commit-Revision: 321137 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:16:59 -0000 Author: ngie Date: Tue Jul 18 17:16:58 2017 New Revision: 321137 URL: https://svnweb.freebsd.org/changeset/base/321137 Log: MFC r319800,r319806: r319800: Don't explicitly get the class to PART in gctl_test_helper.c This will allow the tool to be used with arbitrary geom(4) classes, like GEOM. Specify class=PART explicitly in the tester to keep existing behavior. r319806: Improve handling with system state - Always unlink $cmd after exit via END block. - The tests don't function well if kern.geom.debugflags != 0. Save debugflags, then restore them at the end of the test. Modified: stable/10/tools/regression/geom_gpt/gctl_test.t stable/10/tools/regression/geom_gpt/gctl_test_helper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- stable/10/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 17:16:55 2017 (r321136) +++ stable/10/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 17:16:58 2017 (r321137) @@ -35,48 +35,48 @@ my $disk = "/tmp/disk-$$"; my $mntpt_prefix = "/tmp/mount-$$"; my %steps = ( - "000" => "gctl", - "001" => "gctl verb=bogus", - "010" => "gctl verb=create", - "011" => "gctl verb=create provider=bogus", + "000" => "gctl class=PART", + "001" => "gctl class=PART verb=bogus", + "010" => "gctl class=PART verb=create", + "011" => "gctl class=PART verb=create provider=bogus", "020" => "mdcfg create pristine", - "021" => "gctl verb=create provider=%dev% entries=-1", - "022" => "gctl verb=create provider=%dev% entries=128", - "023" => "gctl verb=create provider=%dev%", - "024" => "gctl verb=modify geom=%dev%", + "021" => "gctl class=PART verb=create provider=%dev% entries=-1", + "022" => "gctl class=PART verb=create provider=%dev% entries=128", + "023" => "gctl class=PART verb=create provider=%dev%", + "024" => "gctl class=PART verb=modify geom=%dev%", "025" => "conf", - "030" => "gctl verb=add", - "031" => "gctl verb=add geom=bogus", - "032" => "gctl verb=add geom=%dev%", - "033" => "gctl verb=add geom=%dev% type=bogus", - "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", - "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", - "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", - "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", - "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", - "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", - "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", - "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", - "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", - "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", - "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", - "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", - "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", + "030" => "gctl class=PART verb=add", + "031" => "gctl class=PART verb=add geom=bogus", + "032" => "gctl class=PART verb=add geom=%dev%", + "033" => "gctl class=PART verb=add geom=%dev% type=bogus", + "034" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", + "035" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", + "036" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", + "037" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", + "038" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", + "039" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", + "040" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", + "041" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", + "042" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", + "043" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", + "044" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", + "045" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", + "046" => "gctl class=PART verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", "047" => "conf", - "050" => "gctl verb=remove geom=%dev% entry=5", - "051" => "gctl verb=remove geom=%dev% entry=2", - "052" => "gctl verb=remove geom=%dev% entry=1", - "053" => "gctl verb=remove geom=%dev% entry=1", + "050" => "gctl class=PART verb=remove geom=%dev% entry=5", + "051" => "gctl class=PART verb=remove geom=%dev% entry=2", + "052" => "gctl class=PART verb=remove geom=%dev% entry=1", + "053" => "gctl class=PART verb=remove geom=%dev% entry=1", "054" => "conf", - "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", + "060" => "gctl class=PART verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", "061" => "mount %dev%p1", - "062" => "gctl verb=delete geom=%dev% entry=1", + "062" => "gctl class=PART verb=delete geom=%dev% entry=1", "063" => "umount %dev%p1", - "064" => "gctl verb=delete geom=%dev% entry=1", + "064" => "gctl class=PART verb=delete geom=%dev% entry=1", "065" => "conf", "100" => "mdcfg destroy", "110" => "mdcfg create corrupted", - "111" => "gctl verb=add geom=%dev%", + "111" => "gctl class=PART verb=add geom=%dev%", "120" => "mdcfg destroy", ); @@ -144,10 +144,20 @@ my $out = basename($cmd) . ".out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { print "1..0 # SKIP insufficient permissions\n"; - unlink $cmd; exit 0; } +my $debugflags_oid = 'kern.geom.debugflags'; +chomp(my $old_geom_debugflags = `sysctl -n $debugflags_oid`); +if ($? != 0) { + print "1..0 # SKIP could not query $debugflags_oid\n"; + exit 0; +} +if (system("sysctl $debugflags_oid=0") != 0) { + print "1..0 # SKIP could not set $debugflags_oid=0\n"; + exit 0; +} + my $count = keys (%steps); print "1..$count\n"; @@ -227,4 +237,7 @@ foreach my $key (sort keys %steps) { } $nr += 1; } -exit 0; +END { + system("sysctl $debugflags_oid=$old_geom_debugflags"); + unlink($cmd); +} Modified: stable/10/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 17:16:55 2017 (r321136) +++ stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 17:16:58 2017 (r321137) @@ -117,7 +117,6 @@ main(int argc, char *argv[]) req = gctl_get_handle(); assert(req != NULL); - gctl_ro_param(req, "class", -1, "PART"); while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { From owner-svn-src-all@freebsd.org Tue Jul 18 17:29: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 D9424D9AB45; Tue, 18 Jul 2017 17:29:13 +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 A884B762DE; Tue, 18 Jul 2017 17:29:13 +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 v6IHTC7e053731; Tue, 18 Jul 2017 17:29:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHTCkb053730; Tue, 18 Jul 2017 17:29:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181729.v6IHTCkb053730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321138 - head/bin/dd/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/bin/dd/tests X-SVN-Commit-Revision: 321138 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:29:14 -0000 Author: ngie Date: Tue Jul 18 17:29:12 2017 New Revision: 321138 URL: https://svnweb.freebsd.org/changeset/base/321138 Log: Remove unnecessary make logic added in r319339 This makes the change cleaner and easier to backport to ^/stable/10. MFC after: now Modified: head/bin/dd/tests/Makefile Modified: head/bin/dd/tests/Makefile ============================================================================== --- head/bin/dd/tests/Makefile Tue Jul 18 17:16:58 2017 (r321137) +++ head/bin/dd/tests/Makefile Tue Jul 18 17:29:12 2017 (r321138) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -.PATH: ${.CURDIR}/.. - ATF_TESTS_SH= dd2_test NETBSD_ATF_TESTS_SH= dd_test From owner-svn-src-all@freebsd.org Tue Jul 18 17:35: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 9135FD9AE24; Tue, 18 Jul 2017 17:35:30 +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 6D4137683F; Tue, 18 Jul 2017 17:35:30 +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 v6IHZT0t058110; Tue, 18 Jul 2017 17:35:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHZTTR058103; Tue, 18 Jul 2017 17:35:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181735.v6IHZTTR058103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321139 - in stable/11/bin/dd: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/bin/dd: . tests X-SVN-Commit-Revision: 321139 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:35:30 -0000 Author: ngie Date: Tue Jul 18 17:35:29 2017 New Revision: 321139 URL: https://svnweb.freebsd.org/changeset/base/321139 Log: MFC r302500,r319339,r319543,r319544,r319551,r321138: r302500 (by cem): dd(1): Enable access to SIZE_T_MAX character devices On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking character devices to negative off_t values. This enables dd(1) to interact with kernel KVA in /dev/kmem on amd64, for example. r319339 (by asomers): Fix integer overflow detection in dd dd(1) tried to detect whether the seek offset would overflow, but it failed to account for the case where the provided argument was negative and the file was a regular file (negative seeks are allowed for character devices). I fixed it, and added a regression test. CID: 1368659 r319543: Stylistic tweaks Move opening braces of functions from the last column to column 0. MFC with: r319339 r319544: Mark :seek_overflow as an expected failure MFC with: r319339 PR: 219757 r319551 (by asomers): Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large. PR: 219757 r321138: Remove unnecessary make logic added in r319339 This makes the change cleaner and easier to backport to ^/stable/10. Added: stable/11/bin/dd/tests/dd2_test.sh - copied, changed from r319339, head/bin/dd/tests/dd2_test.sh Modified: stable/11/bin/dd/args.c stable/11/bin/dd/position.c stable/11/bin/dd/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/dd/args.c ============================================================================== --- stable/11/bin/dd/args.c Tue Jul 18 17:29:12 2017 (r321138) +++ stable/11/bin/dd/args.c Tue Jul 18 17:35:29 2017 (r321139) @@ -167,14 +167,6 @@ jcl(char **argv) errx(1, "cbs meaningless if not doing record operations"); } else cfunc = def; - - /* - * Bail out if the calculation of a file offset would overflow. - */ - if (in.offset > OFF_MAX / (ssize_t)in.dbsz || - out.offset > OFF_MAX / (ssize_t)out.dbsz) - errx(1, "seek offsets cannot be larger than %jd", - (intmax_t)OFF_MAX); } static int Modified: stable/11/bin/dd/position.c ============================================================================== --- stable/11/bin/dd/position.c Tue Jul 18 17:29:12 2017 (r321138) +++ stable/11/bin/dd/position.c Tue Jul 18 17:35:29 2017 (r321139) @@ -45,12 +45,41 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "dd.h" #include "extern.h" +static off_t +seek_offset(IO *io) +{ + off_t n; + size_t sz; + + n = io->offset; + sz = io->dbsz; + + _Static_assert(sizeof(io->offset) == sizeof(int64_t), "64-bit off_t"); + + /* + * If the lseek offset will be negative, verify that this is a special + * device file. Some such files (e.g. /dev/kmem) permit "negative" + * offsets. + * + * Bail out if the calculation of a file offset would overflow. + */ + if ((io->flags & ISCHR) == 0 && (n < 0 || n > OFF_MAX / (ssize_t)sz)) + errx(1, "seek offsets cannot be larger than %jd", + (intmax_t)OFF_MAX); + else if ((io->flags & ISCHR) != 0 && (uint64_t)n > UINT64_MAX / sz) + errx(1, "seek offsets cannot be larger than %ju", + (uintmax_t)UINT64_MAX); + + return ((off_t)( (uint64_t)n * sz )); +} + /* * Position input/output data streams before starting the copy. Device type * dependent. Seekable devices use lseek, and the rest position by reading. @@ -68,7 +97,7 @@ pos_in(void) /* If known to be seekable, try to seek on it. */ if (in.flags & ISSEEK) { errno = 0; - if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 && + if (lseek(in.fd, seek_offset(&in), SEEK_CUR) == -1 && errno != 0) err(1, "%s", in.name); return; @@ -136,7 +165,7 @@ pos_out(void) */ if (out.flags & (ISSEEK | ISPIPE)) { errno = 0; - if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) == -1 && + if (lseek(out.fd, seek_offset(&out), SEEK_CUR) == -1 && errno != 0) err(1, "%s", out.name); return; Modified: stable/11/bin/dd/tests/Makefile ============================================================================== --- stable/11/bin/dd/tests/Makefile Tue Jul 18 17:29:12 2017 (r321138) +++ stable/11/bin/dd/tests/Makefile Tue Jul 18 17:35:29 2017 (r321139) @@ -1,5 +1,6 @@ # $FreeBSD$ +ATF_TESTS_SH= dd2_test NETBSD_ATF_TESTS_SH= dd_test .include Copied and modified: stable/11/bin/dd/tests/dd2_test.sh (from r319339, head/bin/dd/tests/dd2_test.sh) ============================================================================== --- head/bin/dd/tests/dd2_test.sh Wed May 31 16:07:32 2017 (r319339, copy source) +++ stable/11/bin/dd/tests/dd2_test.sh Tue Jul 18 17:35:29 2017 (r321139) @@ -26,17 +26,35 @@ # $FreeBSD$ -atf_test_case seek_overflow -seek_overflow_head() { - atf_set "descr" "dd(1) should reject too-large seek values" +atf_test_case max_seek +max_seek_head() +{ + atf_set "descr" "dd(1) can seek by the maximum amount" } -seek_overflow_body() { +max_seek_body() +{ + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") + atf_skip "UFS's maximum file size is too small";; + "zfs") ;; # ZFS is fine + "tmpfs") + atf_skip "tmpfs can't create arbitrarily large spare files";; + *) atf_skip "Unknown file system";; + esac + touch f.in - # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek +} - # Negative tests +atf_test_case seek_overflow +seek_overflow_head() +{ + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() +{ + touch f.in seek=`echo "2^63 / 4096" | bc` atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ dd if=f.in of=f.out bs=4096 seek=$seek @@ -46,5 +64,6 @@ seek_overflow_body() { atf_init_test_cases() { - atf_add_test_case seek_overflow + atf_add_test_case max_seek + atf_add_test_case seek_overflow } From owner-svn-src-all@freebsd.org Tue Jul 18 17:36: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 EE30CD9AED7; Tue, 18 Jul 2017 17:36:26 +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 C87F47697B; Tue, 18 Jul 2017 17:36:26 +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 v6IHaP2U058214; Tue, 18 Jul 2017 17:36:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHaPGQ058210; Tue, 18 Jul 2017 17:36:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181736.v6IHaPGQ058210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:36: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: r321140 - in stable/10/bin/dd: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/bin/dd: . tests X-SVN-Commit-Revision: 321140 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:36:27 -0000 Author: ngie Date: Tue Jul 18 17:36:25 2017 New Revision: 321140 URL: https://svnweb.freebsd.org/changeset/base/321140 Log: MFC r302500,r319339,r319543,r319544,r319551,r321138: r302500 (by cem): dd(1): Enable access to SIZE_T_MAX character devices On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking character devices to negative off_t values. This enables dd(1) to interact with kernel KVA in /dev/kmem on amd64, for example. r319339 (by asomers): Fix integer overflow detection in dd dd(1) tried to detect whether the seek offset would overflow, but it failed to account for the case where the provided argument was negative and the file was a regular file (negative seeks are allowed for character devices). I fixed it, and added a regression test. CID: 1368659 r319543: Stylistic tweaks Move opening braces of functions from the last column to column 0. MFC with: r319339 r319544: Mark :seek_overflow as an expected failure MFC with: r319339 PR: 219757 r319551 (by asomers): Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large. PR: 219757 r321138: Remove unnecessary make logic added in r319339 This makes the change cleaner and easier to backport to ^/stable/10. Added: stable/10/bin/dd/tests/dd2_test.sh - copied, changed from r319339, head/bin/dd/tests/dd2_test.sh Modified: stable/10/bin/dd/args.c stable/10/bin/dd/position.c stable/10/bin/dd/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/args.c ============================================================================== --- stable/10/bin/dd/args.c Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/args.c Tue Jul 18 17:36:25 2017 (r321140) @@ -165,14 +165,6 @@ jcl(char **argv) errx(1, "cbs meaningless if not doing record operations"); } else cfunc = def; - - /* - * Bail out if the calculation of a file offset would overflow. - */ - if (in.offset > OFF_MAX / (ssize_t)in.dbsz || - out.offset > OFF_MAX / (ssize_t)out.dbsz) - errx(1, "seek offsets cannot be larger than %jd", - (intmax_t)OFF_MAX); } static int Modified: stable/10/bin/dd/position.c ============================================================================== --- stable/10/bin/dd/position.c Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/position.c Tue Jul 18 17:36:25 2017 (r321140) @@ -45,12 +45,41 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "dd.h" #include "extern.h" +static off_t +seek_offset(IO *io) +{ + off_t n; + size_t sz; + + n = io->offset; + sz = io->dbsz; + + _Static_assert(sizeof(io->offset) == sizeof(int64_t), "64-bit off_t"); + + /* + * If the lseek offset will be negative, verify that this is a special + * device file. Some such files (e.g. /dev/kmem) permit "negative" + * offsets. + * + * Bail out if the calculation of a file offset would overflow. + */ + if ((io->flags & ISCHR) == 0 && (n < 0 || n > OFF_MAX / (ssize_t)sz)) + errx(1, "seek offsets cannot be larger than %jd", + (intmax_t)OFF_MAX); + else if ((io->flags & ISCHR) != 0 && (uint64_t)n > UINT64_MAX / sz) + errx(1, "seek offsets cannot be larger than %ju", + (uintmax_t)UINT64_MAX); + + return ((off_t)( (uint64_t)n * sz )); +} + /* * Position input/output data streams before starting the copy. Device type * dependent. Seekable devices use lseek, and the rest position by reading. @@ -68,7 +97,7 @@ pos_in(void) /* If known to be seekable, try to seek on it. */ if (in.flags & ISSEEK) { errno = 0; - if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 && + if (lseek(in.fd, seek_offset(&in), SEEK_CUR) == -1 && errno != 0) err(1, "%s", in.name); return; @@ -136,7 +165,7 @@ pos_out(void) */ if (out.flags & (ISSEEK | ISPIPE)) { errno = 0; - if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) == -1 && + if (lseek(out.fd, seek_offset(&out), SEEK_CUR) == -1 && errno != 0) err(1, "%s", out.name); return; Modified: stable/10/bin/dd/tests/Makefile ============================================================================== --- stable/10/bin/dd/tests/Makefile Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/tests/Makefile Tue Jul 18 17:36:25 2017 (r321140) @@ -1,10 +1,6 @@ # $FreeBSD$ -OBJTOP= ${.OBJDIR:H:H:H} -SRCTOP= ${.CURDIR:H:H:H} -TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/dd -TESTSDIR= ${TESTSBASE}/bin/dd - +ATF_TESTS_SH= dd2_test NETBSD_ATF_TESTS_SH= dd_test .include Copied and modified: stable/10/bin/dd/tests/dd2_test.sh (from r319339, head/bin/dd/tests/dd2_test.sh) ============================================================================== --- head/bin/dd/tests/dd2_test.sh Wed May 31 16:07:32 2017 (r319339, copy source) +++ stable/10/bin/dd/tests/dd2_test.sh Tue Jul 18 17:36:25 2017 (r321140) @@ -26,17 +26,35 @@ # $FreeBSD$ -atf_test_case seek_overflow -seek_overflow_head() { - atf_set "descr" "dd(1) should reject too-large seek values" +atf_test_case max_seek +max_seek_head() +{ + atf_set "descr" "dd(1) can seek by the maximum amount" } -seek_overflow_body() { +max_seek_body() +{ + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") + atf_skip "UFS's maximum file size is too small";; + "zfs") ;; # ZFS is fine + "tmpfs") + atf_skip "tmpfs can't create arbitrarily large spare files";; + *) atf_skip "Unknown file system";; + esac + touch f.in - # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek +} - # Negative tests +atf_test_case seek_overflow +seek_overflow_head() +{ + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() +{ + touch f.in seek=`echo "2^63 / 4096" | bc` atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ dd if=f.in of=f.out bs=4096 seek=$seek @@ -46,5 +64,6 @@ seek_overflow_body() { atf_init_test_cases() { - atf_add_test_case seek_overflow + atf_add_test_case max_seek + atf_add_test_case seek_overflow } From owner-svn-src-all@freebsd.org Tue Jul 18 17: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 8B664D9B624; Tue, 18 Jul 2017 17:51:34 +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 665E8772C1; Tue, 18 Jul 2017 17:51:34 +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 v6IHpXO9064248; Tue, 18 Jul 2017 17:51:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHpX2X064246; Tue, 18 Jul 2017 17:51:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181751.v6IHpX2X064246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:51:33 +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: r321141 - in stable/10: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Commit-Revision: 321141 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:51:34 -0000 Author: ngie Date: Tue Jul 18 17:51:33 2017 New Revision: 321141 URL: https://svnweb.freebsd.org/changeset/base/321141 Log: MFC r316552,r319662: r316552: atf-c: fix documentation description for atf_utils_wait(3) atf_utils_wait(3) should be used in combination with atf_utils_fork(3), not itself (atf_utils_wait(3)). r319662: Add MLINKS for atf-sh(3) to each of the functions it implements This hopefully will make atf-sh(3) easier to understand for newcomers, without having to go through the atf-sh(3) level of indirection. Modified: stable/10/contrib/atf/atf-c/atf-c.3 stable/10/libexec/atf/atf-sh/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-c/atf-c.3 ============================================================================== --- stable/10/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:36:25 2017 (r321140) +++ stable/10/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:51:33 2017 (r321141) @@ -22,7 +22,7 @@ .\" 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. -.Dd March 6, 2017 +.Dd April 5, 2017 .Dt ATF-C 3 .Os .Sh NAME @@ -680,7 +680,7 @@ those spawned by .Fc .Bd -ragged -offset indent Waits and validates the result of a subprocess spawned with -.Fn atf_utils_wait . +.Fn atf_utils_fork . The validation involves checking that the subprocess exited cleanly and returned the code specified in .Fa expected_exit_status Modified: stable/10/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/10/libexec/atf/atf-sh/Makefile Tue Jul 18 17:36:25 2017 (r321140) +++ stable/10/libexec/atf/atf-sh/Makefile Tue Jul 18 17:51:33 2017 (r321141) @@ -33,7 +33,29 @@ ATF= ${SRCTOP}/contrib/atf PROG_CXX= atf-sh SRCS= atf-sh.cpp MAN= atf-sh.1 atf-sh.3 -MLINKS+= atf-sh.3 atf-sh-api.3 # Backwards compatibility. +# Backwards compatibility. +MLINKS+= atf-sh.3 atf-sh-api.3 + +MLINKS+= \ + atf-sh.3 atf_add_test_case.3 \ + atf-sh.3 atf_check.3 \ + atf-sh.3 atf_check_equal.3 \ + atf-sh.3 atf_config_get.3 \ + atf-sh.3 atf_config_has.3 \ + atf-sh.3 atf_expect_death.3 \ + atf-sh.3 atf_expect_exit.3 \ + atf-sh.3 atf_expect_fail.3 \ + atf-sh.3 atf_expect_pass.3 \ + atf-sh.3 atf_expect_signal.3 \ + atf-sh.3 atf_expect_timeout.3 \ + atf-sh.3 atf_fail.3 \ + atf-sh.3 atf_get.3 \ + atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_pass.3 \ + atf-sh.3 atf_require_prog.3 \ + atf-sh.3 atf_set.3 \ + atf-sh.3 atf_skip.3 \ + atf-sh.3 atf_test_case.3 CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -DATF_LIBEXECDIR='"${LIBEXECDIR}"' From owner-svn-src-all@freebsd.org Tue Jul 18 17:51: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 2ABEAD9B668; Tue, 18 Jul 2017 17:51:48 +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 B063F7737F; Tue, 18 Jul 2017 17:51:47 +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 v6IHpkSo064301; Tue, 18 Jul 2017 17:51:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHpkob064299; Tue, 18 Jul 2017 17:51:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181751.v6IHpkob064299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:51: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: r321142 - in stable/11: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Commit-Revision: 321142 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 17:51:48 -0000 Author: ngie Date: Tue Jul 18 17:51:46 2017 New Revision: 321142 URL: https://svnweb.freebsd.org/changeset/base/321142 Log: MFC r316552,r319662: r316552: atf-c: fix documentation description for atf_utils_wait(3) atf_utils_wait(3) should be used in combination with atf_utils_fork(3), not itself (atf_utils_wait(3)). r319662: Add MLINKS for atf-sh(3) to each of the functions it implements This hopefully will make atf-sh(3) easier to understand for newcomers, without having to go through the atf-sh(3) level of indirection. Modified: stable/11/contrib/atf/atf-c/atf-c.3 stable/11/libexec/atf/atf-sh/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/atf/atf-c/atf-c.3 ============================================================================== --- stable/11/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:51:33 2017 (r321141) +++ stable/11/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:51:46 2017 (r321142) @@ -22,7 +22,7 @@ .\" 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. -.Dd March 6, 2017 +.Dd April 5, 2017 .Dt ATF-C 3 .Os .Sh NAME @@ -680,7 +680,7 @@ those spawned by .Fc .Bd -ragged -offset indent Waits and validates the result of a subprocess spawned with -.Fn atf_utils_wait . +.Fn atf_utils_fork . The validation involves checking that the subprocess exited cleanly and returned the code specified in .Fa expected_exit_status Modified: stable/11/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/11/libexec/atf/atf-sh/Makefile Tue Jul 18 17:51:33 2017 (r321141) +++ stable/11/libexec/atf/atf-sh/Makefile Tue Jul 18 17:51:46 2017 (r321142) @@ -34,7 +34,29 @@ ATF= ${SRCTOP}/contrib/atf PROG_CXX= atf-sh SRCS= atf-sh.cpp MAN= atf-sh.1 atf-sh.3 -MLINKS+= atf-sh.3 atf-sh-api.3 # Backwards compatibility. +# Backwards compatibility. +MLINKS+= atf-sh.3 atf-sh-api.3 + +MLINKS+= \ + atf-sh.3 atf_add_test_case.3 \ + atf-sh.3 atf_check.3 \ + atf-sh.3 atf_check_equal.3 \ + atf-sh.3 atf_config_get.3 \ + atf-sh.3 atf_config_has.3 \ + atf-sh.3 atf_expect_death.3 \ + atf-sh.3 atf_expect_exit.3 \ + atf-sh.3 atf_expect_fail.3 \ + atf-sh.3 atf_expect_pass.3 \ + atf-sh.3 atf_expect_signal.3 \ + atf-sh.3 atf_expect_timeout.3 \ + atf-sh.3 atf_fail.3 \ + atf-sh.3 atf_get.3 \ + atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_pass.3 \ + atf-sh.3 atf_require_prog.3 \ + atf-sh.3 atf_set.3 \ + atf-sh.3 atf_skip.3 \ + atf-sh.3 atf_test_case.3 CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -DATF_LIBEXECDIR='"${LIBEXECDIR}"' From owner-svn-src-all@freebsd.org Tue Jul 18 18:09: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 A7F58D9BFD7; Tue, 18 Jul 2017 18:09:17 +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 7F1067CD68; Tue, 18 Jul 2017 18:09:17 +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 v6II9GuC073202; Tue, 18 Jul 2017 18:09:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6II9GUJ073199; Tue, 18 Jul 2017 18:09:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181809.v6II9GUJ073199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321143 - stable/11/lib/libc/tests/nss X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/tests/nss X-SVN-Commit-Revision: 321143 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:09:17 -0000 Author: ngie Date: Tue Jul 18 18:09:16 2017 New Revision: 321143 URL: https://svnweb.freebsd.org/changeset/base/321143 Log: MFC r319048,r319049,r319051,r319054: r319048: Push `snapshot_file` copying down into run_tests function, and mark snapshot_file const char *. This fixes a bogus set of errors from gcc about strdup not being allowed a NULL argument. r319049: Bump WARNS from 1 to 3 after recent commits to fix warnings in the directory. Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0 r319051: hostent_test_getnameinfo_eq(..): initialize found_a_host to false CID: 1368943 r319054: hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done This plugs a leak of memory allocated via getaddrinfo. CID: 1346866 Modified: stable/11/lib/libc/tests/nss/Makefile stable/11/lib/libc/tests/nss/getaddrinfo_test.c stable/11/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/nss/Makefile ============================================================================== --- stable/11/lib/libc/tests/nss/Makefile Tue Jul 18 17:51:46 2017 (r321142) +++ stable/11/lib/libc/tests/nss/Makefile Tue Jul 18 18:09:16 2017 (r321143) @@ -20,7 +20,7 @@ ATF_TESTS_C+= getusershell_test ${PACKAGE}FILES+= mach -WARNS?= 1 +WARNS?= 3 CFLAGS+= -I${SRCTOP}/tests Modified: stable/11/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- stable/11/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 17:51:46 2017 (r321142) +++ stable/11/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 18:09:16 2017 (r321143) @@ -410,11 +410,19 @@ addrinfo_read_hostlist_func(struct addrinfo *ai, char } static void -run_tests(char *hostlist_file, char *snapshot_file, int ai_family) +run_tests(char *hostlist_file, const char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; + char *snapshot_file_copy; int rv; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = ai_family; hints.ai_flags = AI_CANONNAME; @@ -477,24 +485,17 @@ fin: TEST_DATA_DESTROY(addrinfo, &td_snap); TEST_DATA_DESTROY(addrinfo, &td); - free(hostlist_file); - free(snapshot_file); + free(snapshot_file_copy); } #define HOSTLIST_FILE "mach" #define RUN_TESTS(tc, snapshot_file, ai_family) do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - run_tests(_hostlist_file, _snapshot_file, ai_family); \ -} while(0) + run_tests(_hostlist_file, snapshot_file, ai_family); \ + free(_hostlist_file); \ +} while (0) ATF_TC_WITHOUT_HEAD(pf_unspec); ATF_TC_BODY(pf_unspec, tc) Modified: stable/11/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- stable/11/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 17:51:46 2017 (r321142) +++ stable/11/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 18:09:16 2017 (r321143) @@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void * rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv == 0) { printf("not ok - shouldn't have been resolved\n"); - return (-1); - } + rv = -1; + } else + rv = 0; } else { rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv != 0) { printf("not ok - should have been resolved\n"); - return (-1); + rv = -1; + goto done; } - rv = is_hostent_equal(he, ai); if (rv != 0) { printf("not ok - addrinfo and hostent are not equal\n"); - return (-1); + rv = -1; } - } - - return (0); +done: + if (ai != NULL) + freeaddrinfo(ai); + return (rv); } static int @@ -884,7 +886,7 @@ hostent_test_getnameinfo_eq(struct hostent *he, void * * An address might reverse resolve to hostname alias or the * official hostname, e.g. moon.vub.ac.be. */ - bool found_a_match; + bool found_a_match = false; if (strcmp(result->h_name, buffer) == 0) { found_a_match = true; @@ -924,10 +926,19 @@ static int run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type, enum test_methods method, bool use_ipv6_mapping) { + char *snapshot_file_copy; struct hostent_test_data td, td_addr, td_snap; res_state statp; int rv = -2; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + snapshot_file = snapshot_file_copy; + switch (_af_type) { case AF_INET: ATF_REQUIRE_FEATURE("inet"); @@ -946,8 +957,8 @@ run_tests(const char *hostlist_file, const char *snaps if (statp == NULL || ((statp->options & RES_INIT) == 0 && res_ninit(statp) == -1)) { printf("error: can't init res_state\n"); - - return (-1); + rv = -1; + goto fin2; } if (use_ipv6_mapping) @@ -1051,6 +1062,9 @@ fin: TEST_DATA_DESTROY(hostent, &td_addr); TEST_DATA_DESTROY(hostent, &td); +fin2: + free(snapshot_file_copy); + return (rv); } @@ -1059,30 +1073,24 @@ fin: #define _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - ATF_REQUIRE(run_tests(_hostlist_file, _snapshot_file, af_type, \ + ATF_REQUIRE(run_tests(_hostlist_file, snapshot_file, af_type, \ method, use_ipv6_mapping) == 0); \ -} while(0) + free(_hostlist_file); \ +} while (0) #define RUN_HOST_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = false; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) #define RUN_IPNODE_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = true; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) ATF_TC_WITHOUT_HEAD(gethostbyaddr_ipv4); ATF_TC_BODY(gethostbyaddr_ipv4, tc) From owner-svn-src-all@freebsd.org Tue Jul 18 18:09: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 BB6E2D9C028; Tue, 18 Jul 2017 18:09:27 +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 7EA887CDDE; Tue, 18 Jul 2017 18:09:27 +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 v6II9QT3073254; Tue, 18 Jul 2017 18:09:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6II9Q5e073251; Tue, 18 Jul 2017 18:09:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181809.v6II9Q5e073251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:09:26 +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: r321144 - stable/10/lib/libc/tests/nss X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/tests/nss X-SVN-Commit-Revision: 321144 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:09:27 -0000 Author: ngie Date: Tue Jul 18 18:09:26 2017 New Revision: 321144 URL: https://svnweb.freebsd.org/changeset/base/321144 Log: MFC r319048,r319049,r319051,r319054: r319048: Push `snapshot_file` copying down into run_tests function, and mark snapshot_file const char *. This fixes a bogus set of errors from gcc about strdup not being allowed a NULL argument. r319049: Bump WARNS from 1 to 3 after recent commits to fix warnings in the directory. Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0 r319051: hostent_test_getnameinfo_eq(..): initialize found_a_host to false CID: 1368943 r319054: hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done This plugs a leak of memory allocated via getaddrinfo. CID: 1346866 Modified: stable/10/lib/libc/tests/nss/Makefile stable/10/lib/libc/tests/nss/getaddrinfo_test.c stable/10/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/nss/Makefile ============================================================================== --- stable/10/lib/libc/tests/nss/Makefile Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/Makefile Tue Jul 18 18:09:26 2017 (r321144) @@ -18,7 +18,7 @@ ATF_TESTS_C+= getusershell_test FILES+= mach -WARNS?= 1 +WARNS?= 3 CFLAGS+= -I${SRCTOP}/tests Modified: stable/10/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 18:09:26 2017 (r321144) @@ -410,11 +410,19 @@ addrinfo_read_hostlist_func(struct addrinfo *ai, char } static void -run_tests(char *hostlist_file, char *snapshot_file, int ai_family) +run_tests(char *hostlist_file, const char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; + char *snapshot_file_copy; int rv; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = ai_family; hints.ai_flags = AI_CANONNAME; @@ -477,24 +485,17 @@ fin: TEST_DATA_DESTROY(addrinfo, &td_snap); TEST_DATA_DESTROY(addrinfo, &td); - free(hostlist_file); - free(snapshot_file); + free(snapshot_file_copy); } #define HOSTLIST_FILE "mach" #define RUN_TESTS(tc, snapshot_file, ai_family) do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - run_tests(_hostlist_file, _snapshot_file, ai_family); \ -} while(0) + run_tests(_hostlist_file, snapshot_file, ai_family); \ + free(_hostlist_file); \ +} while (0) ATF_TC_WITHOUT_HEAD(pf_unspec); ATF_TC_BODY(pf_unspec, tc) Modified: stable/10/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 18:09:26 2017 (r321144) @@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void * rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv == 0) { printf("not ok - shouldn't have been resolved\n"); - return (-1); - } + rv = -1; + } else + rv = 0; } else { rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv != 0) { printf("not ok - should have been resolved\n"); - return (-1); + rv = -1; + goto done; } - rv = is_hostent_equal(he, ai); if (rv != 0) { printf("not ok - addrinfo and hostent are not equal\n"); - return (-1); + rv = -1; } - } - - return (0); +done: + if (ai != NULL) + freeaddrinfo(ai); + return (rv); } static int @@ -884,7 +886,7 @@ hostent_test_getnameinfo_eq(struct hostent *he, void * * An address might reverse resolve to hostname alias or the * official hostname, e.g. moon.vub.ac.be. */ - bool found_a_match; + bool found_a_match = false; if (strcmp(result->h_name, buffer) == 0) { found_a_match = true; @@ -924,10 +926,19 @@ static int run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type, enum test_methods method, bool use_ipv6_mapping) { + char *snapshot_file_copy; struct hostent_test_data td, td_addr, td_snap; res_state statp; int rv = -2; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + snapshot_file = snapshot_file_copy; + switch (_af_type) { case AF_INET: ATF_REQUIRE_FEATURE("inet"); @@ -946,8 +957,8 @@ run_tests(const char *hostlist_file, const char *snaps if (statp == NULL || ((statp->options & RES_INIT) == 0 && res_ninit(statp) == -1)) { printf("error: can't init res_state\n"); - - return (-1); + rv = -1; + goto fin2; } if (use_ipv6_mapping) @@ -1051,6 +1062,9 @@ fin: TEST_DATA_DESTROY(hostent, &td_addr); TEST_DATA_DESTROY(hostent, &td); +fin2: + free(snapshot_file_copy); + return (rv); } @@ -1059,30 +1073,24 @@ fin: #define _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - ATF_REQUIRE(run_tests(_hostlist_file, _snapshot_file, af_type, \ + ATF_REQUIRE(run_tests(_hostlist_file, snapshot_file, af_type, \ method, use_ipv6_mapping) == 0); \ -} while(0) + free(_hostlist_file); \ +} while (0) #define RUN_HOST_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = false; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) #define RUN_IPNODE_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = true; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) ATF_TC_WITHOUT_HEAD(gethostbyaddr_ipv4); ATF_TC_BODY(gethostbyaddr_ipv4, tc) From owner-svn-src-all@freebsd.org Tue Jul 18 18:15: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 33D61D9C24C; Tue, 18 Jul 2017 18:15:30 +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 030FC7D2B8; Tue, 18 Jul 2017 18:15: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 v6IIFTP2077724; Tue, 18 Jul 2017 18:15:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIFSoX077718; Tue, 18 Jul 2017 18:15:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181815.v6IIFSoX077718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321145 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 321145 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:15:30 -0000 Author: ngie Date: Tue Jul 18 18:15:28 2017 New Revision: 321145 URL: https://svnweb.freebsd.org/changeset/base/321145 Log: MFC r318715,r318717,r318718,r318719,r318720,r318721: r318715: _umtx_op(2): fix minor manlint issues - Sort .Xr entries in SEE ALSO section. - Sort SEE ALSO and STANDARDS sections properly, in terms of the entire document. r318717: cap_enter(2): fix manlint issues - Sort SEE ALSO section appropriately. - Correct section for sysctl(9). r318718: rctl_add_rule(2): fix manlint warnings - Fix commas (either missing or misused) after .Nm entries in SYNOPSIS r318719: open(2): fix manlint warnings - Sort SEE ALSO .Xr entries. - Sort sections (HISTORY comes after STANDARDS). r318720: ptrace(2): clean up trailing whitespace r318721: kill(2): add missing section for sysctl(9) Modified: stable/11/lib/libc/sys/_umtx_op.2 stable/11/lib/libc/sys/cap_enter.2 stable/11/lib/libc/sys/kill.2 stable/11/lib/libc/sys/open.2 stable/11/lib/libc/sys/ptrace.2 stable/11/lib/libc/sys/rctl_add_rule.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/_umtx_op.2 ============================================================================== --- stable/11/lib/libc/sys/_umtx_op.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/_umtx_op.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 29, 2016 +.Dd May 23, 2017 .Dt _UMTX_OP 2 .Os .Sh NAME @@ -1382,32 +1382,11 @@ Mutex lock requests without timeout specified are rest The error is not returned to userspace code since restart is handled by usual adjustment of the instruction counter. .El -.Sh BUGS -A window between a unlocking robust mutex and resetting the pointer in the -.Dv robust_inact_offset -member of the registered -.Vt struct umtx_robust_lists_params -allows another thread to destroy the mutex, thus making the kernel inspect -freed or reused memory. -The -.Li libthr -implementation is only vulnerable to this race when operating on -a shared mutex. -A possible fix for the current implementation is to strengthen the checks -for shared mutexes before terminating them, in particular, verifying -that the mutex memory is mapped from a shared memory object allocated -by the -.Dv UMTX_OP_SHM -request. -This is not done because it is believed that the race is adequately -covered by other consistency checks, while adding the check would -prevent alternative implementations of -.Li libpthread . .Sh SEE ALSO .Xr clock_gettime 2 , .Xr mmap 2 , -.Xr shm_open 2 , .Xr setrlimit 2 , +.Xr shm_open 2 , .Xr sigaction 2 , .Xr thr_exit 2 , .Xr thr_kill 2 , @@ -1425,3 +1404,24 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh BUGS +A window between a unlocking robust mutex and resetting the pointer in the +.Dv robust_inact_offset +member of the registered +.Vt struct umtx_robust_lists_params +allows another thread to destroy the mutex, thus making the kernel inspect +freed or reused memory. +The +.Li libthr +implementation is only vulnerable to this race when operating on +a shared mutex. +A possible fix for the current implementation is to strengthen the checks +for shared mutexes before terminating them, in particular, verifying +that the mutex memory is mapped from a shared memory object allocated +by the +.Dv UMTX_OP_SHM +request. +This is not done because it is believed that the race is adequately +covered by other consistency checks, while adding the check would +prevent alternative implementations of +.Li libpthread . Modified: stable/11/lib/libc/sys/cap_enter.2 ============================================================================== --- stable/11/lib/libc/sys/cap_enter.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/cap_enter.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2016 +.Dd May 23, 2017 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -139,11 +139,11 @@ points outside the process's allocated address space. .Xr cap_fcntls_limit 2 , .Xr cap_ioctls_limit 2 , .Xr cap_rights_limit 2 , -.Xr procctl 2 , -.Xr sysctl 2 , .Xr fexecve 2 , +.Xr procctl 2 , .Xr cap_sandboxed 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr sysctl 9 .Sh HISTORY Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Modified: stable/11/lib/libc/sys/kill.2 ============================================================================== --- stable/11/lib/libc/sys/kill.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/kill.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -71,7 +71,7 @@ A single exception is the signal SIGCONT, which may al to any process with the same session ID as the sender. In addition, if the .Va security.bsd.conservative_signals -.Xr sysctl +.Xr sysctl 9 is set to 1, the user is not a super-user, and the receiver is set-uid, then only job control and terminal control signals may Modified: stable/11/lib/libc/sys/open.2 ============================================================================== --- stable/11/lib/libc/sys/open.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/open.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -471,16 +471,8 @@ is specified and the file is not a directory. .Xr read 2 , .Xr umask 2 , .Xr write 2 , -.Xr fopen 3 -.Sh HISTORY -The -.Fn open -function appeared in -.At v6 . -The -.Fn openat -function was introduced in -.Fx 8.0 . +.Xr fopen 3 , +.Xr capsicum 4 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -497,6 +489,15 @@ when is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in one of its non-final components. +.Sh HISTORY +The +.Fn open +function appeared in +.At v6 . +The +.Fn openat +function was introduced in +.Fx 8.0 . .Sh BUGS The Open Group Extended API Set 2 specification requires that the test for whether Modified: stable/11/lib/libc/sys/ptrace.2 ============================================================================== --- stable/11/lib/libc/sys/ptrace.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/ptrace.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -166,7 +166,7 @@ new child processes will execute without tracing enabl This event flag controls tracing of LWP .Pq kernel thread creation and destruction. -When this event is enabled, +When this event is enabled, new LWPs will stop and report an event with .Dv PL_FLAG_BORN set before executing their first instruction, @@ -215,7 +215,7 @@ or includes only .Dv PTRACE_EXEC events. -All other event flags are disabled. +All other event flags are disabled. .Pp The .Fa request Modified: stable/11/lib/libc/sys/rctl_add_rule.2 ============================================================================== --- stable/11/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:09:26 2017 (r321144) +++ stable/11/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:15:28 2017 (r321145) @@ -28,10 +28,10 @@ .Dt RCTL_ADD_RULE 2 .Os .Sh NAME -.Nm rctl_add_rule, -.Nm rctl_get_limits -.Nm rctl_get_racct, -.Nm rctl_get_rules, +.Nm rctl_add_rule , +.Nm rctl_get_limits , +.Nm rctl_get_racct , +.Nm rctl_get_rules , .Nm rctl_remove_rule .Nd manipulate and query the resource limits database .Sh LIBRARY From owner-svn-src-all@freebsd.org Tue Jul 18 18:15: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 4C3B1D9C2D3; Tue, 18 Jul 2017 18:15:47 +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 27A0B7D3B8; Tue, 18 Jul 2017 18:15:47 +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 v6IIFkWA077784; Tue, 18 Jul 2017 18:15:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIFjjo077780; Tue, 18 Jul 2017 18:15:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181815.v6IIFjjo077780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:15:45 +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: r321146 - stable/10/lib/libc/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/sys X-SVN-Commit-Revision: 321146 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:15:47 -0000 Author: ngie Date: Tue Jul 18 18:15:45 2017 New Revision: 321146 URL: https://svnweb.freebsd.org/changeset/base/321146 Log: MFC r318718,r318719,r318720,r318721: r318718: rctl_add_rule(2): fix manlint warnings - Fix commas (either missing or misused) after .Nm entries in SYNOPSIS r318719: open(2): fix manlint warnings - Sort SEE ALSO .Xr entries. - Sort sections (HISTORY comes after STANDARDS). r318720: ptrace(2): clean up trailing whitespace r318721: kill(2): add missing section for sysctl(9) Modified: stable/10/lib/libc/sys/kill.2 stable/10/lib/libc/sys/open.2 stable/10/lib/libc/sys/ptrace.2 stable/10/lib/libc/sys/rctl_add_rule.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kill.2 ============================================================================== --- stable/10/lib/libc/sys/kill.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/kill.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -71,7 +71,7 @@ A single exception is the signal SIGCONT, which may al to any process with the same session ID as the sender. In addition, if the .Va security.bsd.conservative_signals -.Xr sysctl +.Xr sysctl 9 is set to 1, the user is not a super-user, and the receiver is set-uid, then only job control and terminal control signals may Modified: stable/10/lib/libc/sys/open.2 ============================================================================== --- stable/10/lib/libc/sys/open.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/open.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -461,16 +461,8 @@ is specified and the file is not a directory. .Xr read 2 , .Xr umask 2 , .Xr write 2 , -.Xr fopen 3 -.Sh HISTORY -The -.Fn open -function appeared in -.At v6 . -The -.Fn openat -function was introduced in -.Fx 8.0 . +.Xr fopen 3 , +.Xr capsicum 4 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -487,6 +479,15 @@ when is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in one of its non-final components. +.Sh HISTORY +The +.Fn open +function appeared in +.At v6 . +The +.Fn openat +function was introduced in +.Fx 8.0 . .Sh BUGS The Open Group Extended API Set 2 specification requires that the test for whether Modified: stable/10/lib/libc/sys/ptrace.2 ============================================================================== --- stable/10/lib/libc/sys/ptrace.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/ptrace.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -166,7 +166,7 @@ new child processes will execute without tracing enabl This event flag controls tracing of LWP .Pq kernel thread creation and destruction. -When this event is enabled, +When this event is enabled, new LWPs will stop and report an event with .Dv PL_FLAG_BORN set before executing their first instruction, @@ -215,7 +215,7 @@ or includes only .Dv PTRACE_EXEC events. -All other event flags are disabled. +All other event flags are disabled. .Pp The .Fa request Modified: stable/10/lib/libc/sys/rctl_add_rule.2 ============================================================================== --- stable/10/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -28,10 +28,10 @@ .Dt RCTL_ADD_RULE 2 .Os .Sh NAME -.Nm rctl_add_rule, -.Nm rctl_get_limits -.Nm rctl_get_racct, -.Nm rctl_get_rules, +.Nm rctl_add_rule , +.Nm rctl_get_limits , +.Nm rctl_get_racct , +.Nm rctl_get_rules , .Nm rctl_remove_rule .Nd manipulate and query the resource limits database .Sh LIBRARY From owner-svn-src-all@freebsd.org Tue Jul 18 18:20: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 00944D9C3C2; Tue, 18 Jul 2017 18:20:58 +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 C3AA27D5D2; Tue, 18 Jul 2017 18:20:57 +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 v6IIKvYY080261; Tue, 18 Jul 2017 18:20:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIKv6i080260; Tue, 18 Jul 2017 18:20:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181820.v6IIKv6i080260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:20: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: r321147 - stable/11/lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/stdlib X-SVN-Commit-Revision: 321147 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:20:58 -0000 Author: ngie Date: Tue Jul 18 18:20:56 2017 New Revision: 321147 URL: https://svnweb.freebsd.org/changeset/base/321147 Log: MFC r318710: quick_exit(3): delete trailing whitespace in licensing tort Modified: stable/11/lib/libc/stdlib/quick_exit.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdlib/quick_exit.3 ============================================================================== --- stable/11/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:15:45 2017 (r321146) +++ stable/11/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:20:56 2017 (r321147) @@ -1,6 +1,6 @@ .\" Copyright (c) 2011 David Chisnall .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -9,7 +9,7 @@ .\" 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 @@ -21,7 +21,7 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.\" +.\" .\" $FreeBSD$ .\" .Dd December 13, 2014 From owner-svn-src-all@freebsd.org Tue Jul 18 18:21: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 E6996D9C3E1; Tue, 18 Jul 2017 18:21:01 +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 B12A07D5DF; Tue, 18 Jul 2017 18:21:01 +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 v6IIL0Y3080315; Tue, 18 Jul 2017 18:21:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIL0iG080314; Tue, 18 Jul 2017 18:21:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181821.v6IIL0iG080314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:21:00 +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: r321148 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/stdlib X-SVN-Commit-Revision: 321148 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:21:02 -0000 Author: ngie Date: Tue Jul 18 18:21:00 2017 New Revision: 321148 URL: https://svnweb.freebsd.org/changeset/base/321148 Log: MFC r318710: quick_exit(3): delete trailing whitespace in licensing tort Modified: stable/10/lib/libc/stdlib/quick_exit.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/quick_exit.3 ============================================================================== --- stable/10/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:20:56 2017 (r321147) +++ stable/10/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:21:00 2017 (r321148) @@ -1,6 +1,6 @@ .\" Copyright (c) 2011 David Chisnall .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -9,7 +9,7 @@ .\" 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 @@ -21,7 +21,7 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.\" +.\" .\" $FreeBSD$ .\" .Dd December 13, 2014 From owner-svn-src-all@freebsd.org Tue Jul 18 18:23: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 7A09ED9C648; Tue, 18 Jul 2017 18:23:55 +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 40D8C7DA53; Tue, 18 Jul 2017 18:23:55 +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 v6IINsxw081943; Tue, 18 Jul 2017 18:23:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IINsFw081939; Tue, 18 Jul 2017 18:23:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181823.v6IINsFw081939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:23: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: r321149 - stable/10/lib/libc/posix1e X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/posix1e X-SVN-Commit-Revision: 321149 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:23:55 -0000 Author: ngie Date: Tue Jul 18 18:23:54 2017 New Revision: 321149 URL: https://svnweb.freebsd.org/changeset/base/321149 Log: MFC r318704,r318708,r318709: r318704: posix1e(3): reference using the section (3) when referencing libbsm with .Xr r318708: acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS r318709: acl_to_text(3): start sentences on new lines Modified: stable/10/lib/libc/posix1e/acl_create_entry.3 stable/10/lib/libc/posix1e/acl_to_text.3 stable/10/lib/libc/posix1e/posix1e.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/posix1e/acl_create_entry.3 ============================================================================== --- stable/10/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -29,7 +29,7 @@ .Dt ACL_CREATE_ENTRY 3 .Os .Sh NAME -.Nm acl_create_entry +.Nm acl_create_entry , .Nm acl_create_entry_np .Nd create a new ACL entry .Sh LIBRARY Modified: stable/10/lib/libc/posix1e/acl_to_text.3 ============================================================================== --- stable/10/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -58,8 +58,9 @@ including the NULL terminator) in the location pointed .Va len_p . If the ACL is POSIX.1e, the format of the text string returned by .Fn acl_to_text -shall be the POSIX.1e long ACL form. If the ACL is NFSv4, the format -of the text string shall be the compact form, unless the +shall be the POSIX.1e long ACL form. +If the ACL is NFSv4, the format of the text string shall be the compact form, unless +the .Va ACL_TEXT_VERBOSE flag is given. .Pp Modified: stable/10/lib/libc/posix1e/posix1e.3 ============================================================================== --- stable/10/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -63,7 +63,7 @@ flow label APIs. However, .Fx does implement the -.Xr libbsm +.Xr libbsm 3 audit API. It also provides .Xr capsicum 4 , From owner-svn-src-all@freebsd.org Tue Jul 18 18:23: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 E6E1ED9C64F; Tue, 18 Jul 2017 18:23:57 +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 B3BAA7DA54; Tue, 18 Jul 2017 18:23:57 +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 v6IINufw081992; Tue, 18 Jul 2017 18:23:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IINuNi081989; Tue, 18 Jul 2017 18:23:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181823.v6IINuNi081989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:23: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: r321150 - stable/11/lib/libc/posix1e X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/posix1e X-SVN-Commit-Revision: 321150 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:23:58 -0000 Author: ngie Date: Tue Jul 18 18:23:56 2017 New Revision: 321150 URL: https://svnweb.freebsd.org/changeset/base/321150 Log: MFC r318704,r318708,r318709: r318704: posix1e(3): reference using the section (3) when referencing libbsm with .Xr r318708: acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS r318709: acl_to_text(3): start sentences on new lines Modified: stable/11/lib/libc/posix1e/acl_create_entry.3 stable/11/lib/libc/posix1e/acl_to_text.3 stable/11/lib/libc/posix1e/posix1e.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/posix1e/acl_create_entry.3 ============================================================================== --- stable/11/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:23:54 2017 (r321149) +++ stable/11/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:23:56 2017 (r321150) @@ -29,7 +29,7 @@ .Dt ACL_CREATE_ENTRY 3 .Os .Sh NAME -.Nm acl_create_entry +.Nm acl_create_entry , .Nm acl_create_entry_np .Nd create a new ACL entry .Sh LIBRARY Modified: stable/11/lib/libc/posix1e/acl_to_text.3 ============================================================================== --- stable/11/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:23:54 2017 (r321149) +++ stable/11/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:23:56 2017 (r321150) @@ -58,8 +58,9 @@ including the NULL terminator) in the location pointed .Va len_p . If the ACL is POSIX.1e, the format of the text string returned by .Fn acl_to_text -shall be the POSIX.1e long ACL form. If the ACL is NFSv4, the format -of the text string shall be the compact form, unless the +shall be the POSIX.1e long ACL form. +If the ACL is NFSv4, the format of the text string shall be the compact form, unless +the .Va ACL_TEXT_VERBOSE flag is given. .Pp Modified: stable/11/lib/libc/posix1e/posix1e.3 ============================================================================== --- stable/11/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:23:54 2017 (r321149) +++ stable/11/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:23:56 2017 (r321150) @@ -63,7 +63,7 @@ flow label APIs. However, .Fx does implement the -.Xr libbsm +.Xr libbsm 3 audit API. It also provides .Xr capsicum 4 , From owner-svn-src-all@freebsd.org Tue Jul 18 18:33:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5FDD9CA0E; Tue, 18 Jul 2017 18:33:06 +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 1A3157DF80; Tue, 18 Jul 2017 18:33:06 +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 v6IIX5r8085898; Tue, 18 Jul 2017 18:33:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIX59D085897; Tue, 18 Jul 2017 18:33:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181833.v6IIX59D085897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:33:05 +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: r321151 - stable/10/usr.bin/getconf X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/getconf X-SVN-Commit-Revision: 321151 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:33:06 -0000 Author: ngie Date: Tue Jul 18 18:33:05 2017 New Revision: 321151 URL: https://svnweb.freebsd.org/changeset/base/321151 Log: MFC r318280: getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro Modified: stable/10/usr.bin/getconf/fake-gperf.awk Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/getconf/fake-gperf.awk ============================================================================== --- stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:23:56 2017 (r321150) +++ stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:05 2017 (r321151) @@ -36,7 +36,8 @@ state == 1 { print; next; } state = 3; print "\t{ NULL, 0, 0 }"; print "};"; - print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)"; + print "#include "; + print "#define\tNWORDS\t(nitems(wordlist) - 1)"; print "static const struct map *"; print "in_word_set(const char *word)"; print "{"; From owner-svn-src-all@freebsd.org Tue Jul 18 18:33: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 A20AED9CA23; Tue, 18 Jul 2017 18:33:08 +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 7104B7DF86; Tue, 18 Jul 2017 18:33: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 v6IIX7rs085946; Tue, 18 Jul 2017 18:33:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIX73Z085945; Tue, 18 Jul 2017 18:33:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181833.v6IIX73Z085945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18: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: r321152 - stable/11/usr.bin/getconf X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/getconf X-SVN-Commit-Revision: 321152 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:33:08 -0000 Author: ngie Date: Tue Jul 18 18:33:07 2017 New Revision: 321152 URL: https://svnweb.freebsd.org/changeset/base/321152 Log: MFC r318280: getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro Modified: stable/11/usr.bin/getconf/fake-gperf.awk Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getconf/fake-gperf.awk ============================================================================== --- stable/11/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:05 2017 (r321151) +++ stable/11/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:07 2017 (r321152) @@ -36,7 +36,8 @@ state == 1 { print; next; } state = 3; print "\t{ NULL, 0, 0 }"; print "};"; - print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)"; + print "#include "; + print "#define\tNWORDS\t(nitems(wordlist) - 1)"; print "static const struct map *"; print "in_word_set(const char *word)"; print "{"; From owner-svn-src-all@freebsd.org Tue Jul 18 18:34: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 2EB1ED9CAF6; Tue, 18 Jul 2017 18:34:11 +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 EFF6A7E1F0; Tue, 18 Jul 2017 18:34:10 +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 v6IIYAhJ086078; Tue, 18 Jul 2017 18:34:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIYAob086077; Tue, 18 Jul 2017 18:34:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181834.v6IIYAob086077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:34: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: r321153 - stable/11/lib/libc/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/net X-SVN-Commit-Revision: 321153 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:34:11 -0000 Author: ngie Date: Tue Jul 18 18:34:09 2017 New Revision: 321153 URL: https://svnweb.freebsd.org/changeset/base/321153 Log: MFC r318707: sctp_send(3): start sentences on new lines Modified: stable/11/lib/libc/net/sctp_send.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/sctp_send.3 ============================================================================== --- stable/11/lib/libc/net/sctp_send.3 Tue Jul 18 18:33:07 2017 (r321152) +++ stable/11/lib/libc/net/sctp_send.3 Tue Jul 18 18:34:09 2017 (r321153) @@ -105,8 +105,8 @@ struct sctp_sndrcvinfo { The .Fa sinfo->sinfo_ppid argument is an opaque 32 bit value that is passed transparently -through the stack to the peer endpoint. It will be available on -reception of a message (see +through the stack to the peer endpoint. +It will be available on reception of a message (see .Xr sctp_recvmsg 3 ) . Note that the stack passes this value without regard to byte order. From owner-svn-src-all@freebsd.org Tue Jul 18 18:34: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 992B8D9CB3E; Tue, 18 Jul 2017 18:34:17 +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 665907E214; Tue, 18 Jul 2017 18:34:17 +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 v6IIYGRt086126; Tue, 18 Jul 2017 18:34:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIYGrH086125; Tue, 18 Jul 2017 18:34:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181834.v6IIYGrH086125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321154 - stable/10/lib/libc/net X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/net X-SVN-Commit-Revision: 321154 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:34:17 -0000 Author: ngie Date: Tue Jul 18 18:34:16 2017 New Revision: 321154 URL: https://svnweb.freebsd.org/changeset/base/321154 Log: MFC r318707: sctp_send(3): start sentences on new lines Modified: stable/10/lib/libc/net/sctp_send.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_send.3 ============================================================================== --- stable/10/lib/libc/net/sctp_send.3 Tue Jul 18 18:34:09 2017 (r321153) +++ stable/10/lib/libc/net/sctp_send.3 Tue Jul 18 18:34:16 2017 (r321154) @@ -105,8 +105,8 @@ struct sctp_sndrcvinfo { The .Fa sinfo->sinfo_ppid argument is an opaque 32 bit value that is passed transparently -through the stack to the peer endpoint. It will be available on -reception of a message (see +through the stack to the peer endpoint. +It will be available on reception of a message (see .Xr sctp_recvmsg 3 ) . Note that the stack passes this value without regard to byte order. From owner-svn-src-all@freebsd.org Tue Jul 18 18:35: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 DEC9AD9CC05; Tue, 18 Jul 2017 18:35:42 +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 ABE197E460; Tue, 18 Jul 2017 18:35:42 +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 v6IIZfr8086290; Tue, 18 Jul 2017 18:35:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIZfHI086289; Tue, 18 Jul 2017 18:35:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181835.v6IIZfHI086289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:35:41 +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: r321155 - stable/10/lib/libc/iconv X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/iconv X-SVN-Commit-Revision: 321155 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:35:43 -0000 Author: ngie Date: Tue Jul 18 18:35:41 2017 New Revision: 321155 URL: https://svnweb.freebsd.org/changeset/base/321155 Log: MFC r318703: __iconv_get_list: separate .Nm entries with commas Modified: stable/10/lib/libc/iconv/__iconv_get_list.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/iconv/__iconv_get_list.3 ============================================================================== --- stable/10/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:34:16 2017 (r321154) +++ stable/10/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:35:41 2017 (r321155) @@ -38,7 +38,7 @@ .Dt __ICONV_GET_LIST 3 .Os .Sh NAME -.Nm __iconv_get_list +.Nm __iconv_get_list , .Nm __iconv_free_list .Nd retrieving a list of character encodings supported by .Xr iconv 3 From owner-svn-src-all@freebsd.org Tue Jul 18 18:35: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 3D0A1D9CC46; Tue, 18 Jul 2017 18:35:48 +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 06D6F7E48F; Tue, 18 Jul 2017 18:35:47 +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 v6IIZlcA086340; Tue, 18 Jul 2017 18:35:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIZlAm086339; Tue, 18 Jul 2017 18:35:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181835.v6IIZlAm086339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:35:47 +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: r321156 - stable/11/lib/libc/iconv X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/iconv X-SVN-Commit-Revision: 321156 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:35:48 -0000 Author: ngie Date: Tue Jul 18 18:35:46 2017 New Revision: 321156 URL: https://svnweb.freebsd.org/changeset/base/321156 Log: MFC r318703: __iconv_get_list: separate .Nm entries with commas Modified: stable/11/lib/libc/iconv/__iconv_get_list.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/iconv/__iconv_get_list.3 ============================================================================== --- stable/11/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:35:41 2017 (r321155) +++ stable/11/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:35:46 2017 (r321156) @@ -38,7 +38,7 @@ .Dt __ICONV_GET_LIST 3 .Os .Sh NAME -.Nm __iconv_get_list +.Nm __iconv_get_list , .Nm __iconv_free_list .Nd retrieving a list of character encodings supported by .Xr iconv 3 From owner-svn-src-all@freebsd.org Tue Jul 18 18:36: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 9F2C2D9CD09; Tue, 18 Jul 2017 18:36:45 +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 6CDE07E6C2; Tue, 18 Jul 2017 18:36:45 +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 v6IIaiid086524; Tue, 18 Jul 2017 18:36:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIaiu1086523; Tue, 18 Jul 2017 18:36:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181836.v6IIaiu1086523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:36: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: r321158 - stable/11/lib/libc/xdr X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/xdr X-SVN-Commit-Revision: 321158 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:36:45 -0000 Author: ngie Date: Tue Jul 18 18:36:44 2017 New Revision: 321158 URL: https://svnweb.freebsd.org/changeset/base/321158 Log: MFC r318712: xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS This unbreaks the .Nm declaration Modified: stable/11/lib/libc/xdr/xdr.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/xdr/xdr.3 ============================================================================== --- stable/11/lib/libc/xdr/xdr.3 Tue Jul 18 18:36:40 2017 (r321157) +++ stable/11/lib/libc/xdr/xdr.3 Tue Jul 18 18:36:44 2017 (r321158) @@ -31,7 +31,7 @@ .Nm xdr_reference , .Nm xdr_setpos , .Nm xdr_short , -.Nm xdr_sizeof, +.Nm xdr_sizeof , .Nm xdrstdio_create , .Nm xdr_string , .Nm xdr_u_char , From owner-svn-src-all@freebsd.org Tue Jul 18 18:36: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 438E8D9CCFD; Tue, 18 Jul 2017 18:36:42 +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 1112A7E6C1; Tue, 18 Jul 2017 18:36:41 +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 v6IIafBi086474; Tue, 18 Jul 2017 18:36:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIaftv086473; Tue, 18 Jul 2017 18:36:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181836.v6IIaftv086473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:36:41 +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: r321157 - stable/10/lib/libc/xdr X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/xdr X-SVN-Commit-Revision: 321157 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:36:42 -0000 Author: ngie Date: Tue Jul 18 18:36:40 2017 New Revision: 321157 URL: https://svnweb.freebsd.org/changeset/base/321157 Log: MFC r318712: xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS This unbreaks the .Nm declaration Modified: stable/10/lib/libc/xdr/xdr.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/xdr/xdr.3 ============================================================================== --- stable/10/lib/libc/xdr/xdr.3 Tue Jul 18 18:35:46 2017 (r321156) +++ stable/10/lib/libc/xdr/xdr.3 Tue Jul 18 18:36:40 2017 (r321157) @@ -31,7 +31,7 @@ .Nm xdr_reference , .Nm xdr_setpos , .Nm xdr_short , -.Nm xdr_sizeof, +.Nm xdr_sizeof , .Nm xdrstdio_create , .Nm xdr_string , .Nm xdr_u_char , From owner-svn-src-all@freebsd.org Tue Jul 18 18: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 7DA48D9CE10; Tue, 18 Jul 2017 18:37:51 +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 4D33C7E923; Tue, 18 Jul 2017 18:37:51 +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 v6IIbo21086661; Tue, 18 Jul 2017 18:37:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIboJb086660; Tue, 18 Jul 2017 18:37:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181837.v6IIboJb086660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:37: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: r321159 - stable/11/lib/libc/locale X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/locale X-SVN-Commit-Revision: 321159 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:37:51 -0000 Author: ngie Date: Tue Jul 18 18:37:50 2017 New Revision: 321159 URL: https://svnweb.freebsd.org/changeset/base/321159 Log: MFC r318706: localeconv(3): start sentences on new lines Modified: stable/11/lib/libc/locale/localeconv.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/localeconv.3 ============================================================================== --- stable/11/lib/libc/locale/localeconv.3 Tue Jul 18 18:36:44 2017 (r321158) +++ stable/11/lib/libc/locale/localeconv.3 Tue Jul 18 18:37:50 2017 (r321159) @@ -202,7 +202,8 @@ result similarly denotes an unavailable value. .Pp The .Fn localeconv_l -function takes an explicit locale parameter. For more information, see +function takes an explicit locale parameter. +For more information, see .Xr xlocale 3 . .Sh RETURN VALUES The From owner-svn-src-all@freebsd.org Tue Jul 18 18:37: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 27A1DD9CE45; Tue, 18 Jul 2017 18:37:58 +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 E4CC57E95E; Tue, 18 Jul 2017 18:37:57 +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 v6IIbuIN086711; Tue, 18 Jul 2017 18:37:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIbuHl086710; Tue, 18 Jul 2017 18:37:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181837.v6IIbuHl086710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:37:56 +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: r321160 - stable/10/lib/libc/locale X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/locale X-SVN-Commit-Revision: 321160 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:37:58 -0000 Author: ngie Date: Tue Jul 18 18:37:56 2017 New Revision: 321160 URL: https://svnweb.freebsd.org/changeset/base/321160 Log: MFC r318706: localeconv(3): start sentences on new lines Modified: stable/10/lib/libc/locale/localeconv.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/localeconv.3 ============================================================================== --- stable/10/lib/libc/locale/localeconv.3 Tue Jul 18 18:37:50 2017 (r321159) +++ stable/10/lib/libc/locale/localeconv.3 Tue Jul 18 18:37:56 2017 (r321160) @@ -202,7 +202,8 @@ result similarly denotes an unavailable value. .Pp The .Fn localeconv_l -function takes an explicit locale parameter. For more information, see +function takes an explicit locale parameter. +For more information, see .Xr xlocale 3 . .Sh RETURN VALUES The From owner-svn-src-all@freebsd.org Tue Jul 18 18:39: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 3739DD9CF05; Tue, 18 Jul 2017 18:39:53 +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 03D1D7EBA7; Tue, 18 Jul 2017 18:39:52 +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 v6IIdqeq086876; Tue, 18 Jul 2017 18:39:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIdqZj086875; Tue, 18 Jul 2017 18:39:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181839.v6IIdqZj086875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321161 - stable/10/contrib/libc-vis X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/contrib/libc-vis X-SVN-Commit-Revision: 321161 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:39:53 -0000 Author: ngie Date: Tue Jul 18 18:39:51 2017 New Revision: 321161 URL: https://svnweb.freebsd.org/changeset/base/321161 Log: MFC r318702: vis(3): delete spurious .Pp macro Modified: stable/10/contrib/libc-vis/vis.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libc-vis/vis.3 ============================================================================== --- stable/10/contrib/libc-vis/vis.3 Tue Jul 18 18:37:56 2017 (r321160) +++ stable/10/contrib/libc-vis/vis.3 Tue Jul 18 18:39:51 2017 (r321161) @@ -347,7 +347,6 @@ space. .It Dv \e240 Represents Meta-space. .El -.Pp .It Dv VIS_CSTYLE Use C-style backslash sequences to represent standard non-printable characters. From owner-svn-src-all@freebsd.org Tue Jul 18 18:39: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 081F6D9CF21; Tue, 18 Jul 2017 18:39:56 +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 CB42E7EBA9; Tue, 18 Jul 2017 18:39:55 +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 v6IIdtJO086926; Tue, 18 Jul 2017 18:39:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIdtoQ086925; Tue, 18 Jul 2017 18:39:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181839.v6IIdtoQ086925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:39: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: r321162 - stable/11/contrib/libc-vis X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/contrib/libc-vis X-SVN-Commit-Revision: 321162 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:39:56 -0000 Author: ngie Date: Tue Jul 18 18:39:54 2017 New Revision: 321162 URL: https://svnweb.freebsd.org/changeset/base/321162 Log: MFC r318702: vis(3): delete spurious .Pp macro Modified: stable/11/contrib/libc-vis/vis.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libc-vis/vis.3 ============================================================================== --- stable/11/contrib/libc-vis/vis.3 Tue Jul 18 18:39:51 2017 (r321161) +++ stable/11/contrib/libc-vis/vis.3 Tue Jul 18 18:39:54 2017 (r321162) @@ -373,7 +373,6 @@ space. .It Dv \e240 Represents Meta-space. .El -.Pp .It Dv VIS_CSTYLE Use C-style backslash sequences to represent standard non-printable characters. From owner-svn-src-all@freebsd.org Tue Jul 18 18:48: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 D9F21D9D28A; Tue, 18 Jul 2017 18:48:26 +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 B40E37F263; Tue, 18 Jul 2017 18:48:26 +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 v6IImPGf090926; Tue, 18 Jul 2017 18:48:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IImPj3090923; Tue, 18 Jul 2017 18:48:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181848.v6IImPj3090923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:48: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: r321163 - stable/10/usr.sbin/pw/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/pw/tests X-SVN-Commit-Revision: 321163 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:48:27 -0000 Author: ngie Date: Tue Jul 18 18:48:25 2017 New Revision: 321163 URL: https://svnweb.freebsd.org/changeset/base/321163 Log: MFC r319026: pw: add some basic testcases for groupshow and usershow - groupshow: test out -a/-g/-n . - usershow: test out -a/-n/-u . Added: stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh stable/10/usr.sbin/pw/tests/pw_usershow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh Modified: stable/10/usr.sbin/pw/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/10/usr.sbin/pw/tests/Makefile Tue Jul 18 18:39:54 2017 (r321162) +++ stable/10/usr.sbin/pw/tests/Makefile Tue Jul 18 18:48:25 2017 (r321163) @@ -12,10 +12,12 @@ ATF_TESTS_SH= pw_etcdir_test \ pw_groupadd_test \ pw_groupdel_test \ pw_groupmod_test \ + pw_groupshow_test \ pw_useradd_test \ pw_userdel_test \ pw_usermod_test \ - pw_usernext_test + pw_usernext_test \ + pw_usershow_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Copied: stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh Tue Jul 18 18:48:25 2017 (r321163, copy of r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_show_all +group_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -a +} + +atf_test_case group_show_gid +group_show_gid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -g 0 +} + +atf_test_case group_show_name +group_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow wheel +} + +atf_test_case group_show_nonexistent_gid +group_show_nonexistent_gid_body() { + populate_etc_skel + + nonexistent_gid=4242 + no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_gid + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -g $nonexistent_gid +} + +atf_test_case group_show_nonexistent_name +group_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_name=bogus + no_such_name_msg="pw: unknown group \`$nonexistent_name'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_name + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -n $nonexistent_name +} + +atf_init_test_cases() { + atf_add_test_case group_show_all + atf_add_test_case group_show_gid + atf_add_test_case group_show_name + atf_add_test_case group_show_nonexistent_gid + atf_add_test_case group_show_nonexistent_name +} Copied: stable/10/usr.sbin/pw/tests/pw_usershow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_usershow_test.sh Tue Jul 18 18:48:25 2017 (r321163, copy of r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case user_show_all +user_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -a +} + +atf_test_case user_show_name +user_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow root +} + +atf_test_case user_show_nonexistent_name +user_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_user=bogus + no_such_user_msg="pw: no such user \`$nonexistent_user'\n" + + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + $nonexistent_user + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + -n $nonexistent_user +} + +atf_test_case user_show_nonexistent_uid +user_show_nonexistent_uid_body() { + populate_etc_skel + + nonexistent_uid=4242 + no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n" + + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + $nonexistent_uid + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + -u $nonexistent_uid +} + +atf_test_case user_show_uid +user_show_uid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -u 0 +} + +atf_init_test_cases() { + atf_add_test_case user_show_all + atf_add_test_case user_show_name + atf_add_test_case user_show_nonexistent_name + atf_add_test_case user_show_nonexistent_uid + atf_add_test_case user_show_uid +} From owner-svn-src-all@freebsd.org Tue Jul 18 18:48: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 9C0C3D9D313; Tue, 18 Jul 2017 18:48:59 +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 76BD27F393; Tue, 18 Jul 2017 18:48:59 +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 v6IImwbg090987; Tue, 18 Jul 2017 18:48:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IImwAR090984; Tue, 18 Jul 2017 18:48:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181848.v6IImwAR090984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:48:58 +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: r321164 - stable/11/usr.sbin/pw/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/pw/tests X-SVN-Commit-Revision: 321164 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:48:59 -0000 Author: ngie Date: Tue Jul 18 18:48:58 2017 New Revision: 321164 URL: https://svnweb.freebsd.org/changeset/base/321164 Log: MFC r319026: pw: add some basic testcases for groupshow and usershow - groupshow: test out -a/-g/-n . - usershow: test out -a/-n/-u . Added: stable/11/usr.sbin/pw/tests/pw_groupshow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh stable/11/usr.sbin/pw/tests/pw_usershow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh Modified: stable/11/usr.sbin/pw/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/11/usr.sbin/pw/tests/Makefile Tue Jul 18 18:48:25 2017 (r321163) +++ stable/11/usr.sbin/pw/tests/Makefile Tue Jul 18 18:48:58 2017 (r321164) @@ -14,10 +14,12 @@ ATF_TESTS_SH= pw_etcdir_test \ pw_groupadd_test \ pw_groupdel_test \ pw_groupmod_test \ + pw_groupshow_test \ pw_useradd_test \ pw_userdel_test \ pw_usermod_test \ - pw_usernext_test + pw_usernext_test \ + pw_usershow_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Copied: stable/11/usr.sbin/pw/tests/pw_groupshow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_groupshow_test.sh Tue Jul 18 18:48:58 2017 (r321164, copy of r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_show_all +group_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -a +} + +atf_test_case group_show_gid +group_show_gid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -g 0 +} + +atf_test_case group_show_name +group_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow wheel +} + +atf_test_case group_show_nonexistent_gid +group_show_nonexistent_gid_body() { + populate_etc_skel + + nonexistent_gid=4242 + no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_gid + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -g $nonexistent_gid +} + +atf_test_case group_show_nonexistent_name +group_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_name=bogus + no_such_name_msg="pw: unknown group \`$nonexistent_name'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_name + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -n $nonexistent_name +} + +atf_init_test_cases() { + atf_add_test_case group_show_all + atf_add_test_case group_show_gid + atf_add_test_case group_show_name + atf_add_test_case group_show_nonexistent_gid + atf_add_test_case group_show_nonexistent_name +} Copied: stable/11/usr.sbin/pw/tests/pw_usershow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/pw/tests/pw_usershow_test.sh Tue Jul 18 18:48:58 2017 (r321164, copy of r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case user_show_all +user_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -a +} + +atf_test_case user_show_name +user_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow root +} + +atf_test_case user_show_nonexistent_name +user_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_user=bogus + no_such_user_msg="pw: no such user \`$nonexistent_user'\n" + + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + $nonexistent_user + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + -n $nonexistent_user +} + +atf_test_case user_show_nonexistent_uid +user_show_nonexistent_uid_body() { + populate_etc_skel + + nonexistent_uid=4242 + no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n" + + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + $nonexistent_uid + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + -u $nonexistent_uid +} + +atf_test_case user_show_uid +user_show_uid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -u 0 +} + +atf_init_test_cases() { + atf_add_test_case user_show_all + atf_add_test_case user_show_name + atf_add_test_case user_show_nonexistent_name + atf_add_test_case user_show_nonexistent_uid + atf_add_test_case user_show_uid +} From owner-svn-src-all@freebsd.org Tue Jul 18 18:51: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 ACA31D9D3C2; Tue, 18 Jul 2017 18:51:35 +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 79C217F5C1; Tue, 18 Jul 2017 18:51:35 +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 v6IIpYHF093469; Tue, 18 Jul 2017 18:51:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIpYJs093468; Tue, 18 Jul 2017 18:51:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181851.v6IIpYJs093468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:51: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: r321165 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 321165 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:51:35 -0000 Author: ngie Date: Tue Jul 18 18:51:34 2017 New Revision: 321165 URL: https://svnweb.freebsd.org/changeset/base/321165 Log: MFC r319063: Send all of `data`, not just a portion of it It was sending only a long's worth (4 or 8 bytes) of data previously (instead of the entire buffer) via send(2). CID: 1229966, 1229967, 1230004, 1230005 Modified: stable/11/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/11/tests/sys/kern/unix_seqpacket_test.c Tue Jul 18 18:48:58 2017 (r321164) +++ stable/11/tests/sys/kern/unix_seqpacket_test.c Tue Jul 18 18:51:34 2017 (r321165) @@ -762,7 +762,7 @@ ATF_TC_BODY(shutdown_send, tc) /* ATF's isolation mechanisms will guarantee uniqueness of this file */ const char *path = "sock"; const char *data = "data"; - ssize_t ssize; + ssize_t datalen, ssize; int s, err, s2; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); @@ -786,8 +786,9 @@ ATF_TC_BODY(shutdown_send, tc) } ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR)); + datalen = strlen(data) + 1; /* +1 for the null */ /* USE MSG_NOSIGNAL so we don't get SIGPIPE */ - ssize = send(s2, data, sizeof(data), MSG_EOR | MSG_NOSIGNAL); + ssize = send(s2, data, datalen, MSG_EOR | MSG_NOSIGNAL); ATF_CHECK_EQ(EPIPE, errno); ATF_CHECK_EQ(-1, ssize); close(s); @@ -802,6 +803,7 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) /* ATF's isolation mechanisms will guarantee uniqueness of this file */ const char *path = "sock"; const char *data = "data"; + ssize_t datalen; int s, err, s2; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); @@ -826,7 +828,8 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR)); ATF_REQUIRE(SIG_ERR != signal(SIGPIPE, shutdown_send_sigpipe_handler)); - (void)send(s2, data, sizeof(data), MSG_EOR); + datalen = strlen(data) + 1; /* +1 for the null */ + (void)send(s2, data, sizeof(*data), MSG_EOR); ATF_CHECK_EQ(1, got_sigpipe); close(s); close(s2); From owner-svn-src-all@freebsd.org Tue Jul 18 18:54: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 A7FB7D9D622; Tue, 18 Jul 2017 18:54:48 +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 743A17F9BD; Tue, 18 Jul 2017 18:54:48 +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 v6IIslLt095354; Tue, 18 Jul 2017 18:54:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIslDL095353; Tue, 18 Jul 2017 18:54:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181854.v6IIslDL095353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:54:47 +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: r321166 - stable/10/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321166 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:54:48 -0000 Author: ngie Date: Tue Jul 18 18:54:47 2017 New Revision: 321166 URL: https://svnweb.freebsd.org/changeset/base/321166 Log: MFC r318693,r318694: r318693: Some minor style(9) fixes - Wrap at <80 columns. - Sort by type r318694: style(9): sort headers MFC with: r318693 Modified: stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:51:34 2017 (r321165) +++ stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:54:47 2017 (r321166) @@ -27,11 +27,10 @@ */ #include +#include #include -#include #include - -#include +#include #include #include @@ -47,11 +46,12 @@ static char *boot_disk(struct gmesh *mesh); static char *wizard_partition(struct gmesh *mesh, const char *disk); int -part_wizard(const char *fsreq) { - int error; - struct gmesh mesh; +part_wizard(const char *fsreq) +{ char *disk, *schemeroot; const char *fstype; + struct gmesh mesh; + int error; if (fsreq != NULL) fstype = fsreq; @@ -199,9 +199,9 @@ wizard_partition(struct gmesh *mesh, const char *disk) struct gclass *classp; struct ggeom *gpart = NULL; struct gconfig *gc; - char message[512]; - const char *scheme = NULL; char *retval = NULL; + const char *scheme = NULL; + char message[512]; int choice; LIST_FOREACH(classp, &mesh->lg_class, lg_class) @@ -295,15 +295,17 @@ query: } int -wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive) +wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, + int interactive) { - struct gmesh submesh; struct gclass *classp; struct ggeom *gp; struct gprovider *pp; - intmax_t swapsize, available; - char swapsizestr[10], rootsizestr[10], *fsname; char *fsnames[] = {"freebsd-ufs", "freebsd-zfs"}; + char *fsname; + struct gmesh submesh; + char swapsizestr[10], rootsizestr[10]; + intmax_t swapsize, available; int retval; if (strcmp(fstype, "zfs") == 0) { @@ -362,4 +364,3 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, return (0); } - From owner-svn-src-all@freebsd.org Tue Jul 18 18:54: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 7B7CED9D660; Tue, 18 Jul 2017 18:54:55 +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 453F57FA03; Tue, 18 Jul 2017 18:54:55 +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 v6IIssbw095404; Tue, 18 Jul 2017 18:54:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIss2R095403; Tue, 18 Jul 2017 18:54:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181854.v6IIss2R095403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321167 - stable/11/usr.bin/mkimg/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/mkimg/tests X-SVN-Commit-Revision: 321167 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:54:55 -0000 Author: ngie Date: Tue Jul 18 18:54:54 2017 New Revision: 321167 URL: https://svnweb.freebsd.org/changeset/base/321167 Log: MFC r319293: Formalize the dependent/dependency relationship for .gz.uu vs This helps ensure that the output files are regenerated if the input files change, after the output files have been created. Modified: stable/11/usr.bin/mkimg/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/tests/Makefile ============================================================================== --- stable/11/usr.bin/mkimg/tests/Makefile Tue Jul 18 18:54:47 2017 (r321166) +++ stable/11/usr.bin/mkimg/tests/Makefile Tue Jul 18 18:54:54 2017 (r321167) @@ -1,5 +1,7 @@ # $FreeBSD$ +.PATH: ${.CURDIR} + PACKAGE= tests _REBASE_SCRIPT= mkimg_test @@ -8,8 +10,10 @@ ATF_TESTS_SH= ${_REBASE_SCRIPT} SOURCES!= cd ${.CURDIR}; echo *.uu ${PACKAGE}FILES+= ${SOURCES:S,.gz.uu,,g} -${${PACKAGE}FILES}: - uudecode -p ${.CURDIR}/${.TARGET}.gz.uu | gunzip -c > ${.TARGET} +.for f in ${${PACKAGE}FILES} +$f: $f.gz.uu + uudecode -p ${.ALLSRC} | gunzip -c > ${.TARGET} +.endfor CLEANFILES+= ${${PACKAGE}FILES}} From owner-svn-src-all@freebsd.org Tue Jul 18 18:55: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 52DA1D9D708; Tue, 18 Jul 2017 18:55:49 +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 1FBBB7FC38; Tue, 18 Jul 2017 18:55:49 +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 v6IItmeZ095554; Tue, 18 Jul 2017 18:55:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IItmNB095553; Tue, 18 Jul 2017 18:55:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181855.v6IItmNB095553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:55: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: r321168 - stable/11/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321168 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:55:49 -0000 Author: ngie Date: Tue Jul 18 18:55:48 2017 New Revision: 321168 URL: https://svnweb.freebsd.org/changeset/base/321168 Log: MFC r318693,r318694: r318693: Some minor style(9) fixes - Wrap at <80 columns. - Sort by type r318694: style(9): sort headers MFC with: r318693 Modified: stable/11/usr.sbin/bsdinstall/partedit/part_wizard.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- stable/11/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:54:54 2017 (r321167) +++ stable/11/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:55:48 2017 (r321168) @@ -27,11 +27,10 @@ */ #include +#include #include -#include #include - -#include +#include #include #include @@ -47,11 +46,12 @@ static char *boot_disk(struct gmesh *mesh); static char *wizard_partition(struct gmesh *mesh, const char *disk); int -part_wizard(const char *fsreq) { - int error; - struct gmesh mesh; +part_wizard(const char *fsreq) +{ char *disk, *schemeroot; const char *fstype; + struct gmesh mesh; + int error; if (fsreq != NULL) fstype = fsreq; @@ -199,9 +199,9 @@ wizard_partition(struct gmesh *mesh, const char *disk) struct gclass *classp; struct ggeom *gpart = NULL; struct gconfig *gc; - char message[512]; - const char *scheme = NULL; char *retval = NULL; + const char *scheme = NULL; + char message[512]; int choice; LIST_FOREACH(classp, &mesh->lg_class, lg_class) @@ -295,15 +295,17 @@ query: } int -wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive) +wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, + int interactive) { - struct gmesh submesh; struct gclass *classp; struct ggeom *gp; struct gprovider *pp; - intmax_t swapsize, available; - char swapsizestr[10], rootsizestr[10], *fsname; char *fsnames[] = {"freebsd-ufs", "freebsd-zfs"}; + char *fsname; + struct gmesh submesh; + char swapsizestr[10], rootsizestr[10]; + intmax_t swapsize, available; int retval; if (strcmp(fstype, "zfs") == 0) { @@ -362,4 +364,3 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, return (0); } - From owner-svn-src-all@freebsd.org Tue Jul 18 18:56: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 26E8BD9D7A1; Tue, 18 Jul 2017 18:56:08 +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 E86667FD5F; Tue, 18 Jul 2017 18:56:07 +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 v6IIu7ow095621; Tue, 18 Jul 2017 18:56:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIu7Vl095620; Tue, 18 Jul 2017 18:56:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181856.v6IIu7Vl095620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:56:07 +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: r321169 - stable/10/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321169 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:56:08 -0000 Author: ngie Date: Tue Jul 18 18:56:06 2017 New Revision: 321169 URL: https://svnweb.freebsd.org/changeset/base/321169 Log: MFC r318722: sade(8): start new sentence on new line Modified: stable/10/usr.sbin/bsdinstall/partedit/sade.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/sade.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:55:48 2017 (r321168) +++ stable/10/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:56:06 2017 (r321169) @@ -59,7 +59,8 @@ first appeared in .Fx 6.3 as a utility encapsulating features from the .Xr sysinstall 8 -installer. It was replaced in +installer. +It was replaced in .Fx 10.0 with the equivalent part of .Xr bsdinstall 8 . From owner-svn-src-all@freebsd.org Tue Jul 18 18:56: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 EE652D9D823; Tue, 18 Jul 2017 18:56:52 +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 BBF987FEC4; Tue, 18 Jul 2017 18:56:52 +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 v6IIupMp095697; Tue, 18 Jul 2017 18:56:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIupeN095696; Tue, 18 Jul 2017 18:56:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181856.v6IIupeN095696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321170 - stable/11/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321170 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 18:56:53 -0000 Author: ngie Date: Tue Jul 18 18:56:51 2017 New Revision: 321170 URL: https://svnweb.freebsd.org/changeset/base/321170 Log: MFC r318722: sade(8): start new sentence on new line Modified: stable/11/usr.sbin/bsdinstall/partedit/sade.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/partedit/sade.8 ============================================================================== --- stable/11/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:56:06 2017 (r321169) +++ stable/11/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:56:51 2017 (r321170) @@ -59,7 +59,8 @@ first appeared in .Fx 6.3 as a utility encapsulating features from the .Xr sysinstall 8 -installer. It was replaced in +installer. +It was replaced in .Fx 10.0 with the equivalent part of .Xr bsdinstall 8 . From owner-svn-src-all@freebsd.org Tue Jul 18 19:00: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 3DD5ED9DAD5; Tue, 18 Jul 2017 19:00:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0590280182; Tue, 18 Jul 2017 19:00:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IJ0G5c095892; Tue, 18 Jul 2017 19:00:16 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IJ0GdG095891; Tue, 18 Jul 2017 19:00:16 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201707181900.v6IJ0GdG095891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 18 Jul 2017 19:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321171 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 321171 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 19:00:17 -0000 Author: jilles Date: Tue Jul 18 19:00:15 2017 New Revision: 321171 URL: https://svnweb.freebsd.org/changeset/base/321171 Log: sh: Remove broken #ifdef NOHACK code (related to sh -c). Apart from the fact that subtle syntactic changes make a poor compile-time option, the NOHACK case has been obviously broken since it was added, because it uses q uninitialized if (*p != '\0'). No functional change is intended. Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Tue Jul 18 18:56:51 2017 (r321170) +++ head/bin/sh/options.c Tue Jul 18 19:00:15 2017 (r321171) @@ -191,16 +191,11 @@ options(int cmdline) while ((c = *p++) != '\0') { if (c == 'c' && cmdline) { char *q; -#ifdef NOHACK /* removing this code allows sh -ce 'foo' for compat */ - if (*p == '\0') -#endif - q = *argptr++; + + q = *argptr++; if (q == NULL || minusc != NULL) error("Bad -c option"); minusc = q; -#ifdef NOHACK - break; -#endif } else if (c == 'o') { minus_o(*argptr, val); if (*argptr) From owner-svn-src-all@freebsd.org Tue Jul 18 19:50: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 3424FD9EAEB; Tue, 18 Jul 2017 19:50:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E913981851; Tue, 18 Jul 2017 19:50: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 v6IJo3Xg016046; Tue, 18 Jul 2017 19:50:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IJo3b6016045; Tue, 18 Jul 2017 19:50:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707181950.v6IJo3b6016045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 18 Jul 2017 19:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321172 - 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: 321172 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 19:50:04 -0000 Author: manu Date: Tue Jul 18 19:50:02 2017 New Revision: 321172 URL: https://svnweb.freebsd.org/changeset/base/321172 Log: Allwinner EHCI: Do not fail if we cannot get a phy If we cannot get a phy, do not detach the driver, some boards have phy always enabled and not exposed. While here do not release the clocks if we fails as we release them in a10_ehci_detach. Tested-on: OrangePi-One Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Tue Jul 18 19:00:15 2017 (r321171) +++ head/sys/arm/allwinner/a10_ehci.c Tue Jul 18 19:50:02 2017 (r321172) @@ -226,16 +226,13 @@ a10_ehci_attach(device_t self) } /* Enable USB PHY */ - err = phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy); - if (err != 0) { - device_printf(self, "Could not get phy\n"); - goto error; + if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + err = phy_enable(self, aw_sc->phy); + if (err != 0) { + device_printf(self, "Could not enable phy\n"); + goto error; + } } - err = phy_enable(self, aw_sc->phy); - if (err != 0) { - device_printf(self, "Could not enable phy\n"); - goto error; - } /* Enable passby */ reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); @@ -263,10 +260,6 @@ a10_ehci_attach(device_t self) return (0); error: - if (aw_sc->clk != NULL) { - clk_disable(aw_sc->clk); - clk_release(aw_sc->clk); - } a10_ehci_detach(self); return (ENXIO); } From owner-svn-src-all@freebsd.org Tue Jul 18 20:26: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 B4B8ED9F7AC; Tue, 18 Jul 2017 20:26:42 +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 83EF182A7A; Tue, 18 Jul 2017 20:26:42 +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 v6IKQf3S032156; Tue, 18 Jul 2017 20:26:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IKQfJj032155; Tue, 18 Jul 2017 20:26:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707182026.v6IKQfJj032155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Jul 2017 20:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321173 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321173 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 20:26:42 -0000 Author: kib Date: Tue Jul 18 20:26:41 2017 New Revision: 321173 URL: https://svnweb.freebsd.org/changeset/base/321173 Log: Convert assertion that only vmspace owner grows the stack, into a check blocking grow from other processes accesses. Debugger may access stack grow area with ptrace(2). In this case, real state of the process is to not have the stack grown, which provides more accurate inspection. Technical reason to avoid the grow is to avoid applying wrong process (debugger) stack limit. This change also has a consequence of making aio workers accesses past the bottom of stacks into EFAULT, arguably the situation is a programmers mistake. Reported by: jhb Discussed with: alc, jhb 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 Tue Jul 18 19:50:02 2017 (r321172) +++ head/sys/vm/vm_map.c Tue Jul 18 20:26:41 2017 (r321173) @@ -3698,7 +3698,8 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma p = curproc; vm = p->p_vmspace; - MPASS(map == &p->p_vmspace->vm_map); + if (map != &p->p_vmspace->vm_map) + return (KERN_FAILURE); MPASS(!map->system_map); guard = stack_guard_page * PAGE_SIZE; From owner-svn-src-all@freebsd.org Tue Jul 18 20:40: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 2C693D9FBDC; Tue, 18 Jul 2017 20:40:38 +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 EDDC382FD3; Tue, 18 Jul 2017 20:40:37 +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 v6IKebIT036482; Tue, 18 Jul 2017 20:40:37 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IKebAa036481; Tue, 18 Jul 2017 20:40:37 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707182040.v6IKebAa036481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 18 Jul 2017 20:40: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: r321174 - stable/11/usr.sbin/nfsuserd X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/nfsuserd X-SVN-Commit-Revision: 321174 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 20:40:38 -0000 Author: rmacklem Date: Tue Jul 18 20:40:36 2017 New Revision: 321174 URL: https://svnweb.freebsd.org/changeset/base/321174 Log: MFC: r320659 Add a Bugs section that indicates that the nfsuserd doesn't work when jails are being used on the system. It is hoped that the patches in PR#205193 will someday get tested/debugged so that they can be MFC'd to fix this. This is a content change. Modified: stable/11/usr.sbin/nfsuserd/nfsuserd.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- stable/11/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:26:41 2017 (r321173) +++ stable/11/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:40:36 2017 (r321174) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2017 +.Dd July 4, 2017 .Dt NFSUSERD 8 .Os .Sh NAME @@ -126,3 +126,9 @@ those requests fail and the library functions don't re and .Xr passwd 5 for more information on how the databases are accessed. +.Pp +Since the kernel communicates with the +.Nm +daemon via an upcall that uses the IP address 127.0.0.1, it does not work correctly when +.Xr jail 8 +are used and can crash the system. From owner-svn-src-all@freebsd.org Tue Jul 18 20:46: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 B4413D9FE24; Tue, 18 Jul 2017 20:46:30 +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 8292A83401; Tue, 18 Jul 2017 20:46:30 +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 v6IKkTsr040460; Tue, 18 Jul 2017 20:46:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IKkTfx040459; Tue, 18 Jul 2017 20:46:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707182046.v6IKkTfx040459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 18 Jul 2017 20:46: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: r321175 - stable/10/usr.sbin/nfsuserd X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/usr.sbin/nfsuserd X-SVN-Commit-Revision: 321175 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 20:46:30 -0000 Author: rmacklem Date: Tue Jul 18 20:46:29 2017 New Revision: 321175 URL: https://svnweb.freebsd.org/changeset/base/321175 Log: MFC: r320659 Add a Bugs section that indicates that the nfsuserd doesn't work when jails are being used on the system. It is hoped that the patches in PR#205193 will someday get tested/debugged so that they can be MFC'd to fix this. This is a content change. Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:40:36 2017 (r321174) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:46:29 2017 (r321175) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2017 +.Dd July 4, 2017 .Dt NFSUSERD 8 .Os .Sh NAME @@ -126,3 +126,9 @@ those requests fail and the library functions don't re and .Xr passwd 5 for more information on how the databases are accessed. +.Pp +Since the kernel communicates with the +.Nm +daemon via an upcall that uses the IP address 127.0.0.1, it does not work correctly when +.Xr jail 8 +are used and can crash the system. From owner-svn-src-all@freebsd.org Tue Jul 18 21:09: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 2DC91DA021E; Tue, 18 Jul 2017 21:09:31 +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 DF68683C37; Tue, 18 Jul 2017 21:09:30 +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 v6IL9Uw0048271; Tue, 18 Jul 2017 21:09:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IL9Ur2048270; Tue, 18 Jul 2017 21:09:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707182109.v6IL9Ur2048270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Jul 2017 21:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321176 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 321176 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 21:09:31 -0000 Author: jhb Date: Tue Jul 18 21:09:29 2017 New Revision: 321176 URL: https://svnweb.freebsd.org/changeset/base/321176 Log: Remove special handling for 'disk*.h' This was originally added so that only one of diskmbr.h or diskpc98.h was chosen and is no longer needed after PC98's removal. However, the special handling was also broken as it effectively prevented the decoding of ioctls declared in other headers such as or . Modified: head/lib/libsysdecode/mkioctls Modified: head/lib/libsysdecode/mkioctls ============================================================================== --- head/lib/libsysdecode/mkioctls Tue Jul 18 20:46:29 2017 (r321175) +++ head/lib/libsysdecode/mkioctls Tue Jul 18 21:09:29 2017 (r321176) @@ -18,13 +18,11 @@ LC_ALL=C; export LC_ALL ioctl_includes=$( cd $includedir find -H -s * -name '*.h' | \ - egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \ + egrep -v '(net/pfvar|net/if_pfsync)\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\n", $1)}' ) - -ioctl_includes="$ioctl_includes#include \\n" awk -v x="$ioctl_includes" 'BEGIN {print x}' | $CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - | From owner-svn-src-all@freebsd.org Tue Jul 18 23:02: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 6E950DA1F74; Tue, 18 Jul 2017 23:02:36 +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 386F52F80; Tue, 18 Jul 2017 23:02:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IN2ZPQ096683; Tue, 18 Jul 2017 23:02:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IN2Zjr096682; Tue, 18 Jul 2017 23:02:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707182302.v6IN2Zjr096682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Jul 2017 23:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321177 - stable/11/lib/libc/net X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/lib/libc/net X-SVN-Commit-Revision: 321177 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 23:02:36 -0000 Author: markj Date: Tue Jul 18 23:02:34 2017 New Revision: 321177 URL: https://svnweb.freebsd.org/changeset/base/321177 Log: MFC r320895: Don't dlclose NSS modules from nss_atexit(). Modified: stable/11/lib/libc/net/nsdispatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/nsdispatch.c ============================================================================== --- stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 21:09:29 2017 (r321176) +++ stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 23:02:34 2017 (r321177) @@ -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 18 23: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 DCA2FDA2897; Tue, 18 Jul 2017 23:35:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6FDE3E28; Tue, 18 Jul 2017 23:35:20 +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 v6INZJC9009046; Tue, 18 Jul 2017 23:35:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6INZJuV009039; Tue, 18 Jul 2017 23:35:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707182335.v6INZJuV009039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 18 Jul 2017 23:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321178 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 321178 X-SVN-Commit-Repository: base MIME-Version: 1.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, 18 Jul 2017 23:35:21 -0000 Author: emaste Date: Tue Jul 18 23:35:19 2017 New Revision: 321178 URL: https://svnweb.freebsd.org/changeset/base/321178 Log: bsdinstall: remove EOL whitespace Modified: head/usr.sbin/bsdinstall/scripts/auto head/usr.sbin/bsdinstall/scripts/checksum head/usr.sbin/bsdinstall/scripts/keymap head/usr.sbin/bsdinstall/scripts/mount head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 head/usr.sbin/bsdinstall/scripts/umount Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/auto Tue Jul 18 23:35:19 2017 (r321178) @@ -319,7 +319,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" fi - + export FTP_PASSIVE_MODE=YES # Iterate through the distribution list and set a flag if debugging # distributions have been selected. @@ -413,7 +413,7 @@ finalconfig() { finalconfig ;; "Root Password") - bsdinstall rootpass + bsdinstall rootpass finalconfig ;; "Hostname") Modified: head/usr.sbin/bsdinstall/scripts/checksum ============================================================================== --- head/usr.sbin/bsdinstall/scripts/checksum Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/checksum Tue Jul 18 23:35:19 2017 (r321178) @@ -32,7 +32,7 @@ percentage=0 for dist in $DISTRIBUTIONS; do distname=$(basename $dist .txz) eval "status_$distname=7" - + items="" for i in $DISTRIBUTIONS; do items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`" Modified: head/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- head/usr.sbin/bsdinstall/scripts/keymap Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/keymap Tue Jul 18 23:35:19 2017 (r321178) @@ -28,7 +28,7 @@ # $FreeBSD$ # ############################################################ INCLUDES - + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" Modified: head/usr.sbin/bsdinstall/scripts/mount ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mount Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/mount Tue Jul 18 23:35:19 2017 (r321178) @@ -33,7 +33,7 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL fsname = $2; if (fsname == "/") fsname = "" - printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, + printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, fsname, $3, $4, $5, $6); } }' > $TMP_FSTAB Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jul 18 23:35:19 2017 (r321178) @@ -75,7 +75,7 @@ IF_CONFIG=$(dialog --backtitle 'FreeBSD Installer' --t if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi exec 3>&- -echo $INTERFACE $IF_CONFIG | +echo $INTERFACE $IF_CONFIG | awk -v prefix="$IFCONFIG_PREFIX" '{ printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3); printf("defaultrouter=\"%s\"\n", $4); Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Tue Jul 18 23:35:19 2017 (r321178) @@ -41,9 +41,9 @@ f_include $BSDCFG_SHARE/dialog.subr ############################################################ MAIN # -# TODO: +# TODO: # - Add DHCPv6 support once FreeBSD ships with it. -# +# INTERFACE=$1 case "${INTERFACE}" in Modified: head/usr.sbin/bsdinstall/scripts/umount ============================================================================== --- head/usr.sbin/bsdinstall/scripts/umount Tue Jul 18 23:02:34 2017 (r321177) +++ head/usr.sbin/bsdinstall/scripts/umount Tue Jul 18 23:35:19 2017 (r321178) @@ -33,7 +33,7 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL fsname = $2; if (fsname == "/") fsname = "" - printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, + printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, fsname, $3, $4, $5, $6); } }' > $TMP_FSTAB From owner-svn-src-all@freebsd.org Wed Jul 19 01:49: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 5DB5ADA51D3; Wed, 19 Jul 2017 01:49:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC7C66525; Wed, 19 Jul 2017 01:49:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6J1n1F5061446; Wed, 19 Jul 2017 01:49:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J1n1jU061445; Wed, 19 Jul 2017 01:49:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707190149.v6J1n1jU061445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Jul 2017 01:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321179 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 321179 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 01:49:02 -0000 Author: np Date: Wed Jul 19 01:49:01 2017 New Revision: 321179 URL: https://svnweb.freebsd.org/changeset/base/321179 Log: cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the trace buffer. MFC after: 3 days Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Jul 18 23:35:19 2017 (r321178) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jul 19 01:49:01 2017 (r321179) @@ -385,8 +385,8 @@ make_established(struct toepcb *toep, uint32_t snd_isn tp->t_state == TCPS_SYN_RECEIVED, ("%s: TCP state %s", __func__, tcpstates[tp->t_state])); - CTR4(KTR_CXGBE, "%s: tid %d, toep %p, inp %p", - __func__, toep->tid, toep, inp); + CTR6(KTR_CXGBE, "%s: tid %d, so %p, inp %p, tp %p, toep %p", + __func__, toep->tid, so, inp, tp, toep); tp->t_state = TCPS_ESTABLISHED; tp->t_starttime = ticks; From owner-svn-src-all@freebsd.org Wed Jul 19 02:49: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 3D734DA5EFF; Wed, 19 Jul 2017 02:49: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 F11BB6792F; Wed, 19 Jul 2017 02:49: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 v6J2n7Vk085628; Wed, 19 Jul 2017 02:49:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J2n7mm085627; Wed, 19 Jul 2017 02:49:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707190249.v6J2n7mm085627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 02:49: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: r321180 - stable/11/etc/pam.d X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/etc/pam.d X-SVN-Commit-Revision: 321180 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 02:49:09 -0000 Author: ngie Date: Wed Jul 19 02:49:07 2017 New Revision: 321180 URL: https://svnweb.freebsd.org/changeset/base/321180 Log: MFC r316817: Derive {AT,RCMDS}{DIR,MODE} from FILE{DIR,MODE} This reduces duplicity a bit. Modified: stable/11/etc/pam.d/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/pam.d/Makefile ============================================================================== --- stable/11/etc/pam.d/Makefile Wed Jul 19 01:49:01 2017 (r321179) +++ stable/11/etc/pam.d/Makefile Wed Jul 19 02:49:07 2017 (r321180) @@ -17,24 +17,25 @@ FILES= README \ telnetd \ xdm +FILESDIR= /etc/pam.d +FILESMODE= 644 + .if ${MK_AT} != "no" FILESGROUPS+= AT AT+= atrun ATPACKAGE+= at -ATDIR= /etc/pam.d -ATMODE= 644 +ATDIR= ${FILESDIR} +ATMODE= ${FILESMODE} .endif .if ${MK_RCMDS} != "no" FILESGROUPS+= RCMDS RCMDS+= rsh RCMDSPACKAGE+= rcmds -RCMDSDIR= /etc/pam.d -RCMDSMODE= 644 +RCMDSDIR= ${FILESDIR} +RCMDSMODE= ${FILESMODE} .endif -FILESDIR= /etc/pam.d -FILESMODE= 644 FILESMODE_README= 444 LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp From owner-svn-src-all@freebsd.org Wed Jul 19 02:50: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 4F932DA5F92; Wed, 19 Jul 2017 02:50: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 2BD7367A6E; Wed, 19 Jul 2017 02:50:09 +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 v6J2o82C085816; Wed, 19 Jul 2017 02:50:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J2o8Pw085815; Wed, 19 Jul 2017 02:50:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707190250.v6J2o8Pw085815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 02:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321182 - stable/11/usr.sbin/bsdinstall X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall X-SVN-Commit-Revision: 321182 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 02:50:09 -0000 Author: ngie Date: Wed Jul 19 02:50:08 2017 New Revision: 321182 URL: https://svnweb.freebsd.org/changeset/base/321182 Log: MFC r318723: bsdinstall(8): fix manpage issues - Start new sentences on new lines. - Separate e.g. (more of an igor thing) with commas, and rewrite some examples not to be enclosed in parentheses. Modified: stable/11/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/11/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:50:06 2017 (r321181) +++ stable/11/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:50:08 2017 (r321182) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2014 +.Dd May 23, 2017 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -39,17 +39,18 @@ .Sh DESCRIPTION .Nm is used for installation of new systems, both for system setup from -installation media (e.g. CD-ROMs) and for use on live systems to prepare +installation media, e.g., CD-ROMs, and for use on live systems to prepare VM images and jails. .Pp Much like .Xr make 1 , Nm -takes a target and possible parameters of the target as arguments. If -invoked with no arguments, it will invoke the +takes a target and possible parameters of the target as arguments. +If invoked with no arguments, it will invoke the .Cm auto target, which provides a standard interactive installation, invoking the -others in sequence. To perform a scripted installation, these subtargets -can be invoked separately by an installation script. +others in sequence. +To perform a scripted installation, +these subtargets can be invoked separately by an installation script. .Sh OPTIONS .Nm supports the following options, global to all targets: @@ -115,7 +116,8 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Defaults to UFS. +installations. +Defaults to UFS. .It Cm zfsboot Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single @@ -135,8 +137,8 @@ to encrypt the disk. Provides the installer's interactive manual disk partitioner with an interface identical to .Xr sade 8 . -Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS -is set up with one pool and dataset per partition. +Supports multiple disks as well as UFS, ZFS, and FAT file systems. +ZFS is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -150,14 +152,16 @@ Each disk setup is specified by a three-part argument: .Op Ar scheme .Op Ar {partitions} .Pp -Multiple disk setups are separated by semicolons. The +Multiple disk setups are separated by semicolons. +The .Ar disk argument specifies the disk on which to operate (which will be erased), while the .Ar scheme argument specifies the .Xr gpart 8 -partition scheme to apply to the disk. If +partition scheme to apply to the disk. +If .Ar scheme is unspecified, .Cm scriptedpart @@ -167,7 +171,8 @@ The argument is also optional and specifies how to partition .Ar disk . It consists of a comma-separated list of partitions to create enclosed in -curly braces. Each partition declaration takes the form +curly braces. +Each partition declaration takes the form .Pp .Ar size .Ar type @@ -178,15 +183,17 @@ specifies the partition size to create in bytes (K, M, can be appended to specify kilobytes, megabytes, and gigabytes respectively), while the .Em auto -keyword causes the partition to take all the remaining space on the disk. The +keyword causes the partition to take all the remaining space on the disk. +The .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). +filesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap. The optional .Ar mount point argument sets where the created partition is to be mounted in the installed -system. As an example, a typical invocation looks like: +system. +As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } .Pp @@ -238,37 +245,43 @@ Reads a small amount of data from .Pa /dev/random and stores it in a file in the new system's root directory. .It Cm config -Installs the configuration files destined for the new system (e.g. rc.conf +Installs the configuration files destined for the new system, e.g., +.Xr rc.conf 5 fragments generated by .Cm netconfig , etc.) onto the new system. .El .Sh ENVIRONMENT VARIABLES The following environment variables control various aspects of the installation -process. Many are used internally during installation and have reasonable -default values for most installation scenarios. Others are set by various -interactive user prompts, and can be usefully overridden when making scripted -or customized installers. +process. +Many are used internally during installation and have reasonable default values +for most installation scenarios. +Others are set by various interactive user prompts, and can be usefully +overridden when making scripted or customized installers. .Bl -tag -width ".Ev BSDINSTALL_DISTSITE" .It Ev DISTRIBUTIONS -The set of distributions to install (e.g. "base kernel ports"). Default: none +The set of distributions to install, e.g., "base kernel ports". +Default: none .It Ev BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they -should be downloaded). Default: +should be downloaded). +Default: .Pa /usr/freebsd-dist .It Ev BSDINSTALL_DISTSITE URL from which the distribution files should be downloaded if they are not already present in the directory defined by .Ev BSDINSTALL_DISTDIR . This should be a full path to the files, including architecture and release -names. Most targets (e.g. +names. +Most targets, e.g., .Cm auto and -.Cm jail ) +.Cm jail , that prompt for a .Fx mirror will skip that step if this variable is already defined in the -environment. Example: +environment. +Example: .Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE .It Ev BSDINSTALL_CHROOT The directory into which the distribution files should be unpacked and the @@ -276,23 +289,26 @@ directory at which the root file system of the new sys Default: .Pa /mnt .It Ev BSDINSTALL_LOG -Path to a log file for the installation. Default: +Path to a log file for the installation. +Default: .Pa /tmp/bsdinstall_log .It Ev BSDINSTALL_TMPETC Directory where files destined for the new system's .Pa /etc will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_etc .It Ev BSDINSTALL_TMPBOOT Directory where files destined for the new system's .Pa /boot will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_boot .El .Sh SCRIPTING @@ -307,8 +323,9 @@ a shell script run under .Xr chroot 8 in the newly installed system before .Nm -exits. The two parts are separated by the usual script header (#!), which -also sets the interpreter for the setup script. +exits. +The two parts are separated by the usual script header (#!), which also sets +the interpreter for the setup script. .Pp A typical bsdinstall script looks like this: .Bd -literal -offset indent @@ -326,19 +343,21 @@ On release media, such a script placed at .Pa /etc/installerconfig will be run at boot time and the system will be rebooted automatically after -the installation has completed. This can be used for unattended network -installation of new systems; see +the installation has completed. +This can be used for unattended network installation of new systems; see .Xr diskless 8 for details. .Ss PREAMBLE -The preamble consists of installer settings. These control global installation -parameters (see +The preamble consists of installer settings. +These control global installation parameters (see .Sx ENVIRONMENT VARIABLES ) -as well as disk partitioning. The preamble is interpreted as a +as well as disk partitioning. +The preamble is interpreted as a .Xr sh 1 -script run at the very beginning of the install. If more complicated behavior -than setting these variables is desired, arbitrary commands can be run here -to extend the installer. In addition to the variables in +script run at the very beginning of the install. +If more complicated behavior than setting these variables is desired, +arbitrary commands can be run here to extend the installer. +In addition to the variables in .Sx ENVIRONMENT VARIABLES , in particular .Ev DISTRIBUTIONS , @@ -358,13 +377,14 @@ instead of .Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! -declaration. This script will be run at the end of the installation process -inside a +declaration. +This script will be run at the end of the installation process inside a .Xr chroot 8 environment in the newly installed system and can be used to set up -configuration files, install packages, etc. Note that newly configured -system services (e.g. networking) have not been started in the installed -system at this time and only installation host services are available. +configuration files, install packages, etc. +Note that newly configured system services, e.g., networking have not +been started in the installed system at this time and only installation +host services are available. .Sh HISTORY This version of .Nm From owner-svn-src-all@freebsd.org Wed Jul 19 02:50: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 0CF62DA5F8C; Wed, 19 Jul 2017 02:50:08 +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 DD2E467A6C; Wed, 19 Jul 2017 02:50:07 +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 v6J2o7YP085771; Wed, 19 Jul 2017 02:50:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J2o72A085770; Wed, 19 Jul 2017 02:50:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707190250.v6J2o72A085770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 02:50:07 +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: r321181 - stable/10/usr.sbin/bsdinstall X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall X-SVN-Commit-Revision: 321181 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 02:50:08 -0000 Author: ngie Date: Wed Jul 19 02:50:06 2017 New Revision: 321181 URL: https://svnweb.freebsd.org/changeset/base/321181 Log: MFC r318723: bsdinstall(8): fix manpage issues - Start new sentences on new lines. - Separate e.g. (more of an igor thing) with commas, and rewrite some examples not to be enclosed in parentheses. Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:49:07 2017 (r321180) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:50:06 2017 (r321181) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2014 +.Dd May 23, 2017 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -39,17 +39,18 @@ .Sh DESCRIPTION .Nm is used for installation of new systems, both for system setup from -installation media (e.g. CD-ROMs) and for use on live systems to prepare +installation media, e.g., CD-ROMs, and for use on live systems to prepare VM images and jails. .Pp Much like .Xr make 1 , Nm -takes a target and possible parameters of the target as arguments. If -invoked with no arguments, it will invoke the +takes a target and possible parameters of the target as arguments. +If invoked with no arguments, it will invoke the .Cm auto target, which provides a standard interactive installation, invoking the -others in sequence. To perform a scripted installation, these subtargets -can be invoked separately by an installation script. +others in sequence. +To perform a scripted installation, +these subtargets can be invoked separately by an installation script. .Sh OPTIONS .Nm supports the following options, global to all targets: @@ -115,7 +116,8 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Defaults to UFS. +installations. +Defaults to UFS. .It Cm zfsboot Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single @@ -135,8 +137,8 @@ to encrypt the disk. Provides the installer's interactive manual disk partitioner with an interface identical to .Xr sade 8 . -Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS -is set up with one pool and dataset per partition. +Supports multiple disks as well as UFS, ZFS, and FAT file systems. +ZFS is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -150,14 +152,16 @@ Each disk setup is specified by a three-part argument: .Op Ar scheme .Op Ar {partitions} .Pp -Multiple disk setups are separated by semicolons. The +Multiple disk setups are separated by semicolons. +The .Ar disk argument specifies the disk on which to operate (which will be erased), while the .Ar scheme argument specifies the .Xr gpart 8 -partition scheme to apply to the disk. If +partition scheme to apply to the disk. +If .Ar scheme is unspecified, .Cm scriptedpart @@ -167,7 +171,8 @@ The argument is also optional and specifies how to partition .Ar disk . It consists of a comma-separated list of partitions to create enclosed in -curly braces. Each partition declaration takes the form +curly braces. +Each partition declaration takes the form .Pp .Ar size .Ar type @@ -178,15 +183,17 @@ specifies the partition size to create in bytes (K, M, can be appended to specify kilobytes, megabytes, and gigabytes respectively), while the .Em auto -keyword causes the partition to take all the remaining space on the disk. The +keyword causes the partition to take all the remaining space on the disk. +The .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). +filesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap. The optional .Ar mount point argument sets where the created partition is to be mounted in the installed -system. As an example, a typical invocation looks like: +system. +As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } .Pp @@ -238,37 +245,43 @@ Reads a small amount of data from .Pa /dev/random and stores it in a file in the new system's root directory. .It Cm config -Installs the configuration files destined for the new system (e.g. rc.conf +Installs the configuration files destined for the new system, e.g., +.Xr rc.conf 5 fragments generated by .Cm netconfig , etc.) onto the new system. .El .Sh ENVIRONMENT VARIABLES The following environment variables control various aspects of the installation -process. Many are used internally during installation and have reasonable -default values for most installation scenarios. Others are set by various -interactive user prompts, and can be usefully overridden when making scripted -or customized installers. +process. +Many are used internally during installation and have reasonable default values +for most installation scenarios. +Others are set by various interactive user prompts, and can be usefully +overridden when making scripted or customized installers. .Bl -tag -width ".Ev BSDINSTALL_DISTSITE" .It Ev DISTRIBUTIONS -The set of distributions to install (e.g. "base kernel ports"). Default: none +The set of distributions to install, e.g., "base kernel ports". +Default: none .It Ev BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they -should be downloaded). Default: +should be downloaded). +Default: .Pa /usr/freebsd-dist .It Ev BSDINSTALL_DISTSITE URL from which the distribution files should be downloaded if they are not already present in the directory defined by .Ev BSDINSTALL_DISTDIR . This should be a full path to the files, including architecture and release -names. Most targets (e.g. +names. +Most targets, e.g., .Cm auto and -.Cm jail ) +.Cm jail , that prompt for a .Fx mirror will skip that step if this variable is already defined in the -environment. Example: +environment. +Example: .Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE .It Ev BSDINSTALL_CHROOT The directory into which the distribution files should be unpacked and the @@ -276,23 +289,26 @@ directory at which the root file system of the new sys Default: .Pa /mnt .It Ev BSDINSTALL_LOG -Path to a log file for the installation. Default: +Path to a log file for the installation. +Default: .Pa /tmp/bsdinstall_log .It Ev BSDINSTALL_TMPETC Directory where files destined for the new system's .Pa /etc will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_etc .It Ev BSDINSTALL_TMPBOOT Directory where files destined for the new system's .Pa /boot will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_boot .El .Sh SCRIPTING @@ -307,8 +323,9 @@ a shell script run under .Xr chroot 8 in the newly installed system before .Nm -exits. The two parts are separated by the usual script header (#!), which -also sets the interpreter for the setup script. +exits. +The two parts are separated by the usual script header (#!), which also sets +the interpreter for the setup script. .Pp A typical bsdinstall script looks like this: .Bd -literal -offset indent @@ -326,19 +343,21 @@ On release media, such a script placed at .Pa /etc/installerconfig will be run at boot time and the system will be rebooted automatically after -the installation has completed. This can be used for unattended network -installation of new systems; see +the installation has completed. +This can be used for unattended network installation of new systems; see .Xr diskless 8 for details. .Ss PREAMBLE -The preamble consists of installer settings. These control global installation -parameters (see +The preamble consists of installer settings. +These control global installation parameters (see .Sx ENVIRONMENT VARIABLES ) -as well as disk partitioning. The preamble is interpreted as a +as well as disk partitioning. +The preamble is interpreted as a .Xr sh 1 -script run at the very beginning of the install. If more complicated behavior -than setting these variables is desired, arbitrary commands can be run here -to extend the installer. In addition to the variables in +script run at the very beginning of the install. +If more complicated behavior than setting these variables is desired, +arbitrary commands can be run here to extend the installer. +In addition to the variables in .Sx ENVIRONMENT VARIABLES , in particular .Ev DISTRIBUTIONS , @@ -358,13 +377,14 @@ instead of .Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! -declaration. This script will be run at the end of the installation process -inside a +declaration. +This script will be run at the end of the installation process inside a .Xr chroot 8 environment in the newly installed system and can be used to set up -configuration files, install packages, etc. Note that newly configured -system services (e.g. networking) have not been started in the installed -system at this time and only installation host services are available. +configuration files, install packages, etc. +Note that newly configured system services, e.g., networking have not +been started in the installed system at this time and only installation +host services are available. .Sh HISTORY This version of .Nm From owner-svn-src-all@freebsd.org Wed Jul 19 03:19: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 B1F37DA779B; Wed, 19 Jul 2017 03:19:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6C868E8D; Wed, 19 Jul 2017 03:19:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6J3JiAh098728; Wed, 19 Jul 2017 03:19:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J3JiFF098727; Wed, 19 Jul 2017 03:19:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707190319.v6J3JiFF098727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 03:19: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: r321183 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 321183 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 03:19:45 -0000 Author: emaste Date: Wed Jul 19 03:19:44 2017 New Revision: 321183 URL: https://svnweb.freebsd.org/changeset/base/321183 Log: MFC r320235: retire arm64 kernel module linker workaround Relocatable linking in aarch64 ld from binutils 2.25.1 does not work. The linker corrupts the references to the external symbols which are defined by other object in the linking set and should therefore lose the GOT entry. The problem is fixed in later versions of GNU ld and does not exist in the in-tree lld linker that we now use by default for arm64, so the workaround can be removed. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Wed Jul 19 02:50:08 2017 (r321182) +++ stable/11/sys/conf/kmod.mk Wed Jul 19 03:19:44 2017 (r321183) @@ -209,17 +209,7 @@ ${PROG}.debug: ${FULLPROG} .if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld -.if ${MACHINE_CPUARCH} != "aarch64" ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld -.else -#XXXKIB Relocatable linking in aarch64 ld from binutils 2.25.1 does -# not work. The linker corrupts the references to the external -# symbols which are defined by other object in the linking set -# and should therefore loose the GOT entry. The problem seems -# to be fixed in the binutils-gdb git HEAD as of 2015-10-04. Hack -# below allows to get partially functioning modules for now. - ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS} -.endif .if !defined(DEBUG_FLAGS) ${OBJCOPY} --strip-debug ${.TARGET} .endif From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 A65D1DAAB52; Wed, 19 Jul 2017 07:02:15 +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 1DC856E16A; Wed, 19 Jul 2017 07:02:15 +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 v6J72Ewh090682; Wed, 19 Jul 2017 07:02:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72Bex090654; Wed, 19 Jul 2017 07:02:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72Bex090654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321184 - in vendor/llvm/dist: . docs docs/CommandGuide include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/DWARF include/llvm/DebugInfo/PD... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: . docs docs/CommandGuide include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/DWARF include/llvm/DebugInfo/PDB include/llvm/DebugInfo/... X-SVN-Commit-Revision: 321184 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:15 -0000 Author: dim Date: Wed Jul 19 07:02:10 2017 New Revision: 321184 URL: https://svnweb.freebsd.org/changeset/base/321184 Log: Vendor import of llvm trunk r308421: https://llvm.org/svn/llvm-project/llvm/trunk@308421 Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h (contents, props changed) vendor/llvm/dist/include/llvm/ToolDrivers/llvm-dlltool/ vendor/llvm/dist/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/FlagsTest.cpp (contents, props changed) vendor/llvm/dist/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp (contents, props changed) vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ14.td vendor/llvm/dist/lib/Target/X86/X86CmovConversion.cpp (contents, props changed) vendor/llvm/dist/lib/Target/X86/X86ScheduleZnver1.td vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/ vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/Options.td vendor/llvm/dist/test/Bitcode/upgrade-importedentity.ll vendor/llvm/dist/test/Bitcode/upgrade-importedentity.ll.bc (contents, props changed) vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-fma.mir vendor/llvm/dist/test/CodeGen/AArch64/aarch64_win64cc_vararg.ll vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf-fix.ll vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf-fix.mir vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf.ll vendor/llvm/dist/test/CodeGen/AArch64/win64_vararg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll vendor/llvm/dist/test/CodeGen/AMDGPU/move-to-valu-worklist.ll vendor/llvm/dist/test/CodeGen/BPF/select_ri.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-explicit-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-function-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-text-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-load-v4i16.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-v4i16.ll vendor/llvm/dist/test/CodeGen/MIR/AMDGPU/fold-multiple.mir vendor/llvm/dist/test/CodeGen/Mips/long-calls.ll vendor/llvm/dist/test/CodeGen/PowerPC/PR33671.ll vendor/llvm/dist/test/CodeGen/SPARC/soft-mul-div.ll vendor/llvm/dist/test/CodeGen/SystemZ/branch-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-abs-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-abs-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-add-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-cmp-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-const-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-conv-15.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-conv-16.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-copysign-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-div-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-move-13.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-12.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-neg-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-round-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sqrt-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sub-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-add-17.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-09.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-sub-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/tdc-07.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-abs-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-add-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-and-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-cmp-07.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-ctpop-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-div-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-max-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-min-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-move-18.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-neg-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-or-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-round-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-sqrt-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-sub-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-xor-02.ll vendor/llvm/dist/test/CodeGen/Thumb/litpoolremat.ll vendor/llvm/dist/test/CodeGen/X86/alias-static-alloca.ll vendor/llvm/dist/test/CodeGen/X86/avx512-rotate.ll vendor/llvm/dist/test/CodeGen/X86/bmi-schedule.ll vendor/llvm/dist/test/CodeGen/X86/bmi2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/bswap-rotate.ll vendor/llvm/dist/test/CodeGen/X86/f16c-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lea32-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lea64-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lzcnt-schedule.ll vendor/llvm/dist/test/CodeGen/X86/memcmp-minsize.ll vendor/llvm/dist/test/CodeGen/X86/memcmp-optsize.ll vendor/llvm/dist/test/CodeGen/X86/popcnt-schedule.ll vendor/llvm/dist/test/CodeGen/X86/pr32282.ll vendor/llvm/dist/test/CodeGen/X86/pr32515.ll vendor/llvm/dist/test/CodeGen/X86/pr33772.ll vendor/llvm/dist/test/CodeGen/X86/pr33828.ll vendor/llvm/dist/test/CodeGen/X86/rotate_vec.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-512.ll vendor/llvm/dist/test/CodeGen/X86/x86-cmov-converter.ll vendor/llvm/dist/test/DllTool/ vendor/llvm/dist/test/DllTool/coff-exports.def vendor/llvm/dist/test/DllTool/coff-weak-exports.def vendor/llvm/dist/test/DllTool/lit.local.cfg vendor/llvm/dist/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll vendor/llvm/dist/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_64.ll vendor/llvm/dist/test/MC/AArch64/coff-relocations.s (contents, props changed) vendor/llvm/dist/test/MC/AArch64/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/SystemZ/insns-z14.txt (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/insn-bad-z14.s (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/insn-good-z14.s (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/ObjectYAML/CodeView/ vendor/llvm/dist/test/ObjectYAML/CodeView/guid.yaml vendor/llvm/dist/test/Other/cgscc-libcall-update.ll vendor/llvm/dist/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll vendor/llvm/dist/test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll vendor/llvm/dist/test/Transforms/GlobalOpt/pr33686.ll vendor/llvm/dist/test/Transforms/IRCE/eq_ne.ll vendor/llvm/dist/test/Transforms/IRCE/pre_post_loops.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/ext.ll vendor/llvm/dist/test/Transforms/Inline/PowerPC/ vendor/llvm/dist/test/Transforms/Inline/PowerPC/ext.ll vendor/llvm/dist/test/Transforms/Inline/PowerPC/lit.local.cfg vendor/llvm/dist/test/Transforms/Inline/X86/ext.ll vendor/llvm/dist/test/Transforms/InstCombine/element-atomic-memintrins.ll vendor/llvm/dist/test/Transforms/InstCombine/pr33765.ll vendor/llvm/dist/test/Transforms/LoopInterchange/current-limitations-lcssa.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-not-profitable.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-output-dependencies.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-simple-count-down.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-simple-count-up.ll vendor/llvm/dist/test/Transforms/LoopInterchange/loop-interchange-optimization-remarks.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-dependencies-1.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-loop-nest-3.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-tightly-nested.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll vendor/llvm/dist/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/verify_debug_info.s (contents, props changed) vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s (contents, props changed) vendor/llvm/dist/test/tools/llvm-mt/ vendor/llvm/dist/test/tools/llvm-mt/help.test vendor/llvm/dist/test/tools/llvm-objdump/AArch64/Inputs/reloc-addend.obj.macho-aarch64 (contents, props changed) vendor/llvm/dist/test/tools/llvm-objdump/AArch64/macho-reloc-addend.test vendor/llvm/dist/tools/llvm-mt/ vendor/llvm/dist/tools/llvm-mt/CMakeLists.txt (contents, props changed) vendor/llvm/dist/tools/llvm-mt/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/tools/llvm-mt/Opts.td vendor/llvm/dist/tools/llvm-mt/llvm-mt.cpp (contents, props changed) vendor/llvm/dist/unittests/IR/CFGBuilder.cpp (contents, props changed) vendor/llvm/dist/unittests/IR/CFGBuilder.h (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeServerHandler.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTraceState.cpp vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-loadv4i16.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics.ll vendor/llvm/dist/test/MC/Mips/mt/invalid-wrong-error.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-reserved-valid.s vendor/llvm/dist/test/Transforms/InstCombine/and-not-or.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange.ll vendor/llvm/dist/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp Modified: vendor/llvm/dist/RELEASE_TESTERS.TXT vendor/llvm/dist/docs/AliasAnalysis.rst vendor/llvm/dist/docs/CodingStandards.rst vendor/llvm/dist/docs/CommandGuide/lit.rst vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/PostDominators.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFVerifier.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/GenericError.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/Formatters.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/InfoStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.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/RawTypes.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiHashing.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/PDBExtras.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/RTDyldMemoryManager.h vendor/llvm/dist/include/llvm/IR/CallingConv.h vendor/llvm/dist/include/llvm/IR/Constants.h vendor/llvm/dist/include/llvm/IR/DIBuilder.h vendor/llvm/dist/include/llvm/IR/DebugInfoMetadata.h vendor/llvm/dist/include/llvm/IR/Dominators.h vendor/llvm/dist/include/llvm/IR/IntrinsicsHexagon.td vendor/llvm/dist/include/llvm/IR/IntrinsicsSystemZ.td vendor/llvm/dist/include/llvm/MC/LaneBitmask.h vendor/llvm/dist/include/llvm/MC/MCFixup.h vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h vendor/llvm/dist/include/llvm/Object/COFFImportFile.h vendor/llvm/dist/include/llvm/Object/COFFModuleDefinition.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLTypes.h vendor/llvm/dist/include/llvm/Support/AArch64TargetParser.def vendor/llvm/dist/include/llvm/Support/BinaryItemStream.h vendor/llvm/dist/include/llvm/Support/Format.h vendor/llvm/dist/include/llvm/Support/GenericDomTree.h vendor/llvm/dist/include/llvm/Support/GenericDomTreeConstruction.h vendor/llvm/dist/include/llvm/Support/TargetParser.h vendor/llvm/dist/include/llvm/Support/YAMLTraits.h vendor/llvm/dist/include/llvm/Target/GlobalISel/SelectionDAGCompat.td vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/lib/Analysis/CGSCCPassManager.cpp vendor/llvm/dist/lib/Analysis/DominanceFrontier.cpp vendor/llvm/dist/lib/Analysis/InstCount.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/IteratedDominanceFrontier.cpp vendor/llvm/dist/lib/Analysis/LazyCallGraph.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemorySSA.cpp vendor/llvm/dist/lib/Analysis/PostDominators.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/AsmParser/LLLexer.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/AsmParser/LLToken.h vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm/dist/lib/CodeGen/MachineCombiner.cpp vendor/llvm/dist/lib/CodeGen/MachineDominanceFrontier.cpp vendor/llvm/dist/lib/CodeGen/MachineDominators.cpp vendor/llvm/dist/lib/CodeGen/MachinePostDominators.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/XRayInstrumentation.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/Formatters.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeStreamMerger.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFVerifier.cpp vendor/llvm/dist/lib/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/GenericError.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStreamBuilder.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/TpiHashing.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/PDBExtras.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h 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/FuzzerFlags.def vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMerge.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMutate.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMutate.h vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.h vendor/llvm/dist/lib/Fuzzer/FuzzerUtil.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerUtil.h vendor/llvm/dist/lib/Fuzzer/afl/afl_driver.cpp vendor/llvm/dist/lib/Fuzzer/test/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/test/FuzzerUnittest.cpp vendor/llvm/dist/lib/Fuzzer/test/fuzzer-flags.test vendor/llvm/dist/lib/Fuzzer/test/fuzzer-traces-hooks.test vendor/llvm/dist/lib/Fuzzer/test/reduce_inputs.test vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/Constants.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/IR/DIBuilder.cpp vendor/llvm/dist/lib/IR/DebugInfoMetadata.cpp vendor/llvm/dist/lib/IR/Dominators.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.h vendor/llvm/dist/lib/IR/LegacyPassManager.cpp vendor/llvm/dist/lib/IR/Module.cpp vendor/llvm/dist/lib/Object/ArchiveWriter.cpp vendor/llvm/dist/lib/Object/COFFImportFile.cpp vendor/llvm/dist/lib/Object/COFFModuleDefinition.cpp vendor/llvm/dist/lib/Object/COFFObjectFile.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLTypes.cpp vendor/llvm/dist/lib/Option/OptTable.cpp vendor/llvm/dist/lib/Support/ErrorHandling.cpp vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/Path.cpp vendor/llvm/dist/lib/Support/TargetParser.cpp vendor/llvm/dist/lib/Support/YAMLTraits.cpp vendor/llvm/dist/lib/Support/raw_ostream.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.h vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64CallingConvention.td vendor/llvm/dist/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstrAtomics.td 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/AArch64LegalizerInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterInfo.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/AArch64TargetMachine.h vendor/llvm/dist/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp vendor/llvm/dist/lib/Target/AArch64/CMakeLists.txt vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIFrameLowering.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/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.td vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/VOP2Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3PInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPCInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPInstructions.td vendor/llvm/dist/lib/Target/ARM/ARM.td vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMMCInstLower.cpp vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonBitSimplify.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonDepInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonEarlyIfConv.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonExpandCondsets.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonFrameLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonGenInsert.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonGenPredicate.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.h vendor/llvm/dist/lib/Target/Hexagon/HexagonIntrinsics.td vendor/llvm/dist/lib/Target/Hexagon/HexagonOptAddrMode.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetObjectFile.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetObjectFile.h vendor/llvm/dist/lib/Target/Mips/AsmParser/MipsAsmParser.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp vendor/llvm/dist/lib/Target/Mips/Mips.td vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrFPU.td vendor/llvm/dist/lib/Target/Mips/MipsMTInstrFormats.td vendor/llvm/dist/lib/Target/Mips/MipsMTInstrInfo.td vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.h vendor/llvm/dist/lib/Target/Mips/MipsSEISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsSchedule.td vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/Mips/MipsTargetStreamer.h vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.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.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.h vendor/llvm/dist/lib/Target/Sparc/Sparc.td vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp vendor/llvm/dist/lib/Target/Sparc/SparcInstrInfo.td vendor/llvm/dist/lib/Target/Sparc/SparcSubtarget.cpp vendor/llvm/dist/lib/Target/Sparc/SparcSubtarget.h vendor/llvm/dist/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp vendor/llvm/dist/lib/Target/SystemZ/LLVMBuild.txt vendor/llvm/dist/lib/Target/SystemZ/SystemZFeatures.td vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.h vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFP.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFormats.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrSystem.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrVector.td vendor/llvm/dist/lib/Target/SystemZ/SystemZOperators.td vendor/llvm/dist/lib/Target/SystemZ/SystemZPatterns.td vendor/llvm/dist/lib/Target/SystemZ/SystemZProcessors.td vendor/llvm/dist/lib/Target/SystemZ/SystemZRegisterInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZSchedule.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ196.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZEC12.td vendor/llvm/dist/lib/Target/SystemZ/SystemZShortenInst.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.h vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.h vendor/llvm/dist/lib/Target/X86/CMakeLists.txt vendor/llvm/dist/lib/Target/X86/X86.h vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86CallingConv.td vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp vendor/llvm/dist/lib/Target/X86/X86FixupBWInsts.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86RegisterInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Schedule.td vendor/llvm/dist/lib/Target/X86/X86ScheduleBtVer2.td vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.h vendor/llvm/dist/lib/ToolDrivers/CMakeLists.txt vendor/llvm/dist/lib/ToolDrivers/LLVMBuild.txt vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/Inliner.cpp vendor/llvm/dist/lib/Transforms/IPO/SampleProfile.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInterchange.cpp vendor/llvm/dist/lib/Transforms/Scalar/TailRecursionElimination.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollRuntime.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/test/Analysis/CostModel/SystemZ/fp-arith.ll vendor/llvm/dist/test/Assembler/diimportedentity.ll vendor/llvm/dist/test/Bitcode/DIGlobalVariableExpression.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/CMakeLists.txt vendor/llvm/dist/test/CodeGen/AArch64/arm64-abi-varargs.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-abi_align.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-extern-weak.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-inline-asm.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-platform-reg.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vext.ll vendor/llvm/dist/test/CodeGen/AArch64/atomic-ops-lse.ll vendor/llvm/dist/test/CodeGen/AArch64/dag-combine-invaraints.ll vendor/llvm/dist/test/CodeGen/AArch64/extern-weak.ll vendor/llvm/dist/test/CodeGen/AArch64/preferred-function-alignment.ll vendor/llvm/dist/test/CodeGen/AArch64/swifterror.ll vendor/llvm/dist/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll vendor/llvm/dist/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll vendor/llvm/dist/test/CodeGen/AMDGPU/attr-amdgpu-waves-per-eu.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize-elimination.ll vendor/llvm/dist/test/CodeGen/AMDGPU/function-args.ll vendor/llvm/dist/test/CodeGen/AMDGPU/hsa.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ps.live.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf-offset-private.ll vendor/llvm/dist/test/CodeGen/AMDGPU/parallelandifcollapse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/parallelorifcollapse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/private-access-no-objects.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rename-independent-subregs-mac-operands.mir vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-simple.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-peephole-instr.mir vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-vop2-64bit.mir vendor/llvm/dist/test/CodeGen/AMDGPU/trap.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vccz-corrupt-bug-workaround.mir vendor/llvm/dist/test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel-divmod.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalize-divmod.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/atomic-op.ll vendor/llvm/dist/test/CodeGen/AVR/branch-relaxation.ll vendor/llvm/dist/test/CodeGen/BPF/setcc.ll vendor/llvm/dist/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll vendor/llvm/dist/test/CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll vendor/llvm/dist/test/CodeGen/Generic/print-mul-exp.ll vendor/llvm/dist/test/CodeGen/Generic/print-mul.ll vendor/llvm/dist/test/CodeGen/Generic/print-shift.ll vendor/llvm/dist/test/CodeGen/Generic/v-split.ll vendor/llvm/dist/test/CodeGen/Generic/vector-redux.ll vendor/llvm/dist/test/CodeGen/Generic/vector.ll vendor/llvm/dist/test/CodeGen/Hexagon/intrinsics/system_user.ll vendor/llvm/dist/test/CodeGen/Hexagon/v6vec-vprint.ll vendor/llvm/dist/test/CodeGen/MIR/AArch64/target-memoperands.mir vendor/llvm/dist/test/CodeGen/MSP430/vararg.ll vendor/llvm/dist/test/CodeGen/Mips/2008-06-05-Carry.ll vendor/llvm/dist/test/CodeGen/Mips/dins.ll vendor/llvm/dist/test/CodeGen/Mips/dsp-patterns.ll vendor/llvm/dist/test/CodeGen/Mips/llcarry.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/add.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/sub.ll vendor/llvm/dist/test/CodeGen/Mips/madd-msub.ll vendor/llvm/dist/test/CodeGen/Mips/msa/f16-llvm-ir.ll vendor/llvm/dist/test/CodeGen/PowerPC/build-vector-tests.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-i128-abi.ll vendor/llvm/dist/test/CodeGen/PowerPC/swaps-le-6.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-p9.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-add-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-cmp-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-div-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-08.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sqrt-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sub-01.ll vendor/llvm/dist/test/CodeGen/Thumb/select.ll vendor/llvm/dist/test/CodeGen/WebAssembly/indirect-import.ll vendor/llvm/dist/test/CodeGen/WebAssembly/userstack.ll vendor/llvm/dist/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll vendor/llvm/dist/test/CodeGen/X86/2009-06-03-Win64DisableRedZone.ll vendor/llvm/dist/test/CodeGen/X86/2011-10-19-widen_vselect.ll vendor/llvm/dist/test/CodeGen/X86/DynamicCalleeSavedRegisters.ll vendor/llvm/dist/test/CodeGen/X86/atomic-minmax-i6432.ll vendor/llvm/dist/test/CodeGen/X86/atomic128.ll vendor/llvm/dist/test/CodeGen/X86/avx-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx2-arith.ll vendor/llvm/dist/test/CodeGen/X86/avx2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx2-vector-shifts.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mask-op.ll vendor/llvm/dist/test/CodeGen/X86/avx512-shift.ll vendor/llvm/dist/test/CodeGen/X86/bool-ext-inc.ll vendor/llvm/dist/test/CodeGen/X86/clobber-fi0.ll vendor/llvm/dist/test/CodeGen/X86/combine-rotates.ll vendor/llvm/dist/test/CodeGen/X86/combine-shl.ll vendor/llvm/dist/test/CodeGen/X86/combine-srl.ll vendor/llvm/dist/test/CodeGen/X86/combine-udiv.ll vendor/llvm/dist/test/CodeGen/X86/combine-urem.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-x86-64.ll vendor/llvm/dist/test/CodeGen/X86/hipe-cc.ll vendor/llvm/dist/test/CodeGen/X86/hipe-cc64.ll vendor/llvm/dist/test/CodeGen/X86/legalize-shift-64.ll vendor/llvm/dist/test/CodeGen/X86/machine-outliner-debuginfo.ll vendor/llvm/dist/test/CodeGen/X86/machine-outliner.ll vendor/llvm/dist/test/CodeGen/X86/memcmp.ll vendor/llvm/dist/test/CodeGen/X86/pmul.ll vendor/llvm/dist/test/CodeGen/X86/regparm.ll vendor/llvm/dist/test/CodeGen/X86/sibcall-win64.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/sse4a-schedule.ll vendor/llvm/dist/test/CodeGen/X86/ssse3-schedule.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-invoke.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-stack-usage.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-vector.ll vendor/llvm/dist/test/CodeGen/X86/vec_cmp_uint-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-sdiv-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-sdiv-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-udiv-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-udiv-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-256.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/vselect-avx.ll vendor/llvm/dist/test/CodeGen/X86/widen_arith-2.ll vendor/llvm/dist/test/CodeGen/X86/widen_cast-4.ll vendor/llvm/dist/test/CodeGen/X86/win64-nosse-csrs.ll vendor/llvm/dist/test/CodeGen/X86/win64_nonvol.ll vendor/llvm/dist/test/CodeGen/X86/win64_params.ll vendor/llvm/dist/test/CodeGen/X86/win_chkstk.ll vendor/llvm/dist/test/CodeGen/X86/win_coreclr_chkstk.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-ms_abi-vararg.ll vendor/llvm/dist/test/CodeGen/XCore/varargs.ll vendor/llvm/dist/test/DebugInfo/Generic/namespace.ll vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-headers.test vendor/llvm/dist/test/DebugInfo/X86/DIModule.ll vendor/llvm/dist/test/DebugInfo/X86/DIModuleContext.ll vendor/llvm/dist/test/DebugInfo/X86/fission-inline.ll vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names.ll vendor/llvm/dist/test/DebugInfo/X86/lexical-block-file-inline.ll vendor/llvm/dist/test/DebugInfo/X86/pr19307.ll vendor/llvm/dist/test/FileCheck/regex-scope.txt vendor/llvm/dist/test/Instrumentation/AddressSanitizer/basic.ll vendor/llvm/dist/test/Instrumentation/EfficiencySanitizer/working_set_basic.ll vendor/llvm/dist/test/Instrumentation/EfficiencySanitizer/working_set_slow.ll vendor/llvm/dist/test/Instrumentation/MemorySanitizer/msan_basic.ll vendor/llvm/dist/test/Linker/pr26037.ll vendor/llvm/dist/test/MC/AMDGPU/gfx9_asm_all.s vendor/llvm/dist/test/MC/AMDGPU/vop3-errs.s vendor/llvm/dist/test/MC/ARM/virtexts-thumb.s vendor/llvm/dist/test/MC/Disassembler/AMDGPU/gfx9_dasm_all.txt vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2-el.txt vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2.txt vendor/llvm/dist/test/MC/Mips/mt/invalid.s vendor/llvm/dist/test/MC/Mips/mt/valid.s vendor/llvm/dist/test/MC/SystemZ/insn-bad-z13.s vendor/llvm/dist/test/MC/X86/pr22028.s vendor/llvm/dist/test/Object/no-section-table.test vendor/llvm/dist/test/Object/readobj-shared-object.test vendor/llvm/dist/test/Other/new-pass-manager.ll vendor/llvm/dist/test/ThinLTO/X86/debuginfo-cu-import.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/memcmp.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate.ll vendor/llvm/dist/test/Transforms/InstCombine/2017-07-07-UMul-ZExt.ll vendor/llvm/dist/test/Transforms/InstCombine/and.ll vendor/llvm/dist/test/Transforms/InstCombine/and2.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp-logical.ll vendor/llvm/dist/test/Transforms/InstCombine/or-xor.ll vendor/llvm/dist/test/Transforms/InstCombine/or.ll vendor/llvm/dist/test/Transforms/JumpThreading/select.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/float-induction-x86.ll vendor/llvm/dist/test/Transforms/LoopVectorize/debugloc.ll vendor/llvm/dist/test/Transforms/LoopVectorize/first-order-recurrence.ll vendor/llvm/dist/test/Transforms/LoopVectorize/float-induction.ll vendor/llvm/dist/test/Transforms/LoopVectorize/if-conversion-nest.ll vendor/llvm/dist/test/Transforms/LoopVectorize/induction-step.ll vendor/llvm/dist/test/Transforms/LoopVectorize/induction.ll vendor/llvm/dist/test/Transforms/LoopVectorize/interleaved-accesses-pred-stores.ll vendor/llvm/dist/test/Transforms/LoopVectorize/interleaved-accesses.ll vendor/llvm/dist/test/Transforms/LoopVectorize/iv_outside_user.ll vendor/llvm/dist/test/Transforms/LoopVectorize/miniters.ll vendor/llvm/dist/test/Transforms/LoopVectorize/runtime-check-readonly.ll vendor/llvm/dist/test/Transforms/LoopVectorize/runtime-check.ll vendor/llvm/dist/test/tools/llvm-cov/showTabsHTML.cpp vendor/llvm/dist/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86 vendor/llvm/dist/test/tools/llvm-readobj/Inputs/dynamic-table.c vendor/llvm/dist/test/tools/llvm-readobj/dynamic.test vendor/llvm/dist/test/tools/llvm-readobj/gnu-sections.test vendor/llvm/dist/tools/llvm-ar/CMakeLists.txt vendor/llvm/dist/tools/llvm-ar/llvm-ar.cpp vendor/llvm/dist/tools/llvm-objdump/llvm-objdump.cpp vendor/llvm/dist/tools/llvm-pdbutil/DumpOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalSymbolDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.h vendor/llvm/dist/tools/llvm-pdbutil/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbutil/PdbYaml.h vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.cpp vendor/llvm/dist/tools/llvm-readobj/CMakeLists.txt vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/llvm-readobj.cpp vendor/llvm/dist/tools/opt-viewer/opt-diff.py vendor/llvm/dist/tools/opt-viewer/opt-stats.py vendor/llvm/dist/tools/opt-viewer/opt-viewer.py vendor/llvm/dist/tools/opt-viewer/optpmap.py vendor/llvm/dist/tools/opt-viewer/optrecord.py vendor/llvm/dist/unittests/Analysis/CGSCCPassManagerTest.cpp vendor/llvm/dist/unittests/Analysis/LazyCallGraphTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/unittests/IR/CMakeLists.txt vendor/llvm/dist/unittests/IR/DominatorTreeTest.cpp vendor/llvm/dist/unittests/IR/IRBuilderTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/Support/TargetParserTest.cpp vendor/llvm/dist/unittests/Support/YAMLIOTest.cpp vendor/llvm/dist/unittests/Support/raw_ostream_test.cpp vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp vendor/llvm/dist/utils/lit/lit/LitConfig.py vendor/llvm/dist/utils/lit/lit/TestRunner.py vendor/llvm/dist/utils/lit/lit/main.py vendor/llvm/dist/utils/vim/syntax/llvm.vim Modified: vendor/llvm/dist/RELEASE_TESTERS.TXT ============================================================================== --- vendor/llvm/dist/RELEASE_TESTERS.TXT Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/RELEASE_TESTERS.TXT Wed Jul 19 07:02:10 2017 (r321184) @@ -41,14 +41,9 @@ E: hans@chromium.org T: x86 O: Windows -N: Renato Golin -E: renato.golin@linaro.org -T: ARM -O: Linux - N: Diana Picus E: diana.picus@linaro.org -T: AArch64 +T: ARM, AArch64 O: Linux N: Simon Dardis Modified: vendor/llvm/dist/docs/AliasAnalysis.rst ============================================================================== --- vendor/llvm/dist/docs/AliasAnalysis.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/AliasAnalysis.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -132,7 +132,8 @@ The ``MayAlias`` response is used whenever the two poi same object. The ``PartialAlias`` response is used when the two memory objects are known to -be overlapping in some way, but do not start at the same address. +be overlapping in some way, regardless whether they start at the same address +or not. The ``MustAlias`` response may only be returned if the two memory objects are guaranteed to always start at exactly the same location. A ``MustAlias`` Modified: vendor/llvm/dist/docs/CodingStandards.rst ============================================================================== --- vendor/llvm/dist/docs/CodingStandards.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/CodingStandards.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -34,10 +34,10 @@ There are some conventions that are not uniformly foll (e.g. the naming convention). This is because they are relatively new, and a lot of code was written before they were put in place. Our long term goal is for the entire codebase to follow the convention, but we explicitly *do not* -want patches that do large-scale reformating of existing code. On the other +want patches that do large-scale reformatting of existing code. On the other hand, it is reasonable to rename the methods of a class if you're about to -change it in some other way. Just do the reformating as a separate commit from -the functionality change. +change it in some other way. Just do the reformatting as a separate commit +from the functionality change. The ultimate goal of these guidelines is to increase the readability and maintainability of our common source base. If you have suggestions for topics to Modified: vendor/llvm/dist/docs/CommandGuide/lit.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/lit.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/CommandGuide/lit.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -80,6 +80,13 @@ OUTPUT OPTIONS Show more information on test failures, for example the entire test output instead of just the test result. +.. option:: -vv, --echo-all-commands + + Echo all commands to stdout, as they are being executed. + This can be valuable for debugging test failures, as the last echoed command + will be the one which has failed. + This option implies ``--verbose``. + .. option:: -a, --show-all Show more information about all tests, for example the entire test Modified: vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -29,9 +29,9 @@ namespace llvm { /// DominanceFrontierBase - Common base class for computing forward and inverse /// dominance frontiers for a function. /// -template +template class DominanceFrontierBase { -public: + public: typedef std::set DomSetType; // Dom set for a bb typedef std::map DomSetMapType; // Dom set map @@ -40,10 +40,10 @@ class DominanceFrontierBase { (protected) DomSetMapType Frontiers; std::vector Roots; - const bool IsPostDominators; + static constexpr bool IsPostDominators = IsPostDom; -public: - DominanceFrontierBase(bool isPostDom) : IsPostDominators(isPostDom) {} + public: + DominanceFrontierBase() {} /// getRoots - Return the root blocks of the current CFG. This may include /// multiple blocks if we are computing post dominators. For forward @@ -96,7 +96,7 @@ class DominanceFrontierBase { (protected) /// compare - Return true if the other dominance frontier base matches /// this dominance frontier base. Otherwise return false. - bool compare(DominanceFrontierBase &Other) const; + bool compare(DominanceFrontierBase &Other) const; /// print - Convert to human readable form /// @@ -113,22 +113,21 @@ class DominanceFrontierBase { (protected) /// used to compute a forward dominator frontiers. /// template -class ForwardDominanceFrontierBase : public DominanceFrontierBase { -private: +class ForwardDominanceFrontierBase + : public DominanceFrontierBase { + private: typedef GraphTraits BlockTraits; public: - typedef DominatorTreeBase DomTreeT; - typedef DomTreeNodeBase DomTreeNodeT; - typedef typename DominanceFrontierBase::DomSetType DomSetType; + typedef DomTreeBase DomTreeT; + typedef DomTreeNodeBase DomTreeNodeT; + typedef typename DominanceFrontierBase::DomSetType DomSetType; - ForwardDominanceFrontierBase() : DominanceFrontierBase(false) {} - - void analyze(DomTreeT &DT) { - this->Roots = DT.getRoots(); - assert(this->Roots.size() == 1 && - "Only one entry block for forward domfronts!"); - calculate(DT, DT[this->Roots[0]]); + void analyze(DomTreeT &DT) { + this->Roots = DT.getRoots(); + assert(this->Roots.size() == 1 && + "Only one entry block for forward domfronts!"); + calculate(DT, DT[this->Roots[0]]); } const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node); @@ -136,15 +135,16 @@ class ForwardDominanceFrontierBase : public DominanceF class DominanceFrontier : public ForwardDominanceFrontierBase { public: - typedef DominatorTreeBase DomTreeT; - typedef DomTreeNodeBase DomTreeNodeT; - typedef DominanceFrontierBase::DomSetType DomSetType; - typedef DominanceFrontierBase::iterator iterator; - typedef DominanceFrontierBase::const_iterator const_iterator; + typedef DomTreeBase DomTreeT; + typedef DomTreeNodeBase DomTreeNodeT; + typedef DominanceFrontierBase::DomSetType DomSetType; + typedef DominanceFrontierBase::iterator iterator; + typedef DominanceFrontierBase::const_iterator + const_iterator; - /// Handle invalidation explicitly. - bool invalidate(Function &F, const PreservedAnalyses &PA, - FunctionAnalysisManager::Invalidator &); + /// Handle invalidation explicitly. + bool invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &); }; class DominanceFrontierWrapperPass : public FunctionPass { @@ -168,7 +168,8 @@ class DominanceFrontierWrapperPass : public FunctionPa void dump() const; }; -extern template class DominanceFrontierBase; +extern template class DominanceFrontierBase; +extern template class DominanceFrontierBase; extern template class ForwardDominanceFrontierBase; /// \brief Analysis pass which computes a \c DominanceFrontier. Modified: vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -39,33 +39,33 @@ class DFCalculateWorkObject { (public) const DomTreeNodeT *parentNode; }; -template -void DominanceFrontierBase::removeBlock(BlockT *BB) { +template +void DominanceFrontierBase::removeBlock(BlockT *BB) { assert(find(BB) != end() && "Block is not in DominanceFrontier!"); for (iterator I = begin(), E = end(); I != E; ++I) I->second.erase(BB); Frontiers.erase(BB); } -template -void DominanceFrontierBase::addToFrontier(iterator I, - BlockT *Node) { +template +void DominanceFrontierBase::addToFrontier(iterator I, + BlockT *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB"); I->second.erase(Node); } -template -void DominanceFrontierBase::removeFromFrontier(iterator I, - BlockT *Node) { +template +void DominanceFrontierBase::removeFromFrontier( + iterator I, BlockT *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB"); I->second.erase(Node); } -template -bool DominanceFrontierBase::compareDomSet(DomSetType &DS1, - const DomSetType &DS2) const { +template +bool DominanceFrontierBase::compareDomSet( + DomSetType &DS1, const DomSetType &DS2) const { std::set tmpSet; for (BlockT *BB : DS2) tmpSet.insert(BB); @@ -88,9 +88,9 @@ bool DominanceFrontierBase::compareDomSet(DomS return false; } -template -bool DominanceFrontierBase::compare( - DominanceFrontierBase &Other) const { +template +bool DominanceFrontierBase::compare( + DominanceFrontierBase &Other) const { DomSetMapType tmpFrontiers; for (typename DomSetMapType::const_iterator I = Other.begin(), E = Other.end(); @@ -118,8 +118,8 @@ bool DominanceFrontierBase::compare( return false; } -template -void DominanceFrontierBase::print(raw_ostream &OS) const { +template +void DominanceFrontierBase::print(raw_ostream &OS) const { for (const_iterator I = begin(), E = end(); I != E; ++I) { OS << " DomFrontier for BB "; if (I->first) @@ -142,8 +142,8 @@ void DominanceFrontierBase::print(raw_ostream } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -template -void DominanceFrontierBase::dump() const { +template +void DominanceFrontierBase::dump() const { print(dbgs()); } #endif Modified: vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -42,12 +42,12 @@ namespace llvm { /// By default, liveness is not used to prune the IDF computation. /// The template parameters should be either BasicBlock* or Inverse, depending on if you want the forward or reverse IDF. -template +template class IDFCalculator { + public: + IDFCalculator(DominatorTreeBase &DT) + : DT(DT), useLiveIn(false) {} -public: - IDFCalculator(DominatorTreeBase &DT) : DT(DT), useLiveIn(false) {} - /// \brief Give the IDF calculator the set of blocks in which the value is /// defined. This is equivalent to the set of starting blocks it should be /// calculating the IDF for (though later gets pruned based on liveness). @@ -84,12 +84,12 @@ class IDFCalculator { (public) void calculate(SmallVectorImpl &IDFBlocks); private: - DominatorTreeBase &DT; - bool useLiveIn; - const SmallPtrSetImpl *LiveInBlocks; - const SmallPtrSetImpl *DefBlocks; + DominatorTreeBase &DT; + bool useLiveIn; + const SmallPtrSetImpl *LiveInBlocks; + const SmallPtrSetImpl *DefBlocks; }; -typedef IDFCalculator ForwardIDFCalculator; -typedef IDFCalculator> ReverseIDFCalculator; +typedef IDFCalculator ForwardIDFCalculator; +typedef IDFCalculator, true> ReverseIDFCalculator; } #endif Modified: vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Wed Jul 19 07:02:10 2017 (r321184) @@ -43,6 +43,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" @@ -908,7 +909,7 @@ class LazyCallGraph { (public) /// This sets up the graph and computes all of the entry points of the graph. /// No function definitions are scanned until their nodes in the graph are /// requested during traversal. - LazyCallGraph(Module &M); + LazyCallGraph(Module &M, TargetLibraryInfo &TLI); LazyCallGraph(LazyCallGraph &&G); LazyCallGraph &operator=(LazyCallGraph &&RHS); @@ -966,6 +967,22 @@ class LazyCallGraph { (public) return insertInto(F, N); } + /// Get the sequence of known and defined library functions. + /// + /// These functions, because they are known to LLVM, can have calls + /// introduced out of thin air from arbitrary IR. + ArrayRef getLibFunctions() const { + return LibFunctions.getArrayRef(); + } + + /// Test whether a function is a known and defined library function tracked by + /// the call graph. + /// + /// Because these functions are known to LLVM they are specially modeled in + /// the call graph and even when all IR-level references have been removed + /// remain active and reachable. + bool isLibFunction(Function &F) const { return LibFunctions.count(&F); } + ///@{ /// \name Pre-SCC Mutation API /// @@ -1100,6 +1117,11 @@ class LazyCallGraph { (public) /// These are all of the RefSCCs which have no children. SmallVector LeafRefSCCs; + /// Defined functions that are also known library functions which the + /// optimizer can reason about and therefore might introduce calls to out of + /// thin air. + SmallSetVector LibFunctions; + /// Helper to insert a new function, with an already looked-up entry in /// the NodeMap. Node &insertInto(Function &F, Node *&MappedN); @@ -1216,8 +1238,8 @@ class LazyCallGraphAnalysis : public AnalysisInfoMixin /// /// This just builds the set of entry points to the call graph. The rest is /// built lazily as it is walked. - LazyCallGraph run(Module &M, ModuleAnalysisManager &) { - return LazyCallGraph(M); + LazyCallGraph run(Module &M, ModuleAnalysisManager &AM) { + return LazyCallGraph(M, AM.getResult(M)); } }; Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Wed Jul 19 07:02:10 2017 (r321184) @@ -56,7 +56,8 @@ class Loop; class MDNode; class PHINode; class raw_ostream; -template class DominatorTreeBase; +template +class DominatorTreeBase; template class LoopInfoBase; template class LoopBase; @@ -663,12 +664,12 @@ class LoopInfoBase { (public) } /// Create the loop forest using a stable algorithm. - void analyze(const DominatorTreeBase &DomTree); + void analyze(const DominatorTreeBase &DomTree); // Debugging void print(raw_ostream &OS) const; - void verify(const DominatorTreeBase &DomTree) const; + void verify(const DominatorTreeBase &DomTree) const; }; // Implementation in LoopInfoImpl.h @@ -683,7 +684,7 @@ class LoopInfo : public LoopInfoBase LoopInfo(const LoopInfo &) = delete; public: LoopInfo() {} - explicit LoopInfo(const DominatorTreeBase &DomTree); + explicit LoopInfo(const DominatorTreeBase &DomTree); LoopInfo(LoopInfo &&Arg) : BaseT(std::move(static_cast(Arg))) {} LoopInfo &operator=(LoopInfo &&RHS) { Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -340,10 +340,10 @@ void LoopBase::print(raw_ostream &OS, u /// Discover a subloop with the specified backedges such that: All blocks within /// this loop are mapped to this loop or a subloop. And all subloops within this /// loop have their parent loop set to this loop or a subloop. -template -static void discoverAndMapSubloop(LoopT *L, ArrayRef Backedges, - LoopInfoBase *LI, - const DominatorTreeBase &DomTree) { +template +static void discoverAndMapSubloop( + LoopT *L, ArrayRef Backedges, LoopInfoBase *LI, + const DomTreeBase &DomTree) { typedef GraphTraits > InvBlockTraits; unsigned NumBlocks = 0; @@ -462,10 +462,9 @@ void PopulateLoopsDFS::insertIntoLoop(B /// /// The Block vectors are inclusive, so step 3 requires loop-depth number of /// insertions per block. -template -void LoopInfoBase:: -analyze(const DominatorTreeBase &DomTree) { - +template +void LoopInfoBase::analyze( + const DomTreeBase &DomTree) { // Postorder traversal of the dominator tree. const DomTreeNodeBase *DomRoot = DomTree.getRootNode(); for (auto DomNode : post_order(DomRoot)) { @@ -607,7 +606,7 @@ static void compareLoops(const LoopT *L, const LoopT * template void LoopInfoBase::verify( - const DominatorTreeBase &DomTree) const { + const DomTreeBase &DomTree) const { DenseSet Loops; for (iterator I = begin(), E = end(); I != E; ++I) { assert(!(*I)->getParentLoop() && "Top-level loop has a parent!"); Modified: vendor/llvm/dist/include/llvm/Analysis/PostDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/PostDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/PostDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -22,10 +22,8 @@ namespace llvm { /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to /// compute the post-dominator tree. /// -struct PostDominatorTree : public DominatorTreeBase { - typedef DominatorTreeBase Base; - - PostDominatorTree() : DominatorTreeBase(true) {} +struct PostDominatorTree : public PostDomTreeBase { + typedef PostDomTreeBase Base; /// Handle invalidation explicitly. bool invalidate(Function &F, const PreservedAnalyses &PA, Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Wed Jul 19 07:02:10 2017 (r321184) @@ -237,17 +237,15 @@ struct FoldingSetTrait : DefaultFolding }; /// This class represents an assumption that two SCEV expressions are equal, -/// and this can be checked at run-time. We assume that the left hand side is -/// a SCEVUnknown and the right hand side a constant. +/// and this can be checked at run-time. class SCEVEqualPredicate final : public SCEVPredicate { - /// We assume that LHS == RHS, where LHS is a SCEVUnknown and RHS a - /// constant. - const SCEVUnknown *LHS; - const SCEVConstant *RHS; + /// We assume that LHS == RHS. + const SCEV *LHS; + const SCEV *RHS; public: - SCEVEqualPredicate(const FoldingSetNodeIDRef ID, const SCEVUnknown *LHS, - const SCEVConstant *RHS); + SCEVEqualPredicate(const FoldingSetNodeIDRef ID, const SCEV *LHS, + const SCEV *RHS); /// Implementation of the SCEVPredicate interface bool implies(const SCEVPredicate *N) const override; @@ -256,10 +254,10 @@ class SCEVEqualPredicate final : public SCEVPredicate const SCEV *getExpr() const override; /// Returns the left hand side of the equality. - const SCEVUnknown *getLHS() const { return LHS; } + const SCEV *getLHS() const { return LHS; } /// Returns the right hand side of the equality. - const SCEVConstant *getRHS() const { return RHS; } + const SCEV *getRHS() const { return RHS; } /// Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const SCEVPredicate *P) { @@ -1241,6 +1239,14 @@ class ScalarEvolution { (public) SmallVector NewOp(Operands.begin(), Operands.end()); return getAddRecExpr(NewOp, L, Flags); } + + /// Checks if \p SymbolicPHI can be rewritten as an AddRecExpr under some + /// Predicates. If successful return these ; + /// The function is intended to be called from PSCEV (the caller will decide + /// whether to actually add the predicates and carry out the rewrites). + Optional>> + createAddRecFromPHIWithCasts(const SCEVUnknown *SymbolicPHI); + /// Returns an expression for a GEP /// /// \p GEP The GEP. The indices contained in the GEP itself are ignored, @@ -1675,8 +1681,7 @@ class ScalarEvolution { (public) return F.getParent()->getDataLayout(); } - const SCEVPredicate *getEqualPredicate(const SCEVUnknown *LHS, - const SCEVConstant *RHS); + const SCEVPredicate *getEqualPredicate(const SCEV *LHS, const SCEV *RHS); const SCEVPredicate * getWrapPredicate(const SCEVAddRecExpr *AR, @@ -1692,6 +1697,19 @@ class ScalarEvolution { (public) SmallPtrSetImpl &Preds); private: + /// Similar to createAddRecFromPHI, but with the additional flexibility of + /// suggesting runtime overflow checks in case casts are encountered. + /// If successful, the analysis records that for this loop, \p SymbolicPHI, + /// which is the UnknownSCEV currently representing the PHI, can be rewritten + /// into an AddRec, assuming some predicates; The function then returns the + /// AddRec and the predicates as a pair, and caches this pair in + /// PredicatedSCEVRewrites. + /// If the analysis is not successful, a mapping from the \p SymbolicPHI to + /// itself (with no predicates) is recorded, and a nullptr with an empty + /// predicates vector is returned as a pair. + Optional>> + createAddRecFromPHIWithCastsImpl(const SCEVUnknown *SymbolicPHI); + /// Compute the backedge taken count knowing the interval difference, the /// stride and presence of the equality in the comparison. const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride, @@ -1722,6 +1740,12 @@ class ScalarEvolution { (public) FoldingSet UniquePreds; BumpPtrAllocator SCEVAllocator; + /// Cache tentative mappings from UnknownSCEVs in a Loop, to a SCEV expression + /// they can be rewritten into under certain predicates. + DenseMap, + std::pair>> + PredicatedSCEVRewrites; + /// The head of a linked list of all SCEVUnknown values that have been /// allocated. This is used by releaseMemory to locate them all and call /// their destructors. Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Wed Jul 19 07:02:10 2017 (r321184) @@ -155,6 +155,13 @@ class TargetTransformInfo { (public) int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) const; + /// \brief Estimate the cost of a EXT operation when lowered. + /// + /// The contract for this function is the same as \c getOperationCost except + /// that it supports an interface that provides extra information specific to + /// the EXT operation. + int getExtCost(const Instruction *I, const Value *Src) const; + /// \brief Estimate the cost of a function call when lowered. /// /// The contract for this is the same as \c getOperationCost except that it @@ -849,6 +856,7 @@ class TargetTransformInfo::Concept { (public) virtual int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) = 0; virtual int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) = 0; + virtual int getExtCost(const Instruction *I, const Value *Src) = 0; virtual int getCallCost(FunctionType *FTy, int NumArgs) = 0; virtual int getCallCost(const Function *F, int NumArgs) = 0; virtual int getCallCost(const Function *F, @@ -1021,6 +1029,9 @@ class TargetTransformInfo::Model final : public Target int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) override { return Impl.getGEPCost(PointeeType, Ptr, Operands); + } + int getExtCost(const Instruction *I, const Value *Src) override { + return Impl.getExtCost(I, Src); } int getCallCost(FunctionType *FTy, int NumArgs) override { return Impl.getCallCost(FTy, NumArgs); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -120,6 +120,10 @@ class TargetTransformInfoImplBase { (public) return SI.getNumCases(); } + int getExtCost(const Instruction *I, const Value *Src) { + return TTI::TCC_Basic; + } + unsigned getCallCost(FunctionType *FTy, int NumArgs) { assert(FTy && "FunctionType must be provided to this routine."); @@ -728,6 +732,8 @@ class TargetTransformInfoImplCRTPBase : public TargetT // nop on most sane targets. if (isa(CI->getOperand(0))) return TTI::TCC_Free; + if (isa(CI) || isa(CI) || isa(CI)) + return static_cast(this)->getExtCost(CI, Operands.back()); } return static_cast(this)->getOperationCost( Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -155,6 +155,18 @@ class BasicTTIImplBase : public TargetTransformInfoImp return BaseT::getGEPCost(PointeeType, Ptr, Operands); } + int getExtCost(const Instruction *I, const Value *Src) { + if (getTLI()->isExtFree(I)) + return TargetTransformInfo::TCC_Free; + + if (isa(I) || isa(I)) + if (const LoadInst *LI = dyn_cast(Src)) + if (getTLI()->isExtLoad(LI, I, DL)) + return TargetTransformInfo::TCC_Free; + + return TargetTransformInfo::TCC_Basic; + } + unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy, ArrayRef Arguments) { return BaseT::getIntrinsicCost(IID, RetTy, Arguments); Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -23,27 +23,24 @@ class MachineDominanceFrontier : public MachineFunctio ForwardDominanceFrontierBase Base; public: - using DomTreeT = DominatorTreeBase; - using DomTreeNodeT = DomTreeNodeBase; - using DomSetType = DominanceFrontierBase::DomSetType; - using iterator = DominanceFrontierBase::iterator; - using const_iterator = - DominanceFrontierBase::const_iterator; + using DomTreeT = DomTreeBase; + using DomTreeNodeT = DomTreeNodeBase; + using DomSetType = DominanceFrontierBase::DomSetType; + using iterator = DominanceFrontierBase::iterator; + using const_iterator = + DominanceFrontierBase::const_iterator; - MachineDominanceFrontier(const MachineDominanceFrontier &) = delete; - MachineDominanceFrontier & - operator=(const MachineDominanceFrontier &) = delete; + MachineDominanceFrontier(const MachineDominanceFrontier &) = delete; + MachineDominanceFrontier &operator=(const MachineDominanceFrontier &) = delete; - static char ID; + static char ID; - MachineDominanceFrontier(); + MachineDominanceFrontier(); - DominanceFrontierBase &getBase() { - return Base; - } + DominanceFrontierBase &getBase() { return Base; } - inline const std::vector &getRoots() const { - return Base.getRoots(); + inline const std::vector &getRoots() const { + return Base.getRoots(); } MachineBasicBlock *getRoot() const { @@ -98,7 +95,7 @@ class MachineDominanceFrontier : public MachineFunctio return Base.compareDomSet(DS1, DS2); } - bool compare(DominanceFrontierBase &Other) const { + bool compare(DominanceFrontierBase &Other) const { return Base.compare(Other); } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -28,13 +28,15 @@ namespace llvm { -template<> -inline void DominatorTreeBase::addRoot(MachineBasicBlock* MBB) { +template <> +inline void DominatorTreeBase::addRoot( + MachineBasicBlock *MBB) { this->Roots.push_back(MBB); } extern template class DomTreeNodeBase; -extern template class DominatorTreeBase; +extern template class DominatorTreeBase; // DomTree +extern template class DominatorTreeBase; // PostDomTree using MachineDomTreeNode = DomTreeNodeBase; @@ -65,7 +67,7 @@ class MachineDominatorTree : public MachineFunctionPas mutable SmallSet NewBBs; /// The DominatorTreeBase that is used to compute a normal dominator tree - std::unique_ptr> DT; + std::unique_ptr> DT; /// \brief Apply all the recorded critical edges to the DT. /// This updates the underlying DT information in a way that uses @@ -79,9 +81,8 @@ class MachineDominatorTree : public MachineFunctionPas MachineDominatorTree(); - DominatorTreeBase &getBase() { - if (!DT) - DT.reset(new DominatorTreeBase(false)); + DomTreeBase &getBase() { + if (!DT) DT.reset(new DomTreeBase()); applySplitCriticalEdges(); return *DT; } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -26,7 +26,7 @@ namespace llvm { /// struct MachinePostDominatorTree : public MachineFunctionPass { private: - DominatorTreeBase *DT; + PostDomTreeBase *DT; public: static char ID; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h Wed Jul 19 07:02:10 2017 (r321184) @@ -17,7 +17,6 @@ namespace llvm { namespace codeview { class TypeCollection; -class TypeServerHandler; class TypeVisitorCallbacks; enum VisitorDataSource { @@ -31,11 +30,9 @@ enum VisitorDataSource { Error visitTypeRecord(CVType &Record, TypeIndex Index, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks, VisitorDataSource Source = VDS_BytesPresent); @@ -46,12 +43,9 @@ Error visitMemberRecordStream(ArrayRef FieldL TypeVisitorCallbacks &Callbacks); Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); -Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks, - TypeServerHandler *TS = nullptr); -Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); +Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks); +Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks); } // end namespace codeview } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Wed Jul 19 07:02:10 2017 (r321184) @@ -84,7 +84,7 @@ class CodeViewRecordIO { (public) Error mapEncodedInteger(uint64_t &Value); Error mapEncodedInteger(APSInt &Value); Error mapStringZ(StringRef &Value); - Error mapGuid(StringRef &Guid); + Error mapGuid(GUID &Guid); Error mapStringZVectorZ(std::vector &Value); Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h Wed Jul 19 07:02:10 2017 (r321184) @@ -12,6 +12,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/CodeView/GUID.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/Support/FormatAdapters.h" #include "llvm/Support/FormatVariadic.h" @@ -31,7 +32,7 @@ class GuidAdapter final : public FormatAdapter Guid); explicit GuidAdapter(StringRef Guid); - void format(raw_ostream &Stream, StringRef Style) override ; + void format(raw_ostream &Stream, StringRef Style) override; }; } // end namespace detail @@ -57,6 +58,13 @@ template <> struct format_provider struct format_provider { + static void format(const codeview::GUID &V, llvm::raw_ostream &Stream, + StringRef Style) { + Stream << V; } }; Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h Wed Jul 19 07:02:10 2017 (r321184) @@ -0,0 +1,55 @@ +//===- GUID.h ---------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H +#define LLVM_DEBUGINFO_CODEVIEW_GUID_H + +#include +#include + +namespace llvm { +class raw_ostream; + +namespace codeview { + +/// This represents the 'GUID' type from windows.h. +struct GUID { + uint8_t Guid[16]; +}; + +inline bool operator==(const GUID &LHS, const GUID &RHS) { + return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); +} + +inline bool operator<(const GUID &LHS, const GUID &RHS) { + return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0; +} + +inline bool operator<=(const GUID &LHS, const GUID &RHS) { + return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0; +} + +inline bool operator>(const GUID &LHS, const GUID &RHS) { + return !(LHS <= RHS); +} + +inline bool operator>=(const GUID &LHS, const GUID &RHS) { + return !(LHS < RHS); +} + +inline bool operator!=(const GUID &LHS, const GUID &RHS) { + return !(LHS == RHS); +} + +raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); + +} // namespace codeview +} // namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h Wed Jul 19 07:02:10 2017 (r321184) @@ -848,7 +848,7 @@ class BuildInfoSym : public SymbolRecord { (public) : SymbolRecord(SymbolRecordKind::BuildInfoSym), RecordOffset(RecordOffset) {} - uint32_t BuildId; + TypeIndex BuildId; uint32_t RecordOffset; }; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jul 19 07:02:10 2017 (r321184) @@ -18,6 +18,7 @@ #include "llvm/ADT/iterator_range.h" #include "llvm/DebugInfo/CodeView/CVRecord.h" #include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/GUID.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/Support/BinaryStreamArray.h" #include "llvm/Support/Endian.h" @@ -539,15 +540,17 @@ class TypeServer2Record : public TypeRecord { public: TypeServer2Record() = default; explicit TypeServer2Record(TypeRecordKind Kind) : TypeRecord(Kind) {} - TypeServer2Record(StringRef Guid, uint32_t Age, StringRef Name) - : TypeRecord(TypeRecordKind::TypeServer2), Guid(Guid), Age(Age), - Name(Name) {} + TypeServer2Record(StringRef GuidStr, uint32_t Age, StringRef Name) + : TypeRecord(TypeRecordKind::TypeServer2), Age(Age), Name(Name) { + assert(GuidStr.size() == 16 && "guid isn't 16 bytes"); + ::memcpy(Guid.Guid, GuidStr.data(), 16); + } - StringRef getGuid() const { return Guid; } + const GUID &getGuid() const { return Guid; } uint32_t getAge() const { return Age; } StringRef getName() const { return Name; } - StringRef Guid; + GUID Guid; uint32_t Age; StringRef Name; }; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h Wed Jul 19 07:02:10 2017 (r321184) @@ -19,7 +19,6 @@ namespace llvm { namespace codeview { class TypeIndex; -class TypeServerHandler; class TypeTableBuilder; /// \brief Merge one set of type records into another. This method assumes @@ -31,16 +30,13 @@ class TypeTableBuilder; /// type stream, that contains the index of the corresponding type record /// in the destination stream. /// -/// \param Handler (optional) If non-null, an interface that gets invoked -/// to handle type server records. -/// /// \param Types The collection of types to merge in. /// /// \returns Error::success() if the operation succeeded, otherwise an /// appropriate error code. Error mergeTypeRecords(TypeTableBuilder &Dest, SmallVectorImpl &SourceToDest, - TypeServerHandler *Handler, const CVTypeArray &Types); + const CVTypeArray &Types); /// \brief Merge one set of id records into another. This method assumes /// that all records are id records, and there are no Type records present. @@ -65,7 +61,7 @@ Error mergeTypeRecords(TypeTableBuilder &Dest, /// appropriate error code. Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef Types, SmallVectorImpl &SourceToDest, - const CVTypeArray &Ids); + const CVTypeArray &Ids); /// \brief Merge a unified set of type and id records, splitting them into /// separate output streams. @@ -78,9 +74,6 @@ Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef< /// id stream, that contains the index of the corresponding id record /// in the destination stream. /// -/// \param Handler (optional) If non-null, an interface that gets invoked -/// to handle type server records. -/// /// \param IdsAndTypes The collection of id records to merge in. /// /// \returns Error::success() if the operation succeeded, otherwise an @@ -88,8 +81,7 @@ Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef< Error mergeTypeAndIdRecords(TypeTableBuilder &DestIds, TypeTableBuilder &DestTypes, SmallVectorImpl &SourceToDest, - TypeServerHandler *Handler, - const CVTypeArray &IdsAndTypes); + const CVTypeArray &IdsAndTypes); } // end namespace codeview } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Wed Jul 19 07:02:10 2017 (r321184) @@ -238,6 +238,34 @@ class DWARFUnit { (public) uint8_t getUnitType() const { return UnitType; } + static bool isValidUnitType(uint8_t UnitType) { + return UnitType == dwarf::DW_UT_compile || UnitType == dwarf::DW_UT_type || + UnitType == dwarf::DW_UT_partial || + UnitType == dwarf::DW_UT_skeleton || + UnitType == dwarf::DW_UT_split_compile || + UnitType == dwarf::DW_UT_split_type; + } + + /// \brief Return the number of bytes for the header of a unit of + /// UnitType type. + /// + /// This function must be called with a valid unit type which in + /// DWARF5 is defined as one of the following six types. + static uint32_t getDWARF5HeaderSize(uint8_t UnitType) { + switch (UnitType) { + case dwarf::DW_UT_compile: + case dwarf::DW_UT_partial: + return 12; + case dwarf::DW_UT_skeleton: + case dwarf::DW_UT_split_compile: + return 20; + case dwarf::DW_UT_type: + case dwarf::DW_UT_split_type: + return 24; + } + llvm_unreachable("Invalid UnitType."); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 17FC1DAAB59; Wed, 19 Jul 2017 07:02:20 +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 C39A66E195; Wed, 19 Jul 2017 07:02:19 +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 v6J72Ihl090728; Wed, 19 Jul 2017 07:02:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72IPk090727; Wed, 19 Jul 2017 07:02:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72IPk090727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321185 - vendor/llvm/llvm-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r308421 X-SVN-Commit-Revision: 321185 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:20 -0000 Author: dim Date: Wed Jul 19 07:02:18 2017 New Revision: 321185 URL: https://svnweb.freebsd.org/changeset/base/321185 Log: Tag llvm trunk r308421. Added: vendor/llvm/llvm-trunk-r308421/ - copied from r321184, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 80F2BDAABB7; Wed, 19 Jul 2017 07:02:34 +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 130526E297; Wed, 19 Jul 2017 07:02:34 +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 v6J72XZ0090805; Wed, 19 Jul 2017 07:02:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72UMS090778; Wed, 19 Jul 2017 07:02:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72UMS090778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321186 - in vendor/clang/dist: . cmake/caches docs include/clang include/clang-c include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Config include/clan... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: . cmake/caches docs include/clang include/clang-c include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Config include/clang/Driver include/clang/Fr... X-SVN-Commit-Revision: 321186 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:34 -0000 Author: dim Date: Wed Jul 19 07:02:30 2017 New Revision: 321186 URL: https://svnweb.freebsd.org/changeset/base/321186 Log: Vendor import of clang trunk r308421: https://llvm.org/svn/llvm-project/cfe/trunk@308421 Added: vendor/clang/dist/include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h (contents, props changed) vendor/clang/dist/test/CodeGen/aarch64-varargs-ms.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-vector2-error.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-vector2.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-zvector2-error.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-zvector2.c (contents, props changed) vendor/clang/dist/test/CodeGen/coff-aarch64-type-sizes.c (contents, props changed) vendor/clang/dist/test/CodeGen/ms_abi_aarch64.c (contents, props changed) vendor/clang/dist/test/CodeGen/zvector2.c (contents, props changed) vendor/clang/dist/test/Index/Core/no-templated-canonical-decl.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/DebugObjCImport.h (contents, props changed) vendor/clang/dist/test/Modules/debug-info-moduleimport-in-module.m vendor/clang/dist/test/OpenMP/taskgroup_task_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_reduction_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_simd_reduction_codegen.cpp (contents, props changed) vendor/clang/dist/test/Sema/varargs-aarch64.c (contents, props changed) vendor/clang/dist/test/Sema/zvector2.c (contents, props changed) vendor/clang/dist/test/SemaObjC/attr-ns_returns_retained.m vendor/clang/dist/unittests/Tooling/DiagnosticsYamlTest.cpp (contents, props changed) Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake vendor/clang/dist/cmake/caches/Fuchsia.cmake vendor/clang/dist/docs/LanguageExtensions.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/DeclObjC.h vendor/clang/dist/include/clang/AST/OpenMPClause.h vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h vendor/clang/dist/include/clang/AST/StmtOpenMP.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/Builtins.def vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/IdentifierTable.h vendor/clang/dist/include/clang/Basic/LangOptions.def vendor/clang/dist/include/clang/Basic/OpenMPKinds.def vendor/clang/dist/include/clang/Basic/Specifiers.h vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Config/config.h.cmake vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/LangStandard.h vendor/clang/dist/include/clang/Frontend/LangStandards.def vendor/clang/dist/include/clang/Index/IndexingAction.h vendor/clang/dist/include/clang/Lex/MacroInfo.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Tooling/DiagnosticsYaml.h vendor/clang/dist/include/clang/Tooling/Refactoring/Rename/USRFinder.h vendor/clang/dist/include/clang/module.modulemap vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTDumper.cpp vendor/clang/dist/lib/AST/DeclObjC.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/MicrosoftMangle.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/AST/OpenMPClause.cpp vendor/clang/dist/lib/AST/StmtOpenMP.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/AST/Type.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp vendor/clang/dist/lib/Basic/CMakeLists.txt vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp vendor/clang/dist/lib/Basic/OpenMPKinds.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.h vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/MacroPPCallbacks.cpp vendor/clang/dist/lib/CodeGen/ObjectFilePCHContainerOperations.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Driver/ToolChains/Solaris.cpp vendor/clang/dist/lib/Driver/ToolChains/Solaris.h vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/FrontendTool/ExecuteCompilerInvocation.cpp vendor/clang/dist/lib/Headers/vecintrin.h vendor/clang/dist/lib/Index/IndexingAction.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Lex/MacroArgs.cpp vendor/clang/dist/lib/Lex/MacroInfo.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPExpressions.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Lex/TokenLexer.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/ParseOpenMP.cpp vendor/clang/dist/lib/Sema/DeclSpec.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.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/SemaObjCProperty.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/Serialization/ASTWriterStmt.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp vendor/clang/dist/lib/Tooling/Refactoring/Rename/USRFinder.cpp vendor/clang/dist/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp vendor/clang/dist/lib/Tooling/Tooling.cpp vendor/clang/dist/test/Analysis/localization-aggressive.m vendor/clang/dist/test/Analysis/retain-release-inline.m vendor/clang/dist/test/Analysis/retain-release.m vendor/clang/dist/test/CodeGen/aarch64-type-sizes.c vendor/clang/dist/test/CodeGen/builtins-hexagon.c vendor/clang/dist/test/CodeGen/builtins-systemz-zvector-error.c vendor/clang/dist/test/CodeGen/builtins-systemz-zvector.c vendor/clang/dist/test/CodeGen/debug-info-imported-entity.cpp vendor/clang/dist/test/CodeGen/ms_abi.c vendor/clang/dist/test/CodeGen/systemz-abi-vector.c vendor/clang/dist/test/CodeGen/systemz-abi.c vendor/clang/dist/test/CodeGen/target-data.c vendor/clang/dist/test/CodeGen/ubsan-pointer-overflow.m vendor/clang/dist/test/CodeGenCXX/amdgcn-automatic-variable.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-anon-namespace.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-namespace.cpp vendor/clang/dist/test/CodeGenCXX/implicit-exception-spec.cpp vendor/clang/dist/test/CodeGenObjC/arc-property.m vendor/clang/dist/test/CodeGenObjC/attr-callconv.m vendor/clang/dist/test/CodeGenOpenCL/kernel-arg-info.cl vendor/clang/dist/test/Driver/autocomplete.c vendor/clang/dist/test/Driver/constructors.c vendor/clang/dist/test/Driver/darwin-version.c vendor/clang/dist/test/Driver/emulated-tls.cpp vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/fuchsia.cpp vendor/clang/dist/test/Driver/lto-unit.c vendor/clang/dist/test/Driver/pic.c vendor/clang/dist/test/Driver/std.cpp vendor/clang/dist/test/Driver/systemz-march.c vendor/clang/dist/test/Driver/unknown-std.cpp vendor/clang/dist/test/FixIt/format.m vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/complete-available.m vendor/clang/dist/test/Misc/ast-dump-decl.c vendor/clang/dist/test/Misc/ast-dump-decl.cpp vendor/clang/dist/test/Modules/DebugInfoTransitiveImport.m vendor/clang/dist/test/Modules/ExtDebugInfo.cpp vendor/clang/dist/test/Modules/Inputs/module.map vendor/clang/dist/test/Modules/ModuleDebugInfo.m vendor/clang/dist/test/Modules/debug-info-moduleimport.m vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/OpenMP/distribute_parallel_for_if_codegen.cpp vendor/clang/dist/test/OpenMP/for_reduction_codegen.cpp vendor/clang/dist/test/OpenMP/for_reduction_codegen_UDR.cpp vendor/clang/dist/test/OpenMP/parallel_if_codegen.cpp vendor/clang/dist/test/OpenMP/taskgroup_ast_print.cpp vendor/clang/dist/test/OpenMP/taskgroup_messages.cpp vendor/clang/dist/test/OpenMP/taskloop_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_private_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_private_codegen.cpp vendor/clang/dist/test/Parser/MicrosoftExtensions.cpp vendor/clang/dist/test/Preprocessor/aarch64-target-features.c vendor/clang/dist/test/Preprocessor/cxx_oper_keyword.cpp vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c vendor/clang/dist/test/Sema/tls.c vendor/clang/dist/test/Sema/varargs-x86-32.c vendor/clang/dist/test/SemaCXX/attr-x86-no_caller_saved_registers.cpp vendor/clang/dist/test/SemaCXX/cxx1z-noexcept-function-type.cpp vendor/clang/dist/test/SemaObjC/arc-property-decl-attrs.m vendor/clang/dist/test/SemaObjC/property-ambiguous-synthesis.m vendor/clang/dist/test/SemaObjC/warn-deprecated-implementations.m vendor/clang/dist/tools/clang-fuzzer/CMakeLists.txt vendor/clang/dist/tools/clang-fuzzer/ClangFuzzer.cpp vendor/clang/dist/tools/libclang/ARCMigrate.cpp vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXType.cpp vendor/clang/dist/tools/scan-build-py/libscanbuild/analyze.py vendor/clang/dist/unittests/ASTMatchers/Dynamic/ParserTest.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/SortImportsTestJS.cpp vendor/clang/dist/unittests/Lex/LexerTest.cpp vendor/clang/dist/unittests/Tooling/CMakeLists.txt vendor/clang/dist/utils/bash-autocomplete.sh vendor/clang/dist/www/analyzer/alpha_checks.html vendor/clang/dist/www/analyzer/available_checks.html vendor/clang/dist/www/analyzer/implicit_checks.html vendor/clang/dist/www/cxx_status.html Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/CMakeLists.txt Wed Jul 19 07:02:30 2017 (r321186) @@ -389,11 +389,7 @@ if(CLANG_ANALYZER_BUILD_Z3) endif() if(CLANG_ENABLE_ARCMT) - add_definitions(-DCLANG_ENABLE_ARCMT) - add_definitions(-DCLANG_ENABLE_OBJC_REWRITER) -endif() -if(CLANG_ENABLE_STATIC_ANALYZER) - add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER) + set(CLANG_ENABLE_OBJC_REWRITER ON) endif() # Clang version information Modified: vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Wed Jul 19 07:02:30 2017 (r321186) @@ -7,7 +7,6 @@ set(PACKAGE_VENDOR Fuchsia CACHE STRING "") set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "") set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "") -set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "") set(LLVM_ENABLE_ZLIB ON CACHE BOOL "") set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "") set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "") @@ -27,12 +26,28 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "") -set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia-none;aarch64-fuchsia-none" CACHE STRING "") -set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "") -set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") -set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "") -set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") +set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") +foreach(target x86_64;aarch64) + set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") + set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") +endforeach() +if(NOT APPLE) + list(APPEND LLVM_BUILTIN_TARGETS "default") +endif() +set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") +foreach(target x86_64;aarch64) + set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") + set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") + set(RUNTIMES_${target}-fuchsia_UNIX 1 CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_LIBCXX ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") +endforeach() + # Setup toolchain. set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") set(LLVM_TOOLCHAIN_TOOLS @@ -47,6 +62,7 @@ set(LLVM_TOOLCHAIN_TOOLS llvm-objdump llvm-profdata llvm-ranlib + llvm-readelf llvm-readobj llvm-size llvm-symbolizer @@ -61,8 +77,9 @@ set(LLVM_DISTRIBUTION_COMPONENTS LTO clang-format clang-headers - builtins-x86_64-fuchsia-none - builtins-aarch64-fuchsia-none + clang-tidy + clangd + builtins runtimes ${LLVM_TOOLCHAIN_TOOLS} CACHE STRING "") Modified: vendor/clang/dist/cmake/caches/Fuchsia.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia.cmake Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/cmake/caches/Fuchsia.cmake Wed Jul 19 07:02:30 2017 (r321186) @@ -38,9 +38,11 @@ set(CLANG_BOOTSTRAP_TARGETS install-distribution clang CACHE STRING "") -if(FUCHSIA_SYSROOT) - set(EXTRA_ARGS -DFUCHSIA_SYSROOT=${FUCHSIA_SYSROOT}) -endif() +foreach(target x86_64;aarch64) + if(FUCHSIA_${target}_SYSROOT) + list(APPEND EXTRA_ARGS -DFUCHSIA_${target}_SYSROOT=${FUCHSIA_${target}_SYSROOT}) + endif() +endforeach() # Setup the bootstrap build. set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") Modified: vendor/clang/dist/docs/LanguageExtensions.rst ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.rst Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/docs/LanguageExtensions.rst Wed Jul 19 07:02:30 2017 (r321186) @@ -1271,7 +1271,88 @@ Further examples of these attributes are available in Query for these features with ``__has_attribute(ns_consumed)``, ``__has_attribute(ns_returns_retained)``, etc. +Objective-C @available +---------------------- +It is possible to use the newest SDK but still build a program that can run on +older versions of macOS and iOS by passing ``-mmacosx-version-min=`` / +``-miphoneos-version-min=``. + +Before LLVM 5.0, when calling a function that exists only in the OS that's +newer than the target OS (as determined by the minimum deployment version), +programmers had to carefully check if the function exists at runtime, using +null checks for weakly-linked C functions, ``+class`` for Objective-C classes, +and ``-respondsToSelector:`` or ``+instancesRespondToSelector:`` for +Objective-C methods. If such a check was missed, the program would compile +fine, run fine on newer systems, but crash on older systems. + +As of LLVM 5.0, ``-Wunguarded-availability`` uses the `availability attributes +`_ together +with the new ``@available()`` keyword to assist with this issue. +When a method that's introduced in the OS newer than the target OS is called, a +-Wunguarded-availability warning is emitted if that call is not guarded: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + // If fancyNewMethod was added in e.g. macOS 10.12, but the code is + // built with -mmacosx-version-min=10.11, then this unconditional call + // will emit a -Wunguarded-availability warning: + [var fancyNewMethod]; + } + +To fix the warning and to avoid the crash on macOS 10.11, wrap it in +``if(@available())``: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + if (@available(macOS 10.12, *)) { + [var fancyNewMethod]; + } else { + // Put fallback behavior for old macOS versions (and for non-mac + // platforms) here. + } + } + +The ``*`` is required and means that platforms not explicitly listed will take +the true branch, and the compiler will emit ``-Wunguarded-availability`` +warnings for unlisted platforms based on those platform's deployment target. +More than one platform can be listed in ``@available()``: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + if (@available(macOS 10.12, iOS 10, *)) { + [var fancyNewMethod]; + } + } + +If the caller of ``my_fun()`` already checks that ``my_fun()`` is only called +on 10.12, then add an `availability attribute +`_ to it, +which will also suppress the warning and require that calls to my_fun() are +checked: + +.. code-block:: objc + + API_AVAILABLE(macos(10.12)) void my_fun(NSSomeClass* var) { + [var fancyNewMethod]; // Now ok. + } + +``@available()`` is only available in Objective-C code. To use the feature +in C and C++ code, use the ``__builtin_available()`` spelling instead. + +If existing code uses null checks or ``-respondsToSelector:``, it should +be changed to use ``@available()`` (or ``__builtin_available``) instead. + +``-Wunguarded-availability`` is disabled by default, but +``-Wunguarded-availability-new``, which only emits this warning for APIs +that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and +tvOS >= 11, is enabled by default. + +.. _langext-overloading: + Objective-C++ ABI: protocol-qualifier mangling of parameters ------------------------------------------------------------ @@ -1286,8 +1367,6 @@ parameters of protocol-qualified type. Query the presence of this new mangling with ``__has_feature(objc_protocol_qualifier_mangling)``. - -.. _langext-overloading: Initializer lists for complex numbers in C ========================================== Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/docs/ReleaseNotes.rst Wed Jul 19 07:02:30 2017 (r321186) @@ -82,7 +82,9 @@ Clang now supports the ... Attribute Changes in Clang -------------------------- -- ... +- The ``overloadable`` attribute now allows at most one function with a given + name to lack the ``overloadable`` attribute. This unmarked function will not + have its name mangled. Windows Support --------------- Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang-c/Index.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3205,7 +3205,7 @@ enum CXCallingConv { CXCallingConv_AAPCS_VFP = 7, CXCallingConv_X86RegCall = 8, CXCallingConv_IntelOclBicc = 9, - CXCallingConv_X86_64Win64 = 10, + CXCallingConv_Win64 = 10, CXCallingConv_X86_64SysV = 11, CXCallingConv_X86VectorCall = 12, CXCallingConv_Swift = 13, Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1441,6 +1441,10 @@ class ASTContext : public RefCountedBase { /// The sizeof operator requires this (C99 6.5.3.4p4). CanQualType getSizeType() const; + /// \brief Return the unique signed counterpart of + /// the integer type corresponding to size_t. + CanQualType getSignedSizeType() const; + /// \brief Return the unique type for "intmax_t" (C99 7.18.1.5), defined in /// . CanQualType getIntMaxType() const; Modified: vendor/clang/dist/include/clang/AST/DeclObjC.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclObjC.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/DeclObjC.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1039,10 +1039,9 @@ class ObjCContainerDecl : public NamedDecl, public Dec typedef llvm::DenseMap, ObjCPropertyDecl*> PropertyMap; - - typedef llvm::DenseMap - ProtocolPropertyMap; - + + typedef llvm::SmallDenseSet ProtocolPropertySet; + typedef llvm::SmallVector PropertyDeclOrder; /// This routine collects list of properties to be implemented in the class. @@ -2159,7 +2158,8 @@ class ObjCProtocolDecl : public ObjCContainerDecl, (pu PropertyDeclOrder &PO) const override; void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, - ProtocolPropertyMap &PM) const; + ProtocolPropertySet &PS, + PropertyDeclOrder &PO) const; static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K == ObjCProtocol; } Modified: vendor/clang/dist/include/clang/AST/OpenMPClause.h ============================================================================== --- vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1890,6 +1890,217 @@ class OMPReductionClause final (public) } }; +/// This represents clause 'task_reduction' in the '#pragma omp taskgroup' +/// directives. +/// +/// \code +/// #pragma omp taskgroup task_reduction(+:a,b) +/// \endcode +/// In this example directive '#pragma omp taskgroup' has clause +/// 'task_reduction' with operator '+' and the variables 'a' and 'b'. +/// +class OMPTaskReductionClause final + : public OMPVarListClause, + public OMPClauseWithPostUpdate, + private llvm::TrailingObjects { + friend TrailingObjects; + friend OMPVarListClause; + friend class OMPClauseReader; + /// Location of ':'. + SourceLocation ColonLoc; + /// Nested name specifier for C++. + NestedNameSpecifierLoc QualifierLoc; + /// Name of custom operator. + DeclarationNameInfo NameInfo; + + /// Build clause with number of variables \a N. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param ColonLoc Location of ':'. + /// \param N Number of the variables in the clause. + /// \param QualifierLoc The nested-name qualifier with location information + /// \param NameInfo The full name info for reduction identifier. + /// + OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation ColonLoc, SourceLocation EndLoc, + unsigned N, NestedNameSpecifierLoc QualifierLoc, + const DeclarationNameInfo &NameInfo) + : OMPVarListClause(OMPC_task_reduction, StartLoc, + LParenLoc, EndLoc, N), + OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), + QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} + + /// Build an empty clause. + /// + /// \param N Number of variables. + /// + explicit OMPTaskReductionClause(unsigned N) + : OMPVarListClause( + OMPC_task_reduction, SourceLocation(), SourceLocation(), + SourceLocation(), N), + OMPClauseWithPostUpdate(this), ColonLoc(), QualifierLoc(), NameInfo() {} + + /// Sets location of ':' symbol in clause. + void setColonLoc(SourceLocation CL) { ColonLoc = CL; } + /// Sets the name info for specified reduction identifier. + void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; } + /// Sets the nested name specifier. + void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent private copy of the reduction variable. + void setPrivates(ArrayRef Privates); + + /// Get the list of helper privates. + MutableArrayRef getPrivates() { + return MutableArrayRef(varlist_end(), varlist_size()); + } + ArrayRef getPrivates() const { + return llvm::makeArrayRef(varlist_end(), varlist_size()); + } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent LHS expression in the final reduction + /// expression performed by the reduction clause. + void setLHSExprs(ArrayRef LHSExprs); + + /// Get the list of helper LHS expressions. + MutableArrayRef getLHSExprs() { + return MutableArrayRef(getPrivates().end(), varlist_size()); + } + ArrayRef getLHSExprs() const { + return llvm::makeArrayRef(getPrivates().end(), varlist_size()); + } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent RHS expression in the final reduction + /// expression performed by the reduction clause. Also, variables in these + /// expressions are used for proper initialization of reduction copies. + void setRHSExprs(ArrayRef RHSExprs); + + /// Get the list of helper destination expressions. + MutableArrayRef getRHSExprs() { + return MutableArrayRef(getLHSExprs().end(), varlist_size()); + } + ArrayRef getRHSExprs() const { + return llvm::makeArrayRef(getLHSExprs().end(), varlist_size()); + } + + /// Set list of helper reduction expressions, required for proper + /// codegen of the clause. These expressions are binary expressions or + /// operator/custom reduction call that calculates new value from source + /// helper expressions to destination helper expressions. + void setReductionOps(ArrayRef ReductionOps); + + /// Get the list of helper reduction expressions. + MutableArrayRef getReductionOps() { + return MutableArrayRef(getRHSExprs().end(), varlist_size()); + } + ArrayRef getReductionOps() const { + return llvm::makeArrayRef(getRHSExprs().end(), varlist_size()); + } + +public: + /// Creates clause with a list of variables \a VL. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param ColonLoc Location of ':'. + /// \param EndLoc Ending location of the clause. + /// \param VL The variables in the clause. + /// \param QualifierLoc The nested-name qualifier with location information + /// \param NameInfo The full name info for reduction identifier. + /// \param Privates List of helper expressions for proper generation of + /// private copies. + /// \param LHSExprs List of helper expressions for proper generation of + /// assignment operation required for copyprivate clause. This list represents + /// LHSs of the reduction expressions. + /// \param RHSExprs List of helper expressions for proper generation of + /// assignment operation required for copyprivate clause. This list represents + /// RHSs of the reduction expressions. + /// Also, variables in these expressions are used for proper initialization of + /// reduction copies. + /// \param ReductionOps List of helper expressions that represents reduction + /// expressions: + /// \code + /// LHSExprs binop RHSExprs; + /// operator binop(LHSExpr, RHSExpr); + /// (LHSExpr, RHSExpr); + /// \endcode + /// Required for proper codegen of final reduction operation performed by the + /// reduction clause. + /// \param PreInit Statement that must be executed before entering the OpenMP + /// region with this clause. + /// \param PostUpdate Expression that must be executed after exit from the + /// OpenMP region with this clause. + /// + static OMPTaskReductionClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef VL, + NestedNameSpecifierLoc QualifierLoc, + const DeclarationNameInfo &NameInfo, ArrayRef Privates, + ArrayRef LHSExprs, ArrayRef RHSExprs, + ArrayRef ReductionOps, Stmt *PreInit, Expr *PostUpdate); + + /// Creates an empty clause with the place for \a N variables. + /// + /// \param C AST context. + /// \param N The number of variables. + /// + static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N); + + /// Gets location of ':' symbol in clause. + SourceLocation getColonLoc() const { return ColonLoc; } + /// Gets the name info for specified reduction identifier. + const DeclarationNameInfo &getNameInfo() const { return NameInfo; } + /// Gets the nested name specifier. + NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; } + + typedef MutableArrayRef::iterator helper_expr_iterator; + typedef ArrayRef::iterator helper_expr_const_iterator; + typedef llvm::iterator_range helper_expr_range; + typedef llvm::iterator_range + helper_expr_const_range; + + helper_expr_const_range privates() const { + return helper_expr_const_range(getPrivates().begin(), getPrivates().end()); + } + helper_expr_range privates() { + return helper_expr_range(getPrivates().begin(), getPrivates().end()); + } + helper_expr_const_range lhs_exprs() const { + return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end()); + } + helper_expr_range lhs_exprs() { + return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end()); + } + helper_expr_const_range rhs_exprs() const { + return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end()); + } + helper_expr_range rhs_exprs() { + return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end()); + } + helper_expr_const_range reduction_ops() const { + return helper_expr_const_range(getReductionOps().begin(), + getReductionOps().end()); + } + helper_expr_range reduction_ops() { + return helper_expr_range(getReductionOps().begin(), + getReductionOps().end()); + } + + child_range children() { + return child_range(reinterpret_cast(varlist_begin()), + reinterpret_cast(varlist_end())); + } + + static bool classof(const OMPClause *T) { + return T->getClauseKind() == OMPC_task_reduction; + } +}; + /// \brief This represents clause 'linear' in the '#pragma omp ...' /// directives. /// Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3017,6 +3017,28 @@ RecursiveASTVisitor::VisitOMPReductionClause( } template +bool RecursiveASTVisitor::VisitOMPTaskReductionClause( + OMPTaskReductionClause *C) { + TRY_TO(TraverseNestedNameSpecifierLoc(C->getQualifierLoc())); + TRY_TO(TraverseDeclarationNameInfo(C->getNameInfo())); + TRY_TO(VisitOMPClauseList(C)); + TRY_TO(VisitOMPClauseWithPostUpdate(C)); + for (auto *E : C->privates()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->lhs_exprs()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->rhs_exprs()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->reduction_ops()) { + TRY_TO(TraverseStmt(E)); + } + return true; +} + +template bool RecursiveASTVisitor::VisitOMPFlushClause(OMPFlushClause *C) { TRY_TO(VisitOMPClauseList(C)); return true; Modified: vendor/clang/dist/include/clang/AST/StmtOpenMP.h ============================================================================== --- vendor/clang/dist/include/clang/AST/StmtOpenMP.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/StmtOpenMP.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1895,7 +1895,7 @@ class OMPTaskwaitDirective : public OMPExecutableDirec } }; -/// \brief This represents '#pragma omp taskgroup' directive. +/// This represents '#pragma omp taskgroup' directive. /// /// \code /// #pragma omp taskgroup @@ -1903,39 +1903,45 @@ class OMPTaskwaitDirective : public OMPExecutableDirec /// class OMPTaskgroupDirective : public OMPExecutableDirective { friend class ASTStmtReader; - /// \brief Build directive with the given start and end location. + /// Build directive with the given start and end location. /// /// \param StartLoc Starting location of the directive kind. /// \param EndLoc Ending location of the directive. + /// \param NumClauses Number of clauses. /// - OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc) + OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc, + unsigned NumClauses) : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup, - StartLoc, EndLoc, 0, 1) {} + StartLoc, EndLoc, NumClauses, 1) {} - /// \brief Build an empty directive. + /// Build an empty directive. + /// \param NumClauses Number of clauses. /// - explicit OMPTaskgroupDirective() + explicit OMPTaskgroupDirective(unsigned NumClauses) : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup, - SourceLocation(), SourceLocation(), 0, 1) {} + SourceLocation(), SourceLocation(), NumClauses, + 1) {} public: - /// \brief Creates directive. + /// Creates directive. /// /// \param C AST context. /// \param StartLoc Starting location of the directive kind. /// \param EndLoc Ending Location of the directive. + /// \param Clauses List of clauses. /// \param AssociatedStmt Statement, associated with the directive. /// - static OMPTaskgroupDirective *Create(const ASTContext &C, - SourceLocation StartLoc, - SourceLocation EndLoc, - Stmt *AssociatedStmt); + static OMPTaskgroupDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + ArrayRef Clauses, Stmt *AssociatedStmt); - /// \brief Creates an empty directive. + /// Creates an empty directive. /// /// \param C AST context. + /// \param NumClauses Number of clauses. /// - static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C, EmptyShell); + static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, EmptyShell); static bool classof(const Stmt *T) { return T->getStmtClass() == OMPTaskgroupDirectiveClass; Modified: vendor/clang/dist/include/clang/AST/Type.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Type.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/Type.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3878,6 +3878,7 @@ class AttributedType : public Type, public llvm::Foldi attr_sptr, attr_uptr, attr_nonnull, + attr_ns_returns_retained, attr_nullable, attr_null_unspecified, attr_objc_kindof, Modified: vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h Wed Jul 19 07:02:30 2017 (r321186) @@ -38,15 +38,15 @@ typedef llvm::DomTreeNodeBase DomTreeNode; class DominatorTree : public ManagedAnalysis { virtual void anchor(); public: - llvm::DominatorTreeBase* DT; + llvm::DomTreeBase* DT; DominatorTree() { - DT = new llvm::DominatorTreeBase(false); + DT = new llvm::DomTreeBase(); } ~DominatorTree() override { delete DT; } - llvm::DominatorTreeBase& getBase() { return *DT; } + llvm::DomTreeBase& getBase() { return *DT; } /// \brief This method returns the root CFGBlock of the dominators tree. /// Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/Attr.td Wed Jul 19 07:02:30 2017 (r321186) @@ -1802,11 +1802,18 @@ def Target : InheritableAttr { let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [TargetDocs]; let AdditionalMembers = [{ - typedef std::pair, StringRef> ParsedTargetAttr; + struct ParsedTargetAttr { + std::vector Features; + StringRef Architecture; + bool DuplicateArchitecture = false; + }; ParsedTargetAttr parse() const { + return parse(getFeaturesStr()); + } + static ParsedTargetAttr parse(StringRef Features) { ParsedTargetAttr Ret; SmallVector AttrFeatures; - getFeaturesStr().split(AttrFeatures, ","); + Features.split(AttrFeatures, ","); // Grab the various features and prepend a "+" to turn on the feature to // the backend and add them to our existing set of features. @@ -1823,12 +1830,15 @@ def Target : InheritableAttr { continue; // While we're here iterating check for a different target cpu. - if (Feature.startswith("arch=")) - Ret.second = Feature.split("=").second.trim(); - else if (Feature.startswith("no-")) - Ret.first.push_back("-" + Feature.split("-").second.str()); + if (Feature.startswith("arch=")) { + if (!Ret.Architecture.empty()) + Ret.DuplicateArchitecture = true; + else + Ret.Architecture = Feature.split("=").second.trim(); + } else if (Feature.startswith("no-")) + Ret.Features.push_back("-" + Feature.split("-").second.str()); else - Ret.first.push_back("+" + Feature.str()); + Ret.Features.push_back("+" + Feature.str()); } return Ret; } Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/AttrDocs.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Wed Jul 19 07:02:30 2017 (r321186) @@ -910,13 +910,13 @@ the function declaration for a hypothetical function ` void f(void) __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); -The availability attribute states that ``f`` was introduced in Mac OS X 10.4, -deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +The availability attribute states that ``f`` was introduced in macOS 10.4, +deprecated in macOS 10.6, and obsoleted in macOS 10.7. This information is used by Clang to determine when it is safe to use ``f``: for example, if -Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` -succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +Clang is instructed to compile code for macOS 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for macOS 10.6, the call succeeds but Clang emits a warning specifying that the function is deprecated. -Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +Finally, if Clang is instructed to compile code for macOS 10.7, the call fails because ``f()`` is no longer available. The availability attribute is a comma-separated list starting with the @@ -961,7 +961,7 @@ are: command-line arguments. ``macos`` - Apple's Mac OS X operating system. The minimum deployment target is + Apple's macOS operating system. The minimum deployment target is specified by the ``-mmacosx-version-min=*version*`` command-line argument. ``macosx`` is supported for backward-compatibility reasons, but it is deprecated. @@ -1015,6 +1015,19 @@ When one method overrides another, the overriding meth - (id)method __attribute__((availability(macos,introduced=10.3))); // okay: method moved into base class later - (id)method __attribute__((availability(macos,introduced=10.5))); // error: this method was available via the base class in 10.4 @end + +Starting with the macOS 10.12 SDK, the ``API_AVAILABLE`` macro from +```` can simplify the spelling: + +.. code-block:: objc + + @interface A + - (id)method API_AVAILABLE(macos(10.11))); + - (id)otherMethod API_AVAILABLE(macos(10.11), ios(11.0)); + @end + +Also see the documentation for `@available +`_ }]; } Modified: vendor/clang/dist/include/clang/Basic/Builtins.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/Builtins.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/Builtins.def Wed Jul 19 07:02:30 2017 (r321186) @@ -1413,6 +1413,11 @@ BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt") // Builtins for XRay BUILTIN(__xray_customevent, "vcC*z", "") +// Win64-compatible va_list functions +BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") +BUILTIN(__builtin_ms_va_end, "vc*&", "n") +BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n") + #undef BUILTIN #undef LIBBUILTIN #undef LANGBUILTIN Modified: vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def Wed Jul 19 07:02:30 2017 (r321186) @@ -882,6 +882,12 @@ BUILTIN(__builtin_HEXAGON_S2_ct0p,"iLLi","") BUILTIN(__builtin_HEXAGON_S2_ct1p,"iLLi","") BUILTIN(__builtin_HEXAGON_S2_interleave,"LLiLLi","") BUILTIN(__builtin_HEXAGON_S2_deinterleave,"LLiLLi","") +BUILTIN(__builtin_HEXAGON_Y2_dccleana,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dccleaninva,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dcinva,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dczeroa,"vv*","") +BUILTIN(__builtin_HEXAGON_Y4_l2fetch,"vv*Ui","") +BUILTIN(__builtin_HEXAGON_Y5_l2fetch,"vv*LLUi","") BUILTIN(__builtin_HEXAGON_S6_rol_i_r,"iii","v:60:") BUILTIN(__builtin_HEXAGON_S6_rol_i_p,"LLiLLii","v:60:") Modified: vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def Wed Jul 19 07:02:30 2017 (r321186) @@ -253,5 +253,29 @@ TARGET_BUILTIN(__builtin_s390_vfmsdb, "V2dV2dV2dV2d", TARGET_BUILTIN(__builtin_s390_vfsqdb, "V2dV2d", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vftcidb, "V2SLLiV2dIii*", "nc", "vector") +// Vector-enhancements facility 1 intrinsics. +TARGET_BUILTIN(__builtin_s390_vlrl, "V16ScUivC*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vstrl, "vV16ScUiv*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vbperm, "V2ULLiV16UcV16Uc", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vmslg, "V16UcV2ULLiV2ULLiV16UcIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmaxdb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmindb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmadb, "V2dV2dV2dV2d", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmsdb, "V2dV2dV2dV2d", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfcesbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfchsbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfchesbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfisb, "V4fV4fIiIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmaxsb, "V4fV4fV4fIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfminsb, "V4fV4fV4fIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vflnsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vflpsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmasb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmssb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmasb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmssb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfsqsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vftcisb, "V4SiV4fIii*", "nc", "vector-enhancements-1") + #undef BUILTIN #undef TARGET_BUILTIN Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Wed Jul 19 07:02:30 2017 (r321186) @@ -34,11 +34,6 @@ // can use it? BUILTIN(__builtin_cpu_supports, "bcC*", "nc") -// Win64-compatible va_list functions -BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") -BUILTIN(__builtin_ms_va_end, "vc*&", "n") -BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n") - // Undefined Values // TARGET_BUILTIN(__builtin_ia32_undef128, "V2d", "nc", "") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Wed Jul 19 07:02:30 2017 (r321186) @@ -152,6 +152,8 @@ def GNUFoldingConstant : DiagGroup<"gnu-folding-consta def FormatExtraArgs : DiagGroup<"format-extra-args">; def FormatZeroLength : DiagGroup<"format-zero-length">; def CXX1zCompatMangling : DiagGroup<"c++1z-compat-mangling">; +// Name of this warning in GCC. +def NoexceptType : DiagGroup<"noexcept-type", [CXX1zCompatMangling]>; // Warnings for C++1y code which is not compatible with prior C++ standards. def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Wed Jul 19 07:02:30 2017 (r321186) @@ -18,6 +18,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" +#include namespace clang { class DiagnosticsEngine; @@ -262,6 +263,13 @@ class DiagnosticIDs : public RefCountedBase getDiagnosticFlags(); /// \brief Get the set of all diagnostic IDs in the group with the given name. /// Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Wed Jul 19 07:02:30 2017 (r321186) @@ -808,8 +808,10 @@ def warn_property_types_are_incompatible : Warning< "property type %0 is incompatible with type %1 inherited from %2">, InGroup>; def warn_protocol_property_mismatch : Warning< - "property of type %0 was selected for synthesis">, + "property %select{of type %1|with attribute '%1'|without attribute '%1'|with " + "getter %1|with setter %1}0 was selected for synthesis">, InGroup>; +def err_protocol_property_mismatch: Error; def err_undef_interface : Error<"cannot find interface declaration for %0">; def err_category_forward_interface : Error< "cannot define %select{category|class extension}0 for undefined class %1">; @@ -1088,7 +1090,9 @@ def err_category_property : Error< def note_property_declare : Note< "property declared here">; def note_protocol_property_declare : Note< - "it could also be property of type %0 declared here">; + "it could also be property " + "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter " + "%1|with setter %1}0 declared here">; def note_property_synthesize : Note< "property synthesized here">; def err_synthesize_category_decl : Error< @@ -4575,8 +4579,11 @@ def warn_deprecated_fwdclass_message : Warning< "%0 may be deprecated because the receiver type is unknown">, InGroup; def warn_deprecated_def : Warning< - "Implementing deprecated %select{method|class|category}0">, - InGroup, DefaultIgnore; + "implementing deprecated %select{method|class|category}0">, + InGroup, DefaultIgnore; +def warn_unavailable_def : Warning< + "implementing unavailable method">, + InGroup, DefaultIgnore; def err_unavailable : Error<"%0 is unavailable">; def err_property_method_unavailable : Error<"property access is using %0 method which is unavailable">; @@ -8106,10 +8113,10 @@ def err_systemz_invalid_tabort_code : Error< "invalid transaction abort code">; def err_64_bit_builtin_32_bit_tgt : Error< "this builtin is only available on 64-bit targets">; +def err_builtin_x64_aarch64_only : Error< + "this builtin is only available on x86-64 and aarch64 targets">; def err_ppc_builtin_only_on_pwr7 : Error< "this builtin is only valid on POWER7 or later CPUs">; -def err_x86_builtin_64_only : Error< - "this builtin is only available on x86-64 targets">; def err_x86_builtin_invalid_rounding : Error< "invalid rounding argument">; def err_x86_builtin_invalid_scale : Error< @@ -8648,11 +8655,11 @@ def err_omp_unknown_reduction_identifier : Error< def err_omp_not_resolved_reduction_identifier : Error< "unable to resolve declare reduction construct for type %0">; def err_omp_reduction_ref_type_arg : Error< - "argument of OpenMP clause 'reduction' must reference the same object in all threads">; + "argument of OpenMP clause '%0' must reference the same object in all threads">; def err_omp_clause_not_arithmetic_type_arg : Error< - "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">; + "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">; def err_omp_clause_floating_type_arg : Error< - "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">; + "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">; def err_omp_once_referenced : Error< "variable can appear only once in OpenMP '%0' clause">; def err_omp_once_referenced_in_target_update : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Wed Jul 19 07:02:30 2017 (r321186) @@ -147,18 +147,29 @@ def err_module_odr_violation_mismatch_decl_diff : Erro "%select{non-|}5mutable field %4|" "field %4 with %select{no|an}5 initalizer|" "field %4 with an initializer|" - "method %4|" - "method %4 is %select{not deleted|deleted}5|" - "method %4 is %select{|pure }5%select{not virtual|virtual}6|" - "method %4 is %select{not static|static}5|" - "method %4 is %select{not volatile|volatile}5|" - "method %4 is %select{not const|const}5|" - "method %4 is %select{not inline|inline}5|" - "method %4 that has %5 parameter%s5|" - "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|" - "method %4 with %ordinal5 parameter named %6|" - "method %4 with %ordinal5 parameter with%select{out|}6 a default argument|" - "method %4 with %ordinal5 parameter with a default argument|" + "%select{method %5|constructor|destructor}4|" + "%select{method %5|constructor|destructor}4 " + "is %select{not deleted|deleted}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{|pure }6%select{not virtual|virtual}7|" + "%select{method %5|constructor|destructor}4 " + "is %select{not static|static}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not volatile|volatile}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not const|const}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not inline|inline}6|" + "%select{method %5|constructor|destructor}4 " + "that has %6 parameter%s6|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter of type %7%select{| decayed from %9}8|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter named %7|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter with%select{out|}7 a default argument|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter with a default argument|" "%select{typedef|type alias}4 name %5|" "%select{typedef|type alias}4 %5 with underlying type %6|" "data member with name %4|" @@ -183,18 +194,29 @@ def note_module_odr_violation_mismatch_decl_diff : Not "%select{non-|}3mutable field %2|" "field %2 with %select{no|an}3 initializer|" "field %2 with a different initializer|" - "method %2|" - "method %2 is %select{not deleted|deleted}3|" - "method %2 is %select{|pure }3%select{not virtual|virtual}4|" - "method %2 is %select{not static|static}3|" - "method %2 is %select{not volatile|volatile}3|" - "method %2 is %select{not const|const}3|" - "method %2 is %select{not inline|inline}3|" - "method %2 that has %3 parameter%s3|" - "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|" - "method %2 with %ordinal3 parameter named %4|" - "method %2 with %ordinal3 parameter with%select{out|}4 a default argument|" - "method %2 with %ordinal3 parameter with a different default argument|" + "%select{method %3|constructor|destructor}2|" + "%select{method %3|constructor|destructor}2 " + "is %select{not deleted|deleted}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{|pure }4%select{not virtual|virtual}5|" + "%select{method %3|constructor|destructor}2 " + "is %select{not static|static}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not volatile|volatile}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not const|const}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not inline|inline}4|" + "%select{method %3|constructor|destructor}2 " + "that has %4 parameter%s4|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter of type %5%select{| decayed from %7}6|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter named %5|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter with%select{out|}5 a default argument|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter with a different default argument|" "%select{typedef|type alias}2 name %3|" "%select{typedef|type alias}2 %3 with different underlying type %4|" "data member with name %2|" Modified: vendor/clang/dist/include/clang/Basic/IdentifierTable.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/IdentifierTable.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/IdentifierTable.h Wed Jul 19 07:02:30 2017 (r321186) @@ -272,10 +272,6 @@ class IdentifierInfo { (public) /// this identifier is a C++ alternate representation of an operator. void setIsCPlusPlusOperatorKeyword(bool Val = true) { IsCPPOperatorKeyword = Val; - if (Val) - NeedsHandleIdentifier = true; - else - RecomputeNeedsHandleIdentifier(); } bool isCPlusPlusOperatorKeyword() const { return IsCPPOperatorKeyword; } @@ -381,10 +377,9 @@ class IdentifierInfo { (public) /// This method is very tied to the definition of HandleIdentifier. Any /// change to it should be reflected here. void RecomputeNeedsHandleIdentifier() { - NeedsHandleIdentifier = - (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() | - isExtensionToken() | isFutureCompatKeyword() || isOutOfDate() || - isModulesImport()); + NeedsHandleIdentifier = isPoisoned() || hasMacroDefinition() || + isExtensionToken() || isFutureCompatKeyword() || + isOutOfDate() || isModulesImport(); } }; Modified: vendor/clang/dist/include/clang/Basic/LangOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/LangOptions.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/LangOptions.def Wed Jul 19 07:02:30 2017 (r321186) @@ -90,6 +90,7 @@ LANGOPT(CPlusPlus , 1, 0, "C++") LANGOPT(CPlusPlus11 , 1, 0, "C++11") LANGOPT(CPlusPlus14 , 1, 0, "C++14") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 19 07: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 87826DAABD9; Wed, 19 Jul 2017 07:02:38 +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 3AF476E2E2; Wed, 19 Jul 2017 07:02:38 +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 v6J72bTx090851; Wed, 19 Jul 2017 07:02:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72bDE090850; Wed, 19 Jul 2017 07:02:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72bDE090850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321187 - vendor/clang/clang-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r308421 X-SVN-Commit-Revision: 321187 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:38 -0000 Author: dim Date: Wed Jul 19 07:02:37 2017 New Revision: 321187 URL: https://svnweb.freebsd.org/changeset/base/321187 Log: Tag clang trunk r308421. Added: vendor/clang/clang-trunk-r308421/ - copied from r321186, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 B45FCDAAC25; Wed, 19 Jul 2017 07:02:43 +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 5C1746E353; Wed, 19 Jul 2017 07:02:43 +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 v6J72g80090925; Wed, 19 Jul 2017 07:02:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72eeO090898; Wed, 19 Jul 2017 07:02:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72eeO090898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321188 - in vendor/compiler-rt/dist: . lib/asan lib/asan/tests lib/builtins lib/lsan lib/msan lib/sanitizer_common lib/sanitizer_common/tests lib/scudo lib/tsan/rtl lib/tsan/tests/unit... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: . lib/asan lib/asan/tests lib/builtins lib/lsan lib/msan lib/sanitizer_common lib/sanitizer_common/tests lib/scudo lib/tsan/rtl lib/tsan/tests/unit lib/ubsan test/asan/Test... X-SVN-Commit-Revision: 321188 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:43 -0000 Author: dim Date: Wed Jul 19 07:02:40 2017 New Revision: 321188 URL: https://svnweb.freebsd.org/changeset/base/321188 Log: Vendor import of compiler-rt trunk r308421: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308421 Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h (contents, props changed) Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/builtins/cpu_model.c vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc 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_linux.cc vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan.h vendor/compiler-rt/dist/lib/msan/msan_allocator.cc vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_bitvector_test.cc vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp vendor/compiler-rt/dist/lib/scudo/scudo_allocator_combined.h 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_defs.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_clock_test.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/test/asan/TestCases/allocator_returns_null.cc vendor/compiler-rt/dist/test/lsan/TestCases/allocator_returns_null.cc vendor/compiler-rt/dist/test/msan/allocator_returns_null.cc vendor/compiler-rt/dist/test/scudo/memalign.cpp vendor/compiler-rt/dist/test/tsan/Linux/check_memcpy.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/CMakeLists.txt Wed Jul 19 07:02:40 2017 (r321188) @@ -172,10 +172,16 @@ endif() append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) -# Build with optimization, unless we're in debug mode. If we're using MSVC, +# If we're using MSVC, # always respect the optimization flags set by CMAKE_BUILD_TYPE instead. -if(NOT COMPILER_RT_DEBUG AND NOT MSVC) - list(APPEND SANITIZER_COMMON_CFLAGS -O3) +if (NOT MSVC) + + # Build with optimization, unless we're in debug mode. + if(COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -O0) + else() + list(APPEND SANITIZER_COMMON_CFLAGS -O3) + endif() endif() # Determine if we should restrict stack frame sizes. Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -21,7 +21,9 @@ #include "asan_report.h" #include "asan_stack.h" #include "asan_thread.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_list.h" @@ -799,11 +801,6 @@ void PrintInternalAllocatorStats() { instance.PrintStats(); } -void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, - AllocType alloc_type) { - return instance.Allocate(size, alignment, stack, alloc_type, true); -} - void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { instance.Deallocate(ptr, 0, stack, alloc_type); } @@ -814,16 +811,16 @@ void asan_sized_free(void *ptr, uptr size, BufferedSta } void *asan_malloc(uptr size, BufferedStackTrace *stack) { - return instance.Allocate(size, 8, stack, FROM_MALLOC, true); + return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); } void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) { - return instance.Calloc(nmemb, size, stack); + return SetErrnoOnNull(instance.Calloc(nmemb, size, stack)); } void *asan_realloc(void *p, uptr size, BufferedStackTrace *stack) { if (!p) - return instance.Allocate(size, 8, stack, FROM_MALLOC, true); + return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); if (size == 0) { if (flags()->allocator_frees_and_returns_null_on_realloc_zero) { instance.Deallocate(p, 0, stack, FROM_MALLOC); @@ -832,26 +829,41 @@ void *asan_realloc(void *p, uptr size, BufferedStackTr // Allocate a size of 1 if we shouldn't free() on Realloc to 0 size = 1; } - return instance.Reallocate(p, size, stack); + return SetErrnoOnNull(instance.Reallocate(p, size, stack)); } void *asan_valloc(uptr size, BufferedStackTrace *stack) { - return instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true); + return SetErrnoOnNull( + instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true)); } void *asan_pvalloc(uptr size, BufferedStackTrace *stack) { uptr PageSize = GetPageSizeCached(); - size = RoundUpTo(size, PageSize); - if (size == 0) { - // pvalloc(0) should allocate one page. - size = PageSize; + // pvalloc(0) should allocate one page. + size = size ? RoundUpTo(size, PageSize) : PageSize; + return SetErrnoOnNull( + instance.Allocate(size, PageSize, stack, FROM_MALLOC, true)); +} + +void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, + AllocType alloc_type) { + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return AsanAllocator::FailureHandler::OnBadRequest(); } - return instance.Allocate(size, PageSize, stack, FROM_MALLOC, true); + return SetErrnoOnNull( + instance.Allocate(size, alignment, stack, alloc_type, true)); } int asan_posix_memalign(void **memptr, uptr alignment, uptr size, BufferedStackTrace *stack) { + if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { + AsanAllocator::FailureHandler::OnBadRequest(); + return errno_EINVAL; + } void *ptr = instance.Allocate(size, alignment, stack, FROM_MALLOC, true); + if (UNLIKELY(!ptr)) + return errno_ENOMEM; CHECK(IsAligned((uptr)ptr, alignment)); *memptr = ptr; return 0; Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -178,6 +178,10 @@ void SetThreadName(const char *name) { } int OnExit() { + if (CAN_SANITIZE_LEAKS && common_flags()->detect_leaks && + __lsan::HasReportedLeaks()) { + return common_flags()->exitcode; + } // FIXME: ask frontend whether we need to return failure. return 0; } Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -12,6 +12,8 @@ //===----------------------------------------------------------------------===// #include "asan_test_utils.h" +#include + NOINLINE void *malloc_fff(size_t size) { void *res = malloc/**/(size); break_optimization(0); return res;} NOINLINE void *malloc_eee(size_t size) { @@ -74,9 +76,11 @@ TEST(AddressSanitizer, VariousMallocsTest) { delete c; #if SANITIZER_TEST_HAS_POSIX_MEMALIGN - int *pm; - int pm_res = posix_memalign((void**)&pm, kPageSize, kPageSize); + void *pm = 0; + // Valid allocation. + int pm_res = posix_memalign(&pm, kPageSize, kPageSize); EXPECT_EQ(0, pm_res); + EXPECT_NE(nullptr, pm); free(pm); #endif // SANITIZER_TEST_HAS_POSIX_MEMALIGN Modified: vendor/compiler-rt/dist/lib/builtins/cpu_model.c ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/cpu_model.c Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/builtins/cpu_model.c Wed Jul 19 07:02:40 2017 (r321188) @@ -190,8 +190,8 @@ static bool getX86CpuIDAndInfo(unsigned value, unsigne static bool getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf, unsigned *rEAX, unsigned *rEBX, unsigned *rECX, unsigned *rEDX) { -#if defined(__x86_64__) || defined(_M_X64) #if defined(__GNUC__) || defined(__clang__) +#if defined(__x86_64__) // 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" @@ -200,43 +200,24 @@ static bool getX86CpuIDAndInfoEx(unsigned value, unsig : "=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); - *rEAX = registers[0]; - *rEBX = registers[1]; - *rECX = registers[2]; - *rEDX = registers[3]; - return false; -#else - return true; -#endif -#elif defined(__i386__) || defined(_M_IX86) -#if defined(__GNUC__) || defined(__clang__) +#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), "c"(subleaf)); return false; -#elif defined(_MSC_VER) - __asm { - mov eax,value - mov ecx,subleaf - cpuid - mov esi,rEAX - mov dword ptr [esi],eax - mov esi,rEBX - mov dword ptr [esi],ebx - mov esi,rECX - mov dword ptr [esi],ecx - mov esi,rEDX - mov dword ptr [esi],edx - } - return false; #else return true; #endif +#elif defined(_MSC_VER) + int registers[4]; + __cpuidex(registers, value, subleaf); + *rEAX = registers[0]; + *rEBX = registers[1]; + *rECX = registers[2]; + *rEDX = registers[3]; + return false; #else return true; #endif Modified: vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -15,7 +15,9 @@ #include "lsan_allocator.h" #include "sanitizer_common/sanitizer_allocator.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_stacktrace.h" @@ -86,6 +88,13 @@ void *Allocate(const StackTrace &stack, uptr size, upt return p; } +static void *Calloc(uptr nmemb, uptr size, const StackTrace &stack) { + if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) + return Allocator::FailureHandler::OnBadRequest(); + size *= nmemb; + return Allocate(stack, size, 1, true); +} + void Deallocate(void *p) { if (&__sanitizer_free_hook) __sanitizer_free_hook(p); RunFreeHooks(p); @@ -118,11 +127,15 @@ uptr GetMallocUsableSize(const void *p) { } void *lsan_memalign(uptr alignment, uptr size, const StackTrace &stack) { - return Allocate(stack, size, alignment, kAlwaysClearMemory); + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(Allocate(stack, size, alignment, kAlwaysClearMemory)); } void *lsan_malloc(uptr size, const StackTrace &stack) { - return Allocate(stack, size, 1, kAlwaysClearMemory); + return SetErrnoOnNull(Allocate(stack, size, 1, kAlwaysClearMemory)); } void lsan_free(void *p) { @@ -130,20 +143,16 @@ void lsan_free(void *p) { } void *lsan_realloc(void *p, uptr size, const StackTrace &stack) { - return Reallocate(stack, p, size, 1); + return SetErrnoOnNull(Reallocate(stack, p, size, 1)); } void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack) { - if (CheckForCallocOverflow(size, nmemb)) - return Allocator::FailureHandler::OnBadRequest(); - size *= nmemb; - return Allocate(stack, size, 1, true); + return SetErrnoOnNull(Calloc(nmemb, size, stack)); } void *lsan_valloc(uptr size, const StackTrace &stack) { - if (size == 0) - size = GetPageSizeCached(); - return Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory); + return SetErrnoOnNull( + Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory)); } uptr lsan_mz_size(const void *p) { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -576,18 +576,16 @@ static bool CheckForLeaks() { return false; } +static bool has_reported_leaks = false; +bool HasReportedLeaks() { return has_reported_leaks; } + void DoLeakCheck() { BlockingMutexLock l(&global_mutex); static bool already_done; if (already_done) return; already_done = true; - bool have_leaks = CheckForLeaks(); - if (!have_leaks) { - return; - } - if (common_flags()->exitcode) { - Die(); - } + has_reported_leaks = CheckForLeaks(); + if (has_reported_leaks) HandleLeaks(); } static int DoRecoverableLeakCheck() { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.h Wed Jul 19 07:02:40 2017 (r321188) @@ -226,6 +226,12 @@ IgnoreObjectResult IgnoreObjectLocked(const void *p); // Return the linker module, if valid for the platform. LoadedModule *GetLinker(); +// Return true if LSan has finished leak checking and reported leaks. +bool HasReportedLeaks(); + +// Run platform-specific leak handlers. +void HandleLeaks(); + // Wrapper for chunk metadata operations. class LsanMetadata { public: Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -100,6 +100,13 @@ struct DoStopTheWorldParam { void *argument; }; +// While calling Die() here is undefined behavior and can potentially +// cause race conditions, it isn't possible to intercept exit on linux, +// so we have no choice but to call Die() from the atexit handler. +void HandleLeaks() { + if (common_flags()->exitcode) Die(); +} + static int DoStopTheWorldCallback(struct dl_phdr_info *info, size_t size, void *data) { DoStopTheWorldParam *param = reinterpret_cast(data); Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -164,6 +164,11 @@ void ProcessPlatformSpecificAllocations(Frontier *fron } } +// On darwin, we can intercept _exit gracefully, and return a failing exit code +// if required at that point. Calling Die() here is undefined behavior and +// causes rare race conditions. +void HandleLeaks() {} + void DoStopTheWorld(StopTheWorldCallback callback, void *argument) { StopTheWorld(callback, argument); } Modified: vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -352,6 +352,11 @@ INTERCEPTOR(int, pthread_join, void *th, void **ret) { return res; } +INTERCEPTOR(void, _exit, int status) { + if (status == 0 && HasReportedLeaks()) status = common_flags()->exitcode; + REAL(_exit)(status); +} + namespace __lsan { void InitializeInterceptors() { @@ -371,6 +376,7 @@ void InitializeInterceptors() { LSAN_MAYBE_INTERCEPT_MALLOPT; INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); + INTERCEPT_FUNCTION(_exit); if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) { Report("LeakSanitizer: failed to create thread key.\n"); Modified: vendor/compiler-rt/dist/lib/msan/msan.h ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan.h Wed Jul 19 07:02:40 2017 (r321188) @@ -280,10 +280,18 @@ void InitializeInterceptors(); void MsanAllocatorInit(); void MsanAllocatorThreadFinish(); -void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size); -void *MsanReallocate(StackTrace *stack, void *oldp, uptr size, - uptr alignment, bool zeroise); void MsanDeallocate(StackTrace *stack, void *ptr); + +void *msan_malloc(uptr size, StackTrace *stack); +void *msan_calloc(uptr nmemb, uptr size, StackTrace *stack); +void *msan_realloc(void *ptr, uptr size, StackTrace *stack); +void *msan_valloc(uptr size, StackTrace *stack); +void *msan_pvalloc(uptr size, StackTrace *stack); +void *msan_aligned_alloc(uptr alignment, uptr size, StackTrace *stack); +void *msan_memalign(uptr alignment, uptr size, StackTrace *stack); +int msan_posix_memalign(void **memptr, uptr alignment, uptr size, + StackTrace *stack); + void InstallTrapHandler(); void InstallAtExitHandler(); Modified: vendor/compiler-rt/dist/lib/msan/msan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -13,7 +13,9 @@ //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "msan.h" #include "msan_allocator.h" #include "msan_origin.h" @@ -194,20 +196,8 @@ void MsanDeallocate(StackTrace *stack, void *p) { } } -void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) { - if (CheckForCallocOverflow(size, nmemb)) - return Allocator::FailureHandler::OnBadRequest(); - return MsanReallocate(stack, nullptr, nmemb * size, sizeof(u64), true); -} - void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size, - uptr alignment, bool zeroise) { - if (!old_p) - return MsanAllocate(stack, new_size, alignment, zeroise); - if (!new_size) { - MsanDeallocate(stack, old_p); - return nullptr; - } + uptr alignment) { Metadata *meta = reinterpret_cast(allocator.GetMetaData(old_p)); uptr old_size = meta->requested_size; uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(old_p); @@ -215,10 +205,7 @@ void *MsanReallocate(StackTrace *stack, void *old_p, u // We are not reallocating here. meta->requested_size = new_size; if (new_size > old_size) { - if (zeroise) { - __msan_clear_and_unpoison((char *)old_p + old_size, - new_size - old_size); - } else if (flags()->poison_in_malloc) { + if (flags()->poison_in_malloc) { stack->tag = StackTrace::TAG_ALLOC; PoisonMemory((char *)old_p + old_size, new_size - old_size, stack); } @@ -226,8 +213,7 @@ void *MsanReallocate(StackTrace *stack, void *old_p, u return old_p; } uptr memcpy_size = Min(new_size, old_size); - void *new_p = MsanAllocate(stack, new_size, alignment, zeroise); - // Printf("realloc: old_size %zd new_size %zd\n", old_size, new_size); + void *new_p = MsanAllocate(stack, new_size, alignment, false /*zeroise*/); if (new_p) { CopyMemory(new_p, old_p, memcpy_size, stack); MsanDeallocate(stack, old_p); @@ -241,6 +227,67 @@ static uptr AllocationSize(const void *p) { if (beg != p) return 0; Metadata *b = (Metadata *)allocator.GetMetaData(p); return b->requested_size; +} + +void *msan_malloc(uptr size, StackTrace *stack) { + return SetErrnoOnNull(MsanAllocate(stack, size, sizeof(u64), false)); +} + +void *msan_calloc(uptr nmemb, uptr size, StackTrace *stack) { + if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) + return SetErrnoOnNull(Allocator::FailureHandler::OnBadRequest()); + return SetErrnoOnNull(MsanAllocate(stack, nmemb * size, sizeof(u64), true)); +} + +void *msan_realloc(void *ptr, uptr size, StackTrace *stack) { + if (!ptr) + return SetErrnoOnNull(MsanAllocate(stack, size, sizeof(u64), false)); + if (size == 0) { + MsanDeallocate(stack, ptr); + return nullptr; + } + return SetErrnoOnNull(MsanReallocate(stack, ptr, size, sizeof(u64))); +} + +void *msan_valloc(uptr size, StackTrace *stack) { + return SetErrnoOnNull(MsanAllocate(stack, size, GetPageSizeCached(), false)); +} + +void *msan_pvalloc(uptr size, StackTrace *stack) { + uptr PageSize = GetPageSizeCached(); + // pvalloc(0) should allocate one page. + size = size == 0 ? PageSize : RoundUpTo(size, PageSize); + return SetErrnoOnNull(MsanAllocate(stack, size, PageSize, false)); +} + +void *msan_aligned_alloc(uptr alignment, uptr size, StackTrace *stack) { + if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(MsanAllocate(stack, size, alignment, false)); +} + +void *msan_memalign(uptr alignment, uptr size, StackTrace *stack) { + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(MsanAllocate(stack, size, alignment, false)); +} + +int msan_posix_memalign(void **memptr, uptr alignment, uptr size, + StackTrace *stack) { + if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { + Allocator::FailureHandler::OnBadRequest(); + return errno_EINVAL; + } + void *ptr = MsanAllocate(stack, size, alignment, false); + if (UNLIKELY(!ptr)) + return errno_ENOMEM; + CHECK(IsAligned((uptr)ptr, alignment)); + *memptr = ptr; + return 0; } } // namespace __msan Modified: vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -161,58 +161,45 @@ INTERCEPTOR(void *, bcopy, const void *src, void *dest INTERCEPTOR(int, posix_memalign, void **memptr, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(alignment & (alignment - 1), 0); CHECK_NE(memptr, 0); - *memptr = MsanReallocate(&stack, nullptr, size, alignment, false); - CHECK_NE(*memptr, 0); - __msan_unpoison(memptr, sizeof(*memptr)); - return 0; + int res = msan_posix_memalign(memptr, alignment, size, &stack); + if (!res) + __msan_unpoison(memptr, sizeof(*memptr)); + return res; } #if !SANITIZER_FREEBSD -INTERCEPTOR(void *, memalign, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, memalign, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - return ptr; + return msan_memalign(alignment, size, &stack); } #define MSAN_MAYBE_INTERCEPT_MEMALIGN INTERCEPT_FUNCTION(memalign) #else #define MSAN_MAYBE_INTERCEPT_MEMALIGN #endif -INTERCEPTOR(void *, aligned_alloc, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, aligned_alloc, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - return ptr; + return msan_aligned_alloc(alignment, size, &stack); } -INTERCEPTOR(void *, __libc_memalign, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, __libc_memalign, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - DTLS_on_libc_memalign(ptr, size); + void *ptr = msan_memalign(alignment, size, &stack); + if (ptr) + DTLS_on_libc_memalign(ptr, size); return ptr; } INTERCEPTOR(void *, valloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; - void *ptr = MsanReallocate(&stack, nullptr, size, GetPageSizeCached(), false); - return ptr; + return msan_valloc(size, &stack); } #if !SANITIZER_FREEBSD INTERCEPTOR(void *, pvalloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; - uptr PageSize = GetPageSizeCached(); - size = RoundUpTo(size, PageSize); - if (size == 0) { - // pvalloc(0) should allocate one page. - size = PageSize; - } - void *ptr = MsanReallocate(&stack, nullptr, size, PageSize, false); - return ptr; + return msan_pvalloc(size, &stack); } #define MSAN_MAYBE_INTERCEPT_PVALLOC INTERCEPT_FUNCTION(pvalloc) #else @@ -853,7 +840,7 @@ INTERCEPTOR(void *, calloc, SIZE_T nmemb, SIZE_T size) if (UNLIKELY(!msan_inited)) // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. return AllocateFromLocalPool(nmemb * size); - return MsanCalloc(&stack, nmemb, size); + return msan_calloc(nmemb, size, &stack); } INTERCEPTOR(void *, realloc, void *ptr, SIZE_T size) { @@ -866,12 +853,12 @@ INTERCEPTOR(void *, realloc, void *ptr, SIZE_T size) { new_ptr = AllocateFromLocalPool(copy_size); } else { copy_size = size; - new_ptr = MsanReallocate(&stack, nullptr, copy_size, sizeof(u64), false); + new_ptr = msan_malloc(copy_size, &stack); } internal_memcpy(new_ptr, ptr, copy_size); return new_ptr; } - return MsanReallocate(&stack, ptr, size, sizeof(u64), false); + return msan_realloc(ptr, size, &stack); } INTERCEPTOR(void *, malloc, SIZE_T size) { @@ -879,7 +866,7 @@ INTERCEPTOR(void *, malloc, SIZE_T size) { if (UNLIKELY(!msan_inited)) // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym. return AllocateFromLocalPool(size); - return MsanReallocate(&stack, nullptr, size, sizeof(u64), false); + return msan_malloc(size, &stack); } void __msan_allocated_memory(const void *data, uptr size) { Modified: vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -31,7 +31,7 @@ namespace std { // TODO(alekseys): throw std::bad_alloc instead of dying on OOM. #define OPERATOR_NEW_BODY(nothrow) \ GET_MALLOC_STACK_TRACE; \ - void *res = MsanReallocate(&stack, 0, size, sizeof(u64), false);\ + void *res = msan_malloc(size, &stack);\ if (!nothrow && UNLIKELY(!res)) DieOnFailure::OnOOM();\ return res Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -14,6 +14,7 @@ #include "sanitizer_allocator.h" +#include "sanitizer_allocator_checks.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_atomic.h" #include "sanitizer_common.h" @@ -160,7 +161,7 @@ void *InternalRealloc(void *addr, uptr size, InternalA } void *InternalCalloc(uptr count, uptr size, InternalAllocatorCache *cache) { - if (CheckForCallocOverflow(count, size)) + if (UNLIKELY(CheckForCallocOverflow(count, size))) return InternalAllocator::FailureHandler::OnBadRequest(); void *p = InternalAlloc(count * size, cache); if (p) internal_memset(p, 0, count * size); @@ -200,12 +201,6 @@ void *LowLevelAllocator::Allocate(uptr size) { void SetLowLevelAllocateCallback(LowLevelAllocateCallback callback) { low_level_alloc_callback = callback; -} - -bool CheckForCallocOverflow(uptr size, uptr n) { - if (!size) return false; - uptr max = (uptr)-1L; - return (max / size) < n; } static atomic_uint8_t allocator_out_of_memory = {0}; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h Wed Jul 19 07:02:40 2017 (r321188) @@ -56,11 +56,6 @@ struct NoOpMapUnmapCallback { // Callback type for iterating over chunks. typedef void (*ForEachChunkCallback)(uptr chunk, void *arg); -// Returns true if calloc(size, n) call overflows on size*n calculation. -// The caller should "return POLICY::OnBadRequest();" where POLICY is the -// current allocator failure handling policy. -bool CheckForCallocOverflow(uptr size, uptr n); - #include "sanitizer_allocator_size_class_map.h" #include "sanitizer_allocator_stats.h" #include "sanitizer_allocator_primary64.h" Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h Wed Jul 19 07:02:40 2017 (r321188) @@ -0,0 +1,64 @@ +//===-- sanitizer_allocator_checks.h ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Various checks shared between ThreadSanitizer, MemorySanitizer, etc. memory +// allocators. +// +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_ALLOCATOR_CHECKS_H +#define SANITIZER_ALLOCATOR_CHECKS_H + +#include "sanitizer_errno.h" +#include "sanitizer_internal_defs.h" +#include "sanitizer_common.h" +#include "sanitizer_platform.h" + +namespace __sanitizer { + +// A common errno setting logic shared by almost all sanitizer allocator APIs. +INLINE void *SetErrnoOnNull(void *ptr) { + if (UNLIKELY(!ptr)) + errno = errno_ENOMEM; + return ptr; +} + +// In case of the check failure, the caller of the following Check... functions +// should "return POLICY::OnBadRequest();" where POLICY is the current allocator +// failure handling policy. + +// Checks aligned_alloc() parameters, verifies that the alignment is a power of +// two and that the size is a multiple of alignment for POSIX implementation, +// and a bit relaxed requirement for non-POSIX ones, that the size is a multiple +// of alignment. +INLINE bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { +#if SANITIZER_POSIX + return IsPowerOfTwo(alignment) && (size & (alignment - 1)) == 0; +#else + return size % alignment == 0; +#endif +} + +// Checks posix_memalign() parameters, verifies that alignment is a power of two +// and a multiple of sizeof(void *). +INLINE bool CheckPosixMemalignAlignment(uptr alignment) { + return IsPowerOfTwo(alignment) && (alignment % sizeof(void *)) == 0; // NOLINT +} + +// Returns true if calloc(size, n) call overflows on size*n calculation. +INLINE bool CheckForCallocOverflow(uptr size, uptr n) { + if (!size) + return false; + uptr max = (uptr)-1L; + return (max / size) < n; +} + +} // namespace __sanitizer + +#endif // SANITIZER_ALLOCATOR_CHECKS_H Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h Wed Jul 19 07:02:40 2017 (r321188) @@ -26,6 +26,8 @@ # define __errno_location __error #elif SANITIZER_ANDROID # define __errno_location __errno +#elif SANITIZER_WINDOWS +# define __errno_location _errno #endif extern "C" int *__errno_location(); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -629,8 +629,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const void *ss, void *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Wed Jul 19 07:02:40 2017 (r321188) @@ -21,7 +21,6 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -30,8 +29,7 @@ struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -805,14 +805,35 @@ char **GetArgv() { // fields only available in 10.12+. Declare the struct manually to be able to // build against older SDKs. struct __sanitizer_task_vm_info { - uptr _unused[(SANITIZER_WORDSIZE == 32) ? 20 : 19]; - uptr min_address; - uptr max_address; + mach_vm_size_t virtual_size; + integer_t region_count; + integer_t page_size; + mach_vm_size_t resident_size; + mach_vm_size_t resident_size_peak; + mach_vm_size_t device; + mach_vm_size_t device_peak; + mach_vm_size_t internal; + mach_vm_size_t internal_peak; + mach_vm_size_t external; + mach_vm_size_t external_peak; + mach_vm_size_t reusable; + mach_vm_size_t reusable_peak; + mach_vm_size_t purgeable_volatile_pmap; + mach_vm_size_t purgeable_volatile_resident; + mach_vm_size_t purgeable_volatile_virtual; + mach_vm_size_t compressed; + mach_vm_size_t compressed_peak; + mach_vm_size_t compressed_lifetime; + mach_vm_size_t phys_footprint; + mach_vm_address_t min_address; + mach_vm_address_t max_address; }; +#define __SANITIZER_TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(__sanitizer_task_vm_info) / sizeof(natural_t))) uptr GetTaskInfoMaxAddress() { - __sanitizer_task_vm_info vm_info = {{0}, 0, 0}; - mach_msg_type_number_t count = sizeof(vm_info) / sizeof(int); + __sanitizer_task_vm_info vm_info = {}; + mach_msg_type_number_t count = __SANITIZER_TASK_VM_INFO_COUNT; int err = task_info(mach_task_self(), TASK_VM_INFO, (int *)&vm_info, &count); if (err == 0) { return vm_info.max_address - 1; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Wed Jul 19 07:02:40 2017 (r321188) @@ -13,7 +13,7 @@ #ifndef SANITIZER_PLATFORM_H #define SANITIZER_PLATFORM_H -#if !defined(__linux__) && !defined(__FreeBSD__) && \ +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ !defined(__APPLE__) && !defined(_WIN32) # error "This operating system is not supported" #endif @@ -30,6 +30,12 @@ # define SANITIZER_FREEBSD 0 #endif +#if defined(__NetBSD__) +# define SANITIZER_NETBSD 1 +#else +# define SANITIZER_NETBSD 0 +#endif + #if defined(__APPLE__) # define SANITIZER_MAC 1 # include @@ -79,7 +85,8 @@ # define SANITIZER_ANDROID 0 #endif -#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC) +#define SANITIZER_POSIX \ + (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || SANITIZER_NETBSD) #if __LP64__ || defined(_WIN64) # define SANITIZER_WORDSIZE 64 Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Jul 19 07:02:40 2017 (r321188) @@ -49,6 +49,12 @@ # define SI_FREEBSD 0 #endif +#if SANITIZER_NETBSD +# define SI_NETBSD 1 +#else +# define SI_NETBSD 0 +#endif + #if SANITIZER_LINUX # define SI_LINUX 1 #else @@ -109,9 +115,9 @@ // memmem on Darwin doesn't exist on 10.6 // FIXME: enable memmem on Windows. #define SANITIZER_INTERCEPT_MEMMEM \ - SI_NOT_WINDOWS && !SI_MAC_DEPLOYMENT_BELOW_10_7 + (SI_NOT_WINDOWS && !SI_MAC_DEPLOYMENT_BELOW_10_7) #define SANITIZER_INTERCEPT_MEMCHR 1 -#define SANITIZER_INTERCEPT_MEMRCHR SI_FREEBSD || SI_LINUX +#define SANITIZER_INTERCEPT_MEMRCHR (SI_FREEBSD || SI_LINUX || SI_NETBSD) #define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS @@ -127,7 +133,8 @@ #define SANITIZER_INTERCEPT_READV SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WRITEV SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_PREADV SI_FREEBSD || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_PREADV \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID @@ -142,7 +149,7 @@ #ifndef SANITIZER_INTERCEPT_PRINTF # define SANITIZER_INTERCEPT_PRINTF SI_NOT_WINDOWS -# define SANITIZER_INTERCEPT_PRINTF_L SI_FREEBSD +# define SANITIZER_INTERCEPT_PRINTF_L (SI_FREEBSD || SI_NETBSD) # define SANITIZER_INTERCEPT_ISOC99_PRINTF SI_LINUX_NOT_ANDROID #endif @@ -151,13 +158,14 @@ #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_GETPWENT \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETPWENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_SETPWENT SI_MAC || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_FREEBSD || SI_LINUX +#define SANITIZER_INTERCEPT_GETPWENT_R \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_SETPWENT (SI_MAC || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_CLOCK_GETTIME (SI_FREEBSD || SI_NETBSD || SI_LINUX) #define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_TIME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID @@ -168,10 +176,11 @@ #define SANITIZER_INTERCEPT_GETNAMEINFO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETSOCKNAME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_GETHOSTBYNAME_R SI_FREEBSD || SI_LINUX -#define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETHOSTBYADDR_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETHOSTENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_GETHOSTBYNAME_R (SI_FREEBSD || SI_LINUX) +#define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R \ + (SI_FREEBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_GETHOSTBYADDR_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_GETHOSTENT_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_GETSOCKOPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX_NOT_ANDROID @@ -197,63 +206,67 @@ #define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRTOIMAX SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MBSTOWCS SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_MBSNRTOWCS SI_MAC || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_MBSNRTOWCS (SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_WCSTOMBS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WCSNRTOMBS \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_WCRTOMB \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_REALPATH SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_CONFSTR \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRERROR SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_STRERROR_R SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCANDIR \ - SI_FREEBSD || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETGROUPS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_POLL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WORDEXP \ - SI_FREEBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SIGWAIT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGSETOPS \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 9798EDAAC85; Wed, 19 Jul 2017 07:02: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 478BE6E436; Wed, 19 Jul 2017 07:02: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 v6J72o1d091031; Wed, 19 Jul 2017 07:02:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72nmu091019; Wed, 19 Jul 2017 07:02:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72nmu091019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321190 - in vendor/libc++/dist: docs/DesignDocs include lib test/support www X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist: docs/DesignDocs include lib test/support www X-SVN-Commit-Revision: 321190 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:51 -0000 Author: dim Date: Wed Jul 19 07:02:49 2017 New Revision: 321190 URL: https://svnweb.freebsd.org/changeset/base/321190 Log: Vendor import of libc++ trunk r308421: https://llvm.org/svn/llvm-project/libcxx/trunk@308421 Added: vendor/libc++/dist/www/cxx2a_status.html (contents, props changed) Modified: vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst vendor/libc++/dist/include/__config vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/string vendor/libc++/dist/include/vector vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/test/support/test_macros.h vendor/libc++/dist/www/cxx1z_status.html vendor/libc++/dist/www/index.html vendor/libc++/dist/www/upcoming_meeting.html Modified: vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst ============================================================================== --- vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Wed Jul 19 07:02:49 2017 (r321190) @@ -90,20 +90,21 @@ Visibility Macros The macro has an empty definition with GCC. **Windows Behavior**: `extern template` and `dllexport` are fundamentally - incompatible *on a template class* on Windows; the former suppresses + incompatible *on a class template* on Windows; the former suppresses instantiation, while the latter forces it. Specifying both on the same - declaration makes the template class be instantiated, which is not desirable + declaration makes the class template be instantiated, which is not desirable inside headers. This macro therefore expands to `dllimport` outside of libc++ but nothing inside of it (rather than expanding to `dllexport`); instead, the explicit instantiations themselves are marked as exported. Note that this - applies *only* to extern template *classes*. Extern template *functions* obey + applies *only* to extern *class* templates. Extern *function* templates obey regular import/export semantics, and applying `dllexport` directly to the - extern template declaration is the correct thing to do for them. + extern template declaration (i.e. using `_LIBCPP_FUNC_VIS`) is the correct + thing to do for them. **_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS** Mark the member functions, typeinfo, and vtable of an explicit instantiation of a class template as being exported by the libc++ library. This attribute - must be specified on all template class explicit instantiations. + must be specified on all class template explicit instantiations. It is only necessary to mark the explicit instantiation itself (as opposed to the extern template declaration) as exported on Windows, as discussed above. Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/__config Wed Jul 19 07:02:49 2017 (r321190) @@ -229,8 +229,9 @@ # define _LIBCPP_SHORT_WCHAR 1 // Both MinGW and native MSVC provide a "MSVC"-like enviroment # define _LIBCPP_MSVCRT_LIKE -// If mingw not explicitly detected, assume using MS C runtime only. -# ifndef __MINGW32__ +// If mingw not explicitly detected, assume using MS C runtime only if +// a MS compatibility version is specified. +# if defined(_MSC_VER) && !defined(__MINGW32__) # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library # endif # if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__)) @@ -625,7 +626,6 @@ namespace std { #define _LIBCPP_HIDDEN #define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS #define _LIBCPP_TEMPLATE_VIS -#define _LIBCPP_FUNC_VIS_ONLY #define _LIBCPP_ENUM_VIS #if defined(_LIBCPP_COMPILER_MSVC) @@ -684,10 +684,6 @@ namespace std { # endif #endif -#ifndef _LIBCPP_FUNC_VIS_ONLY -# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS -#endif - #ifndef _LIBCPP_EXTERN_VIS # define _LIBCPP_EXTERN_VIS #endif @@ -925,8 +921,10 @@ template struct __static_assert_check {}; # define _LIBCPP_STD_VER 11 # elif __cplusplus <= 201402L # define _LIBCPP_STD_VER 14 +# elif __cplusplus <= 201703L +# define _LIBCPP_STD_VER 17 # else -# define _LIBCPP_STD_VER 16 // current year, or date of c++17 ratification +# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification # endif #endif // _LIBCPP_STD_VER Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/algorithm Wed Jul 19 07:02:49 2017 (r321190) @@ -4234,10 +4234,6 @@ sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __la _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, char*>(char*, char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) @@ -4271,9 +4267,6 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insert _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&)) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC // lower_bound Modified: vendor/libc++/dist/include/string ============================================================================== --- vendor/libc++/dist/include/string Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/string Wed Jul 19 07:02:49 2017 (r321190) @@ -578,14 +578,7 @@ __basic_string_common<__b>::__throw_out_of_range() con _VSTD::__throw_out_of_range("basic_string"); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231 ) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC #ifdef _LIBCPP_NO_EXCEPTIONS template @@ -4006,7 +3999,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscript _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) -_LIBCPP_EXTERN_TEMPLATE(string operator+, allocator >(char const*, string const&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+, allocator >(char const*, string const&)) #if _LIBCPP_STD_VER > 11 // Literal suffixes for basic_string [basic.string.literals] Modified: vendor/libc++/dist/include/vector ============================================================================== --- vendor/libc++/dist/include/vector Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/vector Wed Jul 19 07:02:49 2017 (r321190) @@ -310,14 +310,7 @@ __vector_base_common<__b>::__throw_out_of_range() cons _VSTD::__throw_out_of_range("vector"); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231 ) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __vector_base_common) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC template class __vector_base Modified: vendor/libc++/dist/lib/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/lib/CMakeLists.txt Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/lib/CMakeLists.txt Wed Jul 19 07:02:49 2017 (r321190) @@ -258,7 +258,7 @@ if (LIBCXX_ENABLE_STATIC) set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}") endif() if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR - (${LIBCXX_CXX_ABI_LIBRARY} STREQUAL "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI)) + (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI)) set(MERGE_ARCHIVES_ABI_TARGET "$") else() set(MERGE_ARCHIVES_ABI_TARGET Modified: vendor/libc++/dist/test/support/test_macros.h ============================================================================== --- vendor/libc++/dist/test/support/test_macros.h Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/test/support/test_macros.h Wed Jul 19 07:02:49 2017 (r321190) @@ -81,8 +81,11 @@ # define TEST_STD_VER 11 #elif __cplusplus <= 201402L # define TEST_STD_VER 14 +#elif __cplusplus <= 201703L +# define TEST_STD_VER 17 #else -# define TEST_STD_VER 16 // current year; greater than current standard +# define TEST_STD_VER 99 // greater than current standard +// This is deliberately different than _LIBCPP_STD_VER to discourage matching them up. #endif #endif Modified: vendor/libc++/dist/www/cxx1z_status.html ============================================================================== --- vendor/libc++/dist/www/cxx1z_status.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/cxx1z_status.html Wed Jul 19 07:02:49 2017 (r321190) @@ -161,6 +161,9 @@ P0607R0LWGInline Variables for the Standard LibraryKona P0618R0LWGDeprecating <codecvt>Kona P0623R0LWGFinal C++17 Parallel Algorithms FixesKona + + P0682R1LWGRepairing elementary string conversionsToronto + P0739R0LWGSome improvements to class template argument deduction integration into the standard libraryToronto @@ -483,6 +486,11 @@ 2911An is_aggregate type trait is neededKonaComplete 2921packaged_task and type-erased allocatorsKona 2934optional<const T> doesn't compare with TKonaComplete + + 2901Variants cannot properly support allocatorsTorontoComplete + 2955to_chars / from_chars depend on std::stringTorontoResolved by P0682R1 + 2956filesystem::canonical() still defined in terms of absolute(p, base)TorontoComplete + Added: vendor/libc++/dist/www/cxx2a_status.html ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/www/cxx2a_status.html Wed Jul 19 07:02:49 2017 (r321190) @@ -0,0 +1,90 @@ + + + + + + libc++ C++2a Status + + + + + + + +
+ +

libc++ C++2a Status

+ + +

In July 2017, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++2a" (probably to be C++20).

+

This page shows the status of libc++; the status of clang's support of the language features is here.

+ +

The groups that have contributed papers: +

    +
  • LWG - Library working group
  • +
  • CWG - Core Language Working group
  • +
  • SG1 - Study group #1 (Concurrency working group)
  • +
+

+ +

Paper Status

+ + + + + + + +
Paper #GroupPaper NameMeetingStatusFirst released version
P0463R1LWGEndian just EndianToronto
P0674R1LWGExtending make_shared to Support ArraysToronto
+ +

[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]

+ +

Library Working group Issues Status

+ + + + + + + + + + + + + + + + + + + +
Issue #Issue NameMeetingStatus
2070allocate_shared should use allocator_traits<A>::constructTorontoResolved by P0674R1
2444Inconsistent complexity for std::sort_heapToronto
2593Moved-from state of AllocatorsToronto
2597std::log misspecified for complex numbersToronto
2783stack::emplace() and queue::emplace() should return decltype(auto)Toronto
2932Constraints on parallel algorithm implementations are underspecifiedToronto
2937Is equivalent("existing_thing", "not_existing_thing") an errorTorontoComplete
2940result_of specification also needs a little cleanupToronto
2942LWG 2873's resolution missed weak_ptr::owner_beforeToronto
2954Specialization of the convenience variable templates should be prohibitedToronto
2961Bad postcondition for set_default_resourceToronto
2966Incomplete resolution of US 74TorontoNothing to do
2974Diagnose out of bounds tuple_element/variant_alternativeTorontoComplete
+ +

Last Updated: 16-Jul-2017

+
+ + Modified: vendor/libc++/dist/www/index.html ============================================================================== --- vendor/libc++/dist/www/index.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/index.html Wed Jul 19 07:02:49 2017 (r321190) @@ -138,6 +138,8 @@ C++14 can be found here.

A list of features and changes for the next C++ standard, known here as "C++1z" (probably to be C++17) can be found here.

+

A list of features and changes for the C++ standard beyond C++17, known here as + "C++2a" (probably to be C++20) can be found here.

Implementation of the post-c++14 Technical Specifications is in progress. A list of features and the current status of these features can be found here.

Modified: vendor/libc++/dist/www/upcoming_meeting.html ============================================================================== --- vendor/libc++/dist/www/upcoming_meeting.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/upcoming_meeting.html Wed Jul 19 07:02:49 2017 (r321190) @@ -73,7 +73,11 @@ 2974Diagnose out of bounds tuple_element/variant_alternativeToronto
Priority 1 Bugs
- 2665remove_filename() post condition is incorrectKonaWe do this already + 2665remove_filename() post condition is incorrectTorontoWe do this already + +
Immediate Issues in Toronto
+ 2901Variants cannot properly support allocatorsTorontoWe do this already + 2956filesystem::canonical() still defined in terms of absolute(p, base)Toronto From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 3F4B6DAACA4; Wed, 19 Jul 2017 07:02: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 E67766E488; Wed, 19 Jul 2017 07:02:54 +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 v6J72sns091077; Wed, 19 Jul 2017 07:02:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72s5q091076; Wed, 19 Jul 2017 07:02:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72s5q091076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321191 - vendor/libc++/libc++-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r308421 X-SVN-Commit-Revision: 321191 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:55 -0000 Author: dim Date: Wed Jul 19 07:02:53 2017 New Revision: 321191 URL: https://svnweb.freebsd.org/changeset/base/321191 Log: Tag libc++ trunk r308421. Added: vendor/libc++/libc++-trunk-r308421/ - copied from r321190, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 07:02: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 95FD6DAAC5A; Wed, 19 Jul 2017 07:02:47 +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 4A0766E3C8; Wed, 19 Jul 2017 07:02:47 +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 v6J72kVZ090971; Wed, 19 Jul 2017 07:02:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72kGZ090970; Wed, 19 Jul 2017 07:02:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72kGZ090970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321189 - vendor/compiler-rt/compiler-rt-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r308421 X-SVN-Commit-Revision: 321189 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:02:47 -0000 Author: dim Date: Wed Jul 19 07:02:46 2017 New Revision: 321189 URL: https://svnweb.freebsd.org/changeset/base/321189 Log: Tag compiler-rt trunk r308421. Added: vendor/compiler-rt/compiler-rt-trunk-r308421/ - copied from r321188, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 07:03: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 757FDDAAD4D; Wed, 19 Jul 2017 07:03:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276616E5AE; Wed, 19 Jul 2017 07:03:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6J734xc091198; Wed, 19 Jul 2017 07:03:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J7341T091197; Wed, 19 Jul 2017 07:03:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J7341T091197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321193 - vendor/lld/lld-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r308421 X-SVN-Commit-Revision: 321193 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:03:05 -0000 Author: dim Date: Wed Jul 19 07:03:04 2017 New Revision: 321193 URL: https://svnweb.freebsd.org/changeset/base/321193 Log: Tag lld trunk r308421. Added: vendor/lld/lld-trunk-r308421/ - copied from r321192, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 07:03: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 7C9B5DAAD1E; Wed, 19 Jul 2017 07:03:01 +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 26F426E54E; Wed, 19 Jul 2017 07:03:01 +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 v6J7300l091151; Wed, 19 Jul 2017 07:03:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72waQ091126; Wed, 19 Jul 2017 07:02:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72waQ091126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321192 - in vendor/lld/dist: COFF ELF ELF/Arch docs test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/linkerscript test/ELF/lto X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: COFF ELF ELF/Arch docs test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/linkerscript test/ELF/lto X-SVN-Commit-Revision: 321192 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:03:01 -0000 Author: dim Date: Wed Jul 19 07:02:58 2017 New Revision: 321192 URL: https://svnweb.freebsd.org/changeset/base/321192 Log: Vendor import of lld trunk r308421: https://llvm.org/svn/llvm-project/lld/trunk@308421 Added: vendor/lld/dist/test/COFF/Inputs/default.def vendor/lld/dist/test/COFF/Inputs/extension.def vendor/lld/dist/test/COFF/Inputs/named.def vendor/lld/dist/test/COFF/Inputs/object.s (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-a.yaml vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-b.yaml vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-ts.yaml vendor/lld/dist/test/COFF/implib-name.test vendor/lld/dist/test/COFF/pdb-type-server-missing.yaml vendor/lld/dist/test/COFF/pdb-type-server-simple.test vendor/lld/dist/test/COFF/reloc-discarded-dwarf.s (contents, props changed) vendor/lld/dist/test/COFF/reloc-oob.yaml vendor/lld/dist/test/ELF/Inputs/gdb-index.s (contents, props changed) vendor/lld/dist/test/ELF/filter.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/exidx-crash.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/got-write-offset.s (contents, props changed) vendor/lld/dist/test/ELF/map-gc-sections.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-twice.s (contents, props changed) Deleted: vendor/lld/dist/test/ELF/Inputs/gdb-index-a.elf vendor/lld/dist/test/ELF/Inputs/gdb-index-b.elf vendor/lld/dist/test/ELF/Inputs/symver-archive1.s vendor/lld/dist/test/ELF/Inputs/symver-archive2.s vendor/lld/dist/test/ELF/symver-archive.s 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/PDB.cpp vendor/lld/dist/ELF/Arch/ARM.cpp vendor/lld/dist/ELF/Arch/MipsArchTree.cpp vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/EhFrame.h vendor/lld/dist/ELF/Filesystem.h vendor/lld/dist/ELF/GdbIndex.h vendor/lld/dist/ELF/ICF.h vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/LTO.h vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/MapFile.cpp vendor/lld/dist/ELF/MapFile.h vendor/lld/dist/ELF/Memory.h vendor/lld/dist/ELF/Options.td 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/Strings.cpp vendor/lld/dist/ELF/Strings.h vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Target.h vendor/lld/dist/ELF/Threads.h vendor/lld/dist/ELF/Thunks.cpp vendor/lld/dist/ELF/Thunks.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/ELF/Writer.h vendor/lld/dist/docs/windows_support.rst vendor/lld/dist/test/COFF/common.test vendor/lld/dist/test/COFF/conflict.test vendor/lld/dist/test/COFF/constant.test vendor/lld/dist/test/COFF/def-export-stdcall.s vendor/lld/dist/test/COFF/delayimports32.test vendor/lld/dist/test/COFF/entry-mangled.test vendor/lld/dist/test/COFF/entrylib.ll vendor/lld/dist/test/COFF/imports.test vendor/lld/dist/test/COFF/include-lto.ll vendor/lld/dist/test/COFF/msvclto-archive.ll vendor/lld/dist/test/COFF/msvclto-order.ll vendor/lld/dist/test/COFF/msvclto.ll vendor/lld/dist/test/COFF/pdb-comdat.test vendor/lld/dist/test/COFF/pdb-lib.s vendor/lld/dist/test/COFF/pdb-symbol-types.yaml vendor/lld/dist/test/COFF/savetemps.ll vendor/lld/dist/test/COFF/thinlto-archives.ll vendor/lld/dist/test/COFF/thinlto-mangled.ll vendor/lld/dist/test/COFF/thinlto.ll vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority1.s vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority2.s vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority3.s vendor/lld/dist/test/ELF/allow-shlib-undefined.s vendor/lld/dist/test/ELF/as-needed-no-reloc.s vendor/lld/dist/test/ELF/as-needed.s vendor/lld/dist/test/ELF/auxiliary.s vendor/lld/dist/test/ELF/compressed-debug-input.s vendor/lld/dist/test/ELF/ctors_dtors_priority.s vendor/lld/dist/test/ELF/debug-gnu-pubnames.s vendor/lld/dist/test/ELF/dynamic-reloc.s vendor/lld/dist/test/ELF/gc-sections-shared.s vendor/lld/dist/test/ELF/gdb-index-empty.s vendor/lld/dist/test/ELF/gdb-index-gc-sections.s vendor/lld/dist/test/ELF/gdb-index.s vendor/lld/dist/test/ELF/i386-reloc-large-addend.s vendor/lld/dist/test/ELF/i386-reloc-range.s vendor/lld/dist/test/ELF/invalid/tls-symbol.s vendor/lld/dist/test/ELF/linkerscript/output-too-large.s vendor/lld/dist/test/ELF/lto/available-externally.ll vendor/lld/dist/test/ELF/lto/comdat2.ll vendor/lld/dist/test/ELF/lto/common2.ll vendor/lld/dist/test/ELF/lto/common3.ll vendor/lld/dist/test/ELF/lto/discard-value-names.ll vendor/lld/dist/test/ELF/lto/opt-level.ll vendor/lld/dist/test/ELF/lto/opt-remarks.ll vendor/lld/dist/test/ELF/lto/relax-relocs.ll vendor/lld/dist/test/ELF/lto/thin-archivecollision.ll vendor/lld/dist/test/ELF/lto/thinlto.ll vendor/lld/dist/test/ELF/lto/type-merge2.ll vendor/lld/dist/test/ELF/lto/unnamed-addr-comdat.ll vendor/lld/dist/test/ELF/lto/unnamed-addr-drop.ll vendor/lld/dist/test/ELF/lto/unnamed-addr.ll vendor/lld/dist/test/ELF/many-alloc-sections.s vendor/lld/dist/test/ELF/many-sections.s vendor/lld/dist/test/ELF/merge-section-types.s vendor/lld/dist/test/ELF/new-dtags.test vendor/lld/dist/test/ELF/no-obj.s vendor/lld/dist/test/ELF/no-soname.s vendor/lld/dist/test/ELF/no-symtab.s vendor/lld/dist/test/ELF/no-undefined.s vendor/lld/dist/test/ELF/pie-weak.s vendor/lld/dist/test/ELF/progname.s vendor/lld/dist/test/ELF/relative-dynamic-reloc-pie.s vendor/lld/dist/test/ELF/relative-dynamic-reloc.s vendor/lld/dist/test/ELF/relocatable-compressed-input.s vendor/lld/dist/test/ELF/relocatable-reloc.s vendor/lld/dist/test/ELF/relocatable-section-symbol.s vendor/lld/dist/test/ELF/relocatable-sections.s vendor/lld/dist/test/ELF/relocatable-tls.s vendor/lld/dist/test/ELF/relocation-shared.s vendor/lld/dist/test/ELF/shared-be.s vendor/lld/dist/test/ELF/shared.s vendor/lld/dist/test/ELF/soname.s vendor/lld/dist/test/ELF/soname2.s Modified: vendor/lld/dist/COFF/Chunks.cpp ============================================================================== --- vendor/lld/dist/COFF/Chunks.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Chunks.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -210,7 +210,15 @@ void SectionChunk::writeTo(uint8_t *Buf) const { memcpy(Buf + OutputSectionOff, A.data(), A.size()); // Apply relocations. + size_t InputSize = getSize(); for (const coff_relocation &Rel : Relocs) { + // Check for an invalid relocation offset. This check isn't perfect, because + // we don't have the relocation size, which is only known after checking the + // machine and relocation type. As a result, a relocation may overwrite the + // beginning of the following input section. + if (Rel.VirtualAddress >= InputSize) + fatal("relocation points beyond the end of its parent section"); + uint8_t *Off = Buf + OutputSectionOff + Rel.VirtualAddress; // Get the output section of the symbol for this relocation. The output @@ -227,7 +235,7 @@ void SectionChunk::writeTo(uint8_t *Buf) const { // sections are not GC roots and can end up with these kinds of relocations. // Skip these relocations. if (!OS && !isa(Sym) && !isa(Sym)) { - if (isCodeView()) + if (isCodeView() || isDWARF()) continue; fatal("relocation against symbol in discarded section: " + Sym->getName()); Modified: vendor/lld/dist/COFF/Chunks.h ============================================================================== --- vendor/lld/dist/COFF/Chunks.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Chunks.h Wed Jul 19 07:02:58 2017 (r321192) @@ -112,7 +112,7 @@ class Chunk { (protected) }; // A chunk corresponding a section of an input file. -class SectionChunk : public Chunk { +class SectionChunk final : public Chunk { // Identical COMDAT Folding feature accesses section internal data. friend class ICF; @@ -187,6 +187,9 @@ class SectionChunk : public Chunk { (public) bool isCodeView() const { return SectionName == ".debug" || SectionName.startswith(".debug$"); } + + // True if this is a DWARF debug info chunk. + bool isDWARF() const { return SectionName.startswith(".debug_"); } // Allow iteration over the bodies of this chunk's relocated symbols. llvm::iterator_range symbols() const { Modified: vendor/lld/dist/COFF/Config.h ============================================================================== --- vendor/lld/dist/COFF/Config.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Config.h Wed Jul 19 07:02:58 2017 (r321192) @@ -82,6 +82,7 @@ struct Configuration { SymbolBody *Entry = nullptr; bool NoEntry = false; std::string OutputFile; + std::string ImportName; bool ColorDiagnostics; bool DoGC = true; bool DoICF = true; Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Driver.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -429,7 +429,32 @@ static std::string getImplibPath() { return Out.str(); } -static void createImportLibrary() { +// +// The import name is caculated as the following: +// +// | LIBRARY w/ ext | LIBRARY w/o ext | no LIBRARY +// -----+----------------+---------------------+------------------ +// LINK | {value} | {value}.{.dll/.exe} | {output name} +// LIB | {value} | {value}.dll | {output name}.dll +// +static std::string getImportName(bool AsLib) { + SmallString<128> Out; + + if (Config->ImportName.empty()) { + Out.assign(sys::path::filename(Config->OutputFile)); + if (AsLib) + sys::path::replace_extension(Out, ".dll"); + } else { + Out.assign(Config->ImportName); + if (!sys::path::has_extension(Out)) + sys::path::replace_extension(Out, + (Config->DLL || AsLib) ? ".dll" : ".exe"); + } + + return Out.str(); +} + +static void createImportLibrary(bool AsLib) { std::vector Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; @@ -444,9 +469,8 @@ static void createImportLibrary() { Exports.push_back(E2); } - std::string DLLName = sys::path::filename(Config->OutputFile); - std::string Path = getImplibPath(); - writeImportLibrary(DLLName, Path, Exports, Config->Machine); + writeImportLibrary(getImportName(AsLib), getImplibPath(), Exports, + Config->Machine); } static void parseModuleDefs(StringRef Path) { @@ -457,6 +481,7 @@ static void parseModuleDefs(StringRef Path) { if (Config->OutputFile.empty()) Config->OutputFile = Saver.save(M.OutputFile); + Config->ImportName = Saver.save(M.ImportName); if (M.ImageBase) Config->ImageBase = M.ImageBase; if (M.StackReserve) @@ -992,7 +1017,7 @@ void LinkerDriver::link(ArrayRef ArgsArr // Handle generation of import library from a def file. if (!Args.hasArgNoClaim(OPT_INPUT)) { fixupExports(); - createImportLibrary(); + createImportLibrary(/*AsLib=*/true); exit(0); } @@ -1117,7 +1142,7 @@ void LinkerDriver::link(ArrayRef ArgsArr // need to create a .lib file. if (!Config->Exports.empty() || Config->DLL) { fixupExports(); - createImportLibrary(); + createImportLibrary(/*AsLib=*/false); assignExportOrdinals(); } Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/PDB.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -14,28 +14,29 @@ #include "SymbolTable.h" #include "Symbols.h" #include "llvm/DebugInfo/CodeView/CVDebugRecord.h" -#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" #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/TypeDeserializer.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/GenericError.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/NativeSession.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/Native/PDBFileBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h" -#include "llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h" #include "llvm/DebugInfo/PDB/Native/TpiStream.h" #include "llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h" +#include "llvm/DebugInfo/PDB/PDB.h" #include "llvm/Object/COFF.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/Endian.h" @@ -53,8 +54,81 @@ using llvm::object::coff_section; static ExitOnError ExitOnErr; +namespace { +/// Map from type index and item index in a type server PDB to the +/// corresponding index in the destination PDB. +struct CVIndexMap { + SmallVector TPIMap; + SmallVector IPIMap; + bool IsTypeServerMap = false; +}; + +class PDBLinker { +public: + PDBLinker(SymbolTable *Symtab) + : Alloc(), Symtab(Symtab), Builder(Alloc), TypeTable(Alloc), + IDTable(Alloc) {} + + /// Emit the basic PDB structure: initial streams, headers, etc. + void initialize(const llvm::codeview::DebugInfo *DI); + + /// Link CodeView from each object file in the symbol table into the PDB. + void addObjectsToPDB(); + + /// Link CodeView from a single object file into the PDB. + void addObjectFile(ObjectFile *File); + + /// Produce a mapping from the type and item indices used in the object + /// file to those in the destination PDB. + /// + /// If the object file uses a type server PDB (compiled with /Zi), merge TPI + /// and IPI from the type server PDB and return a map for it. Each unique type + /// server PDB is merged at most once, so this may return an existing index + /// mapping. + /// + /// If the object does not use a type server PDB (compiled with /Z7), we merge + /// all the type and item records from the .debug$S stream and fill in the + /// caller-provided ObjectIndexMap. + const CVIndexMap &mergeDebugT(ObjectFile *File, CVIndexMap &ObjectIndexMap); + + const CVIndexMap &maybeMergeTypeServerPDB(ObjectFile *File, + TypeServer2Record &TS); + + /// Add the section map and section contributions to the PDB. + void addSections(ArrayRef SectionTable); + + /// Write the PDB to disk. + void commit(); + +private: + BumpPtrAllocator Alloc; + + SymbolTable *Symtab; + + pdb::PDBFileBuilder Builder; + + /// Type records that will go into the PDB TPI stream. + TypeTableBuilder TypeTable; + + /// Item records that will go into the PDB IPI stream. + TypeTableBuilder IDTable; + + /// PDBs use a single global string table for filenames in the file checksum + /// table. + DebugStringTableSubsection PDBStrTab; + + llvm::SmallString<128> NativePath; + + std::vector SectionMap; + + /// Type index mappings of type server PDBs that we've loaded so far. + std::map TypeServerIndexMappings; +}; +} + // Returns a list of all SectionChunks. -static void addSectionContribs(SymbolTable *Symtab, pdb::DbiStreamBuilder &DbiBuilder) { +static void addSectionContribs(SymbolTable *Symtab, + pdb::DbiStreamBuilder &DbiBuilder) { for (Chunk *C : Symtab->getChunks()) if (auto *SC = dyn_cast(C)) DbiBuilder.addSectionContrib(SC->File->ModuleDBI, SC->Header); @@ -96,26 +170,117 @@ static void addTypeInfo(pdb::TpiStreamBuilder &TpiBuil }); } -static void mergeDebugT(ObjectFile *File, - TypeTableBuilder &IDTable, - TypeTableBuilder &TypeTable, - SmallVectorImpl &TypeIndexMap, - pdb::PDBTypeServerHandler &Handler) { +static Optional +maybeReadTypeServerRecord(CVTypeArray &Types) { + auto I = Types.begin(); + if (I == Types.end()) + return None; + const CVType &Type = *I; + if (Type.kind() != LF_TYPESERVER2) + return None; + TypeServer2Record TS; + if (auto EC = TypeDeserializer::deserializeAs(const_cast(Type), TS)) + fatal(EC, "error reading type server record"); + return std::move(TS); +} + +const CVIndexMap &PDBLinker::mergeDebugT(ObjectFile *File, + CVIndexMap &ObjectIndexMap) { ArrayRef Data = getDebugSection(File, ".debug$T"); if (Data.empty()) - return; + return ObjectIndexMap; BinaryByteStream Stream(Data, support::little); CVTypeArray Types; BinaryStreamReader Reader(Stream); - Handler.addSearchPath(sys::path::parent_path(File->getName())); if (auto EC = Reader.readArray(Types, Reader.getLength())) fatal(EC, "Reader::readArray failed"); + + // Look through type servers. If we've already seen this type server, don't + // merge any type information. + if (Optional TS = maybeReadTypeServerRecord(Types)) + return maybeMergeTypeServerPDB(File, *TS); + + // This is a /Z7 object. Fill in the temporary, caller-provided + // ObjectIndexMap. if (auto Err = mergeTypeAndIdRecords(IDTable, TypeTable, - TypeIndexMap, &Handler, Types)) - fatal(Err, "codeview::mergeTypeStreams failed"); + ObjectIndexMap.TPIMap, Types)) + fatal(Err, "codeview::mergeTypeAndIdRecords failed"); + return ObjectIndexMap; } +static Expected> +tryToLoadPDB(const GUID &GuidFromObj, StringRef TSPath) { + std::unique_ptr ThisSession; + if (auto EC = + pdb::loadDataForPDB(pdb::PDB_ReaderType::Native, TSPath, ThisSession)) + return std::move(EC); + + std::unique_ptr NS( + static_cast(ThisSession.release())); + pdb::PDBFile &File = NS->getPDBFile(); + auto ExpectedInfo = File.getPDBInfoStream(); + // All PDB Files should have an Info stream. + if (!ExpectedInfo) + return ExpectedInfo.takeError(); + + // Just because a file with a matching name was found and it was an actual + // PDB file doesn't mean it matches. For it to match the InfoStream's GUID + // must match the GUID specified in the TypeServer2 record. + if (ExpectedInfo->getGuid() != GuidFromObj) + return make_error( + pdb::generic_error_code::type_server_not_found, TSPath); + + return std::move(NS); +} + +const CVIndexMap &PDBLinker::maybeMergeTypeServerPDB(ObjectFile *File, + TypeServer2Record &TS) { + // First, check if we already loaded a PDB with this GUID. Return the type + // index mapping if we have it. + auto Insertion = TypeServerIndexMappings.insert({TS.getGuid(), CVIndexMap()}); + CVIndexMap &IndexMap = Insertion.first->second; + if (!Insertion.second) + return IndexMap; + + // Mark this map as a type server map. + IndexMap.IsTypeServerMap = true; + + // Check for a PDB at: + // 1. The given file path + // 2. Next to the object file or archive file + auto ExpectedSession = tryToLoadPDB(TS.getGuid(), TS.getName()); + if (!ExpectedSession) { + consumeError(ExpectedSession.takeError()); + StringRef LocalPath = + !File->ParentName.empty() ? File->ParentName : File->getName(); + SmallString<128> Path = sys::path::parent_path(LocalPath); + sys::path::append( + Path, sys::path::filename(TS.getName(), sys::path::Style::windows)); + ExpectedSession = tryToLoadPDB(TS.getGuid(), Path); + } + if (auto E = ExpectedSession.takeError()) + fatal(E, "Type server PDB was not found"); + + // Merge TPI first, because the IPI stream will reference type indices. + auto ExpectedTpi = (*ExpectedSession)->getPDBFile().getPDBTpiStream(); + if (auto E = ExpectedTpi.takeError()) + fatal(E, "Type server does not have TPI stream"); + if (auto Err = mergeTypeRecords(TypeTable, IndexMap.TPIMap, + ExpectedTpi->typeArray())) + fatal(Err, "codeview::mergeTypeRecords failed"); + + // Merge IPI. + auto ExpectedIpi = (*ExpectedSession)->getPDBFile().getPDBIpiStream(); + if (auto E = ExpectedIpi.takeError()) + fatal(E, "Type server does not have TPI stream"); + if (auto Err = mergeIdRecords(IDTable, IndexMap.TPIMap, IndexMap.IPIMap, + ExpectedIpi->typeArray())) + fatal(Err, "codeview::mergeIdRecords failed"); + + return IndexMap; +} + static bool remapTypeIndex(TypeIndex &TI, ArrayRef TypeIndexMap) { if (TI.isSimple()) return true; @@ -127,16 +292,22 @@ static bool remapTypeIndex(TypeIndex &TI, ArrayRef Contents, - ArrayRef TypeIndexMap, + const CVIndexMap &IndexMap, ArrayRef TypeRefs) { for (const TiReference &Ref : TypeRefs) { unsigned ByteSize = Ref.Count * sizeof(TypeIndex); if (Contents.size() < Ref.Offset + ByteSize) fatal("symbol record too short"); + + // This can be an item index or a type index. Choose the appropriate map. + ArrayRef TypeOrItemMap = IndexMap.TPIMap; + if (Ref.Kind == TiRefKind::IndexRef && IndexMap.IsTypeServerMap) + TypeOrItemMap = IndexMap.IPIMap; + MutableArrayRef TIs( reinterpret_cast(Contents.data() + Ref.Offset), Ref.Count); for (TypeIndex &TI : TIs) { - if (!remapTypeIndex(TI, TypeIndexMap)) { + if (!remapTypeIndex(TI, TypeOrItemMap)) { TI = TypeIndex(SimpleTypeKind::NotTranslated); log("ignoring symbol record in " + File->getName() + " with bad type index 0x" + utohexstr(TI.getIndex())); @@ -241,7 +412,7 @@ static void scopeStackClose(SmallVectorImpl TypeIndexMap, + const CVIndexMap &IndexMap, BinaryStreamRef SymData) { // FIXME: Improve error recovery by warning and skipping records when // possible. @@ -264,7 +435,7 @@ static void mergeSymbolRecords(BumpPtrAllocator &Alloc // Re-map all the type index references. MutableArrayRef Contents = NewData.drop_front(sizeof(RecordPrefix)); - remapTypesInSymbolRecord(File, Contents, TypeIndexMap, TypeRefs); + remapTypesInSymbolRecord(File, Contents, IndexMap, TypeRefs); // Fill in "Parent" and "End" fields by maintaining a stack of scopes. CVSymbol NewSym(Sym.kind(), NewData); @@ -289,110 +460,105 @@ static ArrayRef relocateDebugChunk(BumpPtrAll ".debug$S"); } -// Add all object files to the PDB. Merge .debug$T sections into IpiData and -// TpiData. -static void addObjectsToPDB(BumpPtrAllocator &Alloc, SymbolTable *Symtab, - pdb::PDBFileBuilder &Builder, - TypeTableBuilder &TypeTable, - TypeTableBuilder &IDTable) { - // Follow type servers. If the same type server is encountered more than - // once for this instance of `PDBTypeServerHandler` (for example if many - // object files reference the same TypeServer), the types from the - // TypeServer will only be visited once. - pdb::PDBTypeServerHandler Handler; +void PDBLinker::addObjectFile(ObjectFile *File) { + // Add a module descriptor for every object file. We need to put an absolute + // path to the object into the PDB. If this is a plain object, we make its + // path absolute. If it's an object in an archive, we make the archive path + // absolute. + bool InArchive = !File->ParentName.empty(); + SmallString<128> Path = InArchive ? File->ParentName : File->getName(); + sys::fs::make_absolute(Path); + sys::path::native(Path, sys::path::Style::windows); + StringRef Name = InArchive ? File->getName() : StringRef(Path); - // PDBs use a single global string table for filenames in the file checksum - // table. - auto PDBStrTab = std::make_shared(); + File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); + File->ModuleDBI->setObjFileName(Path); - // Visit all .debug$T sections to add them to Builder. - for (ObjectFile *File : Symtab->ObjectFiles) { - // Add a module descriptor for every object file. We need to put an absolute - // path to the object into the PDB. If this is a plain object, we make its - // path absolute. If it's an object in an archive, we make the archive path - // absolute. - 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); + // Before we can process symbol substreams from .debug$S, we need to process + // type information, file checksums, and the string table. Add type info to + // the PDB first, so that we can get the map from object file type and item + // indices to PDB type and item indices. + CVIndexMap ObjectIndexMap; + const CVIndexMap &IndexMap = mergeDebugT(File, ObjectIndexMap); - File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); - File->ModuleDBI->setObjFileName(Path); + // Now do all live .debug$S sections. + for (SectionChunk *DebugChunk : File->getDebugChunks()) { + if (!DebugChunk->isLive() || DebugChunk->getSectionName() != ".debug$S") + continue; - // Before we can process symbol substreams from .debug$S, we need to process - // type information, file checksums, and the string table. Add type info to - // the PDB first, so that we can get the map from object file type and item - // indices to PDB type and item indices. - SmallVector TypeIndexMap; - mergeDebugT(File, IDTable, TypeTable, TypeIndexMap, Handler); + ArrayRef RelocatedDebugContents = + relocateDebugChunk(Alloc, DebugChunk); + if (RelocatedDebugContents.empty()) + continue; - // Now do all line info. - for (SectionChunk *DebugChunk : File->getDebugChunks()) { - if (!DebugChunk->isLive() || DebugChunk->getSectionName() != ".debug$S") - continue; + DebugSubsectionArray Subsections; + BinaryStreamReader Reader(RelocatedDebugContents, support::little); + ExitOnErr(Reader.readArray(Subsections, RelocatedDebugContents.size())); - ArrayRef RelocatedDebugContents = - relocateDebugChunk(Alloc, DebugChunk); - if (RelocatedDebugContents.empty()) - continue; - - DebugSubsectionArray Subsections; - BinaryStreamReader Reader(RelocatedDebugContents, support::little); - ExitOnErr(Reader.readArray(Subsections, RelocatedDebugContents.size())); - - DebugStringTableSubsectionRef CVStrTab; - DebugChecksumsSubsectionRef Checksums; - for (const DebugSubsectionRecord &SS : Subsections) { - switch (SS.kind()) { - case DebugSubsectionKind::StringTable: - ExitOnErr(CVStrTab.initialize(SS.getRecordData())); - break; - case DebugSubsectionKind::FileChecksums: - ExitOnErr(Checksums.initialize(SS.getRecordData())); - break; - case DebugSubsectionKind::Lines: - // We can add the relocated line table directly to the PDB without - // modification because the file checksum offsets will stay the same. - File->ModuleDBI->addDebugSubsection(SS); - break; - case DebugSubsectionKind::Symbols: - mergeSymbolRecords(Alloc, File, TypeIndexMap, SS.getRecordData()); - break; - default: - // FIXME: Process the rest of the subsections. - break; - } + DebugStringTableSubsectionRef CVStrTab; + DebugChecksumsSubsectionRef Checksums; + for (const DebugSubsectionRecord &SS : Subsections) { + switch (SS.kind()) { + case DebugSubsectionKind::StringTable: + ExitOnErr(CVStrTab.initialize(SS.getRecordData())); + break; + case DebugSubsectionKind::FileChecksums: + ExitOnErr(Checksums.initialize(SS.getRecordData())); + break; + case DebugSubsectionKind::Lines: + // We can add the relocated line table directly to the PDB without + // modification because the file checksum offsets will stay the same. + File->ModuleDBI->addDebugSubsection(SS); + break; + case DebugSubsectionKind::Symbols: + mergeSymbolRecords(Alloc, File, IndexMap, SS.getRecordData()); + break; + default: + // FIXME: Process the rest of the subsections. + break; } + } - if (Checksums.valid()) { - // Make a new file checksum table that refers to offsets in the PDB-wide - // string table. Generally the string table subsection appears after the - // checksum table, so we have to do this after looping over all the - // subsections. - if (!CVStrTab.valid()) - fatal(".debug$S sections must have both a string table subsection " - "and a checksum subsection table or neither"); - auto NewChecksums = - make_unique(*PDBStrTab); - for (FileChecksumEntry &FC : Checksums) { - StringRef FileName = ExitOnErr(CVStrTab.getString(FC.FileNameOffset)); - ExitOnErr(Builder.getDbiBuilder().addModuleSourceFile( - *File->ModuleDBI, FileName)); - NewChecksums->addChecksum(FileName, FC.Kind, FC.Checksum); - } - File->ModuleDBI->addDebugSubsection(std::move(NewChecksums)); + if (Checksums.valid()) { + // Make a new file checksum table that refers to offsets in the PDB-wide + // string table. Generally the string table subsection appears after the + // checksum table, so we have to do this after looping over all the + // subsections. + if (!CVStrTab.valid()) + fatal(".debug$S sections must have both a string table subsection " + "and a checksum subsection table or neither"); + auto NewChecksums = make_unique(PDBStrTab); + for (FileChecksumEntry &FC : Checksums) { + StringRef FileName = ExitOnErr(CVStrTab.getString(FC.FileNameOffset)); + ExitOnErr(Builder.getDbiBuilder().addModuleSourceFile(*File->ModuleDBI, + FileName)); + NewChecksums->addChecksum(FileName, FC.Kind, FC.Checksum); } + File->ModuleDBI->addDebugSubsection(std::move(NewChecksums)); } } +} - Builder.getStringTableBuilder().setStrings(*PDBStrTab); +// Add all object files to the PDB. Merge .debug$T sections into IpiData and +// TpiData. +void PDBLinker::addObjectsToPDB() { + for (ObjectFile *File : Symtab->ObjectFiles) + addObjectFile(File); + Builder.getStringTableBuilder().setStrings(PDBStrTab); + // Construct TPI stream contents. addTypeInfo(Builder.getTpiBuilder(), TypeTable); // Construct IPI stream contents. addTypeInfo(Builder.getIpiBuilder(), 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(); } static void addLinkerModuleSymbols(StringRef Path, @@ -423,7 +589,7 @@ static void addLinkerModuleSymbols(StringRef Path, std::string ArgStr = llvm::join(Args, " "); EBS.Fields.push_back("cwd"); SmallString<64> cwd; - llvm::sys::fs::current_path(cwd); + sys::fs::current_path(cwd); EBS.Fields.push_back(cwd); EBS.Fields.push_back("exe"); EBS.Fields.push_back(Config->Argv[0]); @@ -442,8 +608,14 @@ static void addLinkerModuleSymbols(StringRef Path, // Creates a PDB file. void coff::createPDB(SymbolTable *Symtab, ArrayRef SectionTable, const llvm::codeview::DebugInfo *DI) { - BumpPtrAllocator Alloc; - pdb::PDBFileBuilder Builder(Alloc); + PDBLinker PDB(Symtab); + PDB.initialize(DI); + PDB.addObjectsToPDB(); + PDB.addSections(SectionTable); + PDB.commit(); +} + +void PDBLinker::initialize(const llvm::codeview::DebugInfo *DI) { ExitOnErr(Builder.initialize(4096)); // 4096 is blocksize // Create streams in MSF for predefined streams, namely @@ -455,12 +627,7 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRefPDB70.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{}; + GUID uuid{}; if (DI) memcpy(&uuid, &DI->PDB70.Signature, sizeof(uuid)); InfoBuilder.setGuid(uuid); @@ -471,32 +638,25 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRef SectionTable) { // Add Section Contributions. + pdb::DbiStreamBuilder &DbiBuilder = Builder.getDbiBuilder(); addSectionContribs(Symtab, DbiBuilder); // Add Section Map stream. ArrayRef Sections = { (const object::coff_section *)SectionTable.data(), SectionTable.size() / sizeof(object::coff_section)}; - std::vector SectionMap = - pdb::DbiStreamBuilder::createSectionMap(Sections); + SectionMap = pdb::DbiStreamBuilder::createSectionMap(Sections); DbiBuilder.setSectionMap(SectionMap); + // It's not entirely clear what this is, but the * Linker * module uses it. + NativePath = Config->PDBPath; + sys::fs::make_absolute(NativePath); + sys::path::native(NativePath, sys::path::Style::windows); + uint32_t PdbFilePathNI = DbiBuilder.addECName(NativePath); auto &LinkerModule = ExitOnErr(DbiBuilder.addModuleInfo("* Linker *")); LinkerModule.setPdbFilePathNI(PdbFilePathNI); addLinkerModuleSymbols(NativePath, LinkerModule, Alloc); @@ -504,7 +664,9 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRefPDBPath)); } Modified: vendor/lld/dist/ELF/Arch/ARM.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/ARM.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Arch/ARM.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -40,6 +40,8 @@ class ARM final : public TargetInfo { (public) void addPltHeaderSymbols(InputSectionBase *ISD) const override; bool needsThunk(RelExpr Expr, uint32_t RelocType, const InputFile *File, const SymbolBody &S) const override; + bool inBranchRange(uint32_t RelocType, uint64_t Src, + uint64_t Dst) const override; void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; }; } // namespace @@ -216,6 +218,49 @@ bool ARM::needsThunk(RelExpr Expr, uint32_t RelocType, break; } return false; +} + +bool ARM::inBranchRange(uint32_t RelocType, uint64_t Src, uint64_t Dst) const { + uint64_t Range; + uint64_t InstrSize; + + switch (RelocType) { + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_JUMP24: + case R_ARM_CALL: + Range = 0x2000000; + InstrSize = 4; + break; + case R_ARM_THM_JUMP19: + Range = 0x100000; + InstrSize = 2; + break; + case R_ARM_THM_JUMP24: + case R_ARM_THM_CALL: + Range = 0x1000000; + InstrSize = 2; + break; + default: + return true; + } + // PC at Src is 2 instructions ahead, immediate of branch is signed + if (Src > Dst) + Range -= 2 * InstrSize; + else + Range += InstrSize; + + if ((Dst & 0x1) == 0) + // Destination is ARM, if ARM caller then Src is already 4-byte aligned. + // If Thumb Caller (BLX) the Src address has bottom 2 bits cleared to ensure + // destination will be 4 byte aligned. + Src &= ~0x3; + else + // Bit 0 == 1 denotes Thumb state, it is not part of the range + Dst &= ~0x1; + + uint64_t Distance = (Src > Dst) ? Src - Dst : Dst - Src; + return Distance <= Range; } void ARM::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { Modified: vendor/lld/dist/ELF/Arch/MipsArchTree.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/MipsArchTree.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Arch/MipsArchTree.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -37,7 +37,7 @@ struct FileFlags { StringRef Filename; uint32_t Flags; }; -} +} // namespace static StringRef getAbiName(uint32_t Flags) { switch (Flags) { @@ -337,8 +337,8 @@ uint8_t elf::getMipsFpAbiFlag(uint8_t OldFlag, uint8_t return NewFlag; if (compareMipsFpAbi(OldFlag, NewFlag) < 0) error("target floating point ABI '" + getMipsFpAbiName(OldFlag) + - "' is incompatible with '" + getMipsFpAbiName(NewFlag) + "': " + - FileName); + "' is incompatible with '" + getMipsFpAbiName(NewFlag) + + "': " + FileName); return OldFlag; } Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Config.h Wed Jul 19 07:02:58 2017 (r321192) @@ -99,6 +99,7 @@ struct Configuration { std::vector VersionDefinitions; std::vector Argv; std::vector AuxiliaryList; + std::vector FilterList; std::vector SearchPaths; std::vector SymbolOrderingFile; std::vector Undefined; Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Driver.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -259,6 +259,9 @@ static void checkOptions(opt::InputArgList &Args) { if (Config->Pie && Config->Shared) error("-shared and -pie may not be used together"); + if (!Config->Shared && !Config->FilterList.empty()) + error("-F may not be used without -shared"); + if (!Config->Shared && !Config->AuxiliaryList.empty()) error("-f may not be used without -shared"); @@ -631,6 +634,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args getArg(Args, OPT_export_dynamic, OPT_no_export_dynamic, false); Config->FatalWarnings = getArg(Args, OPT_fatal_warnings, OPT_no_fatal_warnings, false); + Config->FilterList = getArgs(Args, OPT_filter); Config->Fini = Args.getLastArgValue(OPT_fini, "_fini"); Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false); Config->GdbIndex = Args.hasArg(OPT_gdb_index); Modified: vendor/lld/dist/ELF/EhFrame.h ============================================================================== --- vendor/lld/dist/ELF/EhFrame.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/EhFrame.h Wed Jul 19 07:02:58 2017 (r321192) @@ -19,7 +19,7 @@ struct EhSectionPiece; template size_t readEhRecordSize(InputSectionBase *S, size_t Off); template uint8_t getFdeEncoding(EhSectionPiece *P); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Filesystem.h ============================================================================== --- vendor/lld/dist/ELF/Filesystem.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Filesystem.h Wed Jul 19 07:02:58 2017 (r321192) @@ -16,7 +16,7 @@ namespace lld { namespace elf { void unlinkAsync(StringRef Path); std::error_code tryCreateFile(StringRef Path); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/GdbIndex.h ============================================================================== --- vendor/lld/dist/ELF/GdbIndex.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/GdbIndex.h Wed Jul 19 07:02:58 2017 (r321192) @@ -11,8 +11,8 @@ #define LLD_ELF_GDB_INDEX_H #include "InputFiles.h" -#include "llvm/Object/ELF.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" +#include "llvm/Object/ELF.h" namespace lld { namespace elf { Modified: vendor/lld/dist/ELF/ICF.h ============================================================================== --- vendor/lld/dist/ELF/ICF.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/ICF.h Wed Jul 19 07:02:58 2017 (r321192) @@ -14,6 +14,6 @@ namespace lld { namespace elf { template void doIcf(); } -} +} // namespace lld #endif Modified: vendor/lld/dist/ELF/InputFiles.h ============================================================================== --- vendor/lld/dist/ELF/InputFiles.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/InputFiles.h Wed Jul 19 07:02:58 2017 (r321192) @@ -11,8 +11,8 @@ #define LLD_ELF_INPUT_FILES_H #include "Config.h" -#include "InputSection.h" #include "Error.h" +#include "InputSection.h" #include "Symbols.h" #include "lld/Core/LLVM.h" @@ -34,7 +34,7 @@ struct DILineInfo; namespace lto { class InputFile; } -} +} // namespace llvm namespace lld { namespace elf { Modified: vendor/lld/dist/ELF/LTO.h ============================================================================== --- vendor/lld/dist/ELF/LTO.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/LTO.h Wed Jul 19 07:02:58 2017 (r321192) @@ -30,7 +30,7 @@ namespace llvm { namespace lto { class LTO; } -} +} // namespace llvm namespace lld { namespace elf { @@ -51,7 +51,7 @@ class BitcodeCompiler { (private) std::vector> Buff; std::vector> Files; }; -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/LinkerScript.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -229,6 +229,19 @@ bool LinkerScript::shouldKeep(InputSectionBase *S) { return false; } +// If an input string is in the form of "foo.N" where N is a number, +// return N. Otherwise, returns 65536, which is one greater than the +// lowest priority. +static int getPriority(StringRef S) { + size_t Pos = S.rfind('.'); + if (Pos == StringRef::npos) + return 65536; + int V; + if (!to_integer(S.substr(Pos + 1), V, 10)) + return 65536; + return V; +} + // A helper function for the SORT() command. static std::function getComparator(SortSectionPolicy K) { @@ -449,7 +462,7 @@ void LinkerScript::fabricateDefaultCommands() { // The Sections with -T
have been sorted in order of ascending // address. We must lower StartAddr if the lowest -T
as // calls to setDot() must be monotonically increasing. - for (auto& KV : Config->SectionStartMap) + for (auto &KV : Config->SectionStartMap) StartAddr = std::min(StartAddr, KV.second); Commands.push_back(make( @@ -739,7 +752,7 @@ void LinkerScript::adjustSectionsAfterSorting() { Cmd->MemRegion = findMemoryRegion(Cmd); // Handle align (e.g. ".foo : ALIGN(16) { ... }"). if (Cmd->AlignExpr) - Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue()); + Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue()); } } @@ -1071,7 +1084,7 @@ template void OutputSectionCommand::final } if ((Sec->Flags & SHF_LINK_ORDER)) { - std::sort(Sections.begin(), Sections.end(), compareByFilePosition); + std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition); for (int I = 0, N = Sections.size(); I < N; ++I) *ScriptSections[I] = Sections[I]; Modified: vendor/lld/dist/ELF/MapFile.cpp ============================================================================== --- vendor/lld/dist/ELF/MapFile.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/MapFile.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -55,7 +55,7 @@ template std::vector ge for (SymbolBody *B : File->getSymbols()) if (B->File == File && !B->isSection()) if (auto *Sym = dyn_cast(B)) - if (Sym->Section) + if (Sym->Section && Sym->Section->Live) V.push_back(Sym); return V; } Modified: vendor/lld/dist/ELF/MapFile.h ============================================================================== --- vendor/lld/dist/ELF/MapFile.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/MapFile.h Wed Jul 19 07:02:58 2017 (r321192) @@ -17,7 +17,7 @@ namespace elf { struct OutputSectionCommand; template void writeMapFile(llvm::ArrayRef Script); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Memory.h ============================================================================== --- vendor/lld/dist/ELF/Memory.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Memory.h Wed Jul 19 07:02:58 2017 (r321192) @@ -61,7 +61,7 @@ inline void freeArena() { Alloc->reset(); BAlloc.Reset(); } -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Options.td ============================================================================== --- vendor/lld/dist/ELF/Options.td Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Options.td Wed Jul 19 07:02:58 2017 (r321192) @@ -104,6 +104,8 @@ def export_dynamic_symbol: S<"export-dynamic-symbol">, def fatal_warnings: F<"fatal-warnings">, HelpText<"Treat warnings as errors">; +def filter: J<"filter=">, HelpText<"Set DT_FILTER field to the specified name">; + def fini: S<"fini">, MetaVarName<"">, HelpText<"Specify a finalizer function">; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 19 07:03: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 8F6E9DAADFB; Wed, 19 Jul 2017 07:03:13 +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 354EB6E6A2; Wed, 19 Jul 2017 07:03:13 +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 v6J73C1c091291; Wed, 19 Jul 2017 07:03:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J738eZ091248; Wed, 19 Jul 2017 07:03:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J738eZ091248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321194 - in vendor/lldb/dist: cmake/modules include/lldb include/lldb/Host include/lldb/Host/common include/lldb/Interpreter include/lldb/Utility packages/Python/lldbsuite/test/express... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist: cmake/modules include/lldb include/lldb/Host include/lldb/Host/common include/lldb/Interpreter include/lldb/Utility packages/Python/lldbsuite/test/expression_command/unwind_expres... X-SVN-Commit-Revision: 321194 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:03:13 -0000 Author: dim Date: Wed Jul 19 07:03:07 2017 New Revision: 321194 URL: https://svnweb.freebsd.org/changeset/base/321194 Log: Vendor import of lldb trunk r308421: https://llvm.org/svn/llvm-project/lldb/trunk@308421 Deleted: vendor/lldb/dist/tools/debugserver/source/MacOSX/i386/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/x86_64/CMakeLists.txt Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake vendor/lldb/dist/include/lldb/Host/MainLoop.h vendor/lldb/dist/include/lldb/Host/PosixApi.h vendor/lldb/dist/include/lldb/Host/SocketAddress.h vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h vendor/lldb/dist/include/lldb/Utility/DataExtractor.h vendor/lldb/dist/include/lldb/lldb-private-forward.h vendor/lldb/dist/include/lldb/lldb-types.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py vendor/lldb/dist/source/Host/CMakeLists.txt vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Host/common/Host.cpp vendor/lldb/dist/source/Host/common/MainLoop.cpp vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp vendor/lldb/dist/source/Host/common/Socket.cpp vendor/lldb/dist/source/Host/common/SocketAddress.cpp vendor/lldb/dist/source/Host/common/TCPSocket.cpp vendor/lldb/dist/source/Host/linux/Host.cpp vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp vendor/lldb/dist/source/Host/posix/FileSystem.cpp vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.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.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.h vendor/lldb/dist/source/Plugins/Process/Linux/ProcessorTrace.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h 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/Target/Target.cpp vendor/lldb/dist/test/CMakeLists.txt vendor/lldb/dist/tools/debugserver/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/DarwinLog/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/RNBSocket.cpp vendor/lldb/dist/tools/driver/Driver.cpp vendor/lldb/dist/tools/lldb-mi/MICmnLLDBDebugger.cpp vendor/lldb/dist/tools/lldb-mi/MIDriver.cpp vendor/lldb/dist/tools/lldb-mi/MIDriverMain.cpp vendor/lldb/dist/tools/lldb-server/lldb-gdbserver.cpp vendor/lldb/dist/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp vendor/lldb/dist/unittests/debugserver/RNBSocketTest.cpp Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Wed Jul 19 07:03:07 2017 (r321194) @@ -10,17 +10,22 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_S set(LLDB_LINKER_SUPPORTS_GROUPS ON) endif() +set(LLDB_DEFAULT_DISABLE_PYTHON 0) +set(LLDB_DEFAULT_DISABLE_CURSES 0) + if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set(LLDB_DEFAULT_DISABLE_PYTHON 0) set(LLDB_DEFAULT_DISABLE_CURSES 1) elseif (CMAKE_SYSTEM_NAME MATCHES "Android" ) set(LLDB_DEFAULT_DISABLE_PYTHON 1) set(LLDB_DEFAULT_DISABLE_CURSES 1) -else() - set(LLDB_DEFAULT_DISABLE_PYTHON 0) - set(LLDB_DEFAULT_DISABLE_CURSES 0) +elseif(IOS) + set(LLDB_DEFAULT_DISABLE_PYTHON 1) endif() +if(IOS) + add_definitions(-DNO_XPC_SERVICES) +endif() + set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL "Disables the Python scripting integration.") set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_DISABLE_CURSES} CACHE BOOL @@ -298,13 +303,15 @@ if (NOT LIBXML2_FOUND AND NOT (CMAKE_SYSTEM_NAME MATCH endif() # Find libraries or frameworks that may be needed -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - find_library(CARBON_LIBRARY Carbon) +if (APPLE) + if(NOT IOS) + find_library(CARBON_LIBRARY Carbon) + find_library(CORE_SERVICES_LIBRARY CoreServices) + find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") + endif() find_library(FOUNDATION_LIBRARY Foundation) find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) - find_library(CORE_SERVICES_LIBRARY CoreServices) find_library(SECURITY_LIBRARY Security) - find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Output directory for LLDB.framework") set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") @@ -312,10 +319,13 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources) add_definitions( -DLIBXML2_DEFINED ) - list(APPEND system_libs xml2 ${CURSES_LIBRARIES}) - list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY} - ${DEBUG_SYMBOLS_LIBRARY}) + list(APPEND system_libs xml2 + ${CURSES_LIBRARIES} + ${FOUNDATION_LIBRARY} + ${CORE_FOUNDATION_LIBRARY} + ${CORE_SERVICES_LIBRARY} + ${SECURITY_LIBRARY} + ${DEBUG_SYMBOLS_LIBRARY}) else() if (LIBXML2_FOUND) Modified: vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Wed Jul 19 07:03:07 2017 (r321194) @@ -2,7 +2,6 @@ # standalone project, using LLVM as an external library: if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(lldb) - cmake_minimum_required(VERSION 2.8.12.2) if (POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required Modified: vendor/lldb/dist/include/lldb/Host/MainLoop.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/MainLoop.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/MainLoop.h Wed Jul 19 07:03:07 2017 (r321194) @@ -12,8 +12,8 @@ #include "lldb/Host/Config.h" #include "lldb/Host/MainLoopBase.h" - #include "llvm/ADT/DenseMap.h" +#include #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H #define SIGNAL_POLLING_UNSUPPORTED 1 Modified: vendor/lldb/dist/include/lldb/Host/PosixApi.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/PosixApi.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/PosixApi.h Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,8 @@ #if defined(_WIN32) #include "lldb/Host/windows/PosixApi.h" +#else +#include #endif #endif Modified: vendor/lldb/dist/include/lldb/Host/SocketAddress.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/SocketAddress.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/SocketAddress.h Wed Jul 19 07:03:07 2017 (r321194) @@ -152,6 +152,11 @@ class SocketAddress { (public) bool IsAnyAddr() const; //------------------------------------------------------------------ + // Returns true if the socket is INADDR_LOOPBACK + //------------------------------------------------------------------ + bool IsLocalhost() const; + + //------------------------------------------------------------------ // Direct access to all of the sockaddr structures //------------------------------------------------------------------ struct sockaddr &sockaddr() { Modified: vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Wed Jul 19 07:03:07 2017 (r321194) @@ -33,8 +33,7 @@ class ResumeActionList; //------------------------------------------------------------------ // NativeProcessProtocol //------------------------------------------------------------------ -class NativeProcessProtocol - : public std::enable_shared_from_this { +class NativeProcessProtocol { friend class SoftwareBreakpoint; public: @@ -268,7 +267,7 @@ class NativeProcessProtocol (public) /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. //------------------------------------------------------------------ - virtual llvm::Expected + virtual llvm::Expected> Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; @@ -292,7 +291,7 @@ class NativeProcessProtocol (public) /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. //------------------------------------------------------------------ - virtual llvm::Expected + virtual llvm::Expected> Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; }; Modified: vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h Wed Jul 19 07:03:07 2017 (r321194) @@ -23,7 +23,7 @@ namespace lldb_private { class NativeThreadProtocol : public std::enable_shared_from_this { public: - NativeThreadProtocol(NativeProcessProtocol *process, lldb::tid_t tid); + NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid); virtual ~NativeThreadProtocol() {} @@ -46,7 +46,7 @@ class NativeThreadProtocol (public) lldb::tid_t GetID() const { return m_tid; } - NativeProcessProtocolSP GetProcess(); + NativeProcessProtocol &GetProcess() { return m_process; } // --------------------------------------------------------------------- // Thread-specific watchpoints @@ -64,7 +64,7 @@ class NativeThreadProtocol (public) virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0; protected: - NativeProcessProtocolWP m_process_wp; + NativeProcessProtocol &m_process; lldb::tid_t m_tid; }; } Modified: vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h ============================================================================== --- vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h Wed Jul 19 07:03:07 2017 (r321194) @@ -539,7 +539,7 @@ class CommandInterpreter : public Broadcaster, (privat std::string m_repeat_command; // Stores the command that will be executed for // an empty command string. lldb::ScriptInterpreterSP m_script_interpreter_sp; - std::mutex m_script_interpreter_mutex; + std::recursive_mutex m_script_interpreter_mutex; lldb::IOHandlerSP m_command_io_handler_sp; char m_comment_char; bool m_batch_command_mode; Modified: vendor/lldb/dist/include/lldb/Utility/DataExtractor.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/DataExtractor.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Utility/DataExtractor.h Wed Jul 19 07:03:07 2017 (r321194) @@ -15,6 +15,7 @@ #include "lldb/lldb-forward.h" // for DataBufferSP #include "lldb/lldb-types.h" +#include #include #include Modified: vendor/lldb/dist/include/lldb/lldb-private-forward.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-private-forward.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/lldb-private-forward.h Wed Jul 19 07:03:07 2017 (r321194) @@ -30,10 +30,6 @@ class UnixSignals; // SP/WP decls. // --------------------------------------------------------------- typedef std::shared_ptr NativeBreakpointSP; -typedef std::shared_ptr - NativeProcessProtocolSP; -typedef std::weak_ptr - NativeProcessProtocolWP; typedef std::shared_ptr NativeRegisterContextSP; typedef std::shared_ptr Modified: vendor/lldb/dist/include/lldb/lldb-types.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-types.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/lldb-types.h Wed Jul 19 07:03:07 2017 (r321194) @@ -13,16 +13,10 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-forward.h" -#include -#include #include //---------------------------------------------------------------------- // All host systems must define: -// lldb::condition_t The native condition type (or a substitute class) -// for conditions on the host system. -// lldb::mutex_t The native mutex type for mutex objects on the host -// system. // lldb::thread_t The native thread type for spawned threads on the // system // lldb::thread_arg_t The type of the one any only thread creation @@ -34,32 +28,22 @@ // #define LLDB_INVALID_PROCESS_ID ... // #define LLDB_INVALID_THREAD_ID ... // #define LLDB_INVALID_HOST_THREAD ... -// #define IS_VALID_LLDB_HOST_THREAD ... //---------------------------------------------------------------------- // TODO: Add a bunch of ifdefs to determine the host system and what // things should be defined. Currently MacOSX is being assumed by default // since that is what lldb was first developed for. -#ifndef _MSC_VER -#include -#include -#endif - #ifdef _WIN32 #include namespace lldb { -typedef void *mutex_t; -typedef void *condition_t; typedef void *rwlock_t; typedef void *process_t; // Process type is HANDLE typedef void *thread_t; // Host thread type typedef void *file_t; // Host file type -typedef void *pipe_t; // Host pipe type typedef unsigned int __w64 socket_t; // Host socket type -typedef uint32_t thread_key_t; typedef void *thread_arg_t; // Host thread argument type typedef unsigned thread_result_t; // Host thread result type typedef thread_result_t (*thread_func_t)(void *); // Host thread function type @@ -73,15 +57,11 @@ namespace lldb { //---------------------------------------------------------------------- // MacOSX Types //---------------------------------------------------------------------- -typedef ::pthread_mutex_t mutex_t; -typedef pthread_cond_t condition_t; typedef pthread_rwlock_t rwlock_t; typedef uint64_t process_t; // Process type is just a pid. typedef pthread_t thread_t; // Host thread type typedef int file_t; // Host file type -typedef int pipe_t; // Host pipe type typedef int socket_t; // Host socket type -typedef pthread_key_t thread_key_t; typedef void *thread_arg_t; // Host thread argument type typedef void *thread_result_t; // Host thread result type typedef void *(*thread_func_t)(void *); // Host thread function type @@ -100,10 +80,6 @@ typedef bool (*ExpressionCancelCallback)(ExpressionEva #define LLDB_INVALID_PROCESS ((lldb::process_t)-1) #define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL) -#define IS_VALID_LLDB_HOST_THREAD(t) ((t) != LLDB_INVALID_HOST_THREAD) - -#define LLDB_INVALID_HOST_TIME \ - { 0, 0 } namespace lldb { typedef uint64_t addr_t; Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py Wed Jul 19 07:03:07 2017 (r321194) @@ -23,32 +23,8 @@ class UnwindFromExpressionTest(TestBase): def build_and_run_to_bkpt(self): self.build() - exe = os.path.join(os.getcwd(), "a.out") - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - # Create the breakpoint. - breakpoint = target.BreakpointCreateBySourceRegex( - "// Set a breakpoint here to get started", self.main_spec) - self.assertTrue(breakpoint, VALID_BREAKPOINT) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - if not process: - self.fail("SBTarget.LaunchProcess() failed") - - if process.GetState() != lldb.eStateStopped: - self.fail("Process should be in the 'stopped' state, " - "instead the actual state is: '%s'" % - lldbutil.state_type_to_str(process.GetState())) - - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - process, breakpoint) - self.assertIsNotNone( - self.thread, "Expected one thread to be stopped at the breakpoint") + (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + "// Set a breakpoint here to get started", self.main_spec) # Next set a breakpoint in this function, set up Expression options to stop on # breakpoint hits, and call the function. Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py Wed Jul 19 07:03:07 2017 (r321194) @@ -30,46 +30,13 @@ class BadAddressBreakpointTestCase(TestBase): def address_breakpoints(self): """Test that breakpoints set on a bad address say they are bad.""" - exe = os.path.join(os.getcwd(), "a.out") - # Create a target by the debugger. - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + "Set a breakpoint here", lldb.SBFileSpec("main.c")) - # Now create a breakpoint on main.c by name 'c'. - breakpoint = target.BreakpointCreateBySourceRegex( - "Set a breakpoint here", lldb.SBFileSpec("main.c")) - self.assertTrue(breakpoint and - breakpoint.GetNumLocations() == 1, - VALID_BREAKPOINT) - - # Get the breakpoint location from breakpoint after we verified that, - # indeed, it has one location. - location = breakpoint.GetLocationAtIndex(0) - self.assertTrue(location and - location.IsEnabled(), - VALID_BREAKPOINT_LOCATION) - - launch_info = lldb.SBLaunchInfo(None) - - error = lldb.SBError() - - process = target.Launch(launch_info, error) - self.assertTrue(process, PROCESS_IS_VALID) - - # Did we hit our breakpoint? - from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint - threads = get_threads_stopped_at_breakpoint(process, breakpoint) - self.assertTrue( - len(threads) == 1, - "There should be a thread stopped at our breakpoint") - - # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) - # Now see if we can read from 0. If I can't do that, I don't have a good way to know # what an illegal address is... - error.Clear() + error = lldb.SBError() ptr = process.ReadPointerFromMemory(0x0, error) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py Wed Jul 19 07:03:07 2017 (r321194) @@ -18,29 +18,9 @@ class ConsecutiveBreakpointsTestCase(TestBase): def prepare_test(self): self.build() - exe = os.path.join(os.getcwd(), "a.out") - # Create a target by the debugger. - self.target = self.dbg.CreateTarget(exe) - self.assertTrue(self.target, VALID_TARGET) - - breakpoint1 = self.target.BreakpointCreateBySourceRegex( - "Set breakpoint here", lldb.SBFileSpec("main.cpp")) - self.assertTrue( - breakpoint1 and breakpoint1.GetNumLocations() == 1, - VALID_BREAKPOINT) - - # Now launch the process, and do not stop at entry point. - self.process = self.target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertIsNotNone(self.process, PROCESS_IS_VALID) - - # We should be stopped at the first breakpoint - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - self.process, breakpoint1) - self.assertIsNotNone( - self.thread, - "Expected one thread to be stopped at breakpoint 1") + (self.target, self.process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, "Set breakpoint here", lldb.SBFileSpec("main.cpp")) # Set breakpoint to the next instruction frame = self.thread.GetFrameAtIndex(0) Modified: vendor/lldb/dist/source/Host/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/source/Host/CMakeLists.txt Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/CMakeLists.txt Wed Jul 19 07:03:07 2017 (r321194) @@ -103,6 +103,10 @@ else() macosx/cfcpp/CFCMutableSet.cpp macosx/cfcpp/CFCString.cpp ) + if(IOS) + set_property(SOURCE macosx/Host.mm APPEND PROPERTY + COMPILE_DEFINITIONS "NO_XPC_SERVICES=1") + endif() elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") Modified: vendor/lldb/dist/source/Host/common/File.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/File.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/File.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -21,6 +21,7 @@ #include #include #include +#include #endif #include "llvm/Support/ConvertUTF.h" Modified: vendor/lldb/dist/source/Host/common/Host.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/Host.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/Host.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -46,6 +46,7 @@ #endif // C++ Includes +#include // Other libraries and framework includes // Project includes Modified: vendor/lldb/dist/source/Host/common/MainLoop.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/MainLoop.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/MainLoop.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -10,6 +10,7 @@ #include "llvm/Config/llvm-config.h" #include "lldb/Host/MainLoop.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Utility/Status.h" #include #include Modified: vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -345,17 +345,12 @@ Status NativeRegisterContext::ReadRegisterValueFromMem return error; } - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (!process_sp) { - error.SetErrorString("invalid process"); - return error; - } - + NativeProcessProtocol &process = m_thread.GetProcess(); uint8_t src[RegisterValue::kMaxRegisterByteSize]; // Read the memory size_t bytes_read; - error = process_sp->ReadMemory(src_addr, src, src_len, bytes_read); + error = process.ReadMemory(src_addr, src, src_len, bytes_read); if (error.Fail()) return error; @@ -374,7 +369,7 @@ Status NativeRegisterContext::ReadRegisterValueFromMem // order of the memory data doesn't match the process. For now we are assuming // they are the same. lldb::ByteOrder byte_order; - if (!process_sp->GetByteOrder(byte_order)) { + if (process.GetByteOrder(byte_order)) { error.SetErrorString("NativeProcessProtocol::GetByteOrder () failed"); return error; } @@ -392,41 +387,37 @@ Status NativeRegisterContext::WriteRegisterValueToMemo Status error; - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (process_sp) { + NativeProcessProtocol &process = m_thread.GetProcess(); - // TODO: we might need to add a parameter to this function in case the byte - // order of the memory data doesn't match the process. For now we are - // assuming - // they are the same. - lldb::ByteOrder byte_order; - if (!process_sp->GetByteOrder(byte_order)) - return Status("NativeProcessProtocol::GetByteOrder () failed"); + // TODO: we might need to add a parameter to this function in case the byte + // order of the memory data doesn't match the process. For now we are + // assuming + // they are the same. + lldb::ByteOrder byte_order; + if (!process.GetByteOrder(byte_order)) + return Status("NativeProcessProtocol::GetByteOrder () failed"); - const size_t bytes_copied = - reg_value.GetAsMemoryData(reg_info, dst, dst_len, byte_order, error); + const size_t bytes_copied = + reg_value.GetAsMemoryData(reg_info, dst, dst_len, byte_order, error); - if (error.Success()) { - if (bytes_copied == 0) { - error.SetErrorString("byte copy failed."); - } else { - size_t bytes_written; - error = - process_sp->WriteMemory(dst_addr, dst, bytes_copied, bytes_written); - if (error.Fail()) - return error; + if (error.Success()) { + if (bytes_copied == 0) { + error.SetErrorString("byte copy failed."); + } else { + size_t bytes_written; + error = process.WriteMemory(dst_addr, dst, bytes_copied, bytes_written); + if (error.Fail()) + return error; - if (bytes_written != bytes_copied) { - // This might happen if we read _some_ bytes but not all - error.SetErrorStringWithFormat("only wrote %" PRIu64 " of %" PRIu64 - " bytes", - static_cast(bytes_written), - static_cast(bytes_copied)); - } + if (bytes_written != bytes_copied) { + // This might happen if we read _some_ bytes but not all + error.SetErrorStringWithFormat("only wrote %" PRIu64 " of %" PRIu64 + " bytes", + static_cast(bytes_written), + static_cast(bytes_copied)); } } - } else - error.SetErrorString("invalid process"); + } return error; } Modified: vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,9 +16,9 @@ using namespace lldb; using namespace lldb_private; -NativeThreadProtocol::NativeThreadProtocol(NativeProcessProtocol *process, +NativeThreadProtocol::NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid) - : m_process_wp(process->shared_from_this()), m_tid(tid) {} + : m_process(process), m_tid(tid) {} Status NativeThreadProtocol::ReadRegister(uint32_t reg, RegisterValue ®_value) { @@ -61,8 +61,4 @@ Status NativeThreadProtocol::RestoreAllRegisters(lldb: if (!register_context_sp) return Status("no register context"); return register_context_sp->ReadAllRegisterValues(data_sp); -} - -NativeProcessProtocolSP NativeThreadProtocol::GetProcess() { - return m_process_wp.lock(); } Modified: vendor/lldb/dist/source/Host/common/Socket.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/Socket.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/Socket.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -29,6 +29,7 @@ #include #include #include +#include #endif #ifdef __linux__ Modified: vendor/lldb/dist/source/Host/common/SocketAddress.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/SocketAddress.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/SocketAddress.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -317,6 +317,13 @@ bool SocketAddress::IsAnyAddr() const { : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_any, 16); } +bool SocketAddress::IsLocalhost() const { + return (GetFamily() == AF_INET) + ? m_socket_addr.sa_ipv4.sin_addr.s_addr == htonl(INADDR_LOOPBACK) + : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_loopback, + 16); +} + bool SocketAddress::operator==(const SocketAddress &rhs) const { if (GetFamily() != rhs.GetFamily()) return false; Modified: vendor/lldb/dist/source/Host/common/TCPSocket.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/TCPSocket.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/TCPSocket.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -34,6 +34,7 @@ #define CLOSE_SOCKET closesocket typedef const char *set_socket_option_arg_type; #else +#include #define CLOSE_SOCKET ::close typedef const void *set_socket_option_arg_type; #endif Modified: vendor/lldb/dist/source/Host/linux/Host.cpp ============================================================================== --- vendor/lldb/dist/source/Host/linux/Host.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/linux/Host.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,7 @@ #include #include #include +#include // C++ Includes // Other libraries and framework includes Modified: vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,7 @@ #include #include #include +#include #include #include // std::once Modified: vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -30,6 +30,7 @@ #ifndef LLDB_DISABLE_POSIX #include +#include #endif // C++ Includes Modified: vendor/lldb/dist/source/Host/posix/FileSystem.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/FileSystem.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/FileSystem.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef __linux__ #include #include Modified: vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -13,7 +13,9 @@ #include "llvm/ADT/STLExtras.h" +#include #include +#include using namespace lldb_private; Modified: vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -10,6 +10,7 @@ #include "lldb/Host/posix/LockFilePosix.h" #include +#include using namespace lldb; using namespace lldb_private; Modified: vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -19,8 +19,10 @@ #include #include #include +#include #include +#include #ifdef __ANDROID__ #include Modified: vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp ============================================================================== --- vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -2475,7 +2475,7 @@ void CommandInterpreter::HandleCommandsFromFile( } ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create) { - std::lock_guard locker(m_script_interpreter_mutex); + std::lock_guard locker(m_script_interpreter_mutex); if (!m_script_interpreter_sp) { if (!can_create) return nullptr; Modified: vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -7,23 +7,11 @@ // //===----------------------------------------------------------------------===// -// C Includes -#include -#include -#include - -// C++ Includes -// Other libraries and framework includes +#include "AuxVector.h" #include "lldb/Target/Process.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Log.h" - -#if defined(__linux__) || defined(__FreeBSD__) -#include "Plugins/Process/elf-core/ProcessElfCore.h" -#endif - -#include "AuxVector.h" using namespace lldb; using namespace lldb_private; Modified: vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -451,16 +451,16 @@ void ClangModulesDeclVendorImpl::ForEachMacro( bool first_arg = true; - for (clang::MacroInfo::arg_iterator ai = macro_info->arg_begin(), - ae = macro_info->arg_end(); - ai != ae; ++ai) { + for (auto pi = macro_info->param_begin(), + pe = macro_info->param_end(); + pi != pe; ++pi) { if (!first_arg) { macro_expansion.append(", "); } else { first_arg = false; } - macro_expansion.append((*ai)->getName().str()); + macro_expansion.append((*pi)->getName().str()); } if (macro_info->isC99Varargs()) { Modified: vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -274,6 +274,28 @@ bool CPlusPlusNameParser::ConsumeAnonymousNamespace() return true; } +bool CPlusPlusNameParser::ConsumeLambda() { + Bookmark start_position = SetBookmark(); + if (!ConsumeToken(tok::l_brace)) { + return false; + } + constexpr llvm::StringLiteral g_lambda("lambda"); + if (HasMoreTokens() && Peek().is(tok::raw_identifier) && + Peek().getRawIdentifier() == g_lambda) { + // Put the matched brace back so we can use ConsumeBrackets + TakeBack(); + } else { + return false; + } + + if (!ConsumeBrackets(tok::l_brace, tok::r_brace)) { + return false; + } + + start_position.Remove(); + return true; +} + bool CPlusPlusNameParser::ConsumeBrackets(tok::TokenKind left, tok::TokenKind right) { Bookmark start_position = SetBookmark(); @@ -502,6 +524,15 @@ CPlusPlusNameParser::ParseFullNameImpl() { state = State::AfterTwoColons; break; } + case tok::l_brace: + if (state == State::Beginning || state == State::AfterTwoColons) { + if (ConsumeLambda()) { + state = State::AfterIdentifier; + break; + } + } + continue_parsing = false; + break; case tok::coloncolon: // Type nesting delimiter. if (state != State::Beginning && state != State::AfterIdentifier && state != State::AfterTemplate) { Modified: vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h Wed Jul 19 07:03:07 2017 (r321194) @@ -143,6 +143,9 @@ class CPlusPlusNameParser { (private) // Consumes '(anonymous namespace)' bool ConsumeAnonymousNamespace(); + // Consumes '{lambda ...}' + bool ConsumeLambda(); + // Consumes operator declaration like 'operator *' or 'operator delete []' bool ConsumeOperator(); Modified: vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -23,6 +23,7 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/FileSpec.h" Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -214,7 +214,7 @@ static Status EnsureFDFlags(int fd, int flags) { // Public Static Methods // ----------------------------------------------------------------------------- -llvm::Expected +llvm::Expected> NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const { @@ -259,14 +259,13 @@ NativeProcessLinux::Factory::Launch(ProcessLaunchInfo return status.ToError(); } - std::shared_ptr process_sp(new NativeProcessLinux( + return std::unique_ptr(new NativeProcessLinux( pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate, - arch, mainloop)); - process_sp->InitializeThreads({pid}); - return process_sp; + arch, mainloop, {pid})); } -llvm::Expected NativeProcessLinux::Factory::Attach( +llvm::Expected> +NativeProcessLinux::Factory::Attach( lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop) const { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); @@ -282,10 +281,8 @@ llvm::Expected NativeProcessL if (!tids_or) return tids_or.takeError(); - std::shared_ptr process_sp( - new NativeProcessLinux(pid, -1, native_delegate, arch, mainloop)); - process_sp->InitializeThreads(*tids_or); - return process_sp; + return std::unique_ptr(new NativeProcessLinux( + pid, -1, native_delegate, arch, mainloop, *tids_or)); } // ----------------------------------------------------------------------------- @@ -294,7 +291,8 @@ llvm::Expected NativeProcessL NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, - const ArchSpec &arch, MainLoop &mainloop) + const ArchSpec &arch, MainLoop &mainloop, + llvm::ArrayRef<::pid_t> tids) : NativeProcessProtocol(pid, terminal_fd, delegate), m_arch(arch) { if (m_terminal_fd != -1) { Status status = EnsureFDFlags(m_terminal_fd, O_NONBLOCK); @@ -305,9 +303,7 @@ NativeProcessLinux::NativeProcessLinux(::pid_t pid, in m_sigchld_handle = mainloop.RegisterSignal( SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, status); assert(m_sigchld_handle && status.Success()); -} -void NativeProcessLinux::InitializeThreads(llvm::ArrayRef<::pid_t> tids) { for (const auto &tid : tids) { NativeThreadLinuxSP thread_sp = AddThread(tid); assert(thread_sp && "AddThread() returned a nullptr thread"); @@ -2009,7 +2005,7 @@ NativeThreadLinuxSP NativeProcessLinux::AddThread(lldb if (m_threads.empty()) SetCurrentThreadID(thread_id); - auto thread_sp = std::make_shared(this, thread_id); + auto thread_sp = std::make_shared(*this, thread_id); m_threads.push_back(thread_sp); if (m_pt_proces_trace_id != LLDB_INVALID_UID) { Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h Wed Jul 19 07:03:07 2017 (r321194) @@ -10,7 +10,7 @@ #ifndef liblldb_NativeProcessLinux_H_ #define liblldb_NativeProcessLinux_H_ -// C++ Includes +#include #include // Other libraries and framework includes @@ -42,11 +42,11 @@ class NativeProcessLinux : public NativeProcessProtoco public: class Factory : public NativeProcessProtocol::Factory { public: - llvm::Expected + llvm::Expected> Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const override; - llvm::Expected + llvm::Expected> Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const override; }; @@ -160,14 +160,13 @@ class NativeProcessLinux : public NativeProcessProtoco // Private Instance Methods // --------------------------------------------------------------------- NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, - const ArchSpec &arch, MainLoop &mainloop); + const ArchSpec &arch, MainLoop &mainloop, + llvm::ArrayRef<::pid_t> tids); // Returns a list of process threads that we have attached to. static llvm::Expected> Attach(::pid_t pid); static Status SetDefaultPtraceOpts(const lldb::pid_t); - - void InitializeThreads(llvm::ArrayRef<::pid_t> tids); void MonitorCallback(lldb::pid_t pid, bool exited, WaitStatus status); Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -30,11 +30,7 @@ lldb::ByteOrder NativeRegisterContextLinux::GetByteOrd // read. lldb::ByteOrder byte_order = lldb::eByteOrderInvalid; - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (!process_sp) - return byte_order; - - if (!process_sp->GetByteOrder(byte_order)) { + if (!m_thread.GetProcess().GetByteOrder(byte_order)) { // FIXME log here } Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -873,7 +873,7 @@ Status NativeRegisterContextLinux_arm64::DoReadRegiste PTRACE_GETREGSET, m_thread.GetID(), ®set, &ioVec, sizeof regs); if (error.Success()) { ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) + if (m_thread.GetProcess().GetArchitecture(arch)) value.SetBytes((void *)(((unsigned char *)(®s)) + offset), 16, arch.GetByteOrder()); else @@ -890,7 +890,7 @@ Status NativeRegisterContextLinux_arm64::DoReadRegiste PTRACE_GETREGSET, m_thread.GetID(), ®set, &ioVec, sizeof regs); if (error.Success()) { ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) + if (m_thread.GetProcess().GetArchitecture(arch)) value.SetBytes((void *)(((unsigned char *)(regs)) + offset), 8, arch.GetByteOrder()); else Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -953,7 +953,7 @@ NativeRegisterContextLinux_mips64::GetWatchpointHitAdd return LLDB_INVALID_ADDRESS; EmulatorBaton baton( - static_cast(m_thread.GetProcess().get()), this); + static_cast(&m_thread.GetProcess()), this); emulator_ap->SetBaton(&baton); emulator_ap->SetReadMemCallback(&ReadMemoryCallback); emulator_ap->SetReadRegCallback(&ReadRegisterCallback); @@ -1034,7 +1034,7 @@ Status NativeRegisterContextLinux_mips64::Read_SR_Conf PTRACE_GETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); if (error.Success()) { lldb_private::ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) { + if (m_thread.GetProcess().GetArchitecture(arch)) { void *target_address = ((uint8_t *)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips); value.SetUInt(*(uint32_t *)target_address, size); Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -85,7 +85,7 @@ void LogThreadStopInfo(Log &log, const ThreadStopInfo } } -NativeThreadLinux::NativeThreadLinux(NativeProcessLinux *process, +NativeThreadLinux::NativeThreadLinux(NativeProcessLinux &process, lldb::tid_t tid) : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid), m_stop_info(), m_reg_context_sp(), m_stop_description() {} @@ -144,12 +144,8 @@ NativeRegisterContextSP NativeThreadLinux::GetRegister if (m_reg_context_sp) return m_reg_context_sp; - NativeProcessProtocolSP m_process_sp = m_process_wp.lock(); - if (!m_process_sp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jul 19 07:03: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 7C5ADDAAE31; Wed, 19 Jul 2017 07:03:17 +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 2AC0C6E729; Wed, 19 Jul 2017 07:03:17 +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 v6J73GT4091340; Wed, 19 Jul 2017 07:03:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J73Gdd091339; Wed, 19 Jul 2017 07:03:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J73Gdd091339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321195 - vendor/lldb/lldb-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r308421 X-SVN-Commit-Revision: 321195 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 07:03:17 -0000 Author: dim Date: Wed Jul 19 07:03:16 2017 New Revision: 321195 URL: https://svnweb.freebsd.org/changeset/base/321195 Log: Tag lldb trunk r308421. Added: vendor/lldb/lldb-trunk-r308421/ - copied from r321194, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Wed Jul 19 09:59: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 BB4F5C78072; Wed, 19 Jul 2017 09:59:33 +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 9342E73D21; Wed, 19 Jul 2017 09:59:33 +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 v6J9xWTf060329; Wed, 19 Jul 2017 09:59:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J9xWPi060327; Wed, 19 Jul 2017 09:59:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201707190959.v6J9xWPi060327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 19 Jul 2017 09:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321196 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 321196 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 09:59:33 -0000 Author: trasz Date: Wed Jul 19 09:59:32 2017 New Revision: 321196 URL: https://svnweb.freebsd.org/changeset/base/321196 Log: Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring. It applies to both NFS client and NFS server, and is useful for both. This is different from vfs.nfsd.enable_stringtouid, which is specific to server side. Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed Jul 19 07:03:16 2017 (r321195) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed Jul 19 09:59:32 2017 (r321196) @@ -68,11 +68,15 @@ gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; -int nfsd_enable_uidtostring = 0; +static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; +SYSCTL_DECL(_vfs_nfs); +SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, + &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -2562,7 +2566,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0 && !nfsd_enable_uidtostring) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultuid to "nobody". */ @@ -2824,7 +2828,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0 && !nfsd_enable_uidtostring) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultgid to "nogroup". */ Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jul 19 07:03:16 2017 (r321195) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jul 19 09:59:32 2017 (r321196) @@ -87,7 +87,6 @@ static int nfs_commit_miss; extern int nfsrv_issuedelegs; extern int nfsrv_dolocallocks; extern int nfsd_enable_stringtouid; -extern int nfsd_enable_uidtostring; SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, @@ -104,8 +103,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW 0, "Debug level for NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, &nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric owner_names"); -SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_uidtostring, CTLFLAG_RW, - &nfsd_enable_uidtostring, 0, "Make nfsd always send numeric owner_names"); #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 From owner-svn-src-all@freebsd.org Wed Jul 19 10:59: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 DBB5FC79596; Wed, 19 Jul 2017 10:59:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 89C6A75D0C; Wed, 19 Jul 2017 10:59:47 +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 mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 54595D4B2BC; Wed, 19 Jul 2017 20:59:37 +1000 (AEST) Date: Wed, 19 Jul 2017 20:59:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bruce Evans , 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: <1500389932.22314.151.camel@freebsd.org> Message-ID: <20170719183850.G1161@besplex.bde.org> References: <201707120242.v6C2gvDB026199@repo.freebsd.org> <20170712224803.G1991@besplex.bde.org> <1500308973.22314.89.camel@freebsd.org> <20170718153823.K1105@besplex.bde.org> <1500389932.22314.151.camel@freebsd.org> MIME-Version: 1.0 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=nlC_4_pT8q9DhB4Ho9EA:9 a=oTjj4IIKm4IGRG3_cN8A:9 a=vJojfPJ1HncGs5gt:21 a=r0bWohtU48GZC-tP:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed 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, 19 Jul 2017 10:59:48 -0000 On Tue, 18 Jul 2017, Ian Lepore wrote: > On Tue, 2017-07-18 at 18:08 +1000, Bruce Evans wrote: >> [lots of stuff about locking and accurate time-setting] >> >> Good idea. >> >> My inittodr() waits for the seconds register to change.=A0 This >> increases >> boot time by an average of 0.5 seconds, but is needed to get a result >> that is not out of date by an average of 0.5 seconds.=A0 After the >> seconds >> register changes, the window for reading the other registers is >> almost >> 1 second, but the reads must complete in a few microseconds anyway >> else >> the result is still too out of date.=A0 Debugging printf()s show that >> the reads usually complete in 10-50 usec with low latency (faster on >> old systems with faster ISA buses). >> > > I was considering adding a tunable to do that for people who don't mind > the extra time to boot/wakeup.=A0=A0It's interesting that you label an > error of a few microseconds as "too out of date", I was thinking that > reducing the average error from .5s to .005s was good enough. > > The .005s number comes from an idea of using a callout that begins as > soon as interrupts are available that checks for rtc rollover every > 10ms, with the hopes that it can catch the rollover between the time > callouts start working and rootfs mount time when inittodr() gets > called.=A0=A0If it can catch the rollover happening in that window, it ca= n > latch the monotonic clock and then use that at inittodr() time to > calculate the fractional part of the time.=A0=A0Even if it doesn't catch > the rollover in that time, it at least has a measurement that sets a > floor value for the fractional part, reducing the error to something > less than .5s. Hmm, my rtcintr() already does essentially that without really trying. It is designed to fix up the time after "suspension" in ddb breaks the time by stopping timecounter updates. The fixed up time is: (the rtc time) + (the last known good difference between the timecounter time and the rtc time) + (an adjustment for the drift rate) My rtcintr() samples the difference and calibrates the drift every 64 seconds. It uses rtc update interrupts every second to get precise timing for the sampling and to avoid having to wait for updates to complete before sampling. Initially, the offset and drift are unknown, but using 0 for them would give similar functionality to inittodr(). > I have no idea yet how much time elapses between interrupts coming > online and the first inittodr() call on a typical modern x86 > system.=A0=A0For all my arm systems with nfsroot it's several seconds. = =A0If > it averages a few milliseconds on x86 systems, it isn't useful enough > to justify the extra work. =A0If it's typically half a second or more it > probably is worth it. My fastest x86 system takes 6 seconds to boot from boot2 (no loader) to mounting root. Surprisingly, inittodr() runs even later than mountroot (at least on an old system). That must be for the old feature of defaulting the time to a timestamp on the (ffs) root partition. Normally that is not used, but if inittodr() ran earlier than it would have to run again if it couldn't find a hardware rtc. Interrupt handling starts working much earlier than that, but I wouldn't trust all time features to be initialized on the first call to rtcintr(). However, it is unimportant to set the time very early in the boot. This just makes CLOCK_REALTIME timestamps valid earlier. The time should be fixed up similarly after real suspensions. Then it is even less clear what the reinitialization order actually is. >> Accuracy for reading is not very important because accuracy for >> writing >> is very low (1-2 seconds).=A0 My resettodr() only writes if the >> difference >> is more than 2 seconds. >> > > The gross inaccuracy when writing is fixable now. =A0I'm not worried > about the microsecond inaccuracies of accessing the hardware, what I > want to fix is the fact that clock_settime() may get called at x.995 > and will record the time as x.0. Very old old versions seemed to have complications related to the hardware. Something to do with half-second boundaries, because the hardware is "smart" about this 0.995 error and schedules the next update to 0.5 seconds after writing to the seconds register (this reduces the average error to 0.5 seconds for sloppy settings)? I can't find these in the 2004 version. > Because settime is now called from a task thread, any clock driver is > free to sleep as needed to set the clock hardware in a way that aligns > its second rollover with kernel time. =A0Not efficient, but easy to do. The syscall was always free to sleep, and it is a bug for it return before setting the time. Except, the syscall never claimed to even have hardware to write to. If there were an RTC driver, then it should support both sync and async settings. > Even better, most rtc hardware has unused storage. =A0Sometimes in the > form of battery-backed ram, sometimes in the form of things like alarm > registers that aren't used for anything and a driver can tuck away > values in them for its own use. =A0If clock_settime() stores the > fractional part of the second in such a location, clock_gettime() can > use it to remove all of the inaccuracy that otherwise happens when the > fraction is discarded. =A0If even a single bit is available the error is > cut in half. =A0If a byte is available it drops to ~40ms. I tried to find unused rtc registers for the purpose of fixing nextboot and other boot loaders which do dangerous writes to disks. A single bit is almost enough for them too. I didn't really succeed. On x86, everythin= g is reserved or undocumented and most of the 256 (?) bytes of standard cmos was used by BIOSes before flash RAM made this unecessary (I don't know how much of it they use now). The best that I could find was the alarm registers. On some of my systems, the BIOS does use these registers, but the use is under user control and when non-use by the BIOS is configured, the BIOS doesn't clobber the registers. Bruce From owner-svn-src-all@freebsd.org Wed Jul 19 12:27: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 0E710C7C48F; Wed, 19 Jul 2017 12:27:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A39F87D45A; Wed, 19 Jul 2017 12:27:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JCRetr020754; Wed, 19 Jul 2017 12:27:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JCReUh020750; Wed, 19 Jul 2017 12:27:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707191227.v6JCReUh020750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 19 Jul 2017 12:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321197 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321197 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 12:27:42 -0000 Author: tuexen Date: Wed Jul 19 12:27:40 2017 New Revision: 321197 URL: https://svnweb.freebsd.org/changeset/base/321197 Log: Fix the accounting and add code to detect errors in accounting. Joint work with rrs@ MFC after: 1 week Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed Jul 19 09:59:32 2017 (r321196) +++ head/sys/netinet/sctp_auth.c Wed Jul 19 12:27:40 2017 (r321197) @@ -1797,8 +1797,8 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jul 19 09:59:32 2017 (r321196) +++ head/sys/netinet/sctp_indata.c Wed Jul 19 12:27:40 2017 (r321197) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); * This will cause sctp_service_queues() to get called on the top entry in * the list. */ -static void +static uint32_t sctp_add_chk_to_control(struct sctp_queued_to_read *control, struct sctp_stream_in *strm, struct sctp_tcb *stcb, @@ -92,6 +92,8 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso asoc->size_on_reasm_queue == 0 && asoc->size_on_all_streams == 0) { /* Full rwnd granted */ + KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is %u", asoc->cnt_on_reasm_queue)); + KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is %u", asoc->cnt_on_all_streams)); calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), SCTP_MINIMAL_RWND); return (calc); } @@ -558,7 +560,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, } /* EY it wont be queued if it could be delivered directly */ queue_needed = 0; - asoc->size_on_all_streams -= control->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); strm->last_mid_delivered++; sctp_mark_non_revokable(asoc, control->sinfo_tsn); @@ -571,11 +581,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, nxt_todel = strm->last_mid_delivered + 1; if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid) && (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG)) { - asoc->size_on_all_streams -= control->length; - sctp_ucount_decr(asoc->cnt_on_all_streams); if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { #ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); +#ifdef INVARIANTS } else { panic("Huh control: %p is on_strm_q: %d", control, control->on_strm_q); @@ -671,7 +689,7 @@ sctp_setup_tail_pointer(struct sctp_queued_to_read *co } static void -sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m) +sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, uint32_t *added) { struct mbuf *prev = NULL; struct sctp_tcb *stcb; @@ -715,6 +733,7 @@ sctp_add_to_tail_pointer(struct sctp_queued_to_read *c */ sctp_sballoc(stcb, &stcb->sctp_socket->so_rcv, m); } + *added += SCTP_BUF_LEN(m); atomic_add_int(&control->length, SCTP_BUF_LEN(m)); m = SCTP_BUF_NEXT(m); } @@ -815,7 +834,15 @@ restart: tchk = TAILQ_FIRST(&control->reasm); if (tchk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { TAILQ_REMOVE(&control->reasm, tchk, sctp_next); - asoc->size_on_reasm_queue -= tchk->send_size; + if (asoc->size_on_reasm_queue >= tchk->send_size) { + asoc->size_on_reasm_queue -= tchk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, tchk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); nc->first_frag_seen = 1; nc->fsn_included = tchk->rec.data.fsn; @@ -1127,6 +1154,16 @@ done_un: #endif SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } if (strm->pd_api_started && control->pdapi_started) { @@ -1173,6 +1210,16 @@ deliver_more: #endif SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } ret++; @@ -1219,7 +1266,7 @@ out: } -void +uint32_t sctp_add_chk_to_control(struct sctp_queued_to_read *control, struct sctp_stream_in *strm, struct sctp_tcb *stcb, struct sctp_association *asoc, @@ -1229,6 +1276,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co * Given a control and a chunk, merge the data from the chk onto the * control and free up the chunk resources. */ + uint32_t added = 0; int i_locked = 0; if (control->on_read_q && (hold_rlock == 0)) { @@ -1242,7 +1290,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co control->data = chk->data; sctp_setup_tail_pointer(control); } else { - sctp_add_to_tail_pointer(control, chk->data); + sctp_add_to_tail_pointer(control, chk->data, &added); } control->fsn_included = chk->rec.data.fsn; asoc->size_on_reasm_queue -= chk->send_size; @@ -1268,6 +1316,16 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co } else if (control->on_strm_q == SCTP_ON_ORDERED) { /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; #ifdef INVARIANTS } else if (control->on_strm_q) { @@ -1283,6 +1341,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co SCTP_INP_READ_UNLOCK(stcb->sctp_ep); } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); + return (added); } /* @@ -1302,6 +1361,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc struct sctp_tmit_chunk *at, *nat; struct sctp_stream_in *strm; int do_wakeup, unordered; + uint32_t lenadded; strm = &asoc->strmin[control->sinfo_stream]; /* @@ -1314,6 +1374,9 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc } /* Must be added to the stream-in queue */ if (created_control) { + if (unordered == 0) { + sctp_ucount_incr(asoc->cnt_on_all_streams); + } if (sctp_place_control_in_stream(strm, asoc, control)) { /* Duplicate SSN? */ sctp_clean_up_control(stcb, control); @@ -1373,6 +1436,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); sctp_setup_tail_pointer(control); + asoc->size_on_all_streams += control->length; } else { /* Place the chunk in our list */ int inserted = 0; @@ -1529,7 +1593,8 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc at->rec.data.fsn, next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); - sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); + lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); + asoc->size_on_all_streams += lenadded; if (control->on_read_q) { do_wakeup = 1; } @@ -1600,7 +1665,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc uint16_t sid; struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - struct sctp_queued_to_read *control = NULL; + struct sctp_queued_to_read *control, *ncontrol; uint32_t ppid; uint8_t chk_flags; struct sctp_stream_reset_list *liste; @@ -2006,7 +2071,13 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc return (0); } if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + struct mbuf *m; + control->data = dmbuf; + m = control->data; + for (m = control->data; m; m = m->m_next) { + control->length += SCTP_BUF_LEN(m); + } control->tail_mbuf = NULL; control->end_added = 1; control->last_frag_seen = 1; @@ -2116,16 +2187,16 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc /* first one on */ TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); } else { - struct sctp_queued_to_read *ctlOn, *nctlOn; + struct sctp_queued_to_read *lcontrol, *nlcontrol; unsigned char inserted = 0; - TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { - if (SCTP_TSN_GT(control->sinfo_tsn, ctlOn->sinfo_tsn)) { + TAILQ_FOREACH_SAFE(lcontrol, &asoc->pending_reply_queue, next, nlcontrol) { + if (SCTP_TSN_GT(control->sinfo_tsn, lcontrol->sinfo_tsn)) { continue; } else { /* found it */ - TAILQ_INSERT_BEFORE(ctlOn, control, next); + TAILQ_INSERT_BEFORE(lcontrol, control, next); inserted = 1; break; } @@ -2216,8 +2287,6 @@ finish_express_del: * pending_reply space 3: distribute any chunks in * pending_reply_queue. */ - struct sctp_queued_to_read *ctl, *nctl; - sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); sctp_send_deferred_reset_response(stcb, liste, SCTP_STREAM_RESET_RESULT_PERFORMED); @@ -2226,34 +2295,34 @@ finish_express_del: liste = TAILQ_FIRST(&asoc->resetHead); if (TAILQ_EMPTY(&asoc->resetHead)) { /* All can be removed */ - TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); - sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag, &need_reasm_check); + TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { + TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); + sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { return (0); } if (need_reasm_check) { - (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[ctl->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); + (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[control->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); need_reasm_check = 0; } } } else { - TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - if (SCTP_TSN_GT(ctl->sinfo_tsn, liste->tsn)) { + TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { + if (SCTP_TSN_GT(control->sinfo_tsn, liste->tsn)) { break; } /* - * if ctl->sinfo_tsn is <= liste->tsn we can - * process it which is the NOT of - * ctl->sinfo_tsn > liste->tsn + * if control->sinfo_tsn is <= liste->tsn we + * can process it which is the NOT of + * control->sinfo_tsn > liste->tsn */ - TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); - sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag, &need_reasm_check); + TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); + sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { return (0); } if (need_reasm_check) { - (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[ctl->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); + (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[control->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); need_reasm_check = 0; } } @@ -5181,7 +5250,7 @@ static void sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, struct sctp_stream_in *strmin) { - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; struct sctp_association *asoc; uint32_t mid; int need_reasm_check = 0; @@ -5192,43 +5261,51 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, * First deliver anything prior to and including the stream no that * came in. */ - TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next_instrm, nctl) { - if (SCTP_MID_GE(asoc->idata_supported, mid, ctl->mid)) { + TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) { + if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { /* this is deliverable now */ - if (((ctl->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { - if (ctl->on_strm_q) { - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); + if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + if (control->on_strm_q) { + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strmin->inqueue, control, next_instrm); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm); #ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", - strmin, ctl, ctl->on_strm_q); + strmin, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; + control->on_strm_q = 0; } /* subtract pending on streams */ - asoc->size_on_all_streams -= ctl->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); /* deliver it to at least the delivery-q */ if (stcb->sctp_socket) { - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, + control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } } else { /* Its a fragmented message */ - if (ctl->first_frag_seen) { + if (control->first_frag_seen) { /* * Make it so this is next to * deliver, we restore later */ - strmin->last_mid_delivered = ctl->mid - 1; + strmin->last_mid_delivered = control->mid - 1; need_reasm_check = 1; break; } @@ -5257,32 +5334,40 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, * now ready. */ mid = strmin->last_mid_delivered + 1; - TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next_instrm, nctl) { - if (SCTP_MID_EQ(asoc->idata_supported, mid, ctl->mid)) { - if (((ctl->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) { + if (SCTP_MID_EQ(asoc->idata_supported, mid, control->mid)) { + if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { /* this is deliverable now */ - if (ctl->on_strm_q) { - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); + if (control->on_strm_q) { + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strmin->inqueue, control, next_instrm); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm); #ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", - strmin, ctl, ctl->on_strm_q); + strmin, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; + control->on_strm_q = 0; } /* subtract pending on streams */ - asoc->size_on_all_streams -= ctl->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); /* deliver it to at least the delivery-q */ - strmin->last_mid_delivered = ctl->mid; + strmin->last_mid_delivered = control->mid; if (stcb->sctp_socket) { - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, + control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); @@ -5290,12 +5375,12 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, mid = strmin->last_mid_delivered + 1; } else { /* Its a fragmented message */ - if (ctl->first_frag_seen) { + if (control->first_frag_seen) { /* * Make it so this is next to * deliver */ - strmin->last_mid_delivered = ctl->mid - 1; + strmin->last_mid_delivered = control->mid - 1; need_reasm_check = 1; break; } @@ -5347,7 +5432,15 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } cnt_removed++; TAILQ_REMOVE(&control->reasm, chk, sctp_next); - asoc->size_on_reasm_queue -= chk->send_size; + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); if (chk->data) { sctp_m_freem(chk->data); @@ -5373,6 +5466,16 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } else if (control->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); @@ -5416,7 +5519,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_queued_to_read *ctl, *sv; + struct sctp_queued_to_read *control, *sv; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { @@ -5575,25 +5678,35 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, for (cur_mid = strm->last_mid_delivered; SCTP_MID_GE(asoc->idata_supported, mid, cur_mid); cur_mid++) { sctp_flush_reassm_for_str_seq(stcb, asoc, sid, cur_mid, ordered, new_cum_tsn); } - TAILQ_FOREACH(ctl, &stcb->sctp_ep->read_queue, next) { - if ((ctl->sinfo_stream == sid) && - (SCTP_MID_EQ(asoc->idata_supported, ctl->mid, mid))) { + TAILQ_FOREACH(control, &stcb->sctp_ep->read_queue, next) { + if ((control->sinfo_stream == sid) && + (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) { str_seq = (sid << 16) | (0x0000ffff & mid); - ctl->pdapi_aborted = 1; + control->pdapi_aborted = 1; sv = stcb->asoc.control_pdapi; - ctl->end_added = 1; - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strm->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strm->uno_inqueue, ctl, next_instrm); + control->end_added = 1; + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { #ifdef INVARIANTS - } else if (ctl->on_strm_q) { + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); +#ifdef INVARIANTS + } else if (control->on_strm_q) { panic("strm: %p ctl: %p unknown %d", - strm, ctl, ctl->on_strm_q); + strm, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; - stcb->asoc.control_pdapi = ctl; + control->on_strm_q = 0; + stcb->asoc.control_pdapi = control; sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, stcb, SCTP_PARTIAL_DELIVERY_ABORTED, @@ -5601,8 +5714,8 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, SCTP_SO_NOT_LOCKED); stcb->asoc.control_pdapi = sv; break; - } else if ((ctl->sinfo_stream == sid) && - SCTP_MID_GT(asoc->idata_supported, ctl->mid, mid)) { + } else if ((control->sinfo_stream == sid) && + SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) { /* We are past our victim SSN */ break; } Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jul 19 09:59:32 2017 (r321196) +++ head/sys/netinet/sctp_pcb.c Wed Jul 19 12:27:40 2017 (r321197) @@ -4599,21 +4599,21 @@ void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh) { struct sctp_tmit_chunk *chk, *nchk; - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; - TAILQ_FOREACH_SAFE(ctl, rh, next_instrm, nctl) { - TAILQ_REMOVE(rh, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->on_read_q == 0) { - sctp_free_remote_addr(ctl->whoFrom); - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_FOREACH_SAFE(control, rh, next_instrm, ncontrol) { + TAILQ_REMOVE(rh, control, next_instrm); + control->on_strm_q = 0; + if (control->on_read_q == 0) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } } /* Reassembly free? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -4629,8 +4629,8 @@ sctp_clean_up_stream(struct sctp_tcb *stcb, struct sct * We don't free the address here since all the net's were * freed above. */ - if (ctl->on_read_q == 0) { - sctp_free_a_readq(stcb, ctl); + if (control->on_read_q == 0) { + sctp_free_a_readq(stcb, control); } } } @@ -6801,7 +6801,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) struct sctp_association *asoc; struct sctp_tmit_chunk *chk, *nchk; uint32_t cumulative_tsn_p1; - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; int cnt, strmat; uint32_t gap, i; int fnd = 0; @@ -6818,88 +6818,124 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) cnt = 0; /* Ok that was fun, now we will drain all the inbound streams? */ for (strmat = 0; strmat < asoc->streamincnt; strmat++) { - TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[strmat].inqueue, next_instrm, nctl) { + TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (ctl->on_strm_q != SCTP_ON_ORDERED) { + if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", - ctl, ctl->on_strm_q); + control, control->on_strm_q); } #endif - if (SCTP_TSN_GT(ctl->sinfo_tsn, cumulative_tsn_p1)) { + if (SCTP_TSN_GT(control->sinfo_tsn, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; - SCTP_CALC_TSN_TO_GAP(gap, ctl->sinfo_tsn, asoc->mapping_array_base_tsn); - asoc->size_on_all_streams = sctp_sbspace_sub(asoc->size_on_all_streams, ctl->length); + SCTP_CALC_TSN_TO_GAP(gap, control->sinfo_tsn, asoc->mapping_array_base_tsn); + KASSERT(control->length > 0, ("control has zero length")); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (ctl->on_read_q) { - TAILQ_REMOVE(&stcb->sctp_ep->read_queue, ctl, next); - ctl->on_read_q = 0; + if (control->on_read_q) { + TAILQ_REMOVE(&stcb->sctp_ep->read_queue, control, next); + control->on_read_q = 0; } - TAILQ_REMOVE(&asoc->strmin[strmat].inqueue, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_REMOVE(&asoc->strmin[strmat].inqueue, control, next_instrm); + control->on_strm_q = 0; + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } - sctp_free_remote_addr(ctl->whoFrom); + sctp_free_remote_addr(control->whoFrom); /* Now its reasm? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.tsn, asoc->mapping_array_base_tsn); - asoc->size_on_reasm_queue = sctp_sbspace_sub(asoc->size_on_reasm_queue, chk->send_size); + KASSERT(chk->send_size > 0, ("chunk has zero length")); + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } - sctp_free_a_readq(stcb, ctl); + sctp_free_a_readq(stcb, control); } } - TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[strmat].uno_inqueue, next_instrm, nctl) { + TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].uno_inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (ctl->on_strm_q != SCTP_ON_UNORDERED) { + if (control->on_strm_q != SCTP_ON_UNORDERED) { panic("Huh control: %p on_q: %d -- not unordered?", - ctl, ctl->on_strm_q); + control, control->on_strm_q); } #endif - if (SCTP_TSN_GT(ctl->sinfo_tsn, cumulative_tsn_p1)) { + if (SCTP_TSN_GT(control->sinfo_tsn, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; - SCTP_CALC_TSN_TO_GAP(gap, ctl->sinfo_tsn, asoc->mapping_array_base_tsn); - asoc->size_on_all_streams = sctp_sbspace_sub(asoc->size_on_all_streams, ctl->length); + SCTP_CALC_TSN_TO_GAP(gap, control->sinfo_tsn, asoc->mapping_array_base_tsn); + KASSERT(control->length > 0, ("control has zero length")); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (ctl->on_read_q) { - TAILQ_REMOVE(&stcb->sctp_ep->read_queue, ctl, next); - ctl->on_read_q = 0; + if (control->on_read_q) { + TAILQ_REMOVE(&stcb->sctp_ep->read_queue, control, next); + control->on_read_q = 0; } - TAILQ_REMOVE(&asoc->strmin[strmat].uno_inqueue, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_REMOVE(&asoc->strmin[strmat].uno_inqueue, control, next_instrm); + control->on_strm_q = 0; + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } - sctp_free_remote_addr(ctl->whoFrom); + sctp_free_remote_addr(control->whoFrom); /* Now its reasm? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.tsn, asoc->mapping_array_base_tsn); - asoc->size_on_reasm_queue = sctp_sbspace_sub(asoc->size_on_reasm_queue, chk->send_size); + KASSERT(chk->send_size > 0, ("chunk has zero length")); + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } - sctp_free_a_readq(stcb, ctl); + sctp_free_a_readq(stcb, control); } } } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jul 19 09:59:32 2017 (r321196) +++ head/sys/netinet/sctputil.c Wed Jul 19 12:27:40 2017 (r321197) @@ -2754,9 +2754,9 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_t m_notify); if (control != NULL) { control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, @@ -3039,7 +3039,10 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sctp_m_freem(m_notify); return; } + control->length = SCTP_BUF_LEN(m_notify); control->spec_flags = M_NOTIFICATION; + /* not that we need this */ + control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, @@ -3139,7 +3142,10 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32 sctp_m_freem(m_notify); return; } + control->length = SCTP_BUF_LEN(m_notify); control->spec_flags = M_NOTIFICATION; + /* not that we need this */ + control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); @@ -3240,12 +3246,10 @@ sctp_notify_partial_delivery_indication(struct sctp_tc sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->held_length = 0; - control->length = 0; sb = &stcb->sctp_socket->so_rcv; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m_notify)); @@ -3254,7 +3258,6 @@ sctp_notify_partial_delivery_indication(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } - atomic_add_int(&control->length, SCTP_BUF_LEN(m_notify)); control->end_added = 1; if (stcb->asoc.control_pdapi) TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, stcb->asoc.control_pdapi, control, next); @@ -3349,8 +3352,8 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3456,8 +3459,8 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, ui sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3506,8 +3509,8 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, ui sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3571,8 +3574,8 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3627,9 +3630,9 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16 m_notify); if (control != NULL) { control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, From owner-svn-src-all@freebsd.org Wed Jul 19 13:11: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 43A21C7CFDF; Wed, 19 Jul 2017 13:11:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113327EA18; Wed, 19 Jul 2017 13:11:36 +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 v6JDBal4037896; Wed, 19 Jul 2017 13:11:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JDBZo3037892; Wed, 19 Jul 2017 13:11:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191311.v6JDBZo3037892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 13:11:35 +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: r321198 - in stable/10: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb X-SVN-Commit-Revision: 321198 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 13:11:37 -0000 Author: emaste Date: Wed Jul 19 13:11:35 2017 New Revision: 321198 URL: https://svnweb.freebsd.org/changeset/base/321198 Log: MFC r303043: Increase vt(4) framebuffer maximum size PR: 210382 Relnotes: Yes Modified: stable/10/share/man/man4/vt.4 stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/share/man/man4/vt.4 Wed Jul 19 13:11:35 2017 (r321198) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2016 +.Dd July 19, 2017 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -36,8 +36,8 @@ .Cd "options VT_MAXWINDOWS=N" .Cd "options VT_ALT_TO_ESC_HACK=1" .Cd "options VT_TWOBUTTON_MOUSE" -.Cd "options VT_FB_DEFAULT_WIDTH=X" -.Cd "options VT_FB_DEFAULT_HEIGHT=Y" +.Cd "options VT_FB_MAX_WIDTH=X" +.Cd "options VT_FB_MAX_HEIGHT=Y" .Cd "options SC_NO_CUTPASTE" .Cd "device vt" .Pp Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 19 13:11:35 2017 (r321198) @@ -402,10 +402,10 @@ vt_fb_init(struct vt_device *vd) int err; info = vd->vd_softc; - vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height); margin = (info->fb_height - vd->vd_height) >> 1; vd->vd_transpose = margin * info->fb_stride; - vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + vd->vd_width = MIN(VT_FB_MAX_WIDTH, info->fb_width); margin = (info->fb_width - vd->vd_width) >> 1; vd->vd_transpose += margin * (info->fb_bpp / NBBY); Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/vt.h Wed Jul 19 13:11:35 2017 (r321198) @@ -365,11 +365,11 @@ void vt_upgrade(struct vt_device *vd); #define PIXEL_WIDTH(w) ((w) / 8) #define PIXEL_HEIGHT(h) ((h) / 16) -#ifndef VT_FB_DEFAULT_WIDTH -#define VT_FB_DEFAULT_WIDTH 2048 +#ifndef VT_FB_MAX_WIDTH +#define VT_FB_MAX_WIDTH 4096 #endif -#ifndef VT_FB_DEFAULT_HEIGHT -#define VT_FB_DEFAULT_HEIGHT 1200 +#ifndef VT_FB_MAX_HEIGHT +#define VT_FB_MAX_HEIGHT 2400 #endif /* name argument is not used yet. */ Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/vt_core.c Wed Jul 19 13:11:35 2017 (r321198) @@ -172,8 +172,8 @@ static void vt_resume_handler(void *priv); SET_DECLARE(vt_drv_set, struct vt_driver); -#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) -#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH)) static struct terminal vt_consterm; static struct vt_window vt_conswindow; From owner-svn-src-all@freebsd.org Wed Jul 19 13:28: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 BB6EDC7D4E0; Wed, 19 Jul 2017 13:28:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9D47F2E3; Wed, 19 Jul 2017 13:28:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JDSPO3044981; Wed, 19 Jul 2017 13:28:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JDSPil044980; Wed, 19 Jul 2017 13:28:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191328.v6JDSPil044980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 13:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321199 - stable/11/sys/dev/vt X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/vt X-SVN-Commit-Revision: 321199 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 13:28:26 -0000 Author: emaste Date: Wed Jul 19 13:28:25 2017 New Revision: 321199 URL: https://svnweb.freebsd.org/changeset/base/321199 Log: MFC r313547, r313777: fix mouse selection when vt(4) scrolls r313547 (ray, submitted by hselasky): o Reset mouse selection when new lines reach selection lines. o Fix how selection handled on display. r313777 (rpokala): Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. PR: 211922 Relnotes: Yes Modified: stable/11/sys/dev/vt/vt_buf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_buf.c ============================================================================== --- stable/11/sys/dev/vt/vt_buf.c Wed Jul 19 13:11:35 2017 (r321198) +++ stable/11/sys/dev/vt/vt_buf.c Wed Jul 19 13:28:25 2017 (r321199) @@ -54,6 +54,11 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "vt buffer"); (d).tp_row = (s).tp_row; \ } while (0) +#ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); +static int vtbuf_wth(const struct vt_buf *vb, int row); +static int vtbuf_in_this_range(int begin, int test, int end, int sz); +#endif /* * line4 @@ -122,6 +127,9 @@ vthistory_seek(struct vt_buf *vb, int offset, int when void vthistory_addlines(struct vt_buf *vb, int offset) { +#ifndef SC_NO_CUTPASTE + int cur, sz; +#endif vb->vb_curroffset += offset; if (vb->vb_curroffset < 0) @@ -132,6 +140,17 @@ vthistory_addlines(struct vt_buf *vb, int offset) if ((vb->vb_flags & VBF_SCROLL) == 0) { vb->vb_roffset = vb->vb_curroffset; } + +#ifndef SC_NO_CUTPASTE + sz = vb->vb_history_size; + cur = vb->vb_roffset + vb->vb_scr_size.tp_row + sz - 1; + if (vtbuf_in_this_range(cur, vb->vb_mark_start.tp_row, cur + offset, sz) || + vtbuf_in_this_range(cur, vb->vb_mark_end.tp_row, cur + offset, sz)) { + /* clear screen selection */ + vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row; + vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col; + } +#endif } void @@ -142,15 +161,6 @@ vthistory_getpos(const struct vt_buf *vb, unsigned int } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ -/* Translate current view row number to history row. */ -static int -vtbuf_wth(struct vt_buf *vb, int row) -{ - - return ((vb->vb_roffset + row) % vb->vb_history_size); -} -#endif - /* Translate history row to current view row number. */ static int vtbuf_htw(const struct vt_buf *vb, int row) @@ -166,36 +176,78 @@ vtbuf_htw(const struct vt_buf *vb, int row) vb->vb_history_size); } +/* Translate current view row number to history row. */ +static int +vtbuf_wth(const struct vt_buf *vb, int row) +{ + + return ((vb->vb_roffset + row) % vb->vb_history_size); +} + +/* + * Test if an index in a circular buffer is within a range. + * + * begin - start index + * end - end index + * test - test index + * sz - size of circular buffer when it turns over + */ +static int +vtbuf_in_this_range(int begin, int test, int end, int sz) +{ + + begin %= sz; + end %= sz; + + /* check for inversion */ + if (begin > end) + return (test >= begin || test < end); + else + return (test >= begin && test < end); +} +#endif + int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) { - int sc, sr, ec, er, tmp; +#ifndef SC_NO_CUTPASTE + int sc, sr, sz, ec, er, tmp; +#endif if ((vb->vb_flags & (VBF_CURSOR|VBF_SCROLL)) == VBF_CURSOR && (vb->vb_cursor.tp_row == row) && (vb->vb_cursor.tp_col == col)) return (1); +#ifndef SC_NO_CUTPASTE /* Mark cut/paste region. */ + if (vb->vb_mark_start.tp_col == vb->vb_mark_end.tp_col && + vb->vb_mark_start.tp_row == vb->vb_mark_end.tp_row) + return (0); - /* - * Luckily screen view is not like circular buffer, so we will - * calculate in screen coordinates. Translate first. - */ sc = vb->vb_mark_start.tp_col; - sr = vtbuf_htw(vb, vb->vb_mark_start.tp_row); + sr = vb->vb_mark_start.tp_row; ec = vb->vb_mark_end.tp_col; - er = vtbuf_htw(vb, vb->vb_mark_end.tp_row); + er = vb->vb_mark_end.tp_row; + /* + * Information about if the selection was made bottom-top or + * top-bottom is lost due to modulo arithmetics and needs to + * be recovered: + */ + sz = vb->vb_history_size; + tmp = (sz + er - sr) % sz; + row = vtbuf_wth(vb, row); - /* Swap start and end if start > end. */ - if (POS_INDEX(sc, sr) > POS_INDEX(ec, er)) { + /* Swap start and end if start > end */ + if ((2 * tmp) > sz || (tmp == 0 && sc > ec)) { tmp = sc; sc = ec; ec = tmp; tmp = sr; sr = er; er = tmp; } - if ((POS_INDEX(sc, sr) <= POS_INDEX(col, row)) && - (POS_INDEX(col, row) < POS_INDEX(ec, er))) + if (vtbuf_in_this_range(POS_INDEX(sc, sr), POS_INDEX(col, row), + POS_INDEX(ec, er), POS_INDEX(0, sz))) return (1); +#endif return (0); } @@ -627,8 +679,8 @@ vtbuf_flush_mark(struct vt_buf *vb) int s, e; /* Notify renderer to update marked region. */ - if (vb->vb_mark_start.tp_col || vb->vb_mark_end.tp_col || - vb->vb_mark_start.tp_row || vb->vb_mark_end.tp_row) { + if ((vb->vb_mark_start.tp_col != vb->vb_mark_end.tp_col) || + (vb->vb_mark_start.tp_row != vb->vb_mark_end.tp_row)) { s = vtbuf_htw(vb, vb->vb_mark_start.tp_row); e = vtbuf_htw(vb, vb->vb_mark_end.tp_row); From owner-svn-src-all@freebsd.org Wed Jul 19 13:32: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 4834FC7D7ED; Wed, 19 Jul 2017 13:32:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212037F759; Wed, 19 Jul 2017 13:32:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JDW8kG047500; Wed, 19 Jul 2017 13:32:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JDW8eK047499; Wed, 19 Jul 2017 13:32:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191332.v6JDW8eK047499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 13:32: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: r321200 - stable/10/sys/dev/vt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/vt X-SVN-Commit-Revision: 321200 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 13:32:09 -0000 Author: emaste Date: Wed Jul 19 13:32:08 2017 New Revision: 321200 URL: https://svnweb.freebsd.org/changeset/base/321200 Log: MFC r313547, r313777: fix mouse selection when vt(4) scrolls r313547 (ray, submitted by hselasky): o Reset mouse selection when new lines reach selection lines. o Fix how selection handled on display. r313777 (rpokala): Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. PR: 211922 Relnotes: Yes Modified: stable/10/sys/dev/vt/vt_buf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Wed Jul 19 13:28:25 2017 (r321199) +++ stable/10/sys/dev/vt/vt_buf.c Wed Jul 19 13:32:08 2017 (r321200) @@ -54,6 +54,11 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "vt buffer"); (d).tp_row = (s).tp_row; \ } while (0) +#ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); +static int vtbuf_wth(const struct vt_buf *vb, int row); +static int vtbuf_in_this_range(int begin, int test, int end, int sz); +#endif /* * line4 @@ -122,6 +127,9 @@ vthistory_seek(struct vt_buf *vb, int offset, int when void vthistory_addlines(struct vt_buf *vb, int offset) { +#ifndef SC_NO_CUTPASTE + int cur, sz; +#endif vb->vb_curroffset += offset; if (vb->vb_curroffset < 0) @@ -132,6 +140,17 @@ vthistory_addlines(struct vt_buf *vb, int offset) if ((vb->vb_flags & VBF_SCROLL) == 0) { vb->vb_roffset = vb->vb_curroffset; } + +#ifndef SC_NO_CUTPASTE + sz = vb->vb_history_size; + cur = vb->vb_roffset + vb->vb_scr_size.tp_row + sz - 1; + if (vtbuf_in_this_range(cur, vb->vb_mark_start.tp_row, cur + offset, sz) || + vtbuf_in_this_range(cur, vb->vb_mark_end.tp_row, cur + offset, sz)) { + /* clear screen selection */ + vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row; + vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col; + } +#endif } void @@ -142,15 +161,6 @@ vthistory_getpos(const struct vt_buf *vb, unsigned int } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ -/* Translate current view row number to history row. */ -static int -vtbuf_wth(struct vt_buf *vb, int row) -{ - - return ((vb->vb_roffset + row) % vb->vb_history_size); -} -#endif - /* Translate history row to current view row number. */ static int vtbuf_htw(const struct vt_buf *vb, int row) @@ -166,36 +176,78 @@ vtbuf_htw(const struct vt_buf *vb, int row) vb->vb_history_size); } +/* Translate current view row number to history row. */ +static int +vtbuf_wth(const struct vt_buf *vb, int row) +{ + + return ((vb->vb_roffset + row) % vb->vb_history_size); +} + +/* + * Test if an index in a circular buffer is within a range. + * + * begin - start index + * end - end index + * test - test index + * sz - size of circular buffer when it turns over + */ +static int +vtbuf_in_this_range(int begin, int test, int end, int sz) +{ + + begin %= sz; + end %= sz; + + /* check for inversion */ + if (begin > end) + return (test >= begin || test < end); + else + return (test >= begin && test < end); +} +#endif + int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) { - int sc, sr, ec, er, tmp; +#ifndef SC_NO_CUTPASTE + int sc, sr, sz, ec, er, tmp; +#endif if ((vb->vb_flags & (VBF_CURSOR|VBF_SCROLL)) == VBF_CURSOR && (vb->vb_cursor.tp_row == row) && (vb->vb_cursor.tp_col == col)) return (1); +#ifndef SC_NO_CUTPASTE /* Mark cut/paste region. */ + if (vb->vb_mark_start.tp_col == vb->vb_mark_end.tp_col && + vb->vb_mark_start.tp_row == vb->vb_mark_end.tp_row) + return (0); - /* - * Luckily screen view is not like circular buffer, so we will - * calculate in screen coordinates. Translate first. - */ sc = vb->vb_mark_start.tp_col; - sr = vtbuf_htw(vb, vb->vb_mark_start.tp_row); + sr = vb->vb_mark_start.tp_row; ec = vb->vb_mark_end.tp_col; - er = vtbuf_htw(vb, vb->vb_mark_end.tp_row); + er = vb->vb_mark_end.tp_row; + /* + * Information about if the selection was made bottom-top or + * top-bottom is lost due to modulo arithmetics and needs to + * be recovered: + */ + sz = vb->vb_history_size; + tmp = (sz + er - sr) % sz; + row = vtbuf_wth(vb, row); - /* Swap start and end if start > end. */ - if (POS_INDEX(sc, sr) > POS_INDEX(ec, er)) { + /* Swap start and end if start > end */ + if ((2 * tmp) > sz || (tmp == 0 && sc > ec)) { tmp = sc; sc = ec; ec = tmp; tmp = sr; sr = er; er = tmp; } - if ((POS_INDEX(sc, sr) <= POS_INDEX(col, row)) && - (POS_INDEX(col, row) < POS_INDEX(ec, er))) + if (vtbuf_in_this_range(POS_INDEX(sc, sr), POS_INDEX(col, row), + POS_INDEX(ec, er), POS_INDEX(0, sz))) return (1); +#endif return (0); } @@ -627,8 +679,8 @@ vtbuf_flush_mark(struct vt_buf *vb) int s, e; /* Notify renderer to update marked region. */ - if (vb->vb_mark_start.tp_col || vb->vb_mark_end.tp_col || - vb->vb_mark_start.tp_row || vb->vb_mark_end.tp_row) { + if ((vb->vb_mark_start.tp_col != vb->vb_mark_end.tp_col) || + (vb->vb_mark_start.tp_row != vb->vb_mark_end.tp_row)) { s = vtbuf_htw(vb, vb->vb_mark_start.tp_row); e = vtbuf_htw(vb, vb->vb_mark_end.tp_row); From owner-svn-src-all@freebsd.org Wed Jul 19 14:07: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 9F896C7E391; Wed, 19 Jul 2017 14:07:39 +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 6BF83809FB; Wed, 19 Jul 2017 14:07:39 +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 v6JE7cvm061103; Wed, 19 Jul 2017 14:07:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JE7cu3061102; Wed, 19 Jul 2017 14:07:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191407.v6JE7cu3061102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 14:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321201 - head/lib/libutil/tests X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libutil/tests X-SVN-Commit-Revision: 321201 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 14:07:39 -0000 Author: emaste Date: Wed Jul 19 14:07:38 2017 New Revision: 321201 URL: https://svnweb.freebsd.org/changeset/base/321201 Log: enable pidfile tests on arm64 Pidfile tests were disabled on arm64 (in r286863) because they hung. They have been fixed (r306098) and so can be enabled now. PR: 202304 Sponsored by: The FreeBSD Foundation Modified: head/lib/libutil/tests/Makefile Modified: head/lib/libutil/tests/Makefile ============================================================================== --- head/lib/libutil/tests/Makefile Wed Jul 19 13:32:08 2017 (r321200) +++ head/lib/libutil/tests/Makefile Wed Jul 19 14:07:38 2017 (r321201) @@ -3,9 +3,7 @@ TAP_TESTS_C+= flopen_test TAP_TESTS_C+= grp_test TAP_TESTS_C+= humanize_number_test -.if ${MACHINE_CPUARCH} != "aarch64" # PR202304: pidfile_test hangs on arm64 TAP_TESTS_C+= pidfile_test -.endif TAP_TESTS_C+= trimdomain_test TAP_TESTS_C+= trimdomain-nodomain_test From owner-svn-src-all@freebsd.org Wed Jul 19 14:15: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 94A84C7E683; Wed, 19 Jul 2017 14:15:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54B6C80FA9; Wed, 19 Jul 2017 14:15:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JEFnXK065208; Wed, 19 Jul 2017 14:15:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JEFnku065206; Wed, 19 Jul 2017 14:15:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191415.v6JEFnku065206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 14:15:49 +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: r321202 - in stable/10/usr.sbin/bsdinstall: partedit scripts X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/10/usr.sbin/bsdinstall: partedit scripts X-SVN-Commit-Revision: 321202 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 14:15:50 -0000 Author: emaste Date: Wed Jul 19 14:15:49 2017 New Revision: 321202 URL: https://svnweb.freebsd.org/changeset/base/321202 Log: MFC r302145: bsdinstall: increase EFI partition size to 200MB A larger EFI file system size will facilitate multi-boot configurations and the installation other EFI applications like firmware update tools. 200MB matches OS X. Note that this changes only the partition size, not the file system that bsdinstall places there. We need to do both, but as the partition size is difficult to adjust later make this change for now so that at least systems installed with FreeBSD 11.0 have a partition layout with room to grow. Also merge part of r320007: - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86 - increase ZFS EFI partition to 200M PR: 201898 Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Jul 19 14:07:38 2017 (r321201) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Jul 19 14:15:49 2017 (r321202) @@ -32,6 +32,10 @@ #include "partedit.h" +/* EFI partition size in bytes */ +#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) +#define EFI_BOOTPART_PATH "/boot/boot1.efifat" + static const char * x86_bootmethod(void) { @@ -96,7 +100,7 @@ bootpart_size(const char *scheme) if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else - return (800*1024); + return (EFI_BOOTPART_SIZE); return (0); } @@ -134,7 +138,7 @@ partcode_path(const char *part_type, const char *fs_ty if (strcmp(part_type, "GPT") == 0) { if (strcmp(x86_bootmethod(), "UEFI") == 0) - return ("/boot/boot1.efifat"); + return (EFI_BOOTPART_PATH); else if (strcmp(fs_type, "zfs") == 0) return ("/boot/gptzfsboot"); else Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jul 19 14:07:38 2017 (r321201) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jul 19 14:15:49 2017 (r321202) @@ -816,7 +816,7 @@ zfs_create_diskpart() if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" efiboot$index efi 800k $disk || + "$align_small" efiboot$index efi 200M $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" \ /boot/boot1.efifat 1 $disk || From owner-svn-src-all@freebsd.org Wed Jul 19 14:21: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 3025EC7E902; Wed, 19 Jul 2017 14:21:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3BFA81480; Wed, 19 Jul 2017 14:21:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JELUDi066368; Wed, 19 Jul 2017 14:21:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JELUdM066366; Wed, 19 Jul 2017 14:21:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201707191421.v6JELUdM066366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 19 Jul 2017 14:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321203 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 321203 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 14:21:31 -0000 Author: ae Date: Wed Jul 19 14:21:29 2017 New Revision: 321203 URL: https://svnweb.freebsd.org/changeset/base/321203 Log: Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver. Tested by: David Miguel Almas MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11478 Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Wed Jul 19 14:15:49 2017 (r321202) +++ head/sys/dev/bxe/bxe.c Wed Jul 19 14:21:29 2017 (r321203) @@ -167,6 +167,12 @@ static struct bxe_device_type bxe_devs[] = { "QLogic NetXtreme II BCM57840 4x10GbE" }, { + QLOGIC_VENDORID, + CHIP_NUM_57840_4_10, + PCI_ANY_ID, PCI_ANY_ID, + "QLogic NetXtreme II BCM57840 4x10GbE" + }, + { BRCM_VENDORID, CHIP_NUM_57840_2_20, PCI_ANY_ID, PCI_ANY_ID, Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Wed Jul 19 14:15:49 2017 (r321202) +++ head/sys/dev/bxe/bxe.h Wed Jul 19 14:21:29 2017 (r321203) @@ -168,6 +168,7 @@ int bxe_ilog2(int x) #include "ecore_sp.h" #define BRCM_VENDORID 0x14e4 +#define QLOGIC_VENDORID 0x1077 #define PCI_ANY_ID (uint16_t)(~0U) struct bxe_device_type From owner-svn-src-all@freebsd.org Wed Jul 19 14:29: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 5EBC2C7EAA6; Wed, 19 Jul 2017 14:29:00 +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 079CD817FC; Wed, 19 Jul 2017 14:28:59 +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 v6JESxBq069665; Wed, 19 Jul 2017 14:28:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JESw8k069658; Wed, 19 Jul 2017 14:28:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707191428.v6JESw8k069658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 19 Jul 2017 14:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321204 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 321204 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 14:29:00 -0000 Author: tuexen Date: Wed Jul 19 14:28:58 2017 New Revision: 321204 URL: https://svnweb.freebsd.org/changeset/base/321204 Log: Use memset/memcpy instead of bzero/bcopy. Just use one variant instead of both. Use the memset/memcpy ones since they cause less problems in crossplatform deployment. MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctp_asconf.c Wed Jul 19 14:28:58 2017 (r321204) @@ -182,7 +182,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; @@ -205,7 +205,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_port = stcb->rport; @@ -332,7 +332,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; @@ -352,7 +352,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_port = stcb->rport; @@ -461,7 +461,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src, } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_addr.s_addr = v4addr->addr; @@ -479,7 +479,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src, } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); memcpy((caddr_t)&sin6->sin6_addr, v6addr->addr, @@ -2604,7 +2604,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen SCTP_BUF_LEN(m_asconf_chk) = sizeof(struct sctp_asconf_chunk); SCTP_BUF_LEN(m_asconf) = 0; acp = mtod(m_asconf_chk, struct sctp_asconf_chunk *); - bzero(acp, sizeof(struct sctp_asconf_chunk)); + memset(acp, 0, sizeof(struct sctp_asconf_chunk)); /* save pointers to lookup address and asconf params */ lookup_ptr = (caddr_t)(acp + 1); /* after the header */ ptr = mtod(m_asconf, caddr_t); /* beginning of cluster */ @@ -2737,7 +2737,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen /* XXX for now, we send a IPv4 address of 0.0.0.0 */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); - bzero(lookup->addr, sizeof(struct in_addr)); + memset(lookup->addr, 0, sizeof(struct in_addr)); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)); } } Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctp_auth.c Wed Jul 19 14:28:58 2017 (r321204) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); void sctp_clear_chunklist(sctp_auth_chklist_t *chklist) { - bzero(chklist, sizeof(*chklist)); + memset(chklist, 0, sizeof(*chklist)); /* chklist->num_chunks = 0; */ } @@ -92,7 +92,7 @@ sctp_copy_chunklist(sctp_auth_chklist_t *list) if (new_list == NULL) return (NULL); /* copy it */ - bcopy(list, new_list, sizeof(*new_list)); + memcpy(new_list, list, sizeof(*new_list)); return (new_list); } @@ -338,7 +338,7 @@ sctp_set_key(uint8_t *key, uint32_t keylen) /* out of memory */ return (NULL); } - bcopy(key, new_key->key, keylen); + memcpy(new_key->key, key, keylen); return (new_key); } @@ -427,28 +427,28 @@ sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key if (sctp_compare_key(key1, key2) <= 0) { /* key is shared + key1 + key2 */ if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); + memcpy(key_ptr, shared->key, shared->keylen); key_ptr += shared->keylen; } if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); + memcpy(key_ptr, key1->key, key1->keylen); key_ptr += key1->keylen; } if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); + memcpy(key_ptr, key2->key, key2->keylen); } } else { /* key is shared + key2 + key1 */ if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); + memcpy(key_ptr, shared->key, shared->keylen); key_ptr += shared->keylen; } if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); + memcpy(key_ptr, key2->key, key2->keylen); key_ptr += key2->keylen; } if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); + memcpy(key_ptr, key1->key, key1->keylen); } } return (new_key); @@ -764,7 +764,7 @@ sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t for (i = 0; i < list->num_algo; i++) { hmac_id = htons(list->hmac[i]); - bcopy(&hmac_id, ptr, sizeof(hmac_id)); + memcpy(ptr, &hmac_id, sizeof(hmac_id)); ptr += sizeof(hmac_id); } return (list->num_algo * sizeof(hmac_id)); @@ -795,7 +795,7 @@ sctp_alloc_authinfo(void) /* out of memory */ return (NULL); } - bzero(new_authinfo, sizeof(*new_authinfo)); + memset(new_authinfo, 0, sizeof(*new_authinfo)); return (new_authinfo); } @@ -953,10 +953,10 @@ sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t k key = temp; } /* initialize the inner/outer pads with the key and "append" zeroes */ - bzero(ipad, blocklen); - bzero(opad, blocklen); - bcopy(key, ipad, keylen); - bcopy(key, opad, keylen); + memset(ipad, 0, blocklen); + memset(opad, 0, blocklen); + memcpy(ipad, key, keylen); + memcpy(opad, key, keylen); /* XOR the key with ipad and opad values */ for (i = 0; i < blocklen; i++) { @@ -1013,10 +1013,10 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t key = temp; } /* initialize the inner/outer pads with the key and "append" zeroes */ - bzero(ipad, blocklen); - bzero(opad, blocklen); - bcopy(key, ipad, keylen); - bcopy(key, opad, keylen); + memset(ipad, 0, blocklen); + memset(opad, 0, blocklen); + memcpy(ipad, key, keylen); + memcpy(opad, key, keylen); /* XOR the key with ipad and opad values */ for (i = 0; i < blocklen; i++) { @@ -1124,7 +1124,7 @@ sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, sctp_hmac_final(hmac_algo, &ctx, temp); /* save the hashed key as the new key */ key->keylen = digestlen; - bcopy(temp, key->key, key->keylen); + memcpy(key->key, temp, key->keylen); } return (sctp_hmac(hmac_algo, key->key, key->keylen, text, textlen, digest)); @@ -1158,7 +1158,7 @@ sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *ke sctp_hmac_final(hmac_algo, &ctx, temp); /* save the hashed key as the new key */ key->keylen = digestlen; - bcopy(temp, key->key, key->keylen); + memcpy(key->key, temp, key->keylen); } return (sctp_hmac_m(hmac_algo, key->key, key->keylen, m, m_offset, digest, 0)); } @@ -1501,17 +1501,17 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str /* copy in the RANDOM */ if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; - bcopy(p_random, new_key->key, keylen); + memcpy(new_key->key, p_random, keylen); } /* append in the AUTH chunks */ if (chunks != NULL) { - bcopy(chunks, new_key->key + keylen, + memcpy(new_key->key + keylen, chunks, sizeof(*chunks) + num_chunks); keylen += sizeof(*chunks) + num_chunks; } /* append in the HMACs */ if (hmacs != NULL) { - bcopy(hmacs, new_key->key + keylen, + memcpy(new_key->key + keylen, hmacs, sizeof(*hmacs) + hmacs_len); } } @@ -1550,7 +1550,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_ /* zero the digest + chunk padding */ digestlen = sctp_get_hmac_digest_len(stcb->asoc.peer_hmac_id); - bzero(auth->hmac, SCTP_SIZE32(digestlen)); + memset(auth->hmac, 0, SCTP_SIZE32(digestlen)); /* is the desired key cached? */ if ((keyid != stcb->asoc.authinfo.assoc_keyid) || @@ -1588,7 +1588,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_ static void -sctp_bzero_m(struct mbuf *m, uint32_t m_offset, uint32_t size) +sctp_zero_m(struct mbuf *m, uint32_t m_offset, uint32_t size) { struct mbuf *m_tmp; uint8_t *data; @@ -1607,10 +1607,10 @@ sctp_bzero_m(struct mbuf *m, uint32_t m_offset, uint32 while ((m_tmp != NULL) && (size > 0)) { data = mtod(m_tmp, uint8_t *)+m_offset; if (size > (uint32_t)SCTP_BUF_LEN(m_tmp)) { - bzero(data, SCTP_BUF_LEN(m_tmp)); + memset(data, 0, SCTP_BUF_LEN(m_tmp)); size -= SCTP_BUF_LEN(m_tmp); } else { - bzero(data, size); + memset(data, 0, size); size = 0; } /* clear the offset since it's only for the first mbuf */ @@ -1727,8 +1727,8 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_au return (-1); } /* save a copy of the digest, zero the pseudo header, and validate */ - bcopy(auth->hmac, digest, digestlen); - sctp_bzero_m(m, offset + sizeof(*auth), SCTP_SIZE32(digestlen)); + memcpy(digest, auth->hmac, digestlen); + sctp_zero_m(m, offset + sizeof(*auth), SCTP_SIZE32(digestlen)); (void)sctp_compute_hmac_m(hmac_id, stcb->asoc.authinfo.recv_key, m, offset, computed_digest); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctp_output.c Wed Jul 19 14:28:58 2017 (r321204) @@ -4404,7 +4404,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, * we can try their selection but it may not be * bound. */ - bzero(&lsa6_tmp, sizeof(lsa6_tmp)); + memset(&lsa6_tmp, 0, sizeof(lsa6_tmp)); lsa6_tmp.sin6_family = AF_INET6; lsa6_tmp.sin6_len = sizeof(lsa6_tmp); lsa6 = &lsa6_tmp; @@ -4489,7 +4489,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, * XXX: sa6 may not have a valid sin6_scope_id in * the non-SCOPEDROUTING case. */ - bzero(&lsa6_storage, sizeof(lsa6_storage)); + memset(&lsa6_storage, 0, sizeof(lsa6_storage)); lsa6_storage.sin6_family = AF_INET6; lsa6_storage.sin6_len = sizeof(lsa6_storage); lsa6_storage.sin6_addr = lsa6->sin6_addr; @@ -13730,7 +13730,7 @@ sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_en SCTP_BUF_RESV_UF(m_auth, SCTP_MIN_OVERHEAD); /* fill in the AUTH chunk details */ auth = mtod(m_auth, struct sctp_auth_chunk *); - bzero(auth, sizeof(*auth)); + memset(auth, 0, sizeof(*auth)); auth->ch.chunk_type = SCTP_AUTHENTICATION; auth->ch.chunk_flags = 0; chunk_len = sizeof(*auth) + Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctp_pcb.c Wed Jul 19 14:28:58 2017 (r321204) @@ -702,7 +702,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 return (NULL); } SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_ADD_IP_ADDRESS; @@ -811,7 +811,7 @@ out_now: return; } SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_DEL_IP_ADDRESS; @@ -2429,7 +2429,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) return (ENOBUFS); } /* zap it */ - bzero(inp, sizeof(*inp)); + memset(inp, 0, sizeof(*inp)); /* bump generations */ /* setup socket pointers */ @@ -2715,7 +2715,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, st continue; } SCTP_INCR_LADDR_COUNT(); - bzero(laddr, sizeof(*laddr)); + memset(laddr, 0, sizeof(*laddr)); (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); laddr->ifa = oladdr->ifa; atomic_add_int(&laddr->ifa->refcount, 1); @@ -2765,7 +2765,7 @@ sctp_insert_laddr(struct sctpladdr *list, struct sctp_ return (EINVAL); } SCTP_INCR_LADDR_COUNT(); - bzero(laddr, sizeof(*laddr)); + memset(laddr, 0, sizeof(*laddr)); (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); laddr->ifa = ifa; laddr->action = act; @@ -3766,7 +3766,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc /* Invalid address */ return (-1); } - /* zero out the bzero area */ + /* zero out the zero area */ memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); /* assure len is set */ @@ -3849,7 +3849,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc return (-1); } SCTP_INCR_RADDR_COUNT(); - bzero(net, sizeof(struct sctp_nets)); + memset(net, 0, sizeof(struct sctp_nets)); (void)SCTP_GETTIME_TIMEVAL(&net->start_time); memcpy(&net->ro._l_addr, newaddr, newaddr->sa_len); switch (newaddr->sa_family) { @@ -4285,7 +4285,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd } SCTP_INCR_ASOC_COUNT(); - bzero(stcb, sizeof(*stcb)); + memset(stcb, 0, sizeof(*stcb)); asoc = &stcb->asoc; asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); @@ -5731,7 +5731,7 @@ sctp_pcb_init() SCTP_BASE_VAR(sctp_pcb_initialized) = 1; #if defined(SCTP_LOCAL_TRACE_BUF) - bzero(&SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log)); + memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, @@ -5740,11 +5740,11 @@ sctp_pcb_init() #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * (mp_maxid + 1))); + memset(SCTP_BASE_STATS, 0, sizeof(struct sctpstat) * (mp_maxid + 1)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t)tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t)tv.tv_usec; #else - bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); + memset(&SCTP_BASE_STATS, 0, sizeof(struct sctpstat)); SCTP_BASE_STAT(sctps_discontinuitytime).tv_sec = (uint32_t)tv.tv_sec; SCTP_BASE_STAT(sctps_discontinuitytime).tv_usec = (uint32_t)tv.tv_usec; #endif @@ -6656,17 +6656,17 @@ next_param: /* copy in the RANDOM */ if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; - bcopy(p_random, new_key->key, keylen); + memcpy(new_key->key, p_random, keylen); } /* append in the AUTH chunks */ if (chunks != NULL) { - bcopy(chunks, new_key->key + keylen, + memcpy(new_key->key + keylen, chunks, sizeof(*chunks) + num_chunks); keylen += sizeof(*chunks) + num_chunks; } /* append in the HMACs */ if (hmacs != NULL) { - bcopy(hmacs, new_key->key + keylen, + memcpy(new_key->key + keylen, hmacs, sizeof(*hmacs) + hmacs_len); } } else { Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctp_usrreq.c Wed Jul 19 14:28:58 2017 (r321204) @@ -85,7 +85,7 @@ sctp_init(void) #if defined(SCTP_PACKET_LOGGING) SCTP_BASE_VAR(packet_log_writers) = 0; SCTP_BASE_VAR(packet_log_end) = 0; - bzero(&SCTP_BASE_VAR(packet_log_buffer), SCTP_PACKET_LOG_SIZE); + memset(&SCTP_BASE_VAR(packet_log_buffer), 0, SCTP_PACKET_LOG_SIZE); #endif } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet/sctputil.c Wed Jul 19 14:28:58 2017 (r321204) @@ -2593,7 +2593,7 @@ sctp_m_getptr(struct mbuf *m, int off, int len, uint8_ /* else, it spans more than one mbuf, so save a temp copy... */ while ((m != NULL) && (len > 0)) { count = min(SCTP_BUF_LEN(m) - off, len); - bcopy(mtod(m, caddr_t)+off, ptr, count); + memcpy(ptr, mtod(m, caddr_t)+off, count); len -= count; ptr += count; off = 0; @@ -6167,7 +6167,7 @@ sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t } /* Now incr the count and int wi structure */ SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = ifa; wi->action = SCTP_SET_PRIM_ADDR; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed Jul 19 14:21:29 2017 (r321203) +++ head/sys/netinet6/sctp6_usrreq.c Wed Jul 19 14:28:58 2017 (r321204) @@ -305,7 +305,7 @@ sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void return; } /* Copy out the port numbers and the verification tag. */ - bzero(&sh, sizeof(sh)); + memset(&sh, 0, sizeof(sh)); m_copydata(ip6cp->ip6c_m, ip6cp->ip6c_off, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t), From owner-svn-src-all@freebsd.org Wed Jul 19 15:12: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 D6109C7F5A9; Wed, 19 Jul 2017 15:12:24 +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 A586682E07; Wed, 19 Jul 2017 15:12:24 +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 v6JFCNP5090057; Wed, 19 Jul 2017 15:12:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFCN4W090056; Wed, 19 Jul 2017 15:12:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707191512.v6JFCN4W090056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 19 Jul 2017 15:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321205 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321205 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 15:12:24 -0000 Author: tuexen Date: Wed Jul 19 15:12:23 2017 New Revision: 321205 URL: https://svnweb.freebsd.org/changeset/base/321205 Log: Avoid shadowed variables. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jul 19 14:28:58 2017 (r321204) +++ head/sys/netinet/sctp_indata.c Wed Jul 19 15:12:23 2017 (r321205) @@ -2071,12 +2071,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc return (0); } if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { - struct mbuf *m; + struct mbuf *mm; control->data = dmbuf; - m = control->data; - for (m = control->data; m; m = m->m_next) { - control->length += SCTP_BUF_LEN(m); + mm = control->data; + for (mm = control->data; mm; mm = mm->m_next) { + control->length += SCTP_BUF_LEN(mm); } control->tail_mbuf = NULL; control->end_added = 1; From owner-svn-src-all@freebsd.org Wed Jul 19 15:22: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 1448CC7FB8B; Wed, 19 Jul 2017 15:22:12 +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 D7FAC83AEF; Wed, 19 Jul 2017 15:22:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JFMBQJ093953; Wed, 19 Jul 2017 15:22:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFMB3h093952; Wed, 19 Jul 2017 15:22:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707191522.v6JFMB3h093952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 19 Jul 2017 15:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321206 - 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: 321206 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 15:22:12 -0000 Author: asomers Date: Wed Jul 19 15:22:10 2017 New Revision: 321206 URL: https://svnweb.freebsd.org/changeset/base/321206 Log: Remove dead code that was killed by r320975 Reported by: Coverity CID: 1377977 MFC after: 15 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 Wed Jul 19 15:12:23 2017 (r321205) +++ head/tests/sys/aio/aio_test.c Wed Jul 19 15:22:10 2017 (r321206) @@ -158,15 +158,10 @@ poll(struct aiocb *aio) while ((error = aio_error(aio)) == EINPROGRESS) usleep(25000); - switch (error) { - case EINPROGRESS: - errno = EINTR; - return (-1); - case 0: - return (aio_return(aio)); - default: - return (error); - } + if (error) + return (error); + else + return (aio_return(aio)); } static void From owner-svn-src-all@freebsd.org Wed Jul 19 15:39: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 ABDFACFC00A; Wed, 19 Jul 2017 15:39:02 +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 8634884409; Wed, 19 Jul 2017 15:39:02 +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 v6JFd1EG098777; Wed, 19 Jul 2017 15:39:01 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFd1bn098775; Wed, 19 Jul 2017 15:39:01 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201707191539.v6JFd1bn098775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 19 Jul 2017 15:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321207 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 321207 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 15:39:02 -0000 Author: ken Date: Wed Jul 19 15:39:01 2017 New Revision: 321207 URL: https://svnweb.freebsd.org/changeset/base/321207 Log: Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers. mps_wait_command() and mpr_wait_command() were using getmicrotime() to determine elapsed time when checking for a timeout in polled mode. getmicrotime() isn't guaranteed to monotonically increase, and that caused spurious timeouts occasionally. Switch to using getmicrouptime(), which does increase monotonically. This fixes the spurious timeouts in my test case. Reviewed by: slm, scottl MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Wed Jul 19 15:22:10 2017 (r321206) +++ head/sys/dev/mpr/mpr.c Wed Jul 19 15:39:01 2017 (r321207) @@ -3286,9 +3286,17 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm if (curthread->td_pflags & TDP_NOSLEEPING) #endif //__FreeBSD_version >= 1000029 sleep_flag = NO_SLEEP; - getmicrotime(&start_time); + getmicrouptime(&start_time); if (mtx_owned(&sc->mpr_mtx) && sleep_flag == CAN_SLEEP) { error = msleep(cm, &sc->mpr_mtx, 0, "mprwait", timeout*hz); + if (error == EWOULDBLOCK) { + /* + * Record the actual elapsed time in the case of a + * timeout for the message below. + */ + getmicrouptime(&cur_time); + timevalsub(&cur_time, &start_time); + } } else { while ((cm->cm_flags & MPR_CM_FLAGS_COMPLETE) == 0) { mpr_intr_locked(sc); @@ -3297,8 +3305,9 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm else DELAY(50000); - getmicrotime(&cur_time); - if ((cur_time.tv_sec - start_time.tv_sec) > timeout) { + getmicrouptime(&cur_time); + timevalsub(&cur_time, &start_time); + if (cur_time.tv_sec > timeout) { error = EWOULDBLOCK; break; } @@ -3306,7 +3315,9 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm } if (error == EWOULDBLOCK) { - mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__); + mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s, timeout=%d," + " elapsed=%jd\n", __func__, timeout, + (intmax_t)cur_time.tv_sec); rc = mpr_reinit(sc); mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? "success" : "failed"); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Wed Jul 19 15:22:10 2017 (r321206) +++ head/sys/dev/mps/mps.c Wed Jul 19 15:39:01 2017 (r321207) @@ -2551,10 +2551,18 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm */ if (curthread->td_no_sleeping != 0) sleep_flag = NO_SLEEP; - getmicrotime(&start_time); + getmicrouptime(&start_time); if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) { cm->cm_flags |= MPS_CM_FLAGS_WAKEUP; error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + if (error == EWOULDBLOCK) { + /* + * Record the actual elapsed time in the case of a + * timeout for the message below. + */ + getmicrouptime(&cur_time); + timevalsub(&cur_time, &start_time); + } } else { while ((cm->cm_flags & MPS_CM_FLAGS_COMPLETE) == 0) { mps_intr_locked(sc); @@ -2563,8 +2571,9 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm else DELAY(50000); - getmicrotime(&cur_time); - if ((cur_time.tv_sec - start_time.tv_sec) > timeout) { + getmicrouptime(&cur_time); + timevalsub(&cur_time, &start_time); + if (cur_time.tv_sec > timeout) { error = EWOULDBLOCK; break; } @@ -2572,7 +2581,9 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm } if (error == EWOULDBLOCK) { - mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s\n", __func__); + mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s, timeout=%d," + " elapsed=%jd\n", __func__, timeout, + (intmax_t)cur_time.tv_sec); rc = mps_reinit(sc); mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : "failed"); From owner-svn-src-all@freebsd.org Wed Jul 19 15:58: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 210A1CFC650; Wed, 19 Jul 2017 15:58: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 E436884EB4; Wed, 19 Jul 2017 15:58:28 +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 v6JFwSxg006884; Wed, 19 Jul 2017 15:58:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFwRJB006882; Wed, 19 Jul 2017 15:58:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191558.v6JFwRJB006882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 15:58: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: r321208 - stable/11/usr.bin/sed/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.bin/sed/tests X-SVN-Commit-Revision: 321208 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 15:58:29 -0000 Author: ngie Date: Wed Jul 19 15:58:27 2017 New Revision: 321208 URL: https://svnweb.freebsd.org/changeset/base/321208 Log: MFC r312521,r313397: r312521: Add testcases for -i with hardlinks and symlinks The symlink testcase is expected to fail, post-r312519 (the revert of r312404); mark it so. r313397: Don't expect :inplace_symlink_src to fail anymore (post-r313277) The S_ISREG check was restored, such that the code will again fail with in-place replacements on symlinks Added: stable/11/usr.bin/sed/tests/sed2_test.sh - copied, changed from r312521, head/usr.bin/sed/tests/sed2_test.sh Modified: stable/11/usr.bin/sed/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sed/tests/Makefile ============================================================================== --- stable/11/usr.bin/sed/tests/Makefile Wed Jul 19 15:39:01 2017 (r321207) +++ stable/11/usr.bin/sed/tests/Makefile Wed Jul 19 15:58:27 2017 (r321208) @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH+= sed2_test NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test Copied and modified: stable/11/usr.bin/sed/tests/sed2_test.sh (from r312521, head/usr.bin/sed/tests/sed2_test.sh) ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Fri Jan 20 07:11:21 2017 (r312521, copy source) +++ stable/11/usr.bin/sed/tests/sed2_test.sh Wed Jul 19 15:58:27 2017 (r321208) @@ -47,8 +47,6 @@ inplace_symlink_src_head() } inplace_symlink_src_body() { - atf_expect_fail "Check for S_IFREG reverted in r312404" - echo foo > a atf_check ln -s a b atf_check -e not-empty -s not-exit:0 sed -i '' -e 's,foo,bar,g' b From owner-svn-src-all@freebsd.org Wed Jul 19 15:59: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 A04A3CFC6F8; Wed, 19 Jul 2017 15:59:52 +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 6DCB2E; Wed, 19 Jul 2017 15:59:52 +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 v6JFxpJo007003; Wed, 19 Jul 2017 15:59:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFxpNL007001; Wed, 19 Jul 2017 15:59:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191559.v6JFxpNL007001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 15:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321209 - stable/10/usr.bin/sed/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/sed/tests X-SVN-Commit-Revision: 321209 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 15:59:52 -0000 Author: ngie Date: Wed Jul 19 15:59:51 2017 New Revision: 321209 URL: https://svnweb.freebsd.org/changeset/base/321209 Log: MFC r312521,r313397: r312521: Add testcases for -i with hardlinks and symlinks The symlink testcase is expected to fail, post-r312519 (the revert of r312404); mark it so. r313397: Don't expect :inplace_symlink_src to fail anymore (post-r313277) The S_ISREG check was restored, such that the code will again fail with in-place replacements on symlinks Added: stable/10/usr.bin/sed/tests/sed2_test.sh - copied, changed from r312521, head/usr.bin/sed/tests/sed2_test.sh Modified: stable/10/usr.bin/sed/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/tests/Makefile ============================================================================== --- stable/10/usr.bin/sed/tests/Makefile Wed Jul 19 15:58:27 2017 (r321208) +++ stable/10/usr.bin/sed/tests/Makefile Wed Jul 19 15:59:51 2017 (r321209) @@ -1,5 +1,6 @@ # $FreeBSD$ +ATF_TESTS_SH+= sed2_test NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test Copied and modified: stable/10/usr.bin/sed/tests/sed2_test.sh (from r312521, head/usr.bin/sed/tests/sed2_test.sh) ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Fri Jan 20 07:11:21 2017 (r312521, copy source) +++ stable/10/usr.bin/sed/tests/sed2_test.sh Wed Jul 19 15:59:51 2017 (r321209) @@ -47,8 +47,6 @@ inplace_symlink_src_head() } inplace_symlink_src_body() { - atf_expect_fail "Check for S_IFREG reverted in r312404" - echo foo > a atf_check ln -s a b atf_check -e not-empty -s not-exit:0 sed -i '' -e 's,foo,bar,g' b From owner-svn-src-all@freebsd.org Wed Jul 19 16:08: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 D568ACFC905; Wed, 19 Jul 2017 16:08: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 9784E964; Wed, 19 Jul 2017 16:08:09 +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 v6JG883I011287; Wed, 19 Jul 2017 16:08:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JG889W011286; Wed, 19 Jul 2017 16:08:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191608.v6JG889W011286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321210 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 321210 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:08:09 -0000 Author: ngie Date: Wed Jul 19 16:08:08 2017 New Revision: 321210 URL: https://svnweb.freebsd.org/changeset/base/321210 Log: Remove expected failure for :coredump_phnum The testcase no longer fails on ^/head because readelf has established parity with binutils' copy of readelf. This issue is not seen on Jenkins because `test_suites.FreeBSD.allow_sysctl_side_effects` isn't set in kyua.conf on the CI host, i.e., the test is skipped. PR: 215019 Tested with: binutils (amd64-binutils-2.28,1); elftoolchain (r3561M) Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Wed Jul 19 15:59:51 2017 (r321209) +++ head/tests/sys/kern/coredump_phnum_test.sh Wed Jul 19 16:08:08 2017 (r321210) @@ -39,8 +39,6 @@ coredump_phnum_head() } coredump_phnum_body() { - atf_expect_fail "elftoolchain (base) readelf doesn't handle extended program header numbers; bug # 215019" - # Set up core dumping cat > coredump_phnum_restore_state.sh <<-EOF #!/bin/sh From owner-svn-src-all@freebsd.org Wed Jul 19 16:23: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 85D75CFCD8A; Wed, 19 Jul 2017 16:23:03 +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 6060D16F3; Wed, 19 Jul 2017 16:23:03 +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 v6JGN2bN019112; Wed, 19 Jul 2017 16:23:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGN2FJ019111; Wed, 19 Jul 2017 16:23:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191623.v6JGN2FJ019111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321211 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 321211 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:23:03 -0000 Author: ngie Date: Wed Jul 19 16:23:02 2017 New Revision: 321211 URL: https://svnweb.freebsd.org/changeset/base/321211 Log: Clean up :coredump_phnum - Use "atf_check -x 'cmd1 | cmd2'" instead of "cmd1 | atf_check cmd2". The two forms are idiomatically similar, but subtly different in the sense of what program invokes the other, and there could be unwanted side effects of the latter idiom dealing with forking, pipes, etc. - Remove chmod and instead source coredump_phnum_restore_state.sh directly. This avoids the need to check the result of the chmod call. - Fix indentation in an if-block (4 column space indentation -> hard tab). Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Wed Jul 19 16:08:08 2017 (r321210) +++ head/tests/sys/kern/coredump_phnum_test.sh Wed Jul 19 16:23:02 2017 (r321211) @@ -46,7 +46,6 @@ coredump_phnum_body() sysctl kern.coredump=$(sysctl -n kern.coredump) sysctl kern.corefile='$(sysctl -n kern.corefile)' EOF - chmod +x coredump_phnum_restore_state.sh ulimit -c unlimited sysctl kern.coredump=1 @@ -56,30 +55,27 @@ EOF # Check that core looks good if [ ! -f coredump_phnum_helper.core ]; then - atf_fail "Helper program did not dump core" + atf_fail "Helper program did not dump core" fi # These magic numbers don't have any real significance. They are just # the result of running the helper program and dumping core. The only # important bit is that they're larger than 65535 (UINT16_MAX). - readelf -h coredump_phnum_helper.core | \ - atf_check -o "match:65535 \(66[0-9]{3}\)" \ - grep "Number of program headers:" - readelf -l coredump_phnum_helper.core | \ - atf_check -o "match:There are 66[0-9]{3} program headers" \ - grep -1 "program headers" - readelf -S coredump_phnum_helper.core | \ - atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ - grep -A1 "^ \[ 0\] " + atf_check -o "match:65535 \(66[0-9]{3}\)" \ + -x 'readelf -h coredump_phnum_helper.core | grep "Number of program headers:"' + atf_check -o "match:There are 66[0-9]{3} program headers" \ + -x 'readelf -l coredump_phnum_helper.core | grep -1 "program headers"' + atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ + -x 'readelf -S coredump_phnum_helper.core | grep -A1 "^ \[ 0\] "' - procstat -v coredump_phnum_helper.core | \ - atf_check -o "match:66[0-9]{3}" wc -l + atf_check -o "match:66[0-9]{3}" \ + -x 'procstat -v coredump_phnum_helper.core | wc -l' } coredump_phnum_cleanup() { rm -f coredump_phnum_helper.core - if [ -x coredump_phnum_restore_state.sh ]; then - ./coredump_phnum_restore_state.sh + if [ -f coredump_phnum_restore_state.sh ]; then + . ./coredump_phnum_restore_state.sh fi rm -f coredump_phnum_restore_state.sh } From owner-svn-src-all@freebsd.org Wed Jul 19 16:38: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 AAF4BCFD091; Wed, 19 Jul 2017 16:38:56 +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 7D82A1EA0; Wed, 19 Jul 2017 16:38:56 +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 v6JGctXt023789; Wed, 19 Jul 2017 16:38:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGctBu023788; Wed, 19 Jul 2017 16:38:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191638.v6JGctBu023788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:38:55 +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: r321212 - stable/10/sbin/savecore X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sbin/savecore X-SVN-Commit-Revision: 321212 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:38:56 -0000 Author: ngie Date: Wed Jul 19 16:38:55 2017 New Revision: 321212 URL: https://svnweb.freebsd.org/changeset/base/321212 Log: Relnotes: yes (subtle output/behavior change) MFC r316938,r316953: r316938: savecore: fix space calculation with respect to `minfree` in check_space(..) - Use strtoll(3) instead of atoi(3), because atoi(3) limits the representable data to INT_MAX. Check the values received from strtoll(3), trimming trailing whitespace off the end to maintain POLA. - Use `KiB` instead of `kB` when describing free space, total space, etc. I am now fully aware of `KiB` being the IEC standard for 1024 bytes and `kB` being the IEC standard for 1000 bytes. - Store available number of KiB in `available` so it can be more easily queried and compared to ensure that there are enough KiB to store the dump image on disk. - Print out the reserved space on disk, per `minfree`, so end-users can troubleshoot why check_space(..) is reporting that there isn't enough free space. Tested with: positive/negative cases (see review); make tinderbox r316953: Switch back to non-IEC units for 1024 bytes I was swayed a little too quickly when I saw the wiki page discussing kB vs KiB. Switch back as none of the code in base openly uses IEC units via humanize_number(3) (which was my next step), and there's a large degree of dislike with IEC vs more SI-like units. Modified: stable/10/sbin/savecore/savecore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/savecore/savecore.c ============================================================================== --- stable/10/sbin/savecore/savecore.c Wed Jul 19 16:23:02 2017 (r321211) +++ stable/10/sbin/savecore/savecore.c Wed Jul 19 16:38:55 2017 (r321212) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ static int check_space(const char *savedir, off_t dumpsize, int bounds) { FILE *fp; - off_t minfree, spacefree, totfree, needed; + off_t available, minfree, spacefree, totfree, needed; struct statfs fsbuf; char buf[100]; @@ -268,19 +269,37 @@ check_space(const char *savedir, off_t dumpsize, int b else { if (fgets(buf, sizeof(buf), fp) == NULL) minfree = 0; - else - minfree = atoi(buf); + else { + char *endp; + + errno = 0; + minfree = strtoll(buf, &endp, 10); + if (minfree == 0 && errno != 0) + minfree = -1; + else { + while (*endp != '\0' && isspace(*endp)) + endp++; + if (*endp != '\0' || minfree < 0) + minfree = -1; + } + if (minfree < 0) + syslog(LOG_WARNING, + "`minfree` didn't contain a valid size " + "(`%s`). Defaulting to 0", buf); + } (void)fclose(fp); } + available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ needed -= saved_dump_size(bounds); - if ((minfree > 0 ? spacefree : totfree) - needed < minfree) { + if (available < needed) { syslog(LOG_WARNING, - "no dump: not enough free space on device (%lldkB " - "available; need at least %lldkB)", - (long long)(minfree > 0 ? spacefree : totfree), - (long long)needed); + "no dump: not enough free space on device (need at least " + "%jdkB for dump; %jdkB available; %jdkB reserved)", + (intmax_t)needed, + (intmax_t)available + minfree, + (intmax_t)minfree); return (0); } if (spacefree - needed < 0) From owner-svn-src-all@freebsd.org Wed Jul 19 16:39: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 8802ACFD0C8; Wed, 19 Jul 2017 16:39:01 +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 5FFA21EC4; Wed, 19 Jul 2017 16:39:01 +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 v6JGd03h023840; Wed, 19 Jul 2017 16:39:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGd00O023839; Wed, 19 Jul 2017 16:39:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191639.v6JGd00O023839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:39: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: r321213 - stable/11/sbin/savecore X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sbin/savecore X-SVN-Commit-Revision: 321213 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:39:01 -0000 Author: ngie Date: Wed Jul 19 16:39:00 2017 New Revision: 321213 URL: https://svnweb.freebsd.org/changeset/base/321213 Log: Relnotes: yes (subtle output/behavior change) MFC r316938,r316953: r316938: savecore: fix space calculation with respect to `minfree` in check_space(..) - Use strtoll(3) instead of atoi(3), because atoi(3) limits the representable data to INT_MAX. Check the values received from strtoll(3), trimming trailing whitespace off the end to maintain POLA. - Use `KiB` instead of `kB` when describing free space, total space, etc. I am now fully aware of `KiB` being the IEC standard for 1024 bytes and `kB` being the IEC standard for 1000 bytes. - Store available number of KiB in `available` so it can be more easily queried and compared to ensure that there are enough KiB to store the dump image on disk. - Print out the reserved space on disk, per `minfree`, so end-users can troubleshoot why check_space(..) is reporting that there isn't enough free space. Tested with: positive/negative cases (see review); make tinderbox r316953: Switch back to non-IEC units for 1024 bytes I was swayed a little too quickly when I saw the wiki page discussing kB vs KiB. Switch back as none of the code in base openly uses IEC units via humanize_number(3) (which was my next step), and there's a large degree of dislike with IEC vs more SI-like units. Modified: stable/11/sbin/savecore/savecore.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/savecore/savecore.c ============================================================================== --- stable/11/sbin/savecore/savecore.c Wed Jul 19 16:38:55 2017 (r321212) +++ stable/11/sbin/savecore/savecore.c Wed Jul 19 16:39:00 2017 (r321213) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ static int check_space(const char *savedir, off_t dumpsize, int bounds) { FILE *fp; - off_t minfree, spacefree, totfree, needed; + off_t available, minfree, spacefree, totfree, needed; struct statfs fsbuf; char buf[100]; @@ -268,19 +269,37 @@ check_space(const char *savedir, off_t dumpsize, int b else { if (fgets(buf, sizeof(buf), fp) == NULL) minfree = 0; - else - minfree = atoi(buf); + else { + char *endp; + + errno = 0; + minfree = strtoll(buf, &endp, 10); + if (minfree == 0 && errno != 0) + minfree = -1; + else { + while (*endp != '\0' && isspace(*endp)) + endp++; + if (*endp != '\0' || minfree < 0) + minfree = -1; + } + if (minfree < 0) + syslog(LOG_WARNING, + "`minfree` didn't contain a valid size " + "(`%s`). Defaulting to 0", buf); + } (void)fclose(fp); } + available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ needed -= saved_dump_size(bounds); - if ((minfree > 0 ? spacefree : totfree) - needed < minfree) { + if (available < needed) { syslog(LOG_WARNING, - "no dump: not enough free space on device (%lldkB " - "available; need at least %lldkB)", - (long long)(minfree > 0 ? spacefree : totfree), - (long long)needed); + "no dump: not enough free space on device (need at least " + "%jdkB for dump; %jdkB available; %jdkB reserved)", + (intmax_t)needed, + (intmax_t)available + minfree, + (intmax_t)minfree); return (0); } if (spacefree - needed < 0) From owner-svn-src-all@freebsd.org Wed Jul 19 16:45: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 E0D36CFD2E7; Wed, 19 Jul 2017 16:45:58 +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 AFEB124C3; Wed, 19 Jul 2017 16:45:58 +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 v6JGjvng027662; Wed, 19 Jul 2017 16:45:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGjvEJ027661; Wed, 19 Jul 2017 16:45:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191645.v6JGjvEJ027661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321214 - head/targets/pseudo/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/targets/pseudo/tests X-SVN-Commit-Revision: 321214 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:45:59 -0000 Author: ngie Date: Wed Jul 19 16:45:57 2017 New Revision: 321214 URL: https://svnweb.freebsd.org/changeset/base/321214 Log: Update targets/pseudo/tests/Makefile.depend after recent additions/subtractions from the FreeBSD test suite. MFC after: 3 days MFC with: r316603 Modified: head/targets/pseudo/tests/Makefile.depend Modified: head/targets/pseudo/tests/Makefile.depend ============================================================================== --- head/targets/pseudo/tests/Makefile.depend Wed Jul 19 16:39:00 2017 (r321213) +++ head/targets/pseudo/tests/Makefile.depend Wed Jul 19 16:45:57 2017 (r321214) @@ -7,9 +7,12 @@ # find . -name Makefile -exec grep -l '^\.include.*\.test.mk' {} + | grep -v '^\./contrib' | sed -e 's,/Makefile,,' -e 's,^\./,,' -e 's,^, ,' -e 's,$, \\,' | sort DIRDEPS= \ bin/cat/tests \ + bin/chmod/tests \ bin/date/tests \ bin/dd/tests \ + bin/echo/tests \ bin/expr/tests \ + bin/ln/tests \ bin/ls/tests \ bin/mv/tests \ bin/pax/tests \ @@ -118,7 +121,6 @@ DIRDEPS= \ cddl/usr.sbin/zfsd/tests \ gnu/lib/tests \ gnu/tests \ - gnu/usr.bin/diff/tests \ gnu/usr.bin/tests \ lib/atf/libatf-c++/tests \ lib/atf/libatf-c++/tests/detail \ @@ -186,6 +188,7 @@ DIRDEPS= \ sbin/ifconfig/tests \ sbin/mdconfig/tests \ sbin/pfctl/tests \ + sbin/savecore/tests \ sbin/tests \ secure/lib/tests \ secure/libexec/tests \ @@ -196,7 +199,9 @@ DIRDEPS= \ share/examples/tests/tests \ share/examples/tests/tests/atf \ share/examples/tests/tests/plain \ + share/examples/tests/tests/tap \ share/tests \ + share/zoneinfo/tests \ tests \ tests/etc \ tests/etc/rc.d \ @@ -246,6 +251,7 @@ DIRDEPS= \ tests/sys/pjdfstest/tests/symlink \ tests/sys/pjdfstest/tests/truncate \ tests/sys/pjdfstest/tests/unlink \ + tests/sys/pjdfstest/tests/utimensat \ tests/sys/posixshm \ tests/sys/sys \ tests/sys/vfs \ @@ -306,13 +312,19 @@ DIRDEPS= \ usr.bin/cmp/tests \ usr.bin/col/tests \ usr.bin/comm/tests \ + usr.bin/compress/tests \ usr.bin/cpio/tests \ + usr.bin/csplit/tests \ usr.bin/cut/tests \ usr.bin/diff/tests \ + usr.bin/diff3/tests \ usr.bin/dirname/tests \ + usr.bin/du/tests \ usr.bin/file2c/tests \ + usr.bin/getconf/tests \ usr.bin/grep/tests \ usr.bin/gzip/tests \ + usr.bin/hexdump/tests \ usr.bin/ident/tests \ usr.bin/indent/tests \ usr.bin/join/tests \ @@ -324,10 +336,12 @@ DIRDEPS= \ usr.bin/ncal/tests \ usr.bin/pr/tests \ usr.bin/printf/tests \ + usr.bin/procstat/tests \ usr.bin/sdiff/tests \ usr.bin/sed/tests \ usr.bin/sed/tests/regress.multitest.out \ usr.bin/soelim/tests \ + usr.bin/stat/tests \ usr.bin/tail/tests \ usr.bin/tar/tests \ usr.bin/tests \ From owner-svn-src-all@freebsd.org Wed Jul 19 16:54: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 5A225CFD486; Wed, 19 Jul 2017 16:54:24 +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 E00872915; Wed, 19 Jul 2017 16:54:23 +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 v6JGsN2b031558; Wed, 19 Jul 2017 16:54:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGsNm1031557; Wed, 19 Jul 2017 16:54:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191654.v6JGsNm1031557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:54: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: r321215 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 321215 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:54:24 -0000 Author: ngie Date: Wed Jul 19 16:54:22 2017 New Revision: 321215 URL: https://svnweb.freebsd.org/changeset/base/321215 Log: Record merges for r319659 and r319660. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Wed Jul 19 16:54: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 755D2CFD4C6; Wed, 19 Jul 2017 16:54:36 +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 2596E29B3; Wed, 19 Jul 2017 16:54:36 +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 v6JGsZ7a031608; Wed, 19 Jul 2017 16:54:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGsZgw031607; Wed, 19 Jul 2017 16:54:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191654.v6JGsZgw031607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:54:35 +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: r321216 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 321216 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 16:54:36 -0000 Author: ngie Date: Wed Jul 19 16:54:34 2017 New Revision: 321216 URL: https://svnweb.freebsd.org/changeset/base/321216 Log: Record merges for r319659 and r319660. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Wed Jul 19 17: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 D5C2BCFDEDE; Wed, 19 Jul 2017 17:28:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29633A67; Wed, 19 Jul 2017 17:28:47 +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 v6JHSkaj044202; Wed, 19 Jul 2017 17:28:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JHSkIS044200; Wed, 19 Jul 2017 17:28:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707191728.v6JHSkIS044200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Jul 2017 17:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321217 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321217 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 17:28:47 -0000 Author: kib Date: Wed Jul 19 17:28:46 2017 New Revision: 321217 URL: https://svnweb.freebsd.org/changeset/base/321217 Log: Remove unused function swap_pager_isswapped(). Noted by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c head/sys/vm/swap_pager.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Jul 19 16:54:34 2017 (r321216) +++ head/sys/vm/swap_pager.c Wed Jul 19 17:28:46 2017 (r321217) @@ -1585,43 +1585,6 @@ swp_pager_async_iodone(struct buf *bp) ); } -/* - * swap_pager_isswapped: - * - * Return 1 if at least one page in the given object is paged - * out to the given swap device. - * - * This routine may not sleep. - */ -int -swap_pager_isswapped(vm_object_t object, struct swdevt *sp) -{ - daddr_t index = 0; - int bcount; - int i; - - VM_OBJECT_ASSERT_WLOCKED(object); - if (object->type != OBJT_SWAP) - return (0); - - mtx_lock(&swhash_mtx); - for (bcount = 0; bcount < object->un_pager.swp.swp_bcount; bcount++) { - struct swblock *swap; - - if ((swap = *swp_pager_hash(object, index)) != NULL) { - for (i = 0; i < SWAP_META_PAGES; ++i) { - if (swp_pager_isondev(swap->swb_pages[i], sp)) { - mtx_unlock(&swhash_mtx); - return (1); - } - } - } - index += SWAP_META_PAGES; - } - mtx_unlock(&swhash_mtx); - return (0); -} - int swap_pager_nswapdev(void) { Modified: head/sys/vm/swap_pager.h ============================================================================== --- head/sys/vm/swap_pager.h Wed Jul 19 16:54:34 2017 (r321216) +++ head/sys/vm/swap_pager.h Wed Jul 19 17:28:46 2017 (r321217) @@ -82,7 +82,6 @@ void swap_pager_copy(vm_object_t, vm_object_t, vm_pind vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_swap_init(void); -int swap_pager_isswapped(vm_object_t, struct swdevt *); int swap_pager_nswapdev(void); int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_status(int *total, int *used); From owner-svn-src-all@freebsd.org Wed Jul 19 18:17: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 1CEE5CFECAD; Wed, 19 Jul 2017 18:17:43 +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 DFC5464C13; Wed, 19 Jul 2017 18:17:42 +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 v6JIHgGo066119; Wed, 19 Jul 2017 18:17:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIHgHT066118; Wed, 19 Jul 2017 18:17:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191817.v6JIHgHT066118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 18:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 321218 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:17:43 -0000 Author: emaste Date: Wed Jul 19 18:17:41 2017 New Revision: 321218 URL: https://svnweb.freebsd.org/changeset/base/321218 Log: zfs: Fix a typo in the delay_min_dirty_percent sysctl description The description is FreeBSD-specific and was added in r266497 to fix PR189865. PR: 220825 Submitted by: Fabian Keil Obtained from: ElectroBSD MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jul 19 17:28:46 2017 (r321217) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jul 19 18:17:41 2017 (r321218) @@ -167,7 +167,7 @@ static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_H SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_min_dirty_percent, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), sysctl_zfs_delay_min_dirty_percent, "I", - "The limit of outstanding dirty data before transations are delayed"); + "The limit of outstanding dirty data before transactions are delayed"); static int sysctl_zfs_delay_scale(SYSCTL_HANDLER_ARGS); /* No zfs_delay_scale tunable due to limit requirements */ From owner-svn-src-all@freebsd.org Wed Jul 19 18:19: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 A5D12CFED42; Wed, 19 Jul 2017 18:19:04 +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 6DC9B64D80; Wed, 19 Jul 2017 18:19:04 +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 v6JIJ3FB066260; Wed, 19 Jul 2017 18:19:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIJ3aj066259; Wed, 19 Jul 2017 18:19:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191819.v6JIJ3aj066259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321219 - stable/11/lib/libpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libpmc X-SVN-Commit-Revision: 321219 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:19:04 -0000 Author: ngie Date: Wed Jul 19 18:19:03 2017 New Revision: 321219 URL: https://svnweb.freebsd.org/changeset/base/321219 Log: MFC r316602: pmc_read(3): fix manlint error Remove spurious trailing comma from last .Nm entry in NAME section. Modified: stable/11/lib/libpmc/pmc_read.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpmc/pmc_read.3 ============================================================================== --- stable/11/lib/libpmc/pmc_read.3 Wed Jul 19 18:17:41 2017 (r321218) +++ stable/11/lib/libpmc/pmc_read.3 Wed Jul 19 18:19:03 2017 (r321219) @@ -29,7 +29,7 @@ .Sh NAME .Nm pmc_read , .Nm pmc_rw , -.Nm pmc_write , +.Nm pmc_write .Nd read and write hardware performance counters .Sh LIBRARY .Lb libpmc From owner-svn-src-all@freebsd.org Wed Jul 19 18:19: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 8B44ECFED83; Wed, 19 Jul 2017 18:19:12 +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 54F9264DD8; Wed, 19 Jul 2017 18:19:12 +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 v6JIJBUO066310; Wed, 19 Jul 2017 18:19:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIJBiu066309; Wed, 19 Jul 2017 18:19:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191819.v6JIJBiu066309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:19: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: r321220 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321220 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:19:12 -0000 Author: ngie Date: Wed Jul 19 18:19:11 2017 New Revision: 321220 URL: https://svnweb.freebsd.org/changeset/base/321220 Log: MFC r316602: pmc_read(3): fix manlint error Remove spurious trailing comma from last .Nm entry in NAME section. Modified: stable/10/lib/libpmc/pmc_read.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc_read.3 ============================================================================== --- stable/10/lib/libpmc/pmc_read.3 Wed Jul 19 18:19:03 2017 (r321219) +++ stable/10/lib/libpmc/pmc_read.3 Wed Jul 19 18:19:11 2017 (r321220) @@ -29,7 +29,7 @@ .Sh NAME .Nm pmc_read , .Nm pmc_rw , -.Nm pmc_write , +.Nm pmc_write .Nd read and write hardware performance counters .Sh LIBRARY .Lb libpmc From owner-svn-src-all@freebsd.org Wed Jul 19 18:19: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 65CBBCFEE09; Wed, 19 Jul 2017 18:19:52 +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 3370964FDA; Wed, 19 Jul 2017 18:19:52 +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 v6JIJpt5066406; Wed, 19 Jul 2017 18:19:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIJpw2066405; Wed, 19 Jul 2017 18:19:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191819.v6JIJpw2066405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321221 - stable/11/lib/libpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libpmc X-SVN-Commit-Revision: 321221 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:19:52 -0000 Author: ngie Date: Wed Jul 19 18:19:51 2017 New Revision: 321221 URL: https://svnweb.freebsd.org/changeset/base/321221 Log: MFC r316600: pmc(3): add additional references for libpmc functions in the SEE ALSO section These functions are already referenced throughout the manpage -- this makes their presence more apparent. Modified: stable/11/lib/libpmc/pmc.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpmc/pmc.3 ============================================================================== --- stable/11/lib/libpmc/pmc.3 Wed Jul 19 18:19:11 2017 (r321220) +++ stable/11/lib/libpmc/pmc.3 Wed Jul 19 18:19:51 2017 (r321221) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd April 6, 2017 .Dt PMC 3 .Os .Sh NAME @@ -546,6 +546,19 @@ API is .Xr pmc.westmere 3 , .Xr pmc.westmereuc 3 , .Xr pmc.xscale 3 , +.Xr pmc_allocate 3 , +.Xr pmc_attach 3 , +.Xr pmc_capabilities 3 , +.Xr pmc_configure_logfile 3 , +.Xr pmc_disable 3 , +.Xr pmc_event_names_of_class 3 , +.Xr pmc_get_driver_stats 3 , +.Xr pmc_get_msr 3 , +.Xr pmc_init 3 , +.Xr pmc_name_of_capability 3 , +.Xr pmc_read 3 , +.Xr pmc_set 3 , +.Xr pmc_start 3 , .Xr pmclog 3 , .Xr hwpmc 4 , .Xr pmccontrol 8 , From owner-svn-src-all@freebsd.org Wed Jul 19 18:22: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 79371CFF008; Wed, 19 Jul 2017 18:22:33 +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 549C465389; Wed, 19 Jul 2017 18:22:33 +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 v6JIMW4p070267; Wed, 19 Jul 2017 18:22:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIMWZn070264; Wed, 19 Jul 2017 18:22:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707191822.v6JIMWZn070264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 18:22:32 +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: r321222 - in stable/10: contrib/libc++/include contrib/libc++/src sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/10: contrib/libc++/include contrib/libc++/src sys/sys X-SVN-Commit-Revision: 321222 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:22:33 -0000 Author: dim Date: Wed Jul 19 18:22:32 2017 New Revision: 321222 URL: https://svnweb.freebsd.org/changeset/base/321222 Log: Pull in r229281 from upstream libc++ (by Larisse Voufo): Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241. This allows ports which use C++14's sized deallocation functions, such as cad/openvsp, to build on stable/10. Bump __FreeBSD_version to allow detection from ports. Direct commit, since stable/11 and head already have newer versions of libc++ which include this change. PR: 219484 Modified: stable/10/contrib/libc++/include/new stable/10/contrib/libc++/src/new.cpp stable/10/sys/sys/param.h Modified: stable/10/contrib/libc++/include/new ============================================================================== --- stable/10/contrib/libc++/include/new Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/contrib/libc++/include/new Wed Jul 19 18:22:32 2017 (r321222) @@ -50,12 +50,18 @@ new_handler get_new_handler() noexcept; void* operator new(std::size_t size); // replaceable void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable void operator delete(void* ptr) noexcept; // replaceable +void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable +void operator delete(void* ptr, std::size_t size, + const std::nothrow_t&) noexcept; // replaceable, C++14 void* operator new[](std::size_t size); // replaceable void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable void operator delete[](void* ptr) noexcept; // replaceable +void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable +void operator delete[](void* ptr, std::size_t size, + const std::nothrow_t&) noexcept; // replaceable, C++14 void* operator new (std::size_t size, void* ptr) noexcept; void* operator new[](std::size_t size, void* ptr) noexcept; @@ -131,7 +137,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t ; _LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_NEW_DELETE_VIS void operator delete(void* __p) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz) #if !__has_feature(cxx_noexcept) @@ -140,7 +148,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_ ; _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;} inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;} Modified: stable/10/contrib/libc++/src/new.cpp ============================================================================== --- stable/10/contrib/libc++/src/new.cpp Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/contrib/libc++/src/new.cpp Wed Jul 19 18:22:32 2017 (r321222) @@ -126,6 +126,13 @@ operator delete(void* ptr) _NOEXCEPT _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete(void* ptr, size_t) _NOEXCEPT +{ + ::operator delete(ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT { ::operator delete(ptr); @@ -133,14 +140,35 @@ operator delete(void* ptr, const std::nothrow_t&) _NOE _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete(void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT +{ + ::operator delete(ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete[] (void* ptr) _NOEXCEPT { - ::operator delete (ptr); + ::operator delete(ptr); } _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete[] (void* ptr, size_t) _NOEXCEPT +{ + ::operator delete[](ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT +{ + ::operator delete[](ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void +operator delete[] (void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT { ::operator delete[](ptr); } Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/sys/sys/param.h Wed Jul 19 18:22:32 2017 (r321222) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003515 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Wed Jul 19 18:22: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 1F253CFF0AF; Wed, 19 Jul 2017 18:22:57 +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 E003B6550B; Wed, 19 Jul 2017 18:22:56 +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 v6JIMtY6070347; Wed, 19 Jul 2017 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIMtjk070346; Wed, 19 Jul 2017 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191822.v6JIMtjk070346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:22:55 +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: r321223 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321223 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:22:57 -0000 Author: ngie Date: Wed Jul 19 18:22:55 2017 New Revision: 321223 URL: https://svnweb.freebsd.org/changeset/base/321223 Log: MFC r316600: pmc(3): add additional references for libpmc functions in the SEE ALSO section These functions are already referenced throughout the manpage -- this makes their presence more apparent. Modified: stable/10/lib/libpmc/pmc.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc.3 ============================================================================== --- stable/10/lib/libpmc/pmc.3 Wed Jul 19 18:22:32 2017 (r321222) +++ stable/10/lib/libpmc/pmc.3 Wed Jul 19 18:22:55 2017 (r321223) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2008 +.Dd April 6, 2017 .Dt PMC 3 .Os .Sh NAME @@ -534,6 +534,19 @@ API is .Xr pmc.p6 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , +.Xr pmc_allocate 3 , +.Xr pmc_attach 3 , +.Xr pmc_capabilities 3 , +.Xr pmc_configure_logfile 3 , +.Xr pmc_disable 3 , +.Xr pmc_event_names_of_class 3 , +.Xr pmc_get_driver_stats 3 , +.Xr pmc_get_msr 3 , +.Xr pmc_init 3 , +.Xr pmc_name_of_capability 3 , +.Xr pmc_read 3 , +.Xr pmc_set 3 , +.Xr pmc_start 3 , .Xr pmclog 3 , .Xr hwpmc 4 , .Xr pmccontrol 8 , From owner-svn-src-all@freebsd.org Wed Jul 19 18:23: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 6748CCFF174; Wed, 19 Jul 2017 18:23:27 +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 444F0657A9; Wed, 19 Jul 2017 18:23:27 +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 v6JINQ0Y070440; Wed, 19 Jul 2017 18:23:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JINQkp070439; Wed, 19 Jul 2017 18:23:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191823.v6JINQkp070439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321224 - stable/11/lib/libpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libpmc X-SVN-Commit-Revision: 321224 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:23:27 -0000 Author: ngie Date: Wed Jul 19 18:23:26 2017 New Revision: 321224 URL: https://svnweb.freebsd.org/changeset/base/321224 Log: MFC r316601: pmc.atomsilvermont(3): fix manlint warnings Start new sentences on new lines. Sentences affected by the change are wrapped at <80 columns. Other potentially offending lines have been left alone to reduce churn. Modified: stable/11/lib/libpmc/pmc.atomsilvermont.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpmc/pmc.atomsilvermont.3 ============================================================================== --- stable/11/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:22:55 2017 (r321223) +++ stable/11/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:23:26 2017 (r321224) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd April 6, 2017 .Dt PMC.ATOMSILVERMONT 3 .Os .Sh NAME @@ -262,7 +262,8 @@ The number of store uops reissued from Rehabq. .It Li MEM_UOPS_RETIRED.L1_MISS_LOADS .Pq Event 04H , Umask 01H The number of load ops retired that miss in L1 -Data cache. Note that prefetch misses will not be counted. +Data cache. +Note that prefetch misses will not be counted. .It Li MEM_UOPS_RETIRED.L2_HIT_LOADS .Pq Event 04H , Umask 02H The number of load micro-ops retired that hit L2. @@ -287,26 +288,27 @@ The number of load ops retired. The number of store ops retired. .It Li PAGE_WALKS.D_SIDE_CYCLES .Pq Event 05H , Umask 01H -Every cycle when a D-side (walks due to a load) page walk -is in progress. Page walk duration divided by -number of page walks is the average duration of page-walks. -Edge trigger bit must be cleared. Set Edge to count the number -of page walks. +Every cycle when a D-side (walks due to a load) page walk is in progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. +Edge trigger bit must be cleared. +Set Edge to count the number of page walks. .It Li PAGE_WALKS.I_SIDE_CYCLES .Pq Event 05H , Umask 02H -Every cycle when a I-side (walks due to an instruction fetch) -page walk is in progress. Page walk duration divided by number -of page walks is the average duration of page-walks. +Every cycle when a I-side (walks due to an instruction fetch) page walk is in +progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. .It Li PAGE_WALKS.WALKS .Pq Event 05H , Umask 03H -The number of times a data (D) page walk or an instruction (I) -page walk is completed or started. Since a page walk implies a -TLB miss, the number of TLB misses can be counted by counting -the number of pagewalks. +The number of times a data (D) page walk or an instruction (I) page walk is +completed or started. +Since a page walk implies a TLB miss, the number of TLB misses can be counted +by counting the number of pagewalks. .It Li LONGEST_LAT_CACHE.MISS .Pq Event 2EH , Umask 41H -the total number of L2 cache references and -The number of L2 cache misses respectively. +the total number of L2 cache references and the number of L2 cache misses +respectively. L3 is not supported in Silvermont microarchitecture. .It Li LONGEST_LAT_CACHE.REFERENCE .Pq Event 2EH , Umask 4FH @@ -323,39 +325,39 @@ requests), BBS (L2 misses) and WOB (L2 write-back vict .It Li CORE_REJECT_L2Q.ALL .Pq Event 31H , Umask 00H The number of demand and L1 prefetcher -requests rejected by the L2Q due to a full or nearly full -condition which likely indicates back pressure from L2Q. -It also counts requests that would have gone directly to -the XQ, but are rejected due to a full or nearly full condition, -indicating back pressure from the IDI link. The L2Q may also -reject transactions from a core to insure fairness between -cores, or to delay a core's dirty eviction when the address -conflicts incoming external snoops. (Note that L2 prefetcher -requests that are dropped are not counted by this event.). +requests rejected by the L2Q due to a full or nearly full condition which +likely indicates back pressure from L2Q. +It also counts requests that would have gone directly to the XQ, but are +rejected due to a full or nearly full condition, indicating back pressure from +the IDI link. +The L2Q may also reject transactions from a core to insure fairness between +cores, or to delay a core's dirty eviction when the address conflicts incoming +external snoops. +(Note that L2 prefetcher requests that are dropped are not counted by this +event). .It Li CPU_CLK_UNHALTED.CORE_P .Pq Event 3CH , Umask 00H -The number of core cycles while the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. In mobile systems the core frequency -may change from time to time. For this reason this event -may have a changing ratio with regards to time. +The number of core cycles while the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. +In mobile systems the core frequency may change from time to time. +For this reason this event may have a changing ratio with regards to time. .It Li CPU_CLK_UNHALTED.REF_P .Pq Event 3CH , Umask 01H -The number of reference cycles that the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. +The number of reference cycles that the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time. -This event is not affected by core frequency changes but counts -as if the core is running at the maximum frequency all the time. +This event is not affected by core frequency changes but counts as if the core +is running at the maximum frequency all the time. .It Li ICACHE.HIT .Pq Event 80H , Umask 01H The number of instruction fetches from the instruction cache. .It Li ICACHE.MISSES .Pq Event 80H , Umask 02H -The number of instruction fetches that miss the -Instruction cache or produce memory requests. This includes -uncacheable fetches. An instruction fetch miss is counted only -once and not once for every cycle it is outstanding. +The number of instruction fetches that miss the Instruction cache or produce +memory requests. +This includes uncacheable fetches. +An instruction fetch miss is counted only once and not once for every cycle +it is outstanding. .It Li ICACHE.ACCESSES .Pq Event 80H , Umask 03H The number of instruction fetches, including uncacheable fetches. @@ -372,10 +374,10 @@ Requires MSR_OFFCORE_RESP0 to specify request type and Requires MSR_OFFCORE_RESP to specify request type and response. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -The number of instructions that retire execution. For instructions -that consist of multiple micro-ops, this event counts the -retirement of the last micro-op of the instruction. The counter -continues counting during hardware interrupts, traps, and inside +The number of instructions that retire execution. +For instructions that consist of multiple micro-ops, this event counts the +retirement of the last micro-op of the instruction. +The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. .It Li UOPS_RETIRED.MS .Pq Event C2H , Umask 01H From owner-svn-src-all@freebsd.org Wed Jul 19 18:23: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 D8AE4CFF242; Wed, 19 Jul 2017 18:23:50 +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 991BA65902; Wed, 19 Jul 2017 18:23:50 +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 v6JINnL4070507; Wed, 19 Jul 2017 18:23:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JINnWB070506; Wed, 19 Jul 2017 18:23:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191823.v6JINnWB070506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:23:49 +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: r321225 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321225 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:23:51 -0000 Author: ngie Date: Wed Jul 19 18:23:49 2017 New Revision: 321225 URL: https://svnweb.freebsd.org/changeset/base/321225 Log: MFC r316601: pmc.atomsilvermont(3): fix manlint warnings Start new sentences on new lines. Sentences affected by the change are wrapped at <80 columns. Other potentially offending lines have been left alone to reduce churn. Modified: stable/10/lib/libpmc/pmc.atomsilvermont.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc.atomsilvermont.3 ============================================================================== --- stable/10/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:23:26 2017 (r321224) +++ stable/10/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:23:49 2017 (r321225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd April 6, 2017 .Dt PMC.ATOMSILVERMONT 3 .Os .Sh NAME @@ -262,7 +262,8 @@ The number of store uops reissued from Rehabq. .It Li MEM_UOPS_RETIRED.L1_MISS_LOADS .Pq Event 04H , Umask 01H The number of load ops retired that miss in L1 -Data cache. Note that prefetch misses will not be counted. +Data cache. +Note that prefetch misses will not be counted. .It Li MEM_UOPS_RETIRED.L2_HIT_LOADS .Pq Event 04H , Umask 02H The number of load micro-ops retired that hit L2. @@ -287,26 +288,27 @@ The number of load ops retired. The number of store ops retired. .It Li PAGE_WALKS.D_SIDE_CYCLES .Pq Event 05H , Umask 01H -Every cycle when a D-side (walks due to a load) page walk -is in progress. Page walk duration divided by -number of page walks is the average duration of page-walks. -Edge trigger bit must be cleared. Set Edge to count the number -of page walks. +Every cycle when a D-side (walks due to a load) page walk is in progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. +Edge trigger bit must be cleared. +Set Edge to count the number of page walks. .It Li PAGE_WALKS.I_SIDE_CYCLES .Pq Event 05H , Umask 02H -Every cycle when a I-side (walks due to an instruction fetch) -page walk is in progress. Page walk duration divided by number -of page walks is the average duration of page-walks. +Every cycle when a I-side (walks due to an instruction fetch) page walk is in +progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. .It Li PAGE_WALKS.WALKS .Pq Event 05H , Umask 03H -The number of times a data (D) page walk or an instruction (I) -page walk is completed or started. Since a page walk implies a -TLB miss, the number of TLB misses can be counted by counting -the number of pagewalks. +The number of times a data (D) page walk or an instruction (I) page walk is +completed or started. +Since a page walk implies a TLB miss, the number of TLB misses can be counted +by counting the number of pagewalks. .It Li LONGEST_LAT_CACHE.MISS .Pq Event 2EH , Umask 41H -the total number of L2 cache references and -The number of L2 cache misses respectively. +the total number of L2 cache references and the number of L2 cache misses +respectively. L3 is not supported in Silvermont microarchitecture. .It Li LONGEST_LAT_CACHE.REFERENCE .Pq Event 2EH , Umask 4FH @@ -323,39 +325,39 @@ requests), BBS (L2 misses) and WOB (L2 write-back vict .It Li CORE_REJECT_L2Q.ALL .Pq Event 31H , Umask 00H The number of demand and L1 prefetcher -requests rejected by the L2Q due to a full or nearly full -condition which likely indicates back pressure from L2Q. -It also counts requests that would have gone directly to -the XQ, but are rejected due to a full or nearly full condition, -indicating back pressure from the IDI link. The L2Q may also -reject transactions from a core to insure fairness between -cores, or to delay a core's dirty eviction when the address -conflicts incoming external snoops. (Note that L2 prefetcher -requests that are dropped are not counted by this event.). +requests rejected by the L2Q due to a full or nearly full condition which +likely indicates back pressure from L2Q. +It also counts requests that would have gone directly to the XQ, but are +rejected due to a full or nearly full condition, indicating back pressure from +the IDI link. +The L2Q may also reject transactions from a core to insure fairness between +cores, or to delay a core's dirty eviction when the address conflicts incoming +external snoops. +(Note that L2 prefetcher requests that are dropped are not counted by this +event). .It Li CPU_CLK_UNHALTED.CORE_P .Pq Event 3CH , Umask 00H -The number of core cycles while the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. In mobile systems the core frequency -may change from time to time. For this reason this event -may have a changing ratio with regards to time. +The number of core cycles while the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. +In mobile systems the core frequency may change from time to time. +For this reason this event may have a changing ratio with regards to time. .It Li CPU_CLK_UNHALTED.REF_P .Pq Event 3CH , Umask 01H -The number of reference cycles that the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. +The number of reference cycles that the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time. -This event is not affected by core frequency changes but counts -as if the core is running at the maximum frequency all the time. +This event is not affected by core frequency changes but counts as if the core +is running at the maximum frequency all the time. .It Li ICACHE.HIT .Pq Event 80H , Umask 01H The number of instruction fetches from the instruction cache. .It Li ICACHE.MISSES .Pq Event 80H , Umask 02H -The number of instruction fetches that miss the -Instruction cache or produce memory requests. This includes -uncacheable fetches. An instruction fetch miss is counted only -once and not once for every cycle it is outstanding. +The number of instruction fetches that miss the Instruction cache or produce +memory requests. +This includes uncacheable fetches. +An instruction fetch miss is counted only once and not once for every cycle +it is outstanding. .It Li ICACHE.ACCESSES .Pq Event 80H , Umask 03H The number of instruction fetches, including uncacheable fetches. @@ -372,10 +374,10 @@ Requires MSR_OFFCORE_RESP0 to specify request type and Requires MSR_OFFCORE_RESP to specify request type and response. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -The number of instructions that retire execution. For instructions -that consist of multiple micro-ops, this event counts the -retirement of the last micro-op of the instruction. The counter -continues counting during hardware interrupts, traps, and inside +The number of instructions that retire execution. +For instructions that consist of multiple micro-ops, this event counts the +retirement of the last micro-op of the instruction. +The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. .It Li UOPS_RETIRED.MS .Pq Event C2H , Umask 01H From owner-svn-src-all@freebsd.org Wed Jul 19 18:25: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 D7475CFF309; Wed, 19 Jul 2017 18:25:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A60A865A7F; Wed, 19 Jul 2017 18:25: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 v6JIPq6K070695; Wed, 19 Jul 2017 18:25:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIPqkw070694; Wed, 19 Jul 2017 18:25:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191825.v6JIPqkw070694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 18:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321226 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 321226 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:25:53 -0000 Author: emaste Date: Wed Jul 19 18:25:52 2017 New Revision: 321226 URL: https://svnweb.freebsd.org/changeset/base/321226 Log: bsdinstall: improve checksum mismatch error for snapshots The usual case of a mismatched checksum for installer snapshots (e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and the old install sets have been replaced. Provide a specific error message for checksum mismatches there that suggests looking for a newer snapshot. Submitted by: Guangyuan Yang Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11641 Modified: head/usr.sbin/bsdinstall/scripts/checksum Modified: head/usr.sbin/bsdinstall/scripts/checksum ============================================================================== --- head/usr.sbin/bsdinstall/scripts/checksum Wed Jul 19 18:23:49 2017 (r321225) +++ head/usr.sbin/bsdinstall/scripts/checksum Wed Jul 19 18:25:52 2017 (r321226) @@ -62,8 +62,16 @@ for dist in $DISTRIBUTIONS; do percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) else eval "status_$distname=1" - dialog --backtitle "FreeBSD Installer" --title "Error" \ - --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + case $(/bin/freebsd-version -u) in + *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, or it may be from a newer version of FreeBSD. Please check for a newer snapshot." 0 0 + ;; + *) + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + ;; + esac exit 1 fi done From owner-svn-src-all@freebsd.org Wed Jul 19 18:30: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 E941ECFF47C; Wed, 19 Jul 2017 18:30:17 +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 B809F65E0F; Wed, 19 Jul 2017 18:30:17 +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 v6JIUGe2070958; Wed, 19 Jul 2017 18:30:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIUG1o070957; Wed, 19 Jul 2017 18:30:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191830.v6JIUG1o070957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321227 - head/usr.bin/diff/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/diff/tests X-SVN-Commit-Revision: 321227 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:30:18 -0000 Author: ngie Date: Wed Jul 19 18:30:16 2017 New Revision: 321227 URL: https://svnweb.freebsd.org/changeset/base/321227 Log: Use more flexible expression for replacing t_diff in contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via `basename $0`. This was a change I forgot to port over from ^/head/gnu/usr.bin/diff/tests/Makefile@r272787. Modified: head/usr.bin/diff/tests/Makefile Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Wed Jul 19 18:25:52 2017 (r321226) +++ head/usr.bin/diff/tests/Makefile Wed Jul 19 18:30:16 2017 (r321227) @@ -31,7 +31,7 @@ ${PACKAGE}FILES+= \ d_mallocv1.in \ d_mallocv2.in -ATF_TESTS_SH_SED_netbsd_diff_test+= -e 's,t_diff,netbsd_diff_test,g' +ATF_TESTS_SH_SED_netbsd_diff_test+= -e 's/t_diff/`basename $$0`/g' ATF_TESTS_SH_SRC_netbsd_diff_test= t_diff.sh .include From owner-svn-src-all@freebsd.org Wed Jul 19 18:41: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 907EACFF8E5; Wed, 19 Jul 2017 18:41:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FB03668D2; Wed, 19 Jul 2017 18:41:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JIfGg7078142; Wed, 19 Jul 2017 18:41:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIfGq6078141; Wed, 19 Jul 2017 18:41:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707191841.v6JIfGq6078141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Jul 2017 18:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321228 - head/usr.sbin/crashinfo X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/crashinfo X-SVN-Commit-Revision: 321228 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:41:17 -0000 Author: markj Date: Wed Jul 19 18:41:16 2017 New Revision: 321228 URL: https://svnweb.freebsd.org/changeset/base/321228 Log: Allow matches of truncated version strings. Long objdir paths make it easy to hit the version string length limit in kernel dump headers. The build number and timestamp are unlikely to be truncated and ought to be sufficient to protect against false positives. Discussed with: jhb MFC after: 1 week Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Wed Jul 19 18:30:16 2017 (r321227) +++ head/usr.sbin/crashinfo/crashinfo.sh Wed Jul 19 18:41:16 2017 (r321228) @@ -83,10 +83,12 @@ find_kernel() } }' $INFO) - # Look for a matching kernel version. + # Look for a matching kernel version, handling possible truncation + # of the version string recovered from the dump. 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 19 18:59: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 D59E3CFFD36; Wed, 19 Jul 2017 18:59:27 +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 AFD16670C6; Wed, 19 Jul 2017 18:59:27 +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 v6JIxQV3083258; Wed, 19 Jul 2017 18:59:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIxQYp083252; Wed, 19 Jul 2017 18:59:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191859.v6JIxQYp083252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321229 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 321229 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 18:59:27 -0000 Author: ngie Date: Wed Jul 19 18:59:26 2017 New Revision: 321229 URL: https://svnweb.freebsd.org/changeset/base/321229 Log: MFC note: cnv(9) diff ignored since API/manpage not present on ^/stable/11. MFC r309066: r309066 (by brueffer): Fix various mdoc issues reported by mandoc -Tlint. Modified: stable/11/share/man/man9/bus_map_resource.9 stable/11/share/man/man9/counter.9 stable/11/share/man/man9/osd.9 stable/11/share/man/man9/pmap_zero_page.9 stable/11/share/man/man9/rman.9 stable/11/share/man/man9/tcp_functions.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/bus_map_resource.9 ============================================================================== --- stable/11/share/man/man9/bus_map_resource.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/bus_map_resource.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -135,6 +135,8 @@ By default memory mappings use the .Dv VM_MEMATTR_UNCACHEABLE attribute. .El +.Sh RETURN VALUES +Zero is returned on success, otherwise an error is returned. .Sh EXAMPLES This maps a PCI memory BAR with the write-combining memory attribute and reads the first 32-bit word: @@ -153,9 +155,6 @@ reads the first 32-bit word: bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); val = bus_read_4(&map, 0); .Ed -.Pp -.Sh RETURN VALUES -Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO .Xr bus_activate_resource 9 , .Xr bus_alloc_resource 9 , Modified: stable/11/share/man/man9/counter.9 ============================================================================== --- stable/11/share/man/man9/counter.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/counter.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -224,7 +224,6 @@ static counter_u64_t array[MY_SIZE]; SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, &array[0], MY_SIZE, "Test counter array"); .Ed -.Pp .Sh SEE ALSO .Xr atomic 9 , .Xr critical 9 , Modified: stable/11/share/man/man9/osd.9 ============================================================================== --- stable/11/share/man/man9/osd.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/osd.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -412,7 +412,8 @@ return zero on success or ENOMEM if the specified type triggered an internal .Xr realloc 9 which failed -.Fn ( osd_set_reserved +.Ns ( +.Fn osd_set_reserved will always succeed when .Fa rsv is non-NULL). Modified: stable/11/share/man/man9/pmap_zero_page.9 ============================================================================== --- stable/11/share/man/man9/pmap_zero_page.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/pmap_zero_page.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -52,7 +52,6 @@ The function is used to zero-fill an area of a page. The range specified must not cross a page boundary; it must be contained entirely within a single page. -.Pp The .Fn pmap_zero_page_idle interface is used by the Modified: stable/11/share/man/man9/rman.9 ============================================================================== --- stable/11/share/man/man9/rman.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/rman.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -468,8 +468,8 @@ function returns a pointer to the device which reserve .Xr bus_alloc_resource 9 , .Xr bus_map_resource 9 , .Xr bus_release_resource 9 , -.Xr bus_space 9 , .Xr bus_set_resource 9 , +.Xr bus_space 9 , .Xr mutex 9 .Sh AUTHORS This manual page was written by Modified: stable/11/share/man/man9/tcp_functions.9 ============================================================================== --- stable/11/share/man/man9/tcp_functions.9 Wed Jul 19 18:41:16 2017 (r321228) +++ stable/11/share/man/man9/tcp_functions.9 Wed Jul 19 18:59:26 2017 (r321229) @@ -268,6 +268,7 @@ the current default function block. The .Fa blk argument references a function block that is not currently registered. +.El .Sh SEE ALSO .Xr malloc 9 , .Xr tcp 4 From owner-svn-src-all@freebsd.org Wed Jul 19 19:00: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 08D1FCFFE24; Wed, 19 Jul 2017 19:00:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC69967289; Wed, 19 Jul 2017 19:00: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 v6JJ0Xeb083421; Wed, 19 Jul 2017 19:00:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJ0X87083420; Wed, 19 Jul 2017 19:00:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707191900.v6JJ0X87083420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Jul 2017 19:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321230 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321230 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:00:34 -0000 Author: kib Date: Wed Jul 19 19:00:32 2017 New Revision: 321230 URL: https://svnweb.freebsd.org/changeset/base/321230 Log: Disable stack growth when accessed by AIO daemons. Commit message for r321173 incorrectly stated that the change disables automatic stack growth from the AIO daemons contexts, with explanation that this is currently prevents applying wrong resource limits. Fix this by actually disabling the growth. Noted by: alc Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jul 19 18:59:26 2017 (r321229) +++ head/sys/vm/vm_map.c Wed Jul 19 19:00:32 2017 (r321230) @@ -3698,8 +3698,15 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma p = curproc; vm = p->p_vmspace; - if (map != &p->p_vmspace->vm_map) + + /* + * Disallow stack growth when the access is performed by a + * debugger or AIO daemon. The reason is that the wrong + * resource limits are applied. + */ + if (map != &p->p_vmspace->vm_map || p->p_textvp == NULL) return (KERN_FAILURE); + MPASS(!map->system_map); guard = stack_guard_page * PAGE_SIZE; From owner-svn-src-all@freebsd.org Wed Jul 19 19:02: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 F0852CFFF1A; Wed, 19 Jul 2017 19:02:07 +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 BD5D56765F; Wed, 19 Jul 2017 19:02:07 +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 v6JJ26iV087336; Wed, 19 Jul 2017 19:02:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJ26Ub087335; Wed, 19 Jul 2017 19:02:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191902.v6JJ26Ub087335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:02: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: r321231 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 321231 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:02:08 -0000 Author: ngie Date: Wed Jul 19 19:02:06 2017 New Revision: 321231 URL: https://svnweb.freebsd.org/changeset/base/321231 Log: MFC note: content changes based on r309745 not included. MFC r315799: counter(9): fix igor/manlint warnings - Reword description of `counter_enter` slightly to fix wordiness [1]. - Expand "isn't" as "is not" [1]. - Add missing section number with .Xr sysctl calls [2]. Modified: stable/11/share/man/man9/counter.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/counter.9 ============================================================================== --- stable/11/share/man/man9/counter.9 Wed Jul 19 19:00:32 2017 (r321230) +++ stable/11/share/man/man9/counter.9 Wed Jul 19 19:02:06 2017 (r321231) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2016 +.Dd March 22, 2017 .Dt COUNTER 9 .Os .Sh NAME @@ -105,7 +105,7 @@ to .Fa c . The KPI does not guarantee any protection from wraparound. .It Fn counter_enter -Enter mode that would allow to safely update several counters via +Enter mode that would allow the safe update of several counters via .Fn counter_u64_add_protected . On some machines this expands to .Xr critical 9 @@ -130,7 +130,7 @@ Clear the counter and set it to zero. .It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr Declare a static -.Xr sysctl +.Xr sysctl 9 oid that would represent a .Nm . The @@ -142,7 +142,7 @@ A read of the oid returns value obtained through Any write to the oid zeroes it. .It Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr Create a -.Xr sysctl +.Xr sysctl 9 oid that would represent a .Nm . The @@ -154,7 +154,7 @@ A read of the oid returns value obtained through Any write to the oid zeroes it. .It Fn SYSCTL_COUNTER_U64_ARRAY parent nbr name access ptr len descr Declare a static -.Xr sysctl +.Xr sysctl 9 oid that would represent an array of .Nm . The @@ -171,7 +171,7 @@ values obtained through Any write to the oid zeroes all array elements. .It Fn SYSCTL_ADD_COUNTER_U64_ARRAY ctx parent nbr name access ptr len descr Create a -.Xr sysctl +.Xr sysctl 9 oid that would represent an array of .Nm . The From owner-svn-src-all@freebsd.org Wed Jul 19 19:06: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 DAF9DD7C132; Wed, 19 Jul 2017 19:06:20 +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 AA34C67908; Wed, 19 Jul 2017 19:06:20 +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 v6JJ6Jwc087557; Wed, 19 Jul 2017 19:06:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJ6JNL087555; Wed, 19 Jul 2017 19:06:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191906.v6JJ6JNL087555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321232 - stable/11/sys/boot/common X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/boot/common X-SVN-Commit-Revision: 321232 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:06:21 -0000 Author: ngie Date: Wed Jul 19 19:06:19 2017 New Revision: 321232 URL: https://svnweb.freebsd.org/changeset/base/321232 Log: MFC r316076: sys/boot/common: Make geli(4) support optional in MI sources This saves a negligible amount of memory for non-geli enabled bootloaders. Modified: stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/common/module.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Wed Jul 19 19:02:06 2017 (r321231) +++ stable/11/sys/boot/common/Makefile.inc Wed Jul 19 19:06:19 2017 (r321232) @@ -39,6 +39,9 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -DLOADER_MBR_SUPPORT .endif .endif +.if !defined(LOADER_NO_GELI_SUPPORT) +CFLAGS+= -DLOADER_GELI_SUPPORT +.endif .if defined(HAVE_BCACHE) SRCS+= bcache.c Modified: stable/11/sys/boot/common/module.c ============================================================================== --- stable/11/sys/boot/common/module.c Wed Jul 19 19:02:06 2017 (r321231) +++ stable/11/sys/boot/common/module.c Wed Jul 19 19:06:19 2017 (r321232) @@ -180,6 +180,7 @@ command_load(int argc, char *argv[]) return (error == 0 ? CMD_OK : CMD_CRIT); } +#ifdef LOADER_GELI_SUPPORT COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); static int @@ -217,6 +218,7 @@ command_load_geli(int argc, char *argv[]) sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); return (file_loadraw(argv[2], typestr, 1) ? CMD_OK : CMD_ERROR); } +#endif void unload(void) From owner-svn-src-all@freebsd.org Wed Jul 19 19:08: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 6E898D7C1F9; Wed, 19 Jul 2017 19:08:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4A70C67A5A; Wed, 19 Jul 2017 19:08:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JJ8but087693; Wed, 19 Jul 2017 19:08:37 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJ8bTY087689; Wed, 19 Jul 2017 19:08:37 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201707191908.v6JJ8bTY087689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 19 Jul 2017 19:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321233 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 321233 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:08:38 -0000 Author: davidcs Date: Wed Jul 19 19:08:37 2017 New Revision: 321233 URL: https://svnweb.freebsd.org/changeset/base/321233 Log: Raise the watchdog timer interval to 2 ticks, there by guaranteeing that it fires between 1ms and 2ms. ` Treat two consecutive occurrences of Heartbeat failures as a legitimate Heartbeat failure MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Jul 19 19:06:19 2017 (r321232) +++ head/sys/dev/qlxgbe/ql_def.h Wed Jul 19 19:08:37 2017 (r321233) @@ -105,7 +105,7 @@ struct qla_ivec { typedef struct qla_ivec qla_ivec_t; -#define QLA_WATCHDOG_CALLOUT_TICKS 1 +#define QLA_WATCHDOG_CALLOUT_TICKS 2 typedef struct _qla_tx_ring { qla_tx_buf_t tx_buf[NUM_TX_DESCRIPTORS]; Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:06:19 2017 (r321232) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:08:37 2017 (r321233) @@ -3366,7 +3366,7 @@ ql_hw_check_health(qla_host_t *ha) ha->hw.health_count++; - if (ha->hw.health_count < 1000) + if (ha->hw.health_count < 500) return 0; ha->hw.health_count = 0; @@ -3385,10 +3385,18 @@ ql_hw_check_health(qla_host_t *ha) if ((val != ha->hw.hbeat_value) && (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE)))) { ha->hw.hbeat_value = val; + ha->hw.hbeat_failure = 0; return 0; } - device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n", - __func__, val); + + ha->hw.hbeat_failure++; + + if (ha->hw.hbeat_failure < 2) /* we ignore the first failure */ + return 0; + else + device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n", + __func__, val); + return -1; } Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:06:19 2017 (r321232) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:08:37 2017 (r321233) @@ -1671,6 +1671,7 @@ typedef struct _qla_hw { /* heart beat register value */ uint32_t hbeat_value; uint32_t health_count; + uint32_t hbeat_failure; uint32_t max_tx_segs; uint32_t min_lro_pkt_size; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:06:19 2017 (r321232) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:08:37 2017 (r321233) @@ -276,7 +276,7 @@ qla_watchdog(void *arg) ha->qla_watchdog_paused = 1; } - ha->watchdog_ticks = ha->watchdog_ticks++ % 1000; + ha->watchdog_ticks = ha->watchdog_ticks++ % 500; callout_reset(&ha->tx_callout, QLA_WATCHDOG_CALLOUT_TICKS, qla_watchdog, ha); } From owner-svn-src-all@freebsd.org Wed Jul 19 19:30: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 AC0E2D7C8E2; Wed, 19 Jul 2017 19:30:14 +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 86018687FD; Wed, 19 Jul 2017 19:30:14 +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 v6JJUD30096304; Wed, 19 Jul 2017 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJUD0K096299; Wed, 19 Jul 2017 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191930.v6JJUD0K096299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:30:13 +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: r321234 - in stable/10: etc etc/mtree usr.sbin/syslogd X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc etc/mtree usr.sbin/syslogd X-SVN-Commit-Revision: 321234 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:30:14 -0000 Author: ngie Date: Wed Jul 19 19:30:13 2017 New Revision: 321234 URL: https://svnweb.freebsd.org/changeset/base/321234 Log: MFC r308160,r309194,r309216: r308160 (by bapt): syslogd(8): add an 'include' keyword All the '.conf' files not beginning with a '.' contained int he directory following the keyword will be included. This keyword can only be used in the first level configuration files. Modify the default syslogd.conf to 'include' /etc/syslog.d and /usr/local/etc/syslog.d It simplify a lot handling of syslog from automation tools. Relnotes: yes r309194 (by bapt): initialize *nextp which could be left uninitialized in case the configuration file cannot be open/read CID: 1365665 r309216 (by bapt): Properly initialize nextp Modified: stable/10/etc/mtree/BSD.root.dist stable/10/etc/syslog.conf stable/10/usr.sbin/syslogd/syslog.conf.5 stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/etc/mtree/BSD.root.dist Wed Jul 19 19:30:13 2017 (r321234) @@ -72,6 +72,8 @@ .. ssl .. + syslog.d + .. zfs .. .. Modified: stable/10/etc/syslog.conf ============================================================================== --- stable/10/etc/syslog.conf Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/etc/syslog.conf Wed Jul 19 19:30:13 2017 (r321234) @@ -34,3 +34,5 @@ cron.* /var/log/cron !ppp *.* /var/log/ppp.log !* +include /etc/syslog.d +include /usr/local/etc/syslog.d Modified: stable/10/usr.sbin/syslogd/syslog.conf.5 ============================================================================== --- stable/10/usr.sbin/syslogd/syslog.conf.5 Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/usr.sbin/syslogd/syslog.conf.5 Wed Jul 19 19:30:13 2017 (r321234) @@ -28,7 +28,7 @@ .\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 12, 2012 +.Dd November 1, 2016 .Dt SYSLOG.CONF 5 .Os .Sh NAME @@ -61,6 +61,12 @@ The field is separated from the .Em action field by one or more tab characters or spaces. +.Pp +A special +.Em include +keyword can be used to include all files with names ending in '.conf' and not +beginning with a '.' contained in the directory following the keyword. +This keyword can only be used in the first level configuration file. .Pp Note that if you use spaces as separators, your .Nm Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/usr.sbin/syslogd/syslogd.c Wed Jul 19 19:30:13 2017 (r321234) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -120,6 +121,8 @@ __FBSDID("$FreeBSD$"); const char *ConfFile = _PATH_LOGCONF; const char *PidFile = _PATH_LOGPID; const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #define dprintf if (Debug) printf @@ -1553,93 +1556,46 @@ die(int signo) exit(1); } -/* - * INIT -- Initialize syslogd from configuration table - */ -static void -init(int signo) +static int +configfiles(const struct dirent *dp) { - int i; - FILE *cf; - struct filed *f, *next, **nextp; - char *p; - char cline[LINE_MAX]; - char prog[LINE_MAX]; - char host[MAXHOSTNAMELEN]; - char oldLocalHostName[MAXHOSTNAMELEN]; - char hostMsg[2*MAXHOSTNAMELEN+40]; - char bootfileMsg[LINE_MAX]; + const char *p; + size_t ext_len; - dprintf("init\n"); + if (dp->d_name[0] == '.') + return (0); - /* - * Load hostname (may have changed). - */ - if (signo != 0) - (void)strlcpy(oldLocalHostName, LocalHostName, - sizeof(oldLocalHostName)); - if (gethostname(LocalHostName, sizeof(LocalHostName))) - err(EX_OSERR, "gethostname() failed"); - if ((p = strchr(LocalHostName, '.')) != NULL) { - *p++ = '\0'; - LocalDomain = p; - } else { - LocalDomain = ""; - } + ext_len = sizeof(include_ext) -1; - /* - * Close all open log files. - */ - Initialized = 0; - for (f = Files; f != NULL; f = next) { - /* flush any pending output */ - if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + if (dp->d_namlen <= ext_len) + return (0); - switch (f->f_type) { - case F_FILE: - case F_FORW: - case F_CONSOLE: - case F_TTY: - close_filed(f); - break; - case F_PIPE: - close_filed(f); - deadq_enter(f->f_un.f_pipe.f_pid, - f->f_un.f_pipe.f_pname); - break; - } - next = f->f_next; - if (f->f_program) free(f->f_program); - if (f->f_host) free(f->f_host); - free((char *)f); - } - Files = NULL; - nextp = &Files; + p = &dp->d_name[dp->d_namlen - ext_len]; + if (strcmp(p, include_ext) != 0) + return (0); - /* open the configuration file */ - if ((cf = fopen(ConfFile, "r")) == NULL) { - dprintf("cannot open %s\n", ConfFile); - *nextp = (struct filed *)calloc(1, sizeof(*f)); - if (*nextp == NULL) { - logerror("calloc"); - exit(1); - } - cfline("*.ERR\t/dev/console", *nextp, "*", "*"); - (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); - if ((*nextp)->f_next == NULL) { - logerror("calloc"); - exit(1); - } - cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); - Initialized = 1; - return; - } + return (1); +} +static void +readconfigfile(FILE *cf, struct filed **nextp, int allow_includes) +{ + FILE *cf2; + struct filed *f; + struct dirent **ent; + char cline[LINE_MAX]; + char host[MAXHOSTNAMELEN]; + char prog[LINE_MAX]; + char file[MAXPATHLEN]; + char *p, *tmp; + int i, nents; + size_t include_len; + /* * Foreach line in the conf table, open that file. */ f = NULL; + include_len = sizeof(include_str) -1; (void)strlcpy(host, "*", sizeof(host)); (void)strlcpy(prog, "*", sizeof(prog)); while (fgets(cline, sizeof(cline), cf) != NULL) { @@ -1652,6 +1608,42 @@ init(int signo) continue; if (*p == 0) continue; + if (allow_includes && + strncmp(p, include_str, include_len) == 0 && + isspace(p[include_len])) { + p += include_len; + while (isspace(*p)) + p++; + tmp = p; + while (*tmp != '\0' && !isspace(*tmp)) + tmp++; + *tmp = '\0'; + dprintf("Trying to include files in '%s'\n", p); + nents = scandir(p, &ent, configfiles, alphasort); + if (nents == -1) { + dprintf("Unable to open '%s': %s\n", p, + strerror(errno)); + continue; + } + for (i = 0; i < nents; i++) { + if (snprintf(file, sizeof(file), "%s/%s", p, + ent[i]->d_name) >= (int)sizeof(file)) { + dprintf("ignoring path too long: " + "'%s/%s'\n", p, ent[i]->d_name); + free(ent[i]); + continue; + } + free(ent[i]); + cf2 = fopen(file, "r"); + if (cf2 == NULL) + continue; + dprintf("reading %s\n", file); + readconfigfile(cf2, nextp, 0); + fclose(cf2); + } + free(ent); + continue; + } if (*p == '#') { p++; if (*p != '!' && *p != '+' && *p != '-') @@ -1713,6 +1705,89 @@ init(int signo) nextp = &f->f_next; cfline(cline, f, prog, host); } +} + +/* + * INIT -- Initialize syslogd from configuration table + */ +static void +init(int signo) +{ + int i; + FILE *cf; + struct filed *f, *next, **nextp; + char *p; + char oldLocalHostName[MAXHOSTNAMELEN]; + char hostMsg[2*MAXHOSTNAMELEN+40]; + char bootfileMsg[LINE_MAX]; + + dprintf("init\n"); + + /* + * Load hostname (may have changed). + */ + if (signo != 0) + (void)strlcpy(oldLocalHostName, LocalHostName, + sizeof(oldLocalHostName)); + if (gethostname(LocalHostName, sizeof(LocalHostName))) + err(EX_OSERR, "gethostname() failed"); + if ((p = strchr(LocalHostName, '.')) != NULL) { + *p++ = '\0'; + LocalDomain = p; + } else { + LocalDomain = ""; + } + + /* + * Close all open log files. + */ + Initialized = 0; + for (f = Files; f != NULL; f = next) { + /* flush any pending output */ + if (f->f_prevcount) + fprintlog(f, 0, (char *)NULL); + + switch (f->f_type) { + case F_FILE: + case F_FORW: + case F_CONSOLE: + case F_TTY: + close_filed(f); + break; + case F_PIPE: + close_filed(f); + deadq_enter(f->f_un.f_pipe.f_pid, + f->f_un.f_pipe.f_pname); + break; + } + next = f->f_next; + if (f->f_program) free(f->f_program); + if (f->f_host) free(f->f_host); + free((char *)f); + } + Files = NULL; + nextp = &Files; + + /* open the configuration file */ + if ((cf = fopen(ConfFile, "r")) == NULL) { + dprintf("cannot open %s\n", ConfFile); + *nextp = (struct filed *)calloc(1, sizeof(*f)); + if (*nextp == NULL) { + logerror("calloc"); + exit(1); + } + cfline("*.ERR\t/dev/console", *nextp, "*", "*"); + (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); + if ((*nextp)->f_next == NULL) { + logerror("calloc"); + exit(1); + } + cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); + Initialized = 1; + return; + } + + readconfigfile(cf, &Files, 1); /* close the configuration file */ (void)fclose(cf); From owner-svn-src-all@freebsd.org Wed Jul 19 19:38: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 0A9D8D7CC24; Wed, 19 Jul 2017 19:38:27 +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 CDA3B68DFF; Wed, 19 Jul 2017 19:38:26 +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 v6JJcP0L000608; Wed, 19 Jul 2017 19:38:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJcPn3000607; Wed, 19 Jul 2017 19:38:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191938.v6JJcPn3000607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321235 - head/usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/cron/cron X-SVN-Commit-Revision: 321235 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:38:27 -0000 Author: ngie Date: Wed Jul 19 19:38:25 2017 New Revision: 321235 URL: https://svnweb.freebsd.org/changeset/base/321235 Log: Fix trivial whitespace bug introduced in usage message changes for -n support (r304570). MFC after: now Modified: head/usr.sbin/cron/cron/cron.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Wed Jul 19 19:30:13 2017 (r321234) +++ head/usr.sbin/cron/cron/cron.c Wed Jul 19 19:38:25 2017 (r321235) @@ -59,7 +59,7 @@ usage() { #endif fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] " - "[-m mailto] [-n ] [-s] [-o] [-x debugflag[,...]]\n"); + "[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n"); #if DEBUGGING fprintf(stderr, "\ndebugflags: "); From owner-svn-src-all@freebsd.org Wed Jul 19 19:39: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 12068D7CCB3; Wed, 19 Jul 2017 19:39:28 +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 D492268F6D; Wed, 19 Jul 2017 19:39:27 +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 v6JJdRaf000737; Wed, 19 Jul 2017 19:39:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJdRmw000736; Wed, 19 Jul 2017 19:39:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191939.v6JJdRmw000736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:39: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: r321236 - stable/11/usr.sbin/cron/cron X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/cron/cron X-SVN-Commit-Revision: 321236 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:39:28 -0000 Author: ngie Date: Wed Jul 19 19:39:26 2017 New Revision: 321236 URL: https://svnweb.freebsd.org/changeset/base/321236 Log: MFC r321235: Fix trivial whitespace bug introduced in usage message changes for -n support (r304570). Modified: stable/11/usr.sbin/cron/cron/cron.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/cron/cron/cron.c ============================================================================== --- stable/11/usr.sbin/cron/cron/cron.c Wed Jul 19 19:38:25 2017 (r321235) +++ stable/11/usr.sbin/cron/cron/cron.c Wed Jul 19 19:39:26 2017 (r321236) @@ -59,7 +59,7 @@ usage() { #endif fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] " - "[-m mailto] [-n ] [-s] [-o] [-x debugflag[,...]]\n"); + "[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n"); #if DEBUGGING fprintf(stderr, "\ndebugflags: "); From owner-svn-src-all@freebsd.org Wed Jul 19 19:41: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 5633FD7CEC7; Wed, 19 Jul 2017 19:41:14 +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 30DA6692C0; Wed, 19 Jul 2017 19:41:14 +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 v6JJfDYS000995; Wed, 19 Jul 2017 19:41:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJfDX3000992; Wed, 19 Jul 2017 19:41:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191941.v6JJfDX3000992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:41:13 +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: r321237 - stable/10/usr.sbin/cron/cron X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/cron X-SVN-Commit-Revision: 321237 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:41:14 -0000 Author: ngie Date: Wed Jul 19 19:41:13 2017 New Revision: 321237 URL: https://svnweb.freebsd.org/changeset/base/321237 Log: MFC r304570,r321235: r304570 (by trasz): Add the "-n" flag to cron(8), to prevent it from daemonizing. This makes it possible to use it with external supervisors. The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD. r321235: Fix trivial whitespace bug introduced in usage message changes for -n support (r304570). Modified: stable/10/usr.sbin/cron/cron/cron.8 stable/10/usr.sbin/cron/cron/cron.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/cron.8 ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:39:26 2017 (r321236) +++ stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:41:13 2017 (r321237) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29, 2008 +.Dd August 21, 2016 .Dt CRON 8 .Os .Sh NAME @@ -28,6 +28,7 @@ .Op Fl j Ar jitter .Op Fl J Ar rootjitter .Op Fl m Ar mailto +.Op Fl n .Op Fl s .Op Fl o .Op Fl x Ar debugflag Ns Op , Ns Ar ... @@ -132,6 +133,8 @@ set to a null string, usually specified in a shell as .Li '' or .Li \*q\*q . +.It Fl n +Don't daemonize, run in foreground instead. .It Fl s Enable special handling of situations when the GMT offset of the local timezone changes, such as the switches between the standard time and Modified: stable/10/usr.sbin/cron/cron/cron.c ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.c Wed Jul 19 19:39:26 2017 (r321236) +++ stable/10/usr.sbin/cron/cron/cron.c Wed Jul 19 19:41:13 2017 (r321237) @@ -49,6 +49,7 @@ static int run_at_secres(cron_db *); static time_t last_time = 0; static int dst_enabled = 0; +static int dont_daemonize = 0; struct pidfh *pfh; static void @@ -58,7 +59,7 @@ usage() { #endif fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] " - "[-m mailto] [-s] [-o] [-x debugflag[,...]]\n"); + "[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n"); #if DEBUGGING fprintf(stderr, "\ndebugflags: "); @@ -136,7 +137,7 @@ main(argc, argv) if (0) { # endif (void) fprintf(stderr, "[%d] cron started\n", getpid()); - } else { + } else if (dont_daemonize == 0) { if (daemon(1, 0) == -1) { pidfile_remove(pfh); log_it("CRON",getpid(),"DEATH","can't become daemon"); @@ -512,7 +513,7 @@ parse_args(argc, argv) int argch; char *endp; - while ((argch = getopt(argc, argv, "j:J:m:osx:")) != -1) { + while ((argch = getopt(argc, argv, "j:J:m:nosx:")) != -1) { switch (argch) { case 'j': Jitter = strtoul(optarg, &endp, 10); @@ -528,6 +529,9 @@ parse_args(argc, argv) break; case 'm': defmailto = optarg; + break; + case 'n': + dont_daemonize = 1; break; case 'o': dst_enabled = 0; From owner-svn-src-all@freebsd.org Wed Jul 19 19:53: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 EFBF1D7D181; Wed, 19 Jul 2017 19:53:08 +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 BCFB969B8C; Wed, 19 Jul 2017 19:53: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 v6JJr7on009064; Wed, 19 Jul 2017 19:53:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJr7T5009063; Wed, 19 Jul 2017 19:53:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191953.v6JJr7T5009063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321240 - head/usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/cron/cron X-SVN-Commit-Revision: 321240 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 19:53:09 -0000 Author: ngie Date: Wed Jul 19 19:53:07 2017 New Revision: 321240 URL: https://svnweb.freebsd.org/changeset/base/321240 Log: cron(8) manpage updates - Document /etc/cron.d and /usr/local/etc/cron.d under FILES. - Reword documentation for -n: add appropriate soft-stop and remove contraction to appease igor. MFC after: 3 days Modified: head/usr.sbin/cron/cron/cron.8 Modified: head/usr.sbin/cron/cron/cron.8 ============================================================================== --- head/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:43:10 2017 (r321239) +++ head/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:53:07 2017 (r321240) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2016 +.Dd July 19, 2017 .Dt CRON 8 .Os .Sh NAME @@ -138,7 +138,7 @@ set to a null string, usually specified in a shell as or .Li \*q\*q . .It Fl n -Don't daemonize, run in foreground instead. +Do not daemonize; run in foreground instead. .It Fl s Enable special handling of situations when the GMT offset of the local timezone changes, such as the switches between the standard time and @@ -209,13 +209,17 @@ trace through the execution, but do not perform any ac .El .El .Sh FILES -.Bl -tag -width /etc/pam.d/cron -compact +.Bl -tag -width /usr/local/etc/cron.d -compact .It Pa /etc/crontab System crontab file +.It Pa /etc/cron.d +Directory for optional/modularized system crontab files. .It Pa /etc/pam.d/cron .Xr pam.conf 5 configuration file for .Nm +.It Pa /usr/local/etc/cron.d +Directory for third-party package provided crontab files. .It Pa /var/cron/tabs Directory for personal crontab files .El From owner-svn-src-all@freebsd.org Wed Jul 19 20:22: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 87D19D7D7C4; Wed, 19 Jul 2017 20:22:17 +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 5EE076A87C; Wed, 19 Jul 2017 20:22:17 +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 v6JKMGHW019832; Wed, 19 Jul 2017 20:22:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKMGgo019830; Wed, 19 Jul 2017 20:22:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192022.v6JKMGgo019830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321241 - stable/11/usr.sbin/cron/crontab X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/cron/crontab X-SVN-Commit-Revision: 321241 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:22:17 -0000 Author: ngie Date: Wed Jul 19 20:22:16 2017 New Revision: 321241 URL: https://svnweb.freebsd.org/changeset/base/321241 Log: MFC r310329: r310329 (by cem): Add a 'force' option for non-interactive crontab removal Add a '-f' option to force crontab '-r' to be non-interactive. Modified: stable/11/usr.sbin/cron/crontab/crontab.1 stable/11/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/cron/crontab/crontab.1 ============================================================================== --- stable/11/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 19:53:07 2017 (r321240) +++ stable/11/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 20:22:16 2017 (r321241) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd December 20, 2016 .Dt CRONTAB 1 .Os .Sh NAME @@ -31,7 +31,8 @@ .Op Fl u Ar user { .Fl l | -.Fl r | +.Fl r Op Fl f +| .Fl e } .Sh DESCRIPTION @@ -97,6 +98,11 @@ option for safety's sake. Display the current crontab on standard output. .It Fl r Remove the current crontab. +By default the +.Fl r +option prompts for confirmation, adding the +.Fl f +option will attempt to remove the current crontab without confirmation. .It Fl e Edit the current crontab using the editor specified by the Modified: stable/11/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/11/usr.sbin/cron/crontab/crontab.c Wed Jul 19 19:53:07 2017 (r321240) +++ stable/11/usr.sbin/cron/crontab/crontab.c Wed Jul 19 20:22:16 2017 (r321241) @@ -63,6 +63,7 @@ static char Filename[MAX_FNAME]; static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; +static int fflag; static struct passwd *pw; static void list_cmd(void), delete_cmd(void), @@ -79,7 +80,7 @@ usage(char *msg) fprintf(stderr, "crontab: usage error: %s\n", msg); fprintf(stderr, "%s\n%s\n", "usage: crontab [-u user] file", - " crontab [-u user] { -e | -l | -r }"); + " crontab [-u user] { -l | -r [-f] | -e }"); exit(ERROR_EXIT); } @@ -142,7 +143,7 @@ parse_args(argc, argv) strcpy(RealUser, User); Filename[0] = '\0'; Option = opt_unknown; - while ((argch = getopt(argc, argv, "u:lerx:")) != -1) { + while ((argch = getopt(argc, argv, "u:lerx:f")) != -1) { switch (argch) { case 'x': if (!set_debug_flags(optarg)) @@ -172,6 +173,9 @@ parse_args(argc, argv) usage("only one operation permitted"); Option = opt_edit; break; + case 'f': + fflag = 1; + break; default: usage("unrecognized option"); } @@ -282,7 +286,7 @@ delete_cmd() { char n[MAX_FNAME]; int ch, first; - if (isatty(STDIN_FILENO)) { + if (!fflag && isatty(STDIN_FILENO)) { (void)fprintf(stderr, "remove crontab for %s? ", User); first = ch = getchar(); while (ch != '\n' && ch != EOF) From owner-svn-src-all@freebsd.org Wed Jul 19 20:24: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 6D741D7D86F; Wed, 19 Jul 2017 20:24:40 +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 478BD6AA4D; Wed, 19 Jul 2017 20:24:40 +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 v6JKOd78021568; Wed, 19 Jul 2017 20:24:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKOchu021562; Wed, 19 Jul 2017 20:24:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192024.v6JKOchu021562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:24: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: r321242 - in stable/10: etc/mtree usr.sbin/cron/cron usr.sbin/cron/lib X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.sbin/cron/cron usr.sbin/cron/lib X-SVN-Commit-Revision: 321242 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:24:40 -0000 Author: ngie Date: Wed Jul 19 20:24:38 2017 New Revision: 321242 URL: https://svnweb.freebsd.org/changeset/base/321242 Log: MFC r308139,r308157,r308158: r308139 (by bapt): cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d For automation tools it is way easier to maintain files in directories rather than modifying /etc/crontab. The files in those directories are in the same format as /etc/crontab Relnotes: yes r308157 (by bapt): Fix typo in cron(8) date r308158 (by bapt): Allow symlinks to be followed in cron.d directories and fix detection of regular files on NFS Modified: stable/10/etc/mtree/BSD.root.dist stable/10/usr.sbin/cron/cron/cron.8 stable/10/usr.sbin/cron/cron/cron.h stable/10/usr.sbin/cron/cron/database.c stable/10/usr.sbin/cron/cron/pathnames.h stable/10/usr.sbin/cron/lib/misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/etc/mtree/BSD.root.dist Wed Jul 19 20:24:38 2017 (r321242) @@ -30,6 +30,8 @@ .. bluetooth .. + cron.d + .. defaults .. devd Modified: stable/10/usr.sbin/cron/cron/cron.8 ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 20:24:38 2017 (r321242) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2016 +.Dd October 31, 2016 .Dt CRON 8 .Os .Sh NAME @@ -53,7 +53,11 @@ The .Nm utility also searches for .Pa /etc/crontab -which is in a different format (see +and files in +.Pa /etc/cron.d +and +.Pa /usr/local/etc/cron.d +which are in a different format (see .Xr crontab 5 ) . .Pp The Modified: stable/10/usr.sbin/cron/cron/cron.h ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.h Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/cron.h Wed Jul 19 20:24:38 2017 (r321242) @@ -218,7 +218,7 @@ void set_cron_uid(void), unget_char(int, FILE *), free_entry(entry *), skip_comments(FILE *), - log_it(char *, int, char *, char *), + log_it(char *, int, char *, const char *), log_close(void); int job_runqueue(void), Modified: stable/10/usr.sbin/cron/cron/database.c ============================================================================== --- stable/10/usr.sbin/cron/cron/database.c Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/database.c Wed Jul 19 20:24:38 2017 (r321242) @@ -44,10 +44,19 @@ load_database(old_db) { DIR *dir; struct stat statbuf; - struct stat syscron_stat; + struct stat syscron_stat, st; + time_t maxmtime; DIR_T *dp; cron_db new_db; user *u, *nu; + struct { + const char *name; + struct stat st; + } syscrontabs [] = { + { SYSCRONTABS }, + { LOCALSYSCRONTABS } + }; + int i; Debug(DLOAD, ("[%d] load_database()\n", getpid())) @@ -65,6 +74,16 @@ load_database(old_db) if (stat(SYSCRONTAB, &syscron_stat) < OK) syscron_stat.st_mtime = 0; + maxmtime = TMAX(statbuf.st_mtime, syscron_stat.st_mtime); + + for (i = 0; i < nitems(syscrontabs); i++) { + if (stat(syscrontabs[i].name, &syscrontabs[i].st) != -1) { + maxmtime = TMAX(syscrontabs[i].st.st_mtime, maxmtime); + } else { + syscrontabs[i].st.st_mtime = 0; + } + } + /* if spooldir's mtime has not changed, we don't need to fiddle with * the database. * @@ -72,7 +91,7 @@ load_database(old_db) * so is guaranteed to be different than the stat() mtime the first * time this function is called. */ - if (old_db->mtime == TMAX(statbuf.st_mtime, syscron_stat.st_mtime)) { + if (old_db->mtime == maxmtime) { Debug(DLOAD, ("[%d] spool dir mtime unch, no load needed.\n", getpid())) return; @@ -83,13 +102,37 @@ load_database(old_db) * actually changed. Whatever is left in the old database when * we're done is chaff -- crontabs that disappeared. */ - new_db.mtime = TMAX(statbuf.st_mtime, syscron_stat.st_mtime); + new_db.mtime = maxmtime; new_db.head = new_db.tail = NULL; if (syscron_stat.st_mtime) { process_crontab("root", SYS_NAME, SYSCRONTAB, &syscron_stat, &new_db, old_db); + } + + for (i = 0; i < nitems(syscrontabs); i++) { + char tabname[MAXPATHLEN]; + if (syscrontabs[i].st.st_mtime == 0) + continue; + if (!(dir = opendir(syscrontabs[i].name))) { + log_it("CRON", getpid(), "OPENDIR FAILED", + syscrontabs[i].name); + (void) exit(ERROR_EXIT); + } + + while (NULL != (dp = readdir(dir))) { + if (dp->d_name[0] == '.') + continue; + if (fstatat(dirfd(dir), dp->d_name, &st, 0) == 0 && + !S_ISREG(st.st_mode)) + continue; + snprintf(tabname, sizeof(tabname), "%s/%s", + syscrontabs[i].name, dp->d_name); + process_crontab("root", SYS_NAME, tabname, + &syscrontabs[i].st, &new_db, old_db); + } + closedir(dir); } /* we used to keep this dir open all the time, for the sake of Modified: stable/10/usr.sbin/cron/cron/pathnames.h ============================================================================== --- stable/10/usr.sbin/cron/cron/pathnames.h Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/pathnames.h Wed Jul 19 20:24:38 2017 (r321242) @@ -62,6 +62,8 @@ /* 4.3BSD-style crontab */ #define SYSCRONTAB "/etc/crontab" +#define SYSCRONTABS "/etc/cron.d" +#define LOCALSYSCRONTABS "/usr/local/etc/cron.d" /* what editor to use if no EDITOR or VISUAL * environment variable specified. Modified: stable/10/usr.sbin/cron/lib/misc.c ============================================================================== --- stable/10/usr.sbin/cron/lib/misc.c Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/lib/misc.c Wed Jul 19 20:24:38 2017 (r321242) @@ -385,11 +385,7 @@ out: if (allow) void -log_it(username, xpid, event, detail) - char *username; - int xpid; - char *event; - char *detail; +log_it(char *username, int xpid, char *event, const char *detail) { #if defined(LOG_FILE) || DEBUGGING PID_T pid = xpid; From owner-svn-src-all@freebsd.org Wed Jul 19 20:26: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 7F2B2D7D92A; Wed, 19 Jul 2017 20:26:36 +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 566656ABB0; Wed, 19 Jul 2017 20:26:36 +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 v6JKQZpd021717; Wed, 19 Jul 2017 20:26:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKQZ1m021715; Wed, 19 Jul 2017 20:26:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192026.v6JKQZ1m021715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:26:35 +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: r321243 - stable/10/usr.sbin/cron/crontab X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/crontab X-SVN-Commit-Revision: 321243 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:26:36 -0000 Author: ngie Date: Wed Jul 19 20:26:35 2017 New Revision: 321243 URL: https://svnweb.freebsd.org/changeset/base/321243 Log: MFC r310329: r310329 (by cem): Add a 'force' option for non-interactive crontab removal Add a '-f' option to force crontab '-r' to be non-interactive. Modified: stable/10/usr.sbin/cron/crontab/crontab.1 stable/10/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/crontab/crontab.1 ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 20:24:38 2017 (r321242) +++ stable/10/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 20:26:35 2017 (r321243) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd December 20, 2016 .Dt CRONTAB 1 .Os .Sh NAME @@ -31,7 +31,8 @@ .Op Fl u Ar user { .Fl l | -.Fl r | +.Fl r Op Fl f +| .Fl e } .Sh DESCRIPTION @@ -97,6 +98,11 @@ option for safety's sake. Display the current crontab on standard output. .It Fl r Remove the current crontab. +By default the +.Fl r +option prompts for confirmation, adding the +.Fl f +option will attempt to remove the current crontab without confirmation. .It Fl e Edit the current crontab using the editor specified by the Modified: stable/10/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.c Wed Jul 19 20:24:38 2017 (r321242) +++ stable/10/usr.sbin/cron/crontab/crontab.c Wed Jul 19 20:26:35 2017 (r321243) @@ -63,6 +63,7 @@ static char Filename[MAX_FNAME]; static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; +static int fflag; static struct passwd *pw; static void list_cmd(void), delete_cmd(void), @@ -79,7 +80,7 @@ usage(char *msg) fprintf(stderr, "crontab: usage error: %s\n", msg); fprintf(stderr, "%s\n%s\n", "usage: crontab [-u user] file", - " crontab [-u user] { -e | -l | -r }"); + " crontab [-u user] { -l | -r [-f] | -e }"); exit(ERROR_EXIT); } @@ -142,7 +143,7 @@ parse_args(argc, argv) strcpy(RealUser, User); Filename[0] = '\0'; Option = opt_unknown; - while ((argch = getopt(argc, argv, "u:lerx:")) != -1) { + while ((argch = getopt(argc, argv, "u:lerx:f")) != -1) { switch (argch) { case 'x': if (!set_debug_flags(optarg)) @@ -172,6 +173,9 @@ parse_args(argc, argv) usage("only one operation permitted"); Option = opt_edit; break; + case 'f': + fflag = 1; + break; default: usage("unrecognized option"); } @@ -282,7 +286,7 @@ delete_cmd() { char n[MAX_FNAME]; int ch, first; - if (isatty(STDIN_FILENO)) { + if (!fflag && isatty(STDIN_FILENO)) { (void)fprintf(stderr, "remove crontab for %s? ", User); first = ch = getchar(); while (ch != '\n' && ch != EOF) From owner-svn-src-all@freebsd.org Wed Jul 19 20:29: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 2431CD7DA2B; Wed, 19 Jul 2017 20:29: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 E5B756AD55; Wed, 19 Jul 2017 20:29: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 v6JKT8WD021870; Wed, 19 Jul 2017 20:29:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKT85g021869; Wed, 19 Jul 2017 20:29:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192029.v6JKT85g021869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:29: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: r321244 - stable/10/usr.sbin/cron/cron X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/cron X-SVN-Commit-Revision: 321244 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:29:09 -0000 Author: ngie Date: Wed Jul 19 20:29:07 2017 New Revision: 321244 URL: https://svnweb.freebsd.org/changeset/base/321244 Log: MFC r269550: r269550 (by peter): Check gethostname(2) return code - but even if it succeeds it may not null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet. Modified: stable/10/usr.sbin/cron/cron/do_command.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/10/usr.sbin/cron/cron/do_command.c Wed Jul 19 20:26:35 2017 (r321243) +++ stable/10/usr.sbin/cron/cron/do_command.c Wed Jul 19 20:29:07 2017 (r321244) @@ -484,14 +484,17 @@ child_process(e, u) auto char mailcmd[MAX_COMMAND]; auto char hostname[MAXHOSTNAMELEN]; - (void) gethostname(hostname, MAXHOSTNAMELEN); + if (gethostname(hostname, MAXHOSTNAMELEN) == -1) + hostname[0] = '\0'; + hostname[sizeof(hostname) - 1] = '\0'; (void) snprintf(mailcmd, sizeof(mailcmd), MAILARGS, MAILCMD); if (!(mail = cron_popen(mailcmd, "w", e))) { warn("%s", MAILCMD); (void) _exit(ERROR_EXIT); } - fprintf(mail, "From: %s (Cron Daemon)\n", usernm); + fprintf(mail, "From: Cron Daemon <%s@%s>\n", + usernm, hostname); fprintf(mail, "To: %s\n", mailto); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), From owner-svn-src-all@freebsd.org Wed Jul 19 20:44: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 DC3B5D7DFE1; Wed, 19 Jul 2017 20:44:51 +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 AA3496B606; Wed, 19 Jul 2017 20:44:51 +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 v6JKioGh029676; Wed, 19 Jul 2017 20:44:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKioge029674; Wed, 19 Jul 2017 20:44:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192044.v6JKioge029674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:44:50 +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: r321245 - in stable/10: etc/pam.d tools/build/mk X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/pam.d tools/build/mk X-SVN-Commit-Revision: 321245 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:44:52 -0000 Author: ngie Date: Wed Jul 19 20:44:50 2017 New Revision: 321245 URL: https://svnweb.freebsd.org/changeset/base/321245 Log: MFC r269550: r269550 (by peter): Check gethostname(2) return code - but even if it succeeds it may not null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet. Modified: stable/10/etc/pam.d/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/pam.d/Makefile ============================================================================== --- stable/10/etc/pam.d/Makefile Wed Jul 19 20:29:07 2017 (r321244) +++ stable/10/etc/pam.d/Makefile Wed Jul 19 20:44:50 2017 (r321245) @@ -1,23 +1,34 @@ # $FreeBSD$ +.include + NO_OBJ= FILES= README \ - atrun \ cron \ - ftpd \ imap \ login \ other \ passwd pop3 \ rsh \ sshd su system \ - telnetd \ xdm +.if ${MK_AT} != "no" +FILES+= atrun +.endif + +.if ${MK_FTP} != "no" +FILES+= ftpd +LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp +.endif + +.if ${MK_TELNET} != "no" +FILES+= telnetd +.endif + FILESDIR= /etc/pam.d FILESMODE= 644 FILESMODE_README= 444 -LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:29:07 2017 (r321244) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:44:50 2017 (r321245) @@ -89,6 +89,7 @@ OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz .endif .if ${MK_AT} == no +OLD_FILES+=etc/pam.d/atrun OLD_FILES+=usr/bin/at OLD_FILES+=usr/bin/atq OLD_FILES+=usr/bin/atrm @@ -1063,6 +1064,8 @@ OLD_FILES+=usr/share/man/man8/fmtree.8.gz .if ${MK_FTP} == no OLD_FILES+=etc/ftpusers +OLD_FILES+=etc/pam.d/ftp +OLD_FILES+=etc/pam.d/ftpd OLD_FILES+=etc/rc.d/ftpd OLD_FILES+=usr/bin/ftp OLD_FILES+=usr/bin/gate-ftp @@ -4778,6 +4781,7 @@ OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat .endif .if ${MK_TELNET} == no +OLD_FILES+=etc/pam.d/telnetd OLD_FILES+=usr/bin/telnet OLD_FILES+=usr/libexec/telnetd OLD_FILES+=usr/share/man/man1/telnet.1.gz From owner-svn-src-all@freebsd.org Wed Jul 19 20:49: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 B3BDAD7E08C; Wed, 19 Jul 2017 20:49:05 +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 8212C6B86F; Wed, 19 Jul 2017 20:49:05 +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 v6JKn4SH030029; Wed, 19 Jul 2017 20:49:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKn4vH030027; Wed, 19 Jul 2017 20:49:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192049.v6JKn4vH030027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321246 - in stable/11: etc/pam.d tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/pam.d tools/build/mk X-SVN-Commit-Revision: 321246 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:49:05 -0000 Author: ngie Date: Wed Jul 19 20:49:04 2017 New Revision: 321246 URL: https://svnweb.freebsd.org/changeset/base/321246 Log: MFC r316818: Conditionally install /etc/pam.d/ftp* and /etc/pam.d/telnetd /etc/pam.d/ftp* should be installed with MK_FTP != no and /etc/pam.d/telnetd should be installed when MK_TELNET != no. Modified: stable/11/etc/pam.d/Makefile stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/pam.d/Makefile ============================================================================== --- stable/11/etc/pam.d/Makefile Wed Jul 19 20:44:50 2017 (r321245) +++ stable/11/etc/pam.d/Makefile Wed Jul 19 20:49:04 2017 (r321246) @@ -8,13 +8,11 @@ FILESGROUPS= FILES FILES= README \ cron \ - ftpd \ imap \ login \ other \ passwd pop3 \ sshd su system \ - telnetd \ xdm FILESDIR= /etc/pam.d @@ -28,6 +26,15 @@ ATDIR= ${FILESDIR} ATMODE= ${FILESMODE} .endif +.if ${MK_FTP} != "no" +FILESGROUPS+= FTP +FTP+= ftpd +FTPPACKAGE+= ftp +FTPDIR= ${FILESDIR} +FTPMODE= ${FILESMODE} +LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp +.endif + .if ${MK_RCMDS} != "no" FILESGROUPS+= RCMDS RCMDS+= rsh @@ -36,7 +43,14 @@ RCMDSDIR= ${FILESDIR} RCMDSMODE= ${FILESMODE} .endif +.if ${MK_TELNET} != "no" +FILESGROUPS+= TELNET +TELNET+= telnetd +TELNETPACKAGE+= telnet +TELNETDIR= ${FILESDIR} +TELNETMODE= ${FILESMODE} +.endif + FILESMODE_README= 444 -LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp .include Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:44:50 2017 (r321245) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:49:04 2017 (r321246) @@ -1607,6 +1607,8 @@ OLD_FILES+=usr/share/man/man8/fmtree.8.gz .if ${MK_FTP} == no OLD_FILES+=etc/ftpusers +OLD_FILES+=etc/pam.d/ftp +OLD_FILES+=etc/pam.d/ftpd OLD_FILES+=etc/rc.d/ftpd OLD_FILES+=usr/bin/ftp OLD_FILES+=usr/bin/gate-ftp @@ -7725,6 +7727,7 @@ OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat .endif .if ${MK_TELNET} == no +OLD_FILES+=etc/pam.d/telnetd OLD_FILES+=usr/bin/telnet OLD_FILES+=usr/libexec/telnetd OLD_FILES+=usr/share/man/man1/telnet.1.gz From owner-svn-src-all@freebsd.org Wed Jul 19 20:52: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 15234D7E22A; Wed, 19 Jul 2017 20:52:49 +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 AF8B16BC26; Wed, 19 Jul 2017 20:52:48 +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 v6JKqlp3034028; Wed, 19 Jul 2017 20:52:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKqlI0034022; Wed, 19 Jul 2017 20:52:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707192052.v6JKqlI0034022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Jul 2017 20:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321247 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 321247 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:52:49 -0000 Author: kib Date: Wed Jul 19 20:52:47 2017 New Revision: 321247 URL: https://svnweb.freebsd.org/changeset/base/321247 Log: Add pctrie_init() and vm_radix_init() to initialize generic pctrie and vm_radix trie. Existing vm_radix_init() function is renamed to vm_radix_zinit(). Inlines moved out of the _ headers. Reviewed by: alc, markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11661 Modified: head/sys/sys/_pctrie.h head/sys/sys/pctrie.h head/sys/vm/_vm_radix.h head/sys/vm/vm_object.c head/sys/vm/vm_radix.c head/sys/vm/vm_radix.h Modified: head/sys/sys/_pctrie.h ============================================================================== --- head/sys/sys/_pctrie.h Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/sys/_pctrie.h Wed Jul 19 20:52:47 2017 (r321247) @@ -38,14 +38,4 @@ struct pctrie { uintptr_t pt_root; }; -#ifdef _KERNEL - -static __inline boolean_t -pctrie_is_empty(struct pctrie *ptree) -{ - - return (ptree->pt_root == 0); -} - -#endif /* _KERNEL */ #endif /* !__SYS_PCTRIE_H_ */ Modified: head/sys/sys/pctrie.h ============================================================================== --- head/sys/sys/pctrie.h Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/sys/pctrie.h Wed Jul 19 20:52:47 2017 (r321247) @@ -119,5 +119,19 @@ void pctrie_remove(struct pctrie *ptree, uint64_t key size_t pctrie_node_size(void); int pctrie_zone_init(void *mem, int size, int flags); +static __inline void +pctrie_init(struct pctrie *ptree) +{ + + ptree->pt_root = 0; +} + +static __inline boolean_t +pctrie_is_empty(struct pctrie *ptree) +{ + + return (ptree->pt_root == 0); +} + #endif /* _KERNEL */ #endif /* !_SYS_PCTRIE_H_ */ Modified: head/sys/vm/_vm_radix.h ============================================================================== --- head/sys/vm/_vm_radix.h Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/vm/_vm_radix.h Wed Jul 19 20:52:47 2017 (r321247) @@ -38,14 +38,4 @@ struct vm_radix { uintptr_t rt_root; }; -#ifdef _KERNEL - -static __inline boolean_t -vm_radix_is_empty(struct vm_radix *rtree) -{ - - return (rtree->rt_root == 0); -} - -#endif /* _KERNEL */ #endif /* !__VM_RADIX_H_ */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/vm/vm_object.c Wed Jul 19 20:52:47 2017 (r321247) @@ -204,7 +204,7 @@ vm_object_zinit(void *mem, int size, int flags) /* These are true for any object that has been freed */ object->type = OBJT_DEAD; object->ref_count = 0; - object->rtree.rt_root = 0; + vm_radix_init(&object->rtree); object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; @@ -301,7 +301,7 @@ vm_object_init(void) #endif vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - vm_radix_init(); + vm_radix_zinit(); } void Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/vm/vm_radix.c Wed Jul 19 20:52:47 2017 (r321247) @@ -310,7 +310,7 @@ SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_TH * Initialize the UMA slab zone. */ void -vm_radix_init(void) +vm_radix_zinit(void) { vm_radix_node_zone = uma_zcreate("RADIX NODE", Modified: head/sys/vm/vm_radix.h ============================================================================== --- head/sys/vm/vm_radix.h Wed Jul 19 20:49:04 2017 (r321246) +++ head/sys/vm/vm_radix.h Wed Jul 19 20:52:47 2017 (r321247) @@ -35,7 +35,6 @@ #ifdef _KERNEL -void vm_radix_init(void); int vm_radix_insert(struct vm_radix *rtree, vm_page_t page); boolean_t vm_radix_is_singleton(struct vm_radix *rtree); vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index); @@ -44,6 +43,21 @@ vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, v void vm_radix_reclaim_allnodes(struct vm_radix *rtree); vm_page_t vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage); +void vm_radix_zinit(void); + +static __inline void +vm_radix_init(struct vm_radix *rtree) +{ + + rtree->rt_root = 0; +} + +static __inline boolean_t +vm_radix_is_empty(struct vm_radix *rtree) +{ + + return (rtree->rt_root == 0); +} #endif /* _KERNEL */ #endif /* !_VM_RADIX_H_ */ From owner-svn-src-all@freebsd.org Wed Jul 19 20:57: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 E2B73D7E346; Wed, 19 Jul 2017 20:57:42 +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 A69D46BED9; Wed, 19 Jul 2017 20:57:42 +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 v6JKvfG6034337; Wed, 19 Jul 2017 20:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKvfUV034336; Wed, 19 Jul 2017 20:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707192057.v6JKvfUV034336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 19 Jul 2017 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321248 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 321248 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:57:43 -0000 Author: rmacklem Date: Wed Jul 19 20:57:41 2017 New Revision: 321248 URL: https://svnweb.freebsd.org/changeset/base/321248 Log: Update the nfsv4 man page to reflect recent changes to support the newer RFCs (5661 and 7530). The main man changes are for the case of "numbers in strings" for user/groups that RFC7530 allows and avoids use of nfsuserd(8). This is a content change. Reviewed by: trasz (earlier version) MFC after: 1 week Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Wed Jul 19 20:52:47 2017 (r321247) +++ head/usr.sbin/nfsd/nfsv4.4 Wed Jul 19 20:57:41 2017 (r321248) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2013 +.Dd July 19, 2017 .Dt NFSV4 4 .Os .Sh NAME @@ -34,7 +34,8 @@ The NFS client and server provides support for the .Tn NFSv4 specification; see -.%T "Network File System (NFS) Version 4 Protocol RFC 3530" . +.%T "Network File System (NFS) Version 4 Protocol RFC 7530" and +.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" . The protocol is somewhat similar to NFS Version 3, but differs in significant ways. It uses a single compound RPC that concatenates operations to-gether. @@ -74,6 +75,7 @@ It provides several optional features not present in N - Referrals, which redirect subtrees to other servers (not yet implemented) - Delegations, which allow a client to operate on a file locally +- pNFS, where I/O operations are separated from Metadata operations .Ed .Pp The @@ -115,8 +117,8 @@ multiple server file systems, although not all clients this. .Pp .Nm -uses names for users and groups instead of numbers. -On the wire, they +uses strings for users and groups instead of numbers. +On the wire, these strings can either have the numbers in the string or take the form: .sp .Bd -literal -offset indent -compact @@ -136,15 +138,37 @@ Under FreeBSD, the mapping daemon is called .Xr nfsuserd 8 and has a command line option that overrides the domain component of the machine's hostname. -For use of +For use of this form of string on .Nm , either client or server, this daemon must be running. -If this ``'' is not set correctly or the daemon is not running, ``ls -l'' will typically +.Pp +The form where the numbers are in the strings can only be used for AUTH_SYS. +To configure your systems this way, the +.Xr nfsuserd 8 +daemon does not need to be running on the server, but the following sysctls need to be +set to 1 on the server. +.sp +.Bd -literal -offset indent -compact +vfs.nfs.enable_uidtostring +vfs.nfsd.enable_stringtouid +.Ed +.sp +On the client, the sysctl +.sp +.Bd -literal -offset indent -compact +vfs.nfs.enable_uidtostring +.Ed +.sp +must be set to 1 and the +.Xr nfsuserd 8 +daemon does not need to be running. +.Pp +If these strings are not configured correctly, ``ls -l'' will typically report a lot of ``nobody'' and ``nogroup'' ownerships. .Pp Although uid/gid numbers are no longer used in the .Nm -protocol, they will still be in the RPC authentication fields when +protocol except optionally in the above strings, they will still be in the RPC authentication fields when using AUTH_SYS (sec=sys), which is the default. As such, in this case both the user/group name and number spaces must be consistent between the client and server. @@ -156,24 +180,24 @@ will go on the wire. .Sh SERVER SETUP To set up the NFS server that supports .Nm , -you will need to either set the variables in +you will need to set the variables in .Xr rc.conf 5 as follows: .sp .Bd -literal -offset indent -compact nfs_server_enable="YES" nfsv4_server_enable="YES" +.Ed +.sp +plus +.sp +.Bd -literal -offset indent -compact nfsuserd_enable="YES" .Ed .sp -or start -.Xr mountd 8 -and -.Xr nfsd 8 -without the ``-o'' option, which would force use of the old server. -The -.Xr nfsuserd 8 -daemon must also be running. +if the server is using the ``@'' form of user/group strings or +is using the ``-manage-gids'' option for +.Xr nfsuserd 8 . .Pp You will also need to add at least one ``V4:'' line to the .Xr exports 5 @@ -232,7 +256,7 @@ plus set ``tcp'' and .Pp The .Xr nfsuserd 8 -must be running, as above. +must be running if name<->uid/gid mapping is being used, as above. Also, since an .Nm mount uses the host uuid to identify the client uniquely to the server, @@ -255,7 +279,7 @@ daemon to handle client side callbacks. This will occur if .sp .Bd -literal -offset indent -compact -nfsuserd_enable="YES" +nfsuserd_enable="YES" <-- If name<->uid/gid mapping is being used. nfscbd_enable="YES" .Ed .sp @@ -265,7 +289,7 @@ are set in Without a functioning callback path, a server will never issue Delegations to a client. .sp -By default, the callback address will be set to the IP address acquired via +For NFSv4.0, by default, the callback address will be set to the IP address acquired via rtalloc() in the kernel and port# 7745. To override the default port#, a command line option for .Xr nfscbd 8 @@ -281,6 +305,10 @@ N.N.N.N.N.N .sp where the first 4 Ns are the host IP address and the last two are the port# in network byte order (all decimal #s in the range 0-255). +.Pp +For NFSv4.1, the callback path (called a backchannel) uses the same TCP connection as the mount, +so none of the above applies and should work through gateways without +any issues. .Pp To build a kernel with the client that supports .Nm From owner-svn-src-all@freebsd.org Wed Jul 19 20:58: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 7FE5BD7E3FD; Wed, 19 Jul 2017 20:58:17 +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 4F2056C10C; Wed, 19 Jul 2017 20:58:17 +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 v6JKwGO6034521; Wed, 19 Jul 2017 20:58:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKwGSW034520; Wed, 19 Jul 2017 20:58:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192058.v6JKwGSW034520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321249 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321249 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:58:17 -0000 Author: ngie Date: Wed Jul 19 20:58:16 2017 New Revision: 321249 URL: https://svnweb.freebsd.org/changeset/base/321249 Log: MFC note: content changes of r317315 were reversed. .Dd is being updated for diff reduction purposes. MFC r317315,r317437: r317315: Note that getpagesize(3) can return -1 on failure r317437 (by kib): getpagesize(3) cannot fail. Modified: stable/10/lib/libc/gen/getpagesize.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getpagesize.3 ============================================================================== --- stable/10/lib/libc/gen/getpagesize.3 Wed Jul 19 20:57:41 2017 (r321248) +++ stable/10/lib/libc/gen/getpagesize.3 Wed Jul 19 20:58:16 2017 (r321249) @@ -28,7 +28,7 @@ .\" @(#)getpagesize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 26, 2017 .Dt GETPAGESIZE 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jul 19 20:58: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 80059D7E4C0; Wed, 19 Jul 2017 20:58:46 +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 4ECFD6C280; Wed, 19 Jul 2017 20:58:46 +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 v6JKwj4w034577; Wed, 19 Jul 2017 20:58:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKwjC0034576; Wed, 19 Jul 2017 20:58:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192058.v6JKwjC0034576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321250 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 321250 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 20:58:46 -0000 Author: ngie Date: Wed Jul 19 20:58:45 2017 New Revision: 321250 URL: https://svnweb.freebsd.org/changeset/base/321250 Log: MFC note: content changes of r317315 were reversed. .Dd is being updated for diff reduction purposes. MFC r317315,r317437: r317315: Note that getpagesize(3) can return -1 on failure r317437 (by kib): getpagesize(3) cannot fail. Modified: stable/11/lib/libc/gen/getpagesize.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getpagesize.3 ============================================================================== --- stable/11/lib/libc/gen/getpagesize.3 Wed Jul 19 20:58:16 2017 (r321249) +++ stable/11/lib/libc/gen/getpagesize.3 Wed Jul 19 20:58:45 2017 (r321250) @@ -28,7 +28,7 @@ .\" @(#)getpagesize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 26, 2017 .Dt GETPAGESIZE 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jul 19 21:06:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB421D7E66B; Wed, 19 Jul 2017 21:06:06 +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 6DB8E6C6C9; Wed, 19 Jul 2017 21:06:06 +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 v6JL65c6038768; Wed, 19 Jul 2017 21:06:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JL65or038767; Wed, 19 Jul 2017 21:06:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192106.v6JL65or038767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:06:05 +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: r321251 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 321251 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 21:06:06 -0000 Author: ngie Date: Wed Jul 19 21:06:05 2017 New Revision: 321251 URL: https://svnweb.freebsd.org/changeset/base/321251 Log: MFC note: only the newsyslog.conf.d change has been backported to unbreak "make distribution" with etc/newsyslog.conf.d/opensm.conf installation. The cron.d and syslog.d changes were omitted by request to avoid churn on ^/stable/{10,11}. Requested by: jhb, peter MFC r318545: Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install` I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file, and continued using it in r318441 and r318443. This will fix the files being handled improperly via installworld, preventing tools like etcupdate, mergemaster, etc from functioning properly when comparing the installed contents on a system vs the contents in a source tree when doing merges. PR: 219404 MFC with: r277541, r318441, r318443 Modified: stable/10/etc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Wed Jul 19 20:58:45 2017 (r321250) +++ stable/10/etc/Makefile Wed Jul 19 21:06:05 2017 (r321251) @@ -3,9 +3,6 @@ .include -SUBDIR= \ - newsyslog.conf.d - .if ${MK_SENDMAIL} != "no" SUBDIR+=sendmail .endif @@ -244,6 +241,7 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install .if ${MK_NTP} != "no" ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install .endif From owner-svn-src-all@freebsd.org Wed Jul 19 21:06:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0ADAD7E6CF; Wed, 19 Jul 2017 21:06:32 +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 9F8856C7F7; Wed, 19 Jul 2017 21:06:32 +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 v6JL6VBH038838; Wed, 19 Jul 2017 21:06:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JL6VE2038837; Wed, 19 Jul 2017 21:06:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192106.v6JL6VE2038837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321252 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 321252 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 21:06:32 -0000 Author: ngie Date: Wed Jul 19 21:06:31 2017 New Revision: 321252 URL: https://svnweb.freebsd.org/changeset/base/321252 Log: MFC note: only the newsyslog.conf.d change has been backported to unbreak "make distribution" with etc/newsyslog.conf.d/opensm.conf installation. The cron.d and syslog.d changes were omitted by request to avoid churn on ^/stable/{10,11}. Requested by: jhb, peter MFC r318545: Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install` I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file, and continued using it in r318441 and r318443. This will fix the files being handled improperly via installworld, preventing tools like etcupdate, mergemaster, etc from functioning properly when comparing the installed contents on a system vs the contents in a source tree when doing merges. PR: 219404 MFC with: r277541, r318441, r318443 Modified: stable/11/etc/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/Makefile ============================================================================== --- stable/11/etc/Makefile Wed Jul 19 21:06:05 2017 (r321251) +++ stable/11/etc/Makefile Wed Jul 19 21:06:31 2017 (r321252) @@ -7,8 +7,6 @@ FILESGROUPS= FILES # No need as it is empty and just causes rebuilds since this file does so much. UPDATE_DEPENDFILE= no -SUBDIR= \ - newsyslog.conf.d .if ${MK_SENDMAIL} != "no" SUBDIR+=sendmail @@ -255,6 +253,7 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install .if ${MK_NTP} != "no" ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install .endif From owner-svn-src-all@freebsd.org Wed Jul 19 21:18: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 A83A6D7E9C6; Wed, 19 Jul 2017 21:18:05 +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 7827E6CEFA; Wed, 19 Jul 2017 21:18:05 +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 v6JLI4Eu042973; Wed, 19 Jul 2017 21:18:04 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JLI4NM042972; Wed, 19 Jul 2017 21:18:04 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707192118.v6JLI4NM042972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 19 Jul 2017 21:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321253 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321253 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 21:18:05 -0000 Author: sbruno Date: Wed Jul 19 21:18:04 2017 New Revision: 321253 URL: https://svnweb.freebsd.org/changeset/base/321253 Log: Don't cache mbuf pointers if the number of descriptors is greater than the number of buffers. Submitted by: Matt Macy Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jul 19 21:06:31 2017 (r321252) +++ head/sys/net/iflib.c Wed Jul 19 21:18:04 2017 (r321253) @@ -2927,6 +2927,14 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag m_free(tmp); continue; } + m = m->m_next; + count++; + } while (m != NULL); + if (count > *nsegs) + return (0); + m = *m0; + count = 0; + do { next = (pidx + count) & (ntxd-1); MPASS(ifsd_m[next] == NULL); ifsd_m[next] = m; From owner-svn-src-all@freebsd.org Wed Jul 19 21:19: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 83F90D7EAA0; Wed, 19 Jul 2017 21:19:16 +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 3926C6D181; Wed, 19 Jul 2017 21:19:16 +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 v6JLJFhc043177; Wed, 19 Jul 2017 21:19:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JLJFbc043176; Wed, 19 Jul 2017 21:19:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192119.v6JLJFbc043176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321254 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 321254 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 21:19:16 -0000 Author: ngie Date: Wed Jul 19 21:19:15 2017 New Revision: 321254 URL: https://svnweb.freebsd.org/changeset/base/321254 Log: Record-only merge for ^/head@r312419 Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Wed Jul 19 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 369BED7EAF7; Wed, 19 Jul 2017 21:19:30 +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 DF6256D256; Wed, 19 Jul 2017 21:19: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 v6JLJTc4043228; Wed, 19 Jul 2017 21:19:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JLJT8J043227; Wed, 19 Jul 2017 21:19:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192119.v6JLJT8J043227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:19: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: r321255 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 321255 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 21:19:30 -0000 Author: ngie Date: Wed Jul 19 21:19:28 2017 New Revision: 321255 URL: https://svnweb.freebsd.org/changeset/base/321255 Log: Record-only merge for ^/head@r312419 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Wed Jul 19 22:06: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 120C5D7F787; Wed, 19 Jul 2017 22:06:37 +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 D3DA36ED6D; Wed, 19 Jul 2017 22:06:36 +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 v6JM6ZhT064247; Wed, 19 Jul 2017 22:06:35 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JM6ZtL064245; Wed, 19 Jul 2017 22:06:35 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201707192206.v6JM6ZtL064245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 19 Jul 2017 22:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321256 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 321256 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 22:06:37 -0000 Author: brooks Date: Wed Jul 19 22:06:35 2017 New Revision: 321256 URL: https://svnweb.freebsd.org/changeset/base/321256 Log: Include ARCH_FLAGS in CFLAGS when building modules. Without this change, modules will match the default compiler configuration which may not be the same as the kernel values. Reviewed by: imp Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11633 Modified: head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Jul 19 21:19:28 2017 (r321255) +++ head/sys/conf/kern.pre.mk Wed Jul 19 22:06:35 2017 (r321256) @@ -216,6 +216,7 @@ MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMO MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" +MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}" .if (${KERN_IDENT} == LINT) MKMODULESENV+= ALL_MODULES=LINT .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Jul 19 21:19:28 2017 (r321255) +++ head/sys/conf/kmod.mk Wed Jul 19 22:06:35 2017 (r321256) @@ -366,7 +366,7 @@ ${_src}: .endif # Respect configuration-specific C flags. -CFLAGS+= ${CONF_CFLAGS} +CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} .if !empty(SRCS:Mvnode_if.c) CLEANFILES+= vnode_if.c From owner-svn-src-all@freebsd.org Wed Jul 19 22:41: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 25CEBD7FF94; Wed, 19 Jul 2017 22:41:24 +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 DBC1E6FB26; Wed, 19 Jul 2017 22:41:23 +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 v6JMfNTH079273; Wed, 19 Jul 2017 22:41:23 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JMfMcY079271; Wed, 19 Jul 2017 22:41:22 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707192241.v6JMfMcY079271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 19 Jul 2017 22:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321257 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 321257 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 22:41:24 -0000 Author: sbruno Date: Wed Jul 19 22:41:22 2017 New Revision: 321257 URL: https://svnweb.freebsd.org/changeset/base/321257 Log: Restore igb(4) code dropped during iflib conversion - restore newer code for vf, i350, i210, i211 - restore dmac init code for i354 and i350 - restore WUC/WUFC update - check for igb mac type before attempting trying to assert a media changed event. - handle link events for igb(4) and em(4) devices differently and appropriately for their respective model types. Submitted by: Matt Macy Sponsored by: Limelight Networks Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jul 19 22:06:35 2017 (r321256) +++ head/sys/dev/e1000/if_em.c Wed Jul 19 22:41:22 2017 (r321257) @@ -1025,7 +1025,7 @@ em_if_attach_post(if_ctx_t ctx) /* Non-AMT based hardware can now take control from firmware */ if (adapter->has_manage && !adapter->has_amt) em_get_hw_control(adapter); - + INIT_DEBUGOUT("em_if_attach_post: end"); return (error); @@ -1691,8 +1691,9 @@ em_if_update_admin_status(if_ctx_t ctx) struct e1000_hw *hw = &adapter->hw; struct ifnet *ifp = iflib_get_ifp(ctx); device_t dev = iflib_get_dev(ctx); - u32 link_check = 0; + u32 link_check, thstat, ctrl; + link_check = thstat = ctrl = 0; /* Get the cached link value or read phy for real */ switch (hw->phy.media_type) { case e1000_media_type_copper: @@ -1717,11 +1718,21 @@ em_if_update_admin_status(if_ctx_t ctx) e1000_check_for_link(hw); link_check = adapter->hw.mac.serdes_has_link; break; - default: + /* VF device is type_unknown */ case e1000_media_type_unknown: + e1000_check_for_link(hw); + link_check = !hw->mac.get_link_status; + /* Fall thru */ + default: break; } + /* Check for thermal downshift or shutdown */ + if (hw->mac.type == e1000_i350) { + thstat = E1000_READ_REG(hw, E1000_THSTAT); + ctrl = E1000_READ_REG(hw, E1000_CTRL_EXT); + } + /* Now check for a transition */ if (link_check && (adapter->link_active == 0)) { e1000_get_speed_and_duplex(hw, &adapter->link_speed, @@ -1743,6 +1754,21 @@ em_if_update_admin_status(if_ctx_t ctx) adapter->link_active = 1; adapter->smartspeed = 0; if_setbaudrate(ifp, adapter->link_speed * 1000000); + if ((ctrl & E1000_CTRL_EXT_LINK_MODE_GMII) && + (thstat & E1000_THSTAT_LINK_THROTTLE)) + device_printf(dev, "Link: thermal downshift\n"); + /* Delay Link Up for Phy update */ + if (((hw->mac.type == e1000_i210) || + (hw->mac.type == e1000_i211)) && + (hw->phy.id == I210_I_PHY_ID)) + msec_delay(I210_LINK_DELAY); + /* Reset if the media type changed. */ + if ((hw->dev_spec._82575.media_changed) && + (adapter->hw.mac.type >= igb_mac_min)) { + hw->dev_spec._82575.media_changed = false; + adapter->flags |= IGB_MEDIA_RESET; + em_reset(ctx); + } iflib_link_state_change(ctx, LINK_STATE_UP, ifp->if_baudrate); printf("Link state changed to up\n"); } else if (!link_check && (adapter->link_active == 1)) { @@ -2210,7 +2236,115 @@ lem_smartspeed(struct adapter *adapter) adapter->smartspeed = 0; } +/********************************************************************* + * + * Initialize the DMA Coalescing feature + * + **********************************************************************/ +static void +igb_init_dmac(struct adapter *adapter, u32 pba) +{ + device_t dev = adapter->dev; + struct e1000_hw *hw = &adapter->hw; + u32 dmac, reg = ~E1000_DMACR_DMAC_EN; + u16 hwm; + u16 max_frame_size; + if (hw->mac.type == e1000_i211) + return; + + max_frame_size = adapter->shared->isc_max_frame_size; + if (hw->mac.type > e1000_82580) { + + if (adapter->dmac == 0) { /* Disabling it */ + E1000_WRITE_REG(hw, E1000_DMACR, reg); + return; + } else + device_printf(dev, "DMA Coalescing enabled\n"); + + /* Set starting threshold */ + E1000_WRITE_REG(hw, E1000_DMCTXTH, 0); + + hwm = 64 * pba - max_frame_size / 16; + if (hwm < 64 * (pba - 6)) + hwm = 64 * (pba - 6); + reg = E1000_READ_REG(hw, E1000_FCRTC); + reg &= ~E1000_FCRTC_RTH_COAL_MASK; + reg |= ((hwm << E1000_FCRTC_RTH_COAL_SHIFT) + & E1000_FCRTC_RTH_COAL_MASK); + E1000_WRITE_REG(hw, E1000_FCRTC, reg); + + + dmac = pba - max_frame_size / 512; + if (dmac < pba - 10) + dmac = pba - 10; + reg = E1000_READ_REG(hw, E1000_DMACR); + reg &= ~E1000_DMACR_DMACTHR_MASK; + reg = ((dmac << E1000_DMACR_DMACTHR_SHIFT) + & E1000_DMACR_DMACTHR_MASK); + + /* transition to L0x or L1 if available..*/ + reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK); + + /* Check if status is 2.5Gb backplane connection + * before configuration of watchdog timer, which is + * in msec values in 12.8usec intervals + * watchdog timer= msec values in 32usec intervals + * for non 2.5Gb connection + */ + if (hw->mac.type == e1000_i354) { + int status = E1000_READ_REG(hw, E1000_STATUS); + if ((status & E1000_STATUS_2P5_SKU) && + (!(status & E1000_STATUS_2P5_SKU_OVER))) + reg |= ((adapter->dmac * 5) >> 6); + else + reg |= (adapter->dmac >> 5); + } else { + reg |= (adapter->dmac >> 5); + } + + E1000_WRITE_REG(hw, E1000_DMACR, reg); + + E1000_WRITE_REG(hw, E1000_DMCRTRH, 0); + + /* Set the interval before transition */ + reg = E1000_READ_REG(hw, E1000_DMCTLX); + if (hw->mac.type == e1000_i350) + reg |= IGB_DMCTLX_DCFLUSH_DIS; + /* + ** in 2.5Gb connection, TTLX unit is 0.4 usec + ** which is 0x4*2 = 0xA. But delay is still 4 usec + */ + if (hw->mac.type == e1000_i354) { + int status = E1000_READ_REG(hw, E1000_STATUS); + if ((status & E1000_STATUS_2P5_SKU) && + (!(status & E1000_STATUS_2P5_SKU_OVER))) + reg |= 0xA; + else + reg |= 0x4; + } else { + reg |= 0x4; + } + + E1000_WRITE_REG(hw, E1000_DMCTLX, reg); + + /* free space in tx packet buffer to wake from DMA coal */ + E1000_WRITE_REG(hw, E1000_DMCTXTH, (IGB_TXPBSIZE - + (2 * max_frame_size)) >> 6); + + /* make low power state decision controlled by DMA coal */ + reg = E1000_READ_REG(hw, E1000_PCIEMISC); + reg &= ~E1000_PCIEMISC_LX_DECISION; + E1000_WRITE_REG(hw, E1000_PCIEMISC, reg); + + } else if (hw->mac.type == e1000_82580) { + u32 reg = E1000_READ_REG(hw, E1000_PCIEMISC); + E1000_WRITE_REG(hw, E1000_PCIEMISC, + reg & ~E1000_PCIEMISC_LX_DECISION); + E1000_WRITE_REG(hw, E1000_DMACR, 0); + } +} + static void em_reset(if_ctx_t ctx) { @@ -2222,6 +2356,8 @@ em_reset(if_ctx_t ctx) u32 pba; INIT_DEBUGOUT("em_reset: begin"); + /* Let the firmware know the OS is in control */ + em_get_hw_control(adapter); /* Set up smart power down as default off on newer adapters. */ if (!em_smart_pwr_down && (hw->mac.type == e1000_82571 || @@ -2417,13 +2553,24 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - E1000_WRITE_REG(hw, E1000_WUFC, 0); - em_disable_aspm(adapter); + if (adapter->hw.mac.type >= igb_mac_min) { + E1000_WRITE_REG(hw, E1000_WUC, 0); + } else { + E1000_WRITE_REG(hw, E1000_WUFC, 0); + em_disable_aspm(adapter); + } + if (adapter->flags & IGB_MEDIA_RESET) { + e1000_setup_init_funcs(hw, TRUE); + e1000_get_bus_info(hw); + adapter->flags &= ~IGB_MEDIA_RESET; + } /* and a re-init */ if (e1000_init_hw(hw) < 0) { device_printf(dev, "Hardware Initialization Failed\n"); return; } + if (adapter->hw.mac.type >= igb_mac_min) + igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); e1000_get_phy_info(hw); @@ -3307,6 +3454,9 @@ em_get_hw_control(struct adapter *adapter) { u32 ctrl_ext, swsm; + if (adapter->vf_ifp) + return; + if (adapter->hw.mac.type == e1000_82573) { swsm = E1000_READ_REG(&adapter->hw, E1000_SWSM); E1000_WRITE_REG(&adapter->hw, E1000_SWSM, @@ -3317,7 +3467,6 @@ em_get_hw_control(struct adapter *adapter) ctrl_ext = E1000_READ_REG(&adapter->hw, E1000_CTRL_EXT); E1000_WRITE_REG(&adapter->hw, E1000_CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_DRV_LOAD); - return; } /* Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jul 19 22:06:35 2017 (r321256) +++ head/sys/dev/e1000/if_em.h Wed Jul 19 22:41:22 2017 (r321257) @@ -235,6 +235,27 @@ #define EM_EEPROM_APME 0x400; #define EM_82544_APME 0x0004; + +/* Support AutoMediaDetect for Marvell M88 PHY in i354 */ +#define IGB_MEDIA_RESET (1 << 0) + +/* Define the starting Interrupt rate per Queue */ +#define IGB_INTS_PER_SEC 8000 +#define IGB_DEFAULT_ITR ((1000000/IGB_INTS_PER_SEC) << 2) + +#define IGB_LINK_ITR 2000 +#define I210_LINK_DELAY 1000 + +#define IGB_MAX_SCATTER 40 +#define IGB_VFTA_SIZE 128 +#define IGB_BR_SIZE 4096 /* ring buf size */ +#define IGB_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) +#define IGB_TSO_SEG_SIZE 4096 /* Max dma segment size */ +#define IGB_TXPBSIZE 20408 +#define IGB_HDR_BUF 128 +#define IGB_PKTTYPE_MASK 0x0000FFF0 +#define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */ + /* * Driver state logic for the detection of a hung state * in hardware. Set TX_HUNG whenever a TX packet is used @@ -455,11 +476,11 @@ struct adapter { struct ifmedia *media; int msix; int if_flags; - int min_frame_size; int em_insert_vlan_header; u32 ims; bool in_detach; + u32 flags; /* Task for FAST handling */ struct grouptask link_task; @@ -514,6 +535,7 @@ struct adapter { unsigned long watchdog_events; struct e1000_hw_stats stats; + u16 vf_ifp; }; /******************************************************************************** From owner-svn-src-all@freebsd.org Wed Jul 19 23:34: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 D0275D96E6D; Wed, 19 Jul 2017 23:34:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9532E71249; Wed, 19 Jul 2017 23:34:29 +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 v6JNYSTJ000713; Wed, 19 Jul 2017 23:34:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JNYSDR000712; Wed, 19 Jul 2017 23:34:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707192334.v6JNYSDR000712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Jul 2017 23:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321258 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 321258 X-SVN-Commit-Repository: base MIME-Version: 1.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, 19 Jul 2017 23:34:29 -0000 Author: markj Date: Wed Jul 19 23:34:28 2017 New Revision: 321258 URL: https://svnweb.freebsd.org/changeset/base/321258 Log: Decode FreeBSD11 fstatat calls. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Jul 19 22:41:22 2017 (r321257) +++ head/usr.bin/truss/syscalls.c Wed Jul 19 23:34:28 2017 (r321258) @@ -148,6 +148,9 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 } } }, { .name = "compat11.fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat11 | OUT, 1 } } }, + { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat11 | OUT, 2 }, + { Atflags, 3 } } }, { .name = "compat11.lstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.stat", .ret_type = 1, .nargs = 2, From owner-svn-src-all@freebsd.org Thu Jul 20 00:33:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A537D9B26D; Thu, 20 Jul 2017 00:33:06 +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 C02C272A9D; Thu, 20 Jul 2017 00:33:05 +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 v6K0X4dZ025176; Thu, 20 Jul 2017 00:33:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0X4OH025175; Thu, 20 Jul 2017 00:33:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200033.v6K0X4OH025175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321259 - stable/11/usr.sbin/periodic X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/usr.sbin/periodic X-SVN-Commit-Revision: 321259 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:33:06 -0000 Author: ngie Date: Thu Jul 20 00:33:04 2017 New Revision: 321259 URL: https://svnweb.freebsd.org/changeset/base/321259 Log: MFC r320135: periodic(8): delete trailing whitespace Modified: stable/11/usr.sbin/periodic/periodic.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/periodic/periodic.sh ============================================================================== --- stable/11/usr.sbin/periodic/periodic.sh Wed Jul 19 23:34:28 2017 (r321258) +++ stable/11/usr.sbin/periodic/periodic.sh Thu Jul 20 00:33:04 2017 (r321259) @@ -30,7 +30,7 @@ if [ $# -lt 1 ] ; then usage fi -# If possible, check the global system configuration file, +# If possible, check the global system configuration file, # to see if there are additional dirs to check if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf @@ -43,7 +43,7 @@ export host # If we were called normally, then create a lock file for each argument # in turn and reinvoke ourselves with the LOCKED argument. This prevents # very long running jobs from being overlapped by another run as this is -# will lead the system running progressivly slower and more and more jobs +# will lead the system running progressivly slower and more and more jobs # are run at once. if [ $1 != "LOCKED" ]; then ret=0 @@ -102,7 +102,7 @@ case $arg in /*) if [ -d "$arg" ]; then dirlist="$arg" else - echo "$0: $arg not found" >&2 + echo "$0: $arg not found" >&2 continue fi ;; From owner-svn-src-all@freebsd.org Thu Jul 20 00:33: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 05A7BD9B2A7; Thu, 20 Jul 2017 00:33:14 +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 C303E72AF2; Thu, 20 Jul 2017 00:33:13 +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 v6K0XCvM025226; Thu, 20 Jul 2017 00:33:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0XC9j025225; Thu, 20 Jul 2017 00:33:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200033.v6K0XC9j025225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:33:12 +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: r321260 - stable/10/usr.sbin/periodic X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/periodic X-SVN-Commit-Revision: 321260 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:33:14 -0000 Author: ngie Date: Thu Jul 20 00:33:12 2017 New Revision: 321260 URL: https://svnweb.freebsd.org/changeset/base/321260 Log: MFC r320135: periodic(8): delete trailing whitespace Modified: stable/10/usr.sbin/periodic/periodic.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/periodic/periodic.sh ============================================================================== --- stable/10/usr.sbin/periodic/periodic.sh Thu Jul 20 00:33:04 2017 (r321259) +++ stable/10/usr.sbin/periodic/periodic.sh Thu Jul 20 00:33:12 2017 (r321260) @@ -30,7 +30,7 @@ if [ $# -lt 1 ] ; then usage fi -# If possible, check the global system configuration file, +# If possible, check the global system configuration file, # to see if there are additional dirs to check if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf @@ -43,7 +43,7 @@ export host # If we were called normally, then create a lock file for each argument # in turn and reinvoke ourselves with the LOCKED argument. This prevents # very long running jobs from being overlapped by another run as this is -# will lead the system running progressivly slower and more and more jobs +# will lead the system running progressivly slower and more and more jobs # are run at once. if [ $1 != "LOCKED" ]; then ret=0 @@ -96,7 +96,7 @@ case $arg in /*) if [ -d "$arg" ]; then dirlist="$arg" else - echo "$0: $arg not found" >&2 + echo "$0: $arg not found" >&2 continue fi ;; From owner-svn-src-all@freebsd.org Thu Jul 20 00:40: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 3CE8FD9B45E; Thu, 20 Jul 2017 00:40:05 +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 F41C872DDF; Thu, 20 Jul 2017 00:40:04 +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 v6K0e4Nn025590; Thu, 20 Jul 2017 00:40:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0e4wq025589; Thu, 20 Jul 2017 00:40:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200040.v6K0e4wq025589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321261 - head/usr.sbin/newsyslog/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/newsyslog/tests X-SVN-Commit-Revision: 321261 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:40:05 -0000 Author: ngie Date: Thu Jul 20 00:40:03 2017 New Revision: 321261 URL: https://svnweb.freebsd.org/changeset/base/321261 Log: Clean up leading whitespace (convert single column spaces to hard tabs) MFC after: now Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- head/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:33:12 2017 (r321260) +++ head/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:40:03 2017 (r321261) @@ -14,8 +14,8 @@ RFC3164_FMT='^[A-Z][a-z]{2} [ 0-9][0-9] [0-9]{2}:[0-9] COUNT=0 TMPDIR=$(pwd)/work if [ $? -ne 0 ]; then - echo "$0: Can't create temp dir, exiting..." - exit 1 + echo "$0: Can't create temp dir, exiting..." + exit 1 fi # Begin an individual test @@ -432,8 +432,8 @@ tests_rfc5424() { cknt ${dir}${LOGFNAME}.0${ext} ckfe $LOGFNAME5424 cknt ${dir}${LOGFNAME5424}.0${ext} - ckrfc3164 ${LOGFNAME} - ckrfc5424 ${LOGFNAME5424} + ckrfc3164 ${LOGFNAME} + ckrfc5424 ${LOGFNAME5424} end begin "RFC-5424 - rotate normal 1 ${name_postfix}" @@ -442,10 +442,10 @@ tests_rfc5424() { ckfe ${dir}${LOGFNAME}.0${ext} ckfe $LOGFNAME5424 ckfe ${dir}${LOGFNAME5424}.0${ext} - ckrfc3164 ${LOGFNAME} - ckrfc3164 ${dir}${LOGFNAME}.0${ext} - ckrfc5424 ${LOGFNAME5424} - ckrfc5424 ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc3164 ${dir}${LOGFNAME}.0${ext} + ckrfc5424 ${LOGFNAME5424} + ckrfc5424 ${dir}${LOGFNAME5424}.0${ext} end tmpdir_clean From owner-svn-src-all@freebsd.org Thu Jul 20 00:41: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 D531DD9B6C7; Thu, 20 Jul 2017 00:41:48 +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 90A7D730E3; Thu, 20 Jul 2017 00:41:48 +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 v6K0flFV028744; Thu, 20 Jul 2017 00:41:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0flVU028737; Thu, 20 Jul 2017 00:41:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200041.v6K0flVU028737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:41:47 +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: r321262 - in stable/11/usr.sbin/newsyslog: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.sbin/newsyslog: . tests X-SVN-Commit-Revision: 321262 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:41:48 -0000 Author: ngie Date: Thu Jul 20 00:41:46 2017 New Revision: 321262 URL: https://svnweb.freebsd.org/changeset/base/321262 Log: MFC r318960,r319545,r319546,r319548,r321261: r318960 (by dab): Add newsyslog capability to write RFC5424 compliant rotation message. This modification adds the capability to newsyslog to write the rotation message in a format that is compliant with RFC5424. This capability is enabled on a per-log file basis through a new value ("T") in the flags field in newsyslog.conf. This is useful on systems that use the RFC5424 format for log files so that the rotation message format matches that of the other log messages. There has been recent mention of adding an RFC5424 compliant mode to syslogd and at least one alternative system log daemon (rsyslogd) that already has the capability to use that format. Relnotes: yes r319545: Don't execute the TODO cases in a subshell This messes up the testcase counter, as seen in bug 219756. PR: 212160, 219756 r319546: Fix the testplan after ^/head@r318960 The number of executed testcases is 128, not 126. MFC with: r318960 r319548: Remove TODO for sub testcases added for bug 212160 On closer inspection, the past failures no longer occur on ^/head. PR: 212160 r321261: Clean up leading whitespace (convert single column spaces to hard tabs) Modified: stable/11/usr.sbin/newsyslog/extern.h stable/11/usr.sbin/newsyslog/newsyslog.8 stable/11/usr.sbin/newsyslog/newsyslog.c stable/11/usr.sbin/newsyslog/newsyslog.conf.5 stable/11/usr.sbin/newsyslog/ptimes.c stable/11/usr.sbin/newsyslog/tests/legacy_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/newsyslog/extern.h ============================================================================== --- stable/11/usr.sbin/newsyslog/extern.h Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/extern.h Thu Jul 20 00:41:46 2017 (r321262) @@ -60,6 +60,8 @@ int ptime_free(struct ptime_data *_ptime); int ptime_relparse(struct ptime_data *_ptime, int _parseopts, time_t _basetime, const char *_str); const char *ptimeget_ctime(const struct ptime_data *_ptime); +char *ptimeget_ctime_rfc5424(const struct ptime_data *_ptime, + char *timebuf, size_t bufsize); double ptimeget_diff(const struct ptime_data *_minuend, const struct ptime_data *_subtrahend); time_t ptimeget_secs(const struct ptime_data *_ptime); Modified: stable/11/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/11/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:41:46 2017 (r321262) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd September 23, 2014 +.Dd May 19, 2017 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -125,7 +125,8 @@ reasons for either trimming that log or skipping it. Cause .Nm not to trim the logs, but to print out what it would do if this option -were not specified. This option implies the +were not specified. +This option implies the .Fl r option. .It Fl r Modified: stable/11/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/11/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:41:46 2017 (r321262) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -127,6 +128,8 @@ __FBSDID("$FreeBSD$"); #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ #define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ +#define CE_RFC5424 0x0800 /* Use RFC5424 format rotation message */ + #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -241,6 +244,15 @@ static struct ptime_data *timenow; /* The time to use #define DAYTIME_LEN 16 static char daytime[DAYTIME_LEN];/* The current time in human readable form, * used for rotation-tracking messages. */ + +/* Another buffer to hold the current time in RFC5424 format. Fractional + * seconds are allowed by the RFC, but are not included in the + * rotation-tracking messages written by newsyslog and so are not accounted for + * in the length below. + */ +#define DAYTIME_RFC5424_LEN sizeof("YYYY-MM-DDTHH:MM:SS+00:00") +static char daytime_rfc5424[DAYTIME_RFC5424_LEN]; + static char hostname[MAXHOSTNAMELEN]; /* hostname */ static const char *path_syslogpid = _PATH_SYSLOGPID; @@ -624,6 +636,7 @@ parse_args(int argc, char **argv) timenow = ptime_init(NULL); ptimeset_time(timenow, time(NULL)); strlcpy(daytime, ptimeget_ctime(timenow) + 4, DAYTIME_LEN); + ptimeget_ctime_rfc5424(timenow, daytime_rfc5424, DAYTIME_RFC5424_LEN); /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname)); @@ -1290,11 +1303,14 @@ no_trimat: case 'r': working->flags |= CE_PID2CMD; break; + case 't': + working->flags |= CE_RFC5424; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; case 'w': - /* Depreciated flag - keep for compatibility purposes */ + /* Deprecated flag - keep for compatibility purposes */ break; case 'x': working->compress = COMPRESS_XZ; @@ -2092,7 +2108,7 @@ save_sigwork(const struct conf_entry *ent) tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - + stmp->sw_runcmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { @@ -2248,15 +2264,34 @@ log_trim(const char *logname, const struct conf_entry xtra = ""; if (log_ent->def_cfg) xtra = " using rule"; - if (log_ent->firstcreate) - fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", - daytime, hostname, (int) getpid(), xtra); - else if (log_ent->r_reason != NULL) - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", - daytime, hostname, (int) getpid(), log_ent->r_reason, xtra); - else - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", - daytime, hostname, (int) getpid(), xtra); + if (log_ent->flags & CE_RFC5424) { + if (log_ent->firstcreate) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile first created", xtra); + } else if (log_ent->r_reason != NULL) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", log_ent->r_reason, xtra); + } else { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", xtra); + } + } else { + if (log_ent->firstcreate) + fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", + daytime, hostname, getpid(), xtra); + else if (log_ent->r_reason != NULL) + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", + daytime, hostname, getpid(), log_ent->r_reason, xtra); + else + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", + daytime, hostname, getpid(), xtra); + } if (fclose(f) == EOF) err(1, "log_trim: fclose"); return (0); Modified: stable/11/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/11/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:41:46 2017 (r321262) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd October 24, 2015 +.Dd May 19, 2017 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -242,7 +242,7 @@ rotate at the first day of every month at midnight (i.e., the start of the day; same as .Li @01T00 ) .It Li $M5D6 -rotate on every 5th day of month at 6:00 +rotate on every fifth day of month at 6:00 (same as .Li @05T06 ) .El @@ -313,6 +313,11 @@ will run shell command defined in .Ar path_to_pid_cmd_file after rotation instead of trying to send signal to a process id stored in the file. +.It Cm T +if this flag is set the informational rotation message written to +the log file will be in the format specified by RFC5424. +Normally, the rotation message is written in the traditional (RFC3164) +syslog format. .It Cm U indicates that the file specified by .Ar path_to_pid_cmd_file @@ -389,6 +394,17 @@ entry: .Xr chown 8 , .Xr newsyslog 8 , .Xr syslogd 8 +.Pp +.Rs +.%A C. Lonvick +.%T The BSD syslog Protocol +.%O RFC3164 +.Re +.Rs +.%A R. Gerhards +.%T The Syslog Protocol +.%O RFC5424 +.Re .Sh HISTORY This manual page first appeared in .Fx 4.10 . Modified: stable/11/usr.sbin/newsyslog/ptimes.c ============================================================================== --- stable/11/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:41:46 2017 (r321262) @@ -478,6 +478,75 @@ ptimeget_ctime(const struct ptime_data *ptime) return (ctime(&ptime->tsecs)); } +/* + * Generate a time of day string in an RFC5424 compatible format. Return a + * pointer to the buffer with the timestamp string or NULL if an error. If the + * time is not supplied, cannot be converted to local time, or the resulting + * string would overflow the buffer, the returned string will be the RFC5424 + * NILVALUE. + */ +char * +ptimeget_ctime_rfc5424(const struct ptime_data *ptime, + char *timebuf, size_t bufsize) +{ + static const char NILVALUE[] = {"-"}; /* RFC5424 specified NILVALUE */ + int chars; + struct tm tm; + int tz_hours; + int tz_mins; + long tz_offset; + char tz_sign; + + if (timebuf == NULL) { + return (NULL); + } + + if (bufsize < sizeof(NILVALUE)) { + return (NULL); + } + + /* + * Convert to localtime. RFC5424 mandates the use of the NILVALUE if + * the time cannot be obtained, so use that if there is an error in the + * conversion. + */ + if (ptime == NULL || localtime_r(&(ptime->tsecs), &tm) == NULL) { + strlcpy(timebuf, NILVALUE, bufsize); + return (timebuf); + } + + /* + * Convert the time to a string in RFC5424 format. The conversion + * cannot be done with strftime() because it cannot produce the correct + * timezone offset format. + */ + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + tz_hours = tz_offset / 3600; + tz_mins = (tz_offset % 3600) / 60; + + chars = snprintf(timebuf, bufsize, + "%04d-%02d-%02d" /* date */ + "T%02d:%02d:%02d" /* time */ + "%c%02d:%02d", /* time zone offset */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + tz_sign, tz_hours, tz_mins); + + /* If the timestamp is too big for timebuf, return the NILVALUE. */ + if (chars >= (int)bufsize) { + strlcpy(timebuf, NILVALUE, bufsize); + } + + return (timebuf); +} + double ptimeget_diff(const struct ptime_data *minuend, const struct ptime_data *subtrahend) Modified: stable/11/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- stable/11/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:40:03 2017 (r321261) +++ stable/11/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:41:46 2017 (r321262) @@ -2,11 +2,20 @@ # $FreeBSD$ +# A regular expression matching the format of an RFC-5424 log line header, +# including the timestamp up through the seconds indicator; it does not include +# the (optional) timezone offset. +RFC5424_FMT='^<[0-9][0-9]*>1 [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' + +# A regular expression matching the format of an RFC-3164 (traditional syslog) +# log line header, including the timestamp. +RFC3164_FMT='^[A-Z][a-z]{2} [ 0-9][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}' + COUNT=0 TMPDIR=$(pwd)/work if [ $? -ne 0 ]; then - echo "$0: Can't create temp dir, exiting..." - exit 1 + echo "$0: Can't create temp dir, exiting..." + exit 1 fi # Begin an individual test @@ -89,8 +98,34 @@ ckntfe() fi } +# Verify that the specified file has RFC-5424 rotation messages. +ckrfc5424() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC5424_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} +# Verify that the specified file has RFC-3164 rotation messages. +ckrfc3164() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC3164_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} + + # A part of a test succeeds ok() { @@ -368,13 +403,56 @@ tests_time_rotate() { tmpdir_clean } -echo 1..126 +tests_rfc5424() { + ext="$1" + dir="$2" + + if [ -n "$dir" ]; then + newsyslog_args=" -a ${dir}" + name_postfix="${ext} archive dir" + else + newsyslog_args="" + name_postfix="${ext}" + fi + + tmpdir_create + + begin "RFC-5424 - create file ${name_postfix}" -newdir + run_newsyslog -C + ckfe $LOGFNAME + cknt ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + cknt ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc5424 ${LOGFNAME5424} + end + + begin "RFC-5424 - rotate normal 1 ${name_postfix}" + run_newsyslog $newsyslog_args + ckfe ${LOGFNAME} + ckfe ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + ckfe ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc3164 ${dir}${LOGFNAME}.0${ext} + ckrfc5424 ${LOGFNAME5424} + ckrfc5424 ${dir}${LOGFNAME5424}.0${ext} + end + + tmpdir_clean +} + +echo 1..128 mkdir -p ${TMPDIR} cd ${TMPDIR} LOGFNAME=foo.log LOGFPATH=${TMPDIR}/log/${LOGFNAME} +# Log file for RFC-5424 testing +LOGFNAME5424=foo5424.log +LOGFPATH5424=${TMPDIR}/log/${LOGFNAME5424} + # Normal, no archive dir, keep X files echo "$LOGFPATH 640 0 * @T00 NC" > newsyslog.conf tests_normal_rotate_keepn 0 @@ -440,5 +518,10 @@ tests_time_rotate "gz" "${TMPDIR}/alog/" echo "$LOGFPATH 640 3 * @T00 NCJ" > newsyslog.conf tests_time_rotate "bz2" "${TMPDIR}/alog/" + +# RFC-5424; Normal, no archive dir +echo "$LOGFPATH5424 640 3 * @T00 NCT" > newsyslog.conf +echo "$LOGFPATH 640 3 * @T00 NC" >> newsyslog.conf +tests_rfc5424 rm -rf "${TMPDIR}" From owner-svn-src-all@freebsd.org Thu Jul 20 00:44: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 59198D9B7B8; Thu, 20 Jul 2017 00:44:03 +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 2258E732F1; Thu, 20 Jul 2017 00:44:03 +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 v6K0i2n1029646; Thu, 20 Jul 2017 00:44:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0i1od029640; Thu, 20 Jul 2017 00:44:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200044.v6K0i1od029640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:44: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: r321263 - in stable/10/usr.sbin/newsyslog: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/newsyslog: . tests X-SVN-Commit-Revision: 321263 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:44:03 -0000 Author: ngie Date: Thu Jul 20 00:44:01 2017 New Revision: 321263 URL: https://svnweb.freebsd.org/changeset/base/321263 Log: MFC r318960,r319545,r319546,r319548,r321261: r318960 (by dab): Add newsyslog capability to write RFC5424 compliant rotation message. This modification adds the capability to newsyslog to write the rotation message in a format that is compliant with RFC5424. This capability is enabled on a per-log file basis through a new value ("T") in the flags field in newsyslog.conf. This is useful on systems that use the RFC5424 format for log files so that the rotation message format matches that of the other log messages. There has been recent mention of adding an RFC5424 compliant mode to syslogd and at least one alternative system log daemon (rsyslogd) that already has the capability to use that format. Relnotes: yes r319545: Don't execute the TODO cases in a subshell This messes up the testcase counter, as seen in bug 219756. PR: 212160, 219756 r319546: Fix the testplan after ^/head@r318960 The number of executed testcases is 128, not 126. MFC with: r318960 r319548: Remove TODO for sub testcases added for bug 212160 On closer inspection, the past failures no longer occur on ^/head. PR: 212160 r321261: Clean up leading whitespace (convert single column spaces to hard tabs) Modified: stable/10/usr.sbin/newsyslog/extern.h stable/10/usr.sbin/newsyslog/newsyslog.8 stable/10/usr.sbin/newsyslog/newsyslog.c stable/10/usr.sbin/newsyslog/newsyslog.conf.5 stable/10/usr.sbin/newsyslog/ptimes.c stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/newsyslog/extern.h ============================================================================== --- stable/10/usr.sbin/newsyslog/extern.h Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/extern.h Thu Jul 20 00:44:01 2017 (r321263) @@ -60,6 +60,8 @@ int ptime_free(struct ptime_data *_ptime); int ptime_relparse(struct ptime_data *_ptime, int _parseopts, time_t _basetime, const char *_str); const char *ptimeget_ctime(const struct ptime_data *_ptime); +char *ptimeget_ctime_rfc5424(const struct ptime_data *_ptime, + char *timebuf, size_t bufsize); double ptimeget_diff(const struct ptime_data *_minuend, const struct ptime_data *_subtrahend); time_t ptimeget_secs(const struct ptime_data *_ptime); Modified: stable/10/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:44:01 2017 (r321263) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd September 23, 2014 +.Dd May 19, 2017 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -125,7 +125,8 @@ reasons for either trimming that log or skipping it. Cause .Nm not to trim the logs, but to print out what it would do if this option -were not specified. This option implies the +were not specified. +This option implies the .Fl r option. .It Fl r Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:44:01 2017 (r321263) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -127,6 +128,8 @@ __FBSDID("$FreeBSD$"); #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ #define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ +#define CE_RFC5424 0x0800 /* Use RFC5424 format rotation message */ + #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -241,6 +244,15 @@ static struct ptime_data *timenow; /* The time to use #define DAYTIME_LEN 16 static char daytime[DAYTIME_LEN];/* The current time in human readable form, * used for rotation-tracking messages. */ + +/* Another buffer to hold the current time in RFC5424 format. Fractional + * seconds are allowed by the RFC, but are not included in the + * rotation-tracking messages written by newsyslog and so are not accounted for + * in the length below. + */ +#define DAYTIME_RFC5424_LEN sizeof("YYYY-MM-DDTHH:MM:SS+00:00") +static char daytime_rfc5424[DAYTIME_RFC5424_LEN]; + static char hostname[MAXHOSTNAMELEN]; /* hostname */ static const char *path_syslogpid = _PATH_SYSLOGPID; @@ -624,6 +636,7 @@ parse_args(int argc, char **argv) timenow = ptime_init(NULL); ptimeset_time(timenow, time(NULL)); strlcpy(daytime, ptimeget_ctime(timenow) + 4, DAYTIME_LEN); + ptimeget_ctime_rfc5424(timenow, daytime_rfc5424, DAYTIME_RFC5424_LEN); /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname)); @@ -1304,11 +1317,14 @@ no_trimat: case 'r': working->flags |= CE_PID2CMD; break; + case 't': + working->flags |= CE_RFC5424; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; case 'w': - /* Depreciated flag - keep for compatibility purposes */ + /* Deprecated flag - keep for compatibility purposes */ break; case 'x': working->compress = COMPRESS_XZ; @@ -2106,7 +2122,7 @@ save_sigwork(const struct conf_entry *ent) tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - + stmp->sw_runcmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { @@ -2262,15 +2278,34 @@ log_trim(const char *logname, const struct conf_entry xtra = ""; if (log_ent->def_cfg) xtra = " using rule"; - if (log_ent->firstcreate) - fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", - daytime, hostname, (int) getpid(), xtra); - else if (log_ent->r_reason != NULL) - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", - daytime, hostname, (int) getpid(), log_ent->r_reason, xtra); - else - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", - daytime, hostname, (int) getpid(), xtra); + if (log_ent->flags & CE_RFC5424) { + if (log_ent->firstcreate) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile first created", xtra); + } else if (log_ent->r_reason != NULL) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", log_ent->r_reason, xtra); + } else { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", xtra); + } + } else { + if (log_ent->firstcreate) + fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", + daytime, hostname, getpid(), xtra); + else if (log_ent->r_reason != NULL) + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", + daytime, hostname, getpid(), log_ent->r_reason, xtra); + else + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", + daytime, hostname, getpid(), xtra); + } if (fclose(f) == EOF) err(1, "log_trim: fclose"); return (0); Modified: stable/10/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:44:01 2017 (r321263) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd October 24, 2015 +.Dd May 19, 2017 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -242,7 +242,7 @@ rotate at the first day of every month at midnight (i.e., the start of the day; same as .Li @01T00 ) .It Li $M5D6 -rotate on every 5th day of month at 6:00 +rotate on every fifth day of month at 6:00 (same as .Li @05T06 ) .El @@ -313,6 +313,11 @@ will run shell command defined in .Ar path_to_pid_cmd_file after rotation instead of trying to send signal to a process id stored in the file. +.It Cm T +if this flag is set the informational rotation message written to +the log file will be in the format specified by RFC5424. +Normally, the rotation message is written in the traditional (RFC3164) +syslog format. .It Cm U indicates that the file specified by .Ar path_to_pid_cmd_file @@ -389,6 +394,17 @@ entry: .Xr chown 8 , .Xr newsyslog 8 , .Xr syslogd 8 +.Pp +.Rs +.%A C. Lonvick +.%T The BSD syslog Protocol +.%O RFC3164 +.Re +.Rs +.%A R. Gerhards +.%T The Syslog Protocol +.%O RFC5424 +.Re .Sh HISTORY This manual page first appeared in .Fx 4.10 . Modified: stable/10/usr.sbin/newsyslog/ptimes.c ============================================================================== --- stable/10/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:44:01 2017 (r321263) @@ -478,6 +478,75 @@ ptimeget_ctime(const struct ptime_data *ptime) return (ctime(&ptime->tsecs)); } +/* + * Generate a time of day string in an RFC5424 compatible format. Return a + * pointer to the buffer with the timestamp string or NULL if an error. If the + * time is not supplied, cannot be converted to local time, or the resulting + * string would overflow the buffer, the returned string will be the RFC5424 + * NILVALUE. + */ +char * +ptimeget_ctime_rfc5424(const struct ptime_data *ptime, + char *timebuf, size_t bufsize) +{ + static const char NILVALUE[] = {"-"}; /* RFC5424 specified NILVALUE */ + int chars; + struct tm tm; + int tz_hours; + int tz_mins; + long tz_offset; + char tz_sign; + + if (timebuf == NULL) { + return (NULL); + } + + if (bufsize < sizeof(NILVALUE)) { + return (NULL); + } + + /* + * Convert to localtime. RFC5424 mandates the use of the NILVALUE if + * the time cannot be obtained, so use that if there is an error in the + * conversion. + */ + if (ptime == NULL || localtime_r(&(ptime->tsecs), &tm) == NULL) { + strlcpy(timebuf, NILVALUE, bufsize); + return (timebuf); + } + + /* + * Convert the time to a string in RFC5424 format. The conversion + * cannot be done with strftime() because it cannot produce the correct + * timezone offset format. + */ + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + tz_hours = tz_offset / 3600; + tz_mins = (tz_offset % 3600) / 60; + + chars = snprintf(timebuf, bufsize, + "%04d-%02d-%02d" /* date */ + "T%02d:%02d:%02d" /* time */ + "%c%02d:%02d", /* time zone offset */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + tz_sign, tz_hours, tz_mins); + + /* If the timestamp is too big for timebuf, return the NILVALUE. */ + if (chars >= (int)bufsize) { + strlcpy(timebuf, NILVALUE, bufsize); + } + + return (timebuf); +} + double ptimeget_diff(const struct ptime_data *minuend, const struct ptime_data *subtrahend) Modified: stable/10/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:44:01 2017 (r321263) @@ -2,11 +2,20 @@ # $FreeBSD$ +# A regular expression matching the format of an RFC-5424 log line header, +# including the timestamp up through the seconds indicator; it does not include +# the (optional) timezone offset. +RFC5424_FMT='^<[0-9][0-9]*>1 [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' + +# A regular expression matching the format of an RFC-3164 (traditional syslog) +# log line header, including the timestamp. +RFC3164_FMT='^[A-Z][a-z]{2} [ 0-9][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}' + COUNT=0 TMPDIR=$(pwd)/work if [ $? -ne 0 ]; then - echo "$0: Can't create temp dir, exiting..." - exit 1 + echo "$0: Can't create temp dir, exiting..." + exit 1 fi # Begin an individual test @@ -89,8 +98,34 @@ ckntfe() fi } +# Verify that the specified file has RFC-5424 rotation messages. +ckrfc5424() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC5424_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} +# Verify that the specified file has RFC-3164 rotation messages. +ckrfc3164() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC3164_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} + + # A part of a test succeeds ok() { @@ -368,13 +403,56 @@ tests_time_rotate() { tmpdir_clean } -echo 1..126 +tests_rfc5424() { + ext="$1" + dir="$2" + + if [ -n "$dir" ]; then + newsyslog_args=" -a ${dir}" + name_postfix="${ext} archive dir" + else + newsyslog_args="" + name_postfix="${ext}" + fi + + tmpdir_create + + begin "RFC-5424 - create file ${name_postfix}" -newdir + run_newsyslog -C + ckfe $LOGFNAME + cknt ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + cknt ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc5424 ${LOGFNAME5424} + end + + begin "RFC-5424 - rotate normal 1 ${name_postfix}" + run_newsyslog $newsyslog_args + ckfe ${LOGFNAME} + ckfe ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + ckfe ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc3164 ${dir}${LOGFNAME}.0${ext} + ckrfc5424 ${LOGFNAME5424} + ckrfc5424 ${dir}${LOGFNAME5424}.0${ext} + end + + tmpdir_clean +} + +echo 1..128 mkdir -p ${TMPDIR} cd ${TMPDIR} LOGFNAME=foo.log LOGFPATH=${TMPDIR}/log/${LOGFNAME} +# Log file for RFC-5424 testing +LOGFNAME5424=foo5424.log +LOGFPATH5424=${TMPDIR}/log/${LOGFNAME5424} + # Normal, no archive dir, keep X files echo "$LOGFPATH 640 0 * @T00 NC" > newsyslog.conf tests_normal_rotate_keepn 0 @@ -440,5 +518,10 @@ tests_time_rotate "gz" "${TMPDIR}/alog/" echo "$LOGFPATH 640 3 * @T00 NCJ" > newsyslog.conf tests_time_rotate "bz2" "${TMPDIR}/alog/" + +# RFC-5424; Normal, no archive dir +echo "$LOGFPATH5424 640 3 * @T00 NCT" > newsyslog.conf +echo "$LOGFPATH 640 3 * @T00 NC" >> newsyslog.conf +tests_rfc5424 rm -rf "${TMPDIR}" From owner-svn-src-all@freebsd.org Thu Jul 20 00:47: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 9F955D9B8B3; Thu, 20 Jul 2017 00:47:51 +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 691207347D; Thu, 20 Jul 2017 00:47:51 +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 v6K0lobj029881; Thu, 20 Jul 2017 00:47:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0loKf029880; Thu, 20 Jul 2017 00:47:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200047.v6K0loKf029880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:47: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: r321264 - stable/11/sys/boot/common X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/boot/common X-SVN-Commit-Revision: 321264 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:47:51 -0000 Author: ngie Date: Thu Jul 20 00:47:50 2017 New Revision: 321264 URL: https://svnweb.freebsd.org/changeset/base/321264 Log: MFC r316102: Wrap bootcamp DEBUG statement with curly braces This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined. Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Modified: stable/11/sys/boot/common/part.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/part.c ============================================================================== --- stable/11/sys/boot/common/part.c Thu Jul 20 00:44:01 2017 (r321263) +++ stable/11/sys/boot/common/part.c Thu Jul 20 00:47:50 2017 (r321264) @@ -664,8 +664,9 @@ ptable_open(void *dev, off_t sectors, uint16_t sectors if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; DEBUG("Incorrect PMBR, ignore it"); - } else + } else { DEBUG("Bootcamp detected"); + } } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-all@freebsd.org Thu Jul 20 00:48: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 6621BD9B915; Thu, 20 Jul 2017 00:48:05 +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 33F2E73548; Thu, 20 Jul 2017 00:48:05 +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 v6K0m4ck029944; Thu, 20 Jul 2017 00:48:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0m4xw029943; Thu, 20 Jul 2017 00:48:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200048.v6K0m4xw029943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:48:04 +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: r321265 - stable/10/sys/boot/common X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sys/boot/common X-SVN-Commit-Revision: 321265 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:48:05 -0000 Author: ngie Date: Thu Jul 20 00:48:04 2017 New Revision: 321265 URL: https://svnweb.freebsd.org/changeset/base/321265 Log: MFC r316102: Wrap bootcamp DEBUG statement with curly braces This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined. Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Modified: stable/10/sys/boot/common/part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/part.c ============================================================================== --- stable/10/sys/boot/common/part.c Thu Jul 20 00:47:50 2017 (r321264) +++ stable/10/sys/boot/common/part.c Thu Jul 20 00:48:04 2017 (r321265) @@ -660,8 +660,9 @@ ptable_open(void *dev, off_t sectors, uint16_t sectors if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; DEBUG("Incorrect PMBR, ignore it"); - } else + } else { DEBUG("Bootcamp detected"); + } } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-all@freebsd.org Thu Jul 20 00:50: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 159DBD9B9CF; Thu, 20 Jul 2017 00:50:03 +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 D6146736E1; Thu, 20 Jul 2017 00:50:02 +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 v6K0o1bG030102; Thu, 20 Jul 2017 00:50:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0o1rf030098; Thu, 20 Jul 2017 00:50:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200050.v6K0o1rf030098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:50: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: r321266 - in stable/11/usr.bin/fortune: . datfiles fortune unstr X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.bin/fortune: . datfiles fortune unstr X-SVN-Commit-Revision: 321266 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:50:03 -0000 Author: ngie Date: Thu Jul 20 00:50:01 2017 New Revision: 321266 URL: https://svnweb.freebsd.org/changeset/base/321266 Log: MFC r314893: usr.bin/fortune: convert to OBJTOP/SRCTOP idioms - Use OBJTOP/SRCTOP-relative paths when looking for include files and strfile. - Add FORTUNES_OBJ and FORTUNES_SRC to abbreviate usr.bin/fortune pathing. This is being done to simplify make output/idioms. Modified: stable/11/usr.bin/fortune/Makefile.inc stable/11/usr.bin/fortune/datfiles/Makefile stable/11/usr.bin/fortune/fortune/Makefile stable/11/usr.bin/fortune/unstr/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/fortune/Makefile.inc ============================================================================== --- stable/11/usr.bin/fortune/Makefile.inc Thu Jul 20 00:48:04 2017 (r321265) +++ stable/11/usr.bin/fortune/Makefile.inc Thu Jul 20 00:50:01 2017 (r321266) @@ -1,3 +1,6 @@ -.if exists(${.CURDIR}/../../Makefile.inc) -.include "${.CURDIR}/../../Makefile.inc" -.endif +# $FreeBSD$ + +FORTUNE_SRC= ${SRCTOP}/usr.bin/fortune +FORTUNE_OBJ= ${OBJTOP}/usr.bin/fortune + +.include "${SRCTOP}/usr.bin/Makefile.inc" Modified: stable/11/usr.bin/fortune/datfiles/Makefile ============================================================================== --- stable/11/usr.bin/fortune/datfiles/Makefile Thu Jul 20 00:48:04 2017 (r321265) +++ stable/11/usr.bin/fortune/datfiles/Makefile Thu Jul 20 00:50:01 2017 (r321266) @@ -15,7 +15,7 @@ FILESDIR= ${SHAREDIR}/games/fortune .for f in ${DB} $f.dat: $f - PATH=$$PATH:/usr/bin:${.OBJDIR}/../strfile \ + PATH=$$PATH:/usr/bin:${FORTUNE_OBJ}/strfile \ strfile -Cs ${.ALLSRC} ${.TARGET} .endfor Modified: stable/11/usr.bin/fortune/fortune/Makefile ============================================================================== --- stable/11/usr.bin/fortune/fortune/Makefile Thu Jul 20 00:48:04 2017 (r321265) +++ stable/11/usr.bin/fortune/fortune/Makefile Thu Jul 20 00:50:01 2017 (r321266) @@ -3,7 +3,7 @@ PROG= fortune MAN= fortune.6 -CFLAGS+=-DDEBUG -I${.CURDIR}/../strfile +CFLAGS+=-DDEBUG -I${FORTUNE_SRC}/strfile .include Modified: stable/11/usr.bin/fortune/unstr/Makefile ============================================================================== --- stable/11/usr.bin/fortune/unstr/Makefile Thu Jul 20 00:48:04 2017 (r321265) +++ stable/11/usr.bin/fortune/unstr/Makefile Thu Jul 20 00:50:01 2017 (r321266) @@ -3,6 +3,6 @@ PROG= unstr MAN= -CFLAGS+= -I${.CURDIR}/../strfile +CFLAGS+= -I${FORTUNE_SRC}/strfile .include From owner-svn-src-all@freebsd.org Thu Jul 20 00:52: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 1D290D9BBBA; Thu, 20 Jul 2017 00:52:14 +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 E8A1073A10; Thu, 20 Jul 2017 00:52:13 +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 v6K0qDCd031659; Thu, 20 Jul 2017 00:52:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0qCYt031648; Thu, 20 Jul 2017 00:52:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200052.v6K0qCYt031648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:52:12 +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: r321267 - in stable/10/libexec: atrun ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/libexec: atrun ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Commit-Revision: 321267 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:52:14 -0000 Author: ngie Date: Thu Jul 20 00:52:11 2017 New Revision: 321267 URL: https://svnweb.freebsd.org/changeset/base/321267 Log: MFC r314653: libexec: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output Modified: stable/10/libexec/atrun/Makefile stable/10/libexec/ftpd/Makefile stable/10/libexec/hyperv/Makefile stable/10/libexec/mail.local/Makefile stable/10/libexec/smrsh/Makefile stable/10/libexec/talkd/Makefile stable/10/libexec/tcpd/Makefile stable/10/libexec/telnetd/Makefile stable/10/libexec/tftp-proxy/Makefile stable/10/libexec/ypxfr/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/atrun/Makefile ============================================================================== --- stable/10/libexec/atrun/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/atrun/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -MAINSRC=${.CURDIR}/../../usr.bin/at +MAINSRC=${SRCTOP}/usr.bin/at .include "${MAINSRC}/Makefile.inc" Modified: stable/10/libexec/ftpd/Makefile ============================================================================== --- stable/10/libexec/ftpd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/ftpd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -20,10 +20,9 @@ LDADD= -lutil -lcrypt DPADD+= ${LIBOPIE} ${LIBMD} LDADD+= -lopie -lmd -LSDIR= ../../bin/ls -.PATH: ${.CURDIR}/${LSDIR} +.PATH: ${SRCTOP}/bin/ls SRCS+= ls.c cmp.c print.c util.c -CFLAGS+=-Dmain=ls_main -I${.CURDIR}/${LSDIR} +CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls DPADD+= ${LIBM} LDADD+= -lm Modified: stable/10/libexec/hyperv/Makefile ============================================================================== --- stable/10/libexec/hyperv/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/hyperv/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/hyperv/tools/scripts +.PATH: ${SRCTOP}/contrib/hyperv/tools/scripts BINDIR= ${LIBEXECDIR}/hyperv Modified: stable/10/libexec/mail.local/Makefile ============================================================================== --- stable/10/libexec/mail.local/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/mail.local/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 7/19/93 # $FreeBSD$ -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/mail.local PROG= mail.local Modified: stable/10/libexec/smrsh/Makefile ============================================================================== --- stable/10/libexec/smrsh/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/smrsh/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 7/2/95 # $FreeBSD$ -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/smrsh PROG= smrsh Modified: stable/10/libexec/talkd/Makefile ============================================================================== --- stable/10/libexec/talkd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/talkd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -3,8 +3,8 @@ PROG= ntalkd SRCS= talkd.c announce.c process.c table.c print.c ttymsg.c -.PATH: ${.CURDIR}/../../usr.bin/wall +.PATH: ${SRCTOP}/usr.bin/wall MAN= talkd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/wall +CFLAGS+=-I${SRCTOP}/usr.bin/wall .include Modified: stable/10/libexec/tcpd/Makefile ============================================================================== --- stable/10/libexec/tcpd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/tcpd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../contrib/tcp_wrappers +.PATH: ${SRCTOP}/contrib/tcp_wrappers PROG= tcpd MAN= tcpd.8 Modified: stable/10/libexec/telnetd/Makefile ============================================================================== --- stable/10/libexec/telnetd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/telnetd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -5,7 +5,7 @@ .include -TELNETDIR= ${.CURDIR}/../../contrib/telnet +TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/telnetd PROG= telnetd @@ -27,7 +27,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${TELNETDIR} CFLAGS+= -I${TELNETDIR}/telnet -LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a +LIBTELNET= ${OBJTOP}/lib/libtelnet/libtelnet.a DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} LDADD= -lutil -ltermcap ${LIBTELNET} Modified: stable/10/libexec/tftp-proxy/Makefile ============================================================================== --- stable/10/libexec/tftp-proxy/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/tftp-proxy/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/pf/tftp-proxy +.PATH: ${SRCTOP}/contrib/pf/tftp-proxy PROG= tftp-proxy SRCS= tftp-proxy.c filter.c Modified: stable/10/libexec/ypxfr/Makefile ============================================================================== --- stable/10/libexec/ypxfr/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/ypxfr/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -7,7 +7,7 @@ SRCS= yp_dblookup.c yp_dbwrite.c yp_error.c \ ${GENSRCS} GENSRCS=yp.h yp_clnt.c ypxfr_clnt.c -.PATH: ${.CURDIR}/../../usr.sbin/ypserv +.PATH: ${SRCTOP}/usr.sbin/ypserv MAN= ypxfr.8 @@ -21,7 +21,7 @@ LDADD= -lrpcsvc CLEANFILES= ${GENSRCS} -RPCDIR= ${.CURDIR}/../../include/rpcsvc +RPCDIR= ${SRCTOP}/include/rpcsvc RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C ypxfr_clnt.c: ${RPCDIR}/yp.x From owner-svn-src-all@freebsd.org Thu Jul 20 00:53: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 5F83CD9BC4D; Thu, 20 Jul 2017 00:53:54 +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 0F5C573B7F; Thu, 20 Jul 2017 00:53:53 +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 v6K0rrt4034077; Thu, 20 Jul 2017 00:53:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0rolw034052; Thu, 20 Jul 2017 00:53:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200053.v6K0rolw034052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:53: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: r321268 - in stable/11/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfc... X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfconvert usr.bin/ctfdump us... X-SVN-Commit-Revision: 321268 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:53:54 -0000 Author: ngie Date: Thu Jul 20 00:53:50 2017 New Revision: 321268 URL: https://svnweb.freebsd.org/changeset/base/321268 Log: MFC r314654: cddl: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output While here, remove bogus CFLAGS which look for headers in cddl/lib/libumem. There aren't any source files there (just Makefiles) Modified: stable/11/cddl/lib/drti/Makefile stable/11/cddl/lib/libavl/Makefile stable/11/cddl/lib/libctf/Makefile stable/11/cddl/lib/libdtrace/Makefile stable/11/cddl/lib/libnvpair/Makefile stable/11/cddl/lib/libumem/Makefile stable/11/cddl/lib/libuutil/Makefile stable/11/cddl/lib/libzfs/Makefile stable/11/cddl/lib/libzfs_core/Makefile stable/11/cddl/lib/libzpool/Makefile stable/11/cddl/sbin/zfs/Makefile stable/11/cddl/sbin/zpool/Makefile stable/11/cddl/usr.bin/ctfconvert/Makefile stable/11/cddl/usr.bin/ctfdump/Makefile stable/11/cddl/usr.bin/ctfmerge/Makefile stable/11/cddl/usr.bin/zinject/Makefile stable/11/cddl/usr.bin/zlook/Makefile stable/11/cddl/usr.bin/zstreamdump/Makefile stable/11/cddl/usr.bin/ztest/Makefile stable/11/cddl/usr.sbin/dtrace/Makefile stable/11/cddl/usr.sbin/lockstat/Makefile stable/11/cddl/usr.sbin/plockstat/Makefile stable/11/cddl/usr.sbin/zdb/Makefile stable/11/cddl/usr.sbin/zhack/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/drti/Makefile ============================================================================== --- stable/11/cddl/lib/drti/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/drti/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common SRCS= drti.c FILES= ${SRCS:R:S/$/.o/g} @@ -12,8 +12,8 @@ CLEANFILES= ${FILES} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ Modified: stable/11/cddl/lib/libavl/Makefile ============================================================================== --- stable/11/cddl/lib/libavl/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libavl/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= avl SRCS= avl.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/11/cddl/lib/libctf/Makefile ============================================================================== --- stable/11/cddl/lib/libctf/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libctf/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/ctf -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libctf/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/ctf LIB= ctf SRCS= ctf_create.c \ @@ -21,8 +21,8 @@ MAN= ctf.5 WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/common/ctf \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ Modified: stable/11/cddl/lib/libdtrace/Makefile ============================================================================== --- stable/11/cddl/lib/libdtrace/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libdtrace/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libgen/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common LIB= dtrace SRCS= dt_aggregate.c \ @@ -63,9 +63,9 @@ FILESMODE= ${NOBINMODE} WARNS?= 1 CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ - -I${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ @@ -75,33 +75,33 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/aarch64 -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/aarch64 -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/aarch64 +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/aarch64 +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/aarch64 .elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +CFLAGS+= -I${SRCTOP}/sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/i386 +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/x86 .elif ${MACHINE_CPUARCH} == "arm" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/arm +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/arm +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/arm .elif ${MACHINE_CPUARCH} == "mips" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/mips +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/mips .elif ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/powerpc .elif ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/riscv -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/riscv +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/riscv +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/riscv .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: stable/11/cddl/lib/libnvpair/Makefile ============================================================================== --- stable/11/cddl/lib/libnvpair/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libnvpair/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/nvpair +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/nvpair LIB= nvpair @@ -13,18 +13,18 @@ SRCS= libnvpair.c \ opensolaris_nvpair_alloc_fixed.c WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem # This library uses macros to define fprintf behavior for several object types # The compiler will see the non-string literal arguments to the fprintf calls and -# omit warnings for them. Quiesce these warnings in contrib code: +# omit warnings for them. Quiesce these warnings in contrib code: # # cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format # string is not a string literal (potentially insecure) [-Wformat-security] Modified: stable/11/cddl/lib/libumem/Makefile ============================================================================== --- stable/11/cddl/lib/libumem/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libumem/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +.PATH: ${SRCTOP}/cddl/compat/opensolaris/lib/libumem LIB= umem SRCS= umem.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem .include Modified: stable/11/cddl/lib/libuutil/Makefile ============================================================================== --- stable/11/cddl/lib/libuutil/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libuutil/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= uutil SRCS= avl.c \ @@ -17,10 +17,10 @@ SRCS= avl.c \ WARNS?= 1 CFLAGS+= -DNATIVE_BUILD -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head .include Modified: stable/11/cddl/lib/libzfs/Makefile ============================================================================== --- stable/11/cddl/lib/libzfs/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libzfs/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core @@ -39,20 +39,19 @@ SRCS+= libzfs_changelist.c \ WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common .include Modified: stable/11/cddl/lib/libzfs_core/Makefile ============================================================================== --- stable/11/cddl/lib/libzfs_core/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libzfs_core/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs_core LIBADD= nvpair @@ -18,20 +18,19 @@ SRCS+= libzfs_compat.c WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common .include Modified: stable/11/cddl/lib/libzpool/Makefile ============================================================================== --- stable/11/cddl/lib/libzpool/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/lib/libzpool/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,28 +1,28 @@ # $FreeBSD$ -.include "${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/Makefile.files" +.include "${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/Makefile.files" # ZFS_COMMON_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs # ZFS_SHARED_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs # KERNEL_SRCS -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common # LIST_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/os # ATOMIC_SRCS -.if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S .if ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack .endif .else -.PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern +.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c .endif # UNICODE_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/unicode +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/unicode LIB= zpool @@ -37,24 +37,23 @@ SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} \ ${UNICODE_SRCS} WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair # XXX: pthread doesn't have mutex_owned() equivalent, so we need to look # into libthr private structures. That's sooo evil, but it's only for # ZFS debugging tools needs. CFLAGS+= -DWANTS_MUTEX_OWNED -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys -CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include +CFLAGS+= -I${SRCTOP}/lib/libpthread/thread +CFLAGS+= -I${SRCTOP}/lib/libpthread/sys +CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include LIBADD= md pthread z nvpair avl umem Modified: stable/11/cddl/sbin/zfs/Makefile ============================================================================== --- stable/11/cddl/sbin/zfs/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/sbin/zfs/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,26 +1,26 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zfs PROG= zfs MAN= zfs.8 SRCS= zfs_main.c zfs_iter.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs LIBADD= jail nvpair uutil zfs_core zfs Modified: stable/11/cddl/sbin/zpool/Makefile ============================================================================== --- stable/11/cddl/sbin/zpool/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/sbin/zpool/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zpool -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zpool +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs PROG= zpool MAN= zpool.8 zpool-features.7 @@ -10,22 +10,22 @@ SRCS= zpool_main.c zpool_vdev.c zpool_iter.c zpool_uti SRCS+= timestamp.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common LIBADD= geom nvpair uutil zfs Modified: stable/11/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- stable/11/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt PROG= ctfconvert SRCS= alist.c \ @@ -25,8 +25,8 @@ SRCS= alist.c \ traverse.c \ util.c -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/11/cddl/usr.bin/ctfdump/Makefile ============================================================================== --- stable/11/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/dump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/dump PROG= ctfdump SRCS= dump.c \ @@ -12,8 +12,8 @@ CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/cmd/mdb/tools/common \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common Modified: stable/11/cddl/usr.bin/ctfmerge/Makefile ============================================================================== --- stable/11/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt PROG= ctfmerge SRCS= alist.c \ @@ -24,8 +24,8 @@ SRCS= alist.c \ WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/11/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/11/cddl/usr.bin/zinject/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/zinject/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,25 +1,24 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zinject +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zinject PROG= zinject SRCS= zinject.c translate.c MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs/ +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head LIBADD= geom m nvpair umem uutil zfs_core zfs zpool Modified: stable/11/cddl/usr.bin/zlook/Makefile ============================================================================== --- stable/11/cddl/usr.bin/zlook/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/zlook/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,25 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zlook +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zlook PROG= zlook MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -#CFLAGS+= -I${.CURDIR}/../../lib/libumem -# -#DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ -# ${LIBZFS} ${LIBZPOOL} -#LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/11/cddl/usr.bin/zstreamdump/Makefile ============================================================================== --- stable/11/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/zstreamdump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zstreamdump PROG= zstreamdump MAN= zstreamdump.1 WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head LIBADD= m nvpair umem zpool pthread z avl Modified: stable/11/cddl/usr.bin/ztest/Makefile ============================================================================== --- stable/11/cddl/usr.bin/ztest/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.bin/ztest/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/ztest +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/ztest PROG= ztest MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head LIBADD= geom m nvpair umem zpool pthread avl zfs_core zfs uutil Modified: stable/11/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace PROG= dtrace SRCS= dtrace.c @@ -10,8 +10,8 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ Modified: stable/11/cddl/usr.sbin/lockstat/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/lockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/lockstat PROG= lockstat SRCS= lockstat.c sym.c @@ -8,14 +8,14 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/sys CFLAGS+= -DNEED_ERRLOC -g Modified: stable/11/cddl/usr.sbin/plockstat/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,22 +1,22 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/plockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/plockstat PROG= plockstat -SRCS= plockstat.c +SRCS= plockstat.c BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../cddl/lib/libdtrace \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/cddl/lib/libdtrace \ + -I${SRCTOP}/sys LIBADD= dtrace proc Modified: stable/11/cddl/usr.sbin/zdb/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/zdb/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.sbin/zdb/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zdb +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zdb PROG= zdb MAN= zdb.8 @@ -9,20 +9,19 @@ SRCS= zdb.c zdb_il.c WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head LIBADD= nvpair umem uutil zfs zpool Modified: stable/11/cddl/usr.sbin/zhack/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/zhack/Makefile Thu Jul 20 00:52:11 2017 (r321267) +++ stable/11/cddl/usr.sbin/zhack/Makefile Thu Jul 20 00:53:50 2017 (r321268) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zhack PROG= zhack MAN= @@ -8,20 +8,19 @@ MAN= WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head LIBADD= nvpair zfs zpool From owner-svn-src-all@freebsd.org Thu Jul 20 00:58: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 D76D4D9BDD5; Thu, 20 Jul 2017 00:58:21 +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 B13B473DAA; Thu, 20 Jul 2017 00:58:21 +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 v6K0wKUY034336; Thu, 20 Jul 2017 00:58:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0wJZv034325; Thu, 20 Jul 2017 00:58:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200058.v6K0wJZv034325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321269 - in stable/11/libexec: atrun dma ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/libexec: atrun dma ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Commit-Revision: 321269 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 00:58:21 -0000 Author: ngie Date: Thu Jul 20 00:58:19 2017 New Revision: 321269 URL: https://svnweb.freebsd.org/changeset/base/321269 Log: MFC r314653: libexec: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output Modified: stable/11/libexec/atrun/Makefile stable/11/libexec/dma/Makefile.inc stable/11/libexec/ftpd/Makefile stable/11/libexec/hyperv/Makefile stable/11/libexec/mail.local/Makefile stable/11/libexec/smrsh/Makefile stable/11/libexec/talkd/Makefile stable/11/libexec/tcpd/Makefile stable/11/libexec/telnetd/Makefile stable/11/libexec/tftp-proxy/Makefile stable/11/libexec/ypxfr/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/atrun/Makefile ============================================================================== --- stable/11/libexec/atrun/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/atrun/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=at -MAINSRC=${.CURDIR}/../../usr.bin/at +MAINSRC=${SRCTOP}/usr.bin/at .include "${MAINSRC}/Makefile.inc" Modified: stable/11/libexec/dma/Makefile.inc ============================================================================== --- stable/11/libexec/dma/Makefile.inc Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/dma/Makefile.inc Thu Jul 20 00:58:19 2017 (r321269) @@ -1,7 +1,7 @@ # $FreeBSD$ -.sinclude "${.CURDIR}/../../Makefile.inc" -DMA_SOURCES= ${.CURDIR}/../../../contrib/dma +.sinclude "${.CURDIR:H:H}/Makefile.inc" +DMA_SOURCES= ${SRCTOP}/contrib/dma .PATH: ${DMA_SOURCES} CFLAGS+= -I${DMA_SOURCES} \ Modified: stable/11/libexec/ftpd/Makefile ============================================================================== --- stable/11/libexec/ftpd/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/ftpd/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -18,10 +18,9 @@ LIBADD= crypt xo util # XXX Kluge! Conversation mechanism needs to be fixed. LIBADD+= opie md -LSDIR= ../../bin/ls -.PATH: ${.CURDIR}/${LSDIR} +.PATH: ${SRCTOP}/bin/ls SRCS+= ls.c cmp.c print.c util.c -CFLAGS+=-Dmain=ls_main -I${.CURDIR}/${LSDIR} +CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls LIBADD+= m .if ${MK_BLACKLIST_SUPPORT} != "no" Modified: stable/11/libexec/hyperv/Makefile ============================================================================== --- stable/11/libexec/hyperv/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/hyperv/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/hyperv/tools/scripts +.PATH: ${SRCTOP}/contrib/hyperv/tools/scripts BINDIR= ${LIBEXECDIR}/hyperv Modified: stable/11/libexec/mail.local/Makefile ============================================================================== --- stable/11/libexec/mail.local/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/mail.local/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -2,7 +2,7 @@ # $FreeBSD$ PACKAGE=sendmail -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/mail.local PROG= mail.local Modified: stable/11/libexec/smrsh/Makefile ============================================================================== --- stable/11/libexec/smrsh/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/smrsh/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -2,7 +2,7 @@ # $FreeBSD$ PACKAGE=sendmail -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/smrsh PROG= smrsh Modified: stable/11/libexec/talkd/Makefile ============================================================================== --- stable/11/libexec/talkd/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/talkd/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -3,8 +3,8 @@ PROG= ntalkd SRCS= talkd.c announce.c process.c table.c print.c ttymsg.c -.PATH: ${.CURDIR}/../../usr.bin/wall +.PATH: ${SRCTOP}/usr.bin/wall MAN= talkd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/wall +CFLAGS+=-I${SRCTOP}/usr.bin/wall .include Modified: stable/11/libexec/tcpd/Makefile ============================================================================== --- stable/11/libexec/tcpd/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/tcpd/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../contrib/tcp_wrappers +.PATH: ${SRCTOP}/contrib/tcp_wrappers PROG= tcpd MAN= tcpd.8 Modified: stable/11/libexec/telnetd/Makefile ============================================================================== --- stable/11/libexec/telnetd/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/telnetd/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -5,7 +5,7 @@ .include -TELNETDIR= ${.CURDIR}/../../contrib/telnet +TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/telnetd PROG= telnetd @@ -27,7 +27,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${TELNETDIR} CFLAGS+= -I${TELNETDIR}/telnet -LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a +LIBTELNET= ${OBJTOP}/lib/libtelnet/libtelnet.a LIBADD= telnet util ncursesw Modified: stable/11/libexec/tftp-proxy/Makefile ============================================================================== --- stable/11/libexec/tftp-proxy/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/tftp-proxy/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/pf/tftp-proxy +.PATH: ${SRCTOP}/contrib/pf/tftp-proxy PROG= tftp-proxy SRCS= tftp-proxy.c filter.c Modified: stable/11/libexec/ypxfr/Makefile ============================================================================== --- stable/11/libexec/ypxfr/Makefile Thu Jul 20 00:53:50 2017 (r321268) +++ stable/11/libexec/ypxfr/Makefile Thu Jul 20 00:58:19 2017 (r321269) @@ -7,7 +7,7 @@ SRCS= yp_dblookup.c yp_dbwrite.c yp_error.c \ ${GENSRCS} GENSRCS=yp.h yp_clnt.c ypxfr_clnt.c -.PATH: ${.CURDIR}/../../usr.sbin/ypserv +.PATH: ${SRCTOP}/usr.sbin/ypserv MAN= ypxfr.8 @@ -20,7 +20,7 @@ LIBADD= rpcsvc CLEANFILES= ${GENSRCS} -RPCDIR= ${.CURDIR}/../../include/rpcsvc +RPCDIR= ${SRCTOP}/include/rpcsvc RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C ypxfr_clnt.c: ${RPCDIR}/yp.x From owner-svn-src-all@freebsd.org Thu Jul 20 01:01: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 DEF18D9BE9A; Thu, 20 Jul 2017 01:01:19 +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 6AE2274072; Thu, 20 Jul 2017 01:01:19 +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 v6K11ION038263; Thu, 20 Jul 2017 01:01:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K11GkV038239; Thu, 20 Jul 2017 01:01:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200101.v6K11GkV038239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321270 - in stable/10/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfc... X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfconvert usr.bin/ctfdump us... X-SVN-Commit-Revision: 321270 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:01:20 -0000 Author: ngie Date: Thu Jul 20 01:01:16 2017 New Revision: 321270 URL: https://svnweb.freebsd.org/changeset/base/321270 Log: MFC r314654: cddl: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output While here, remove bogus CFLAGS which look for headers in cddl/lib/libumem. There aren't any source files there (just Makefiles) Modified: stable/10/cddl/lib/drti/Makefile stable/10/cddl/lib/libavl/Makefile stable/10/cddl/lib/libctf/Makefile stable/10/cddl/lib/libdtrace/Makefile stable/10/cddl/lib/libnvpair/Makefile stable/10/cddl/lib/libumem/Makefile stable/10/cddl/lib/libuutil/Makefile stable/10/cddl/lib/libzfs/Makefile stable/10/cddl/lib/libzfs_core/Makefile stable/10/cddl/lib/libzpool/Makefile stable/10/cddl/sbin/zfs/Makefile stable/10/cddl/sbin/zpool/Makefile stable/10/cddl/usr.bin/ctfconvert/Makefile stable/10/cddl/usr.bin/ctfdump/Makefile stable/10/cddl/usr.bin/ctfmerge/Makefile stable/10/cddl/usr.bin/zinject/Makefile stable/10/cddl/usr.bin/zlook/Makefile stable/10/cddl/usr.bin/zstreamdump/Makefile stable/10/cddl/usr.bin/ztest/Makefile stable/10/cddl/usr.sbin/dtrace/Makefile stable/10/cddl/usr.sbin/lockstat/Makefile stable/10/cddl/usr.sbin/plockstat/Makefile stable/10/cddl/usr.sbin/zdb/Makefile stable/10/cddl/usr.sbin/zhack/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/lib/drti/Makefile ============================================================================== --- stable/10/cddl/lib/drti/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/drti/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common SRCS= drti.c FILES= ${SRCS:R:S/$/.o/g} @@ -12,8 +12,8 @@ CLEANFILES= ${FILES} LIB= drti-dummy INTERNALLIB= -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ Modified: stable/10/cddl/lib/libavl/Makefile ============================================================================== --- stable/10/cddl/lib/libavl/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libavl/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= avl SRCS= avl.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/10/cddl/lib/libctf/Makefile ============================================================================== --- stable/10/cddl/lib/libctf/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libctf/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/ctf -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libctf/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/ctf LIB= ctf SRCS= ctf_create.c \ @@ -20,8 +20,8 @@ SRCS= ctf_create.c \ WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/common/ctf \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ Modified: stable/10/cddl/lib/libdtrace/Makefile ============================================================================== --- stable/10/cddl/lib/libdtrace/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libdtrace/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libgen/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common LIB= dtrace SRCS= dt_aggregate.c \ @@ -58,9 +58,9 @@ DSRCS= errno.d \ WARNS?= 1 CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ - -I${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ @@ -69,22 +69,22 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +CFLAGS+= -I${SRCTOP}/sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/i386 +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/x86 .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc .elif ${MACHINE_CPUARCH} == "mips" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/mips +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/mips .elif ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: stable/10/cddl/lib/libnvpair/Makefile ============================================================================== --- stable/10/cddl/lib/libnvpair/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libnvpair/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/nvpair +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/nvpair LIB= nvpair @@ -13,18 +13,18 @@ SRCS= libnvpair.c \ opensolaris_nvpair_alloc_fixed.c WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem # This library uses macros to define fprintf behavior for several object types # The compiler will see the non-string literal arguments to the fprintf calls and -# omit warnings for them. Quiesce these warnings in contrib code: +# omit warnings for them. Quiesce these warnings in contrib code: # # cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format # string is not a string literal (potentially insecure) [-Wformat-security] Modified: stable/10/cddl/lib/libumem/Makefile ============================================================================== --- stable/10/cddl/lib/libumem/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libumem/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +.PATH: ${SRCTOP}/cddl/compat/opensolaris/lib/libumem LIB= umem SRCS= umem.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem .include Modified: stable/10/cddl/lib/libuutil/Makefile ============================================================================== --- stable/10/cddl/lib/libuutil/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libuutil/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= uutil SRCS= avl.c \ @@ -17,10 +17,10 @@ SRCS= avl.c \ WARNS?= 1 CFLAGS+= -DNATIVE_BUILD -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head .include Modified: stable/10/cddl/lib/libzfs/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzfs/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ @@ -45,20 +45,19 @@ SRCS+= libzfs_changelist.c \ WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common .include Modified: stable/10/cddl/lib/libzfs_core/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs_core/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzfs_core/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs_core DPADD= ${LIBNVPAIR} @@ -19,20 +19,19 @@ SRCS+= libzfs_compat.c WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common .include Modified: stable/10/cddl/lib/libzpool/Makefile ============================================================================== --- stable/10/cddl/lib/libzpool/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzpool/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,28 +1,28 @@ # $FreeBSD$ -.include "${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/Makefile.files" +.include "${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/Makefile.files" # ZFS_COMMON_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs # ZFS_SHARED_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs # KERNEL_SRCS -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common # LIST_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/os # ATOMIC_SRCS -.if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S .if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack .endif .else -.PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern +.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c .endif # UNICODE_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/unicode +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/unicode LIB= zpool @@ -37,24 +37,23 @@ SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} \ ${UNICODE_SRCS} WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair # XXX: pthread doesn't have mutex_owned() equivalent, so we need to look # into libthr private structures. That's sooo evil, but it's only for # ZFS debugging tools needs. CFLAGS+= -DWANTS_MUTEX_OWNED -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys -CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include +CFLAGS+= -I${SRCTOP}/lib/libpthread/thread +CFLAGS+= -I${SRCTOP}/lib/libpthread/sys +CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} ${LIBNVPAIR} \ ${LIBAVL} ${LIBUMEM} Modified: stable/10/cddl/sbin/zfs/Makefile ============================================================================== --- stable/10/cddl/sbin/zfs/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/sbin/zfs/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,26 +1,26 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zfs PROG= zfs MAN= zfs.8 SRCS= zfs_main.c zfs_iter.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} Modified: stable/10/cddl/sbin/zpool/Makefile ============================================================================== --- stable/10/cddl/sbin/zpool/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/sbin/zpool/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zpool -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zpool +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs PROG= zpool MAN= zpool.8 zpool-features.7 @@ -10,22 +10,22 @@ SRCS= zpool_main.c zpool_vdev.c zpool_iter.c zpool_uti SRCS+= timestamp.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} Modified: stable/10/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt DEBUG_FLAGS= -g @@ -27,8 +27,8 @@ SRCS= alist.c \ traverse.c \ util.c -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/10/cddl/usr.bin/ctfdump/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/dump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/dump PROG= ctfdump SRCS= dump.c \ @@ -12,8 +12,8 @@ CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/cmd/mdb/tools/common \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common Modified: stable/10/cddl/usr.bin/ctfmerge/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt PROG= ctfmerge SRCS= alist.c \ @@ -24,8 +24,8 @@ SRCS= alist.c \ WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zinject/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,25 +1,24 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zinject +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zinject PROG= zinject SRCS= zinject.c translate.c MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs/ +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} Modified: stable/10/cddl/usr.bin/zlook/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zlook/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zlook/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,25 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zlook +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zlook PROG= zlook MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -#CFLAGS+= -I${.CURDIR}/../../lib/libumem -# -#DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ -# ${LIBZFS} ${LIBZPOOL} -#LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/10/cddl/usr.bin/zstreamdump/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/zstreamdump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zstreamdump PROG= zstreamdump MAN= zstreamdump.1 WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ ${LIBPTHREAD} ${LIBZ} ${LIBAVL} Modified: stable/10/cddl/usr.bin/ztest/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ztest/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ztest/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/ztest +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/ztest PROG= ztest MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ ${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL} Modified: stable/10/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace PROG= dtrace SRCS= dtrace.c @@ -8,8 +8,8 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ Modified: stable/10/cddl/usr.sbin/lockstat/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/lockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/lockstat PROG= lockstat NO_MAN= @@ -9,14 +9,14 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/sys CFLAGS+= -DNEED_ERRLOC -g Modified: stable/10/cddl/usr.sbin/plockstat/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,22 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/plockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/plockstat PROG= plockstat -SRCS= plockstat.c +SRCS= plockstat.c BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../cddl/lib/libdtrace \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/cddl/lib/libdtrace \ + -I${SRCTOP}/sys DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF}\ ${LIBELF} ${LIBZ} ${LIBRT} ${LIBRTLD_DB} ${LIBUTIL} Modified: stable/10/cddl/usr.sbin/zdb/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zdb/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/zdb/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zdb +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zdb PROG= zdb MAN= zdb.8 @@ -9,20 +9,19 @@ SRCS= zdb.c zdb_il.c WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} Modified: stable/10/cddl/usr.sbin/zhack/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zhack/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/zhack/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zhack PROG= zhack MAN= @@ -8,20 +8,19 @@ MAN= WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} From owner-svn-src-all@freebsd.org Thu Jul 20 01:02: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 BF301D9D06C; Thu, 20 Jul 2017 01:02:31 +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 8DD52742B8; Thu, 20 Jul 2017 01:02:31 +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 v6K12UMs038385; Thu, 20 Jul 2017 01:02:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K12U2I038382; Thu, 20 Jul 2017 01:02:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200102.v6K12U2I038382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:02: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: r321271 - in stable/11/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Commit-Revision: 321271 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:02:31 -0000 Author: ngie Date: Thu Jul 20 01:02:30 2017 New Revision: 321271 URL: https://svnweb.freebsd.org/changeset/base/321271 Log: MFC r314479: Use :H to manipulate .CURDIR-relative paths instead of ../ This simplifies make output Modified: stable/11/usr.sbin/fifolog/fifolog_create/Makefile stable/11/usr.sbin/fifolog/fifolog_reader/Makefile stable/11/usr.sbin/fifolog/fifolog_writer/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/fifolog/fifolog_create/Makefile ============================================================================== --- stable/11/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:01:16 2017 (r321270) +++ stable/11/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:02:30 2017 (r321271) @@ -2,7 +2,7 @@ PROG= fifolog_create -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib LIBADD= util fifolog Modified: stable/11/usr.sbin/fifolog/fifolog_reader/Makefile ============================================================================== --- stable/11/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:01:16 2017 (r321270) +++ stable/11/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:02:30 2017 (r321271) @@ -2,7 +2,7 @@ PROG= fifolog_reader -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= Modified: stable/11/usr.sbin/fifolog/fifolog_writer/Makefile ============================================================================== --- stable/11/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:01:16 2017 (r321270) +++ stable/11/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:02:30 2017 (r321271) @@ -2,7 +2,7 @@ PROG= fifolog_writer -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= From owner-svn-src-all@freebsd.org Thu Jul 20 01: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 84AA8D9D0D5; Thu, 20 Jul 2017 01:02: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 5266A742F4; Thu, 20 Jul 2017 01:02: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 v6K12bsD038437; Thu, 20 Jul 2017 01:02:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K12bJn038434; Thu, 20 Jul 2017 01:02:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200102.v6K12bJn038434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:02:37 +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: r321272 - in stable/10/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Commit-Revision: 321272 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:02:38 -0000 Author: ngie Date: Thu Jul 20 01:02:37 2017 New Revision: 321272 URL: https://svnweb.freebsd.org/changeset/base/321272 Log: MFC r314479: Use :H to manipulate .CURDIR-relative paths instead of ../ This simplifies make output Modified: stable/10/usr.sbin/fifolog/fifolog_create/Makefile stable/10/usr.sbin/fifolog/fifolog_reader/Makefile stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/fifolog/fifolog_create/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_create -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib DPADD= ${LIBFIFOLOG} ${LIBUTIL} LDADD= ${LIBFIFOLOG} -lutil Modified: stable/10/usr.sbin/fifolog/fifolog_reader/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_reader -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= Modified: stable/10/usr.sbin/fifolog/fifolog_writer/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_writer -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= From owner-svn-src-all@freebsd.org Thu Jul 20 01:03: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 225EED9D19A; Thu, 20 Jul 2017 01:03:45 +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 E30DD74572; Thu, 20 Jul 2017 01:03:44 +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 v6K13iHl038593; Thu, 20 Jul 2017 01:03:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K13hmk038591; Thu, 20 Jul 2017 01:03:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200103.v6K13hmk038591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:03: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: r321273 - in stable/11/usr.sbin: rpc.lockd rpc.statd X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.sbin: rpc.lockd rpc.statd X-SVN-Commit-Revision: 321273 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:03:45 -0000 Author: ngie Date: Thu Jul 20 01:03:43 2017 New Revision: 321273 URL: https://svnweb.freebsd.org/changeset/base/321273 Log: MFC r314454,r314455: r314454: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. r314455: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. Modified: stable/11/usr.sbin/rpc.lockd/Makefile stable/11/usr.sbin/rpc.statd/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rpc.lockd/Makefile ============================================================================== --- stable/11/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:02:37 2017 (r321272) +++ stable/11/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:03:43 2017 (r321273) @@ -17,10 +17,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C nlm_prot_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} nlm_prot.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: ${.CURDIR}/test.c cc -o test ${.CURDIR}/test.c -lrpcsvc Modified: stable/11/usr.sbin/rpc.statd/Makefile ============================================================================== --- stable/11/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:02:37 2017 (r321272) +++ stable/11/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:03:43 2017 (r321273) @@ -15,10 +15,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C sm_inter_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} sm_inter.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: test.c cc -o test test.c -lrpcsvc From owner-svn-src-all@freebsd.org Thu Jul 20 01:03: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 CB71CD9D1E9; Thu, 20 Jul 2017 01:03:51 +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 9A425745A7; Thu, 20 Jul 2017 01:03:51 +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 v6K13owq038644; Thu, 20 Jul 2017 01:03:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K13oU0038642; Thu, 20 Jul 2017 01:03:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200103.v6K13oU0038642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:03:50 +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: r321274 - in stable/10/usr.sbin: rpc.lockd rpc.statd X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin: rpc.lockd rpc.statd X-SVN-Commit-Revision: 321274 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:03:51 -0000 Author: ngie Date: Thu Jul 20 01:03:50 2017 New Revision: 321274 URL: https://svnweb.freebsd.org/changeset/base/321274 Log: MFC r314454,r314455: r314454: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. r314455: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. Modified: stable/10/usr.sbin/rpc.lockd/Makefile stable/10/usr.sbin/rpc.statd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.lockd/Makefile ============================================================================== --- stable/10/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:03:43 2017 (r321273) +++ stable/10/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:03:50 2017 (r321274) @@ -18,10 +18,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C nlm_prot_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} nlm_prot.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: ${.CURDIR}/test.c cc -o test ${.CURDIR}/test.c -lrpcsvc Modified: stable/10/usr.sbin/rpc.statd/Makefile ============================================================================== --- stable/10/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:03:43 2017 (r321273) +++ stable/10/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:03:50 2017 (r321274) @@ -16,10 +16,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C sm_inter_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} sm_inter.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: test.c cc -o test test.c -lrpcsvc From owner-svn-src-all@freebsd.org Thu Jul 20 01:07: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 4DD8ED9D3C4; Thu, 20 Jul 2017 01:07:04 +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 283A774891; Thu, 20 Jul 2017 01:07:04 +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 v6K173XI038912; Thu, 20 Jul 2017 01:07:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K172Qd038901; Thu, 20 Jul 2017 01:07:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200107.v6K172Qd038901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:07: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: r321275 - in stable/10/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Commit-Revision: 321275 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:07:04 -0000 Author: ngie Date: Thu Jul 20 01:07:02 2017 New Revision: 321275 URL: https://svnweb.freebsd.org/changeset/base/321275 Log: MFC r314475: Simplify idioms in usr.sbin/lpr Makefiles Use :H instead of .CURDIR-relative pathing to simplify make output, etc. Modified: stable/10/usr.sbin/lpr/chkprintcap/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile stable/10/usr.sbin/lpr/filters/Makefile stable/10/usr.sbin/lpr/lpc/Makefile stable/10/usr.sbin/lpr/lpd/Makefile stable/10/usr.sbin/lpr/lpq/Makefile stable/10/usr.sbin/lpr/lpr/Makefile stable/10/usr.sbin/lpr/lprm/Makefile stable/10/usr.sbin/lpr/lptest/Makefile stable/10/usr.sbin/lpr/pac/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/lpr/chkprintcap/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= chkprintcap MAN= chkprintcap.8 SRCS= chkprintcap.c skimprintcap.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= koi2855 MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= koi2alt MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/10/usr.sbin/lpr/filters/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -6,6 +6,6 @@ BINDIR= ${LIBEXECDIR}/lpr PROG= lpf MAN= -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/10/usr.sbin/lpr/lpc/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= lpc MAN= lpc.8 @@ -9,7 +9,7 @@ SRCS= lpc.c cmds.c cmdtab.c movejobs.c BINGRP= daemon BINMODE= 2555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 0 Modified: stable/10/usr.sbin/lpr/lpd/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -5,7 +5,7 @@ PROG= lpd MAN= lpd.8 SRCS= lpd.c printjob.c recvjob.c lpdchar.c modes.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 1 Modified: stable/10/usr.sbin/lpr/lpq/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -8,7 +8,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/lpr/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -11,7 +11,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 2 Modified: stable/10/usr.sbin/lpr/lprm/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -10,7 +10,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/lptest/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= lptest -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/10/usr.sbin/lpr/pac/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,12 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= pac MAN= pac.8 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} From owner-svn-src-all@freebsd.org Thu Jul 20 01: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 C7554D9D42E; Thu, 20 Jul 2017 01:07:17 +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 A38E474957; Thu, 20 Jul 2017 01:07:17 +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 v6K17GQ4038975; Thu, 20 Jul 2017 01:07:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K17FNM038964; Thu, 20 Jul 2017 01:07:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200107.v6K17FNM038964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321276 - in stable/11/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Commit-Revision: 321276 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:07:17 -0000 Author: ngie Date: Thu Jul 20 01:07:15 2017 New Revision: 321276 URL: https://svnweb.freebsd.org/changeset/base/321276 Log: MFC r314475: Simplify idioms in usr.sbin/lpr Makefiles Use :H instead of .CURDIR-relative pathing to simplify make output, etc. Modified: stable/11/usr.sbin/lpr/chkprintcap/Makefile stable/11/usr.sbin/lpr/filters.ru/koi2855/Makefile stable/11/usr.sbin/lpr/filters.ru/koi2alt/Makefile stable/11/usr.sbin/lpr/filters/Makefile stable/11/usr.sbin/lpr/lpc/Makefile stable/11/usr.sbin/lpr/lpd/Makefile stable/11/usr.sbin/lpr/lpq/Makefile stable/11/usr.sbin/lpr/lpr/Makefile stable/11/usr.sbin/lpr/lprm/Makefile stable/11/usr.sbin/lpr/lptest/Makefile stable/11/usr.sbin/lpr/pac/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/lpr/chkprintcap/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= chkprintcap MAN= chkprintcap.8 SRCS= chkprintcap.c skimprintcap.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source LIBADD= lpr Modified: stable/11/usr.sbin/lpr/filters.ru/koi2855/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -3,6 +3,6 @@ PROG= koi2855 MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/11/usr.sbin/lpr/filters.ru/koi2alt/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -3,6 +3,6 @@ PROG= koi2alt MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/11/usr.sbin/lpr/filters/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -6,6 +6,6 @@ BINDIR= ${LIBEXECDIR}/lpr PROG= lpf MAN= -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/11/usr.sbin/lpr/lpc/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= lpc MAN= lpc.8 @@ -9,7 +9,7 @@ SRCS= lpc.c cmds.c cmdtab.c movejobs.c BINGRP= daemon BINMODE= 2555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 0 Modified: stable/11/usr.sbin/lpr/lpd/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -5,7 +5,7 @@ PROG= lpd MAN= lpd.8 SRCS= lpd.c printjob.c recvjob.c lpdchar.c modes.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 1 Modified: stable/11/usr.sbin/lpr/lpq/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -8,7 +8,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source LIBADD= lpr Modified: stable/11/usr.sbin/lpr/lpr/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -11,7 +11,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 2 Modified: stable/11/usr.sbin/lpr/lprm/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -10,7 +10,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source LIBADD= lpr Modified: stable/11/usr.sbin/lpr/lptest/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -3,6 +3,6 @@ PROG= lptest -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/11/usr.sbin/lpr/pac/Makefile ============================================================================== --- stable/11/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:07:02 2017 (r321275) +++ stable/11/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:07:15 2017 (r321276) @@ -1,12 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= pac MAN= pac.8 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source LIBADD= lpr From owner-svn-src-all@freebsd.org Thu Jul 20 01:07: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 02D85D9D4E7; Thu, 20 Jul 2017 01:07:53 +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 C60A674AE9; Thu, 20 Jul 2017 01:07:52 +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 v6K17plM039072; Thu, 20 Jul 2017 01:07:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K17pZm039071; Thu, 20 Jul 2017 01:07:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200107.v6K17pZm039071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321277 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 321277 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:07:53 -0000 Author: ngie Date: Thu Jul 20 01:07:51 2017 New Revision: 321277 URL: https://svnweb.freebsd.org/changeset/base/321277 Log: MFC r314543: Add missing section when referencing ctl(4) via .Xr macro Modified: stable/11/share/man/man4/cfumass.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/cfumass.4 ============================================================================== --- stable/11/share/man/man4/cfumass.4 Thu Jul 20 01:07:15 2017 (r321276) +++ stable/11/share/man/man4/cfumass.4 Thu Jul 20 01:07:51 2017 (r321277) @@ -72,7 +72,7 @@ The USB OTG port must be working in USB device-side mo This happens automatically upon connection to a USB host. .It There must be a -.Xr ctl +.Xr ctl 4 LUN configured for the .Pa cfumass port. From owner-svn-src-all@freebsd.org Thu Jul 20 01:12:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1EED9DA22; Thu, 20 Jul 2017 01:12:32 +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 292EB75057; Thu, 20 Jul 2017 01:12:32 +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 v6K1CVRh043075; Thu, 20 Jul 2017 01:12:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1CVKN043074; Thu, 20 Jul 2017 01:12:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200112.v6K1CVKN043074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:12: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: r321279 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 321279 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:12:32 -0000 Author: ngie Date: Thu Jul 20 01:12:31 2017 New Revision: 321279 URL: https://svnweb.freebsd.org/changeset/base/321279 Log: MFC r278329: Document WITNESS_COUNT and WITNESS_NO_VNODE Modified: stable/10/share/man/man4/witness.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/witness.4 ============================================================================== --- stable/10/share/man/man4/witness.4 Thu Jul 20 01:11:58 2017 (r321278) +++ stable/10/share/man/man4/witness.4 Thu Jul 20 01:12:31 2017 (r321279) @@ -32,7 +32,9 @@ .Nd lock validation facility .Sh SYNOPSIS .Cd options WITNESS +.Cd options WITNESS_COUNT .Cd options WITNESS_KDB +.Cd options WITNESS_NO_VNODE .Cd options WITNESS_SKIPSPIN .Sh DESCRIPTION The @@ -55,6 +57,28 @@ code also checks various other conditions such as veri does not recurse on a non-recursive lock, or attempt an upgrade on a shared lock held by another thread. If any of these checks fail, then the kernel will panic. +.Pp +The +.Dv WITNESS_COUNT +kernel option controls the maximum number of +.Xr witness 4 +entries that are tracked in the kernel. +The maximum number of entries can be queried via the +.Va debug.witness.count +sysctl. +It can also be set from the +.Xr loader 8 +via the +.Va debug.witness.count +environment variable. +.Pp +The +.Dv WITNESS_NO_VNODE +kernel option tells +.Xr witness 4 +to ignore locking issues between +.Xr vnode 9 +objects. .Pp The flag that controls whether or not the kernel debugger is entered when a lock order violation is detected can be set in a variety of ways. From owner-svn-src-all@freebsd.org Thu Jul 20 01:12: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 53558D9D9A2; Thu, 20 Jul 2017 01:12:00 +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 0591374E0A; Thu, 20 Jul 2017 01:11:59 +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 v6K1BxPJ043000; Thu, 20 Jul 2017 01:11:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1BxGN042999; Thu, 20 Jul 2017 01:11:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200111.v6K1BxGN042999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321278 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 321278 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:12:00 -0000 Author: ngie Date: Thu Jul 20 01:11:58 2017 New Revision: 321278 URL: https://svnweb.freebsd.org/changeset/base/321278 Log: MFC r314543: Add missing section when referencing ctl(4) via .Xr macro Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Thu Jul 20 01:13: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 22668D9DB7E; Thu, 20 Jul 2017 01:13:11 +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 C8B3475202; Thu, 20 Jul 2017 01:13:10 +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 v6K1D9xK043143; Thu, 20 Jul 2017 01:13:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1D9OK043142; Thu, 20 Jul 2017 01:13:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200113.v6K1D9OK043142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:13:09 +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: r321280 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 321280 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:13:11 -0000 Author: ngie Date: Thu Jul 20 01:13:09 2017 New Revision: 321280 URL: https://svnweb.freebsd.org/changeset/base/321280 Log: Revert r321278 I accidentally merged a mergeinfo change to this branch with a bad commit message. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Thu Jul 20 01: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 202A5D9E3A9; Thu, 20 Jul 2017 01:19:07 +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 E01FC755F9; Thu, 20 Jul 2017 01:19:06 +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 v6K1J68Y043391; Thu, 20 Jul 2017 01:19:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1J6Nu043390; Thu, 20 Jul 2017 01:19:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200119.v6K1J6Nu043390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:19:06 +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: r321281 - stable/10/cddl/usr.sbin/dtrace/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/cddl/usr.sbin/dtrace/tests X-SVN-Commit-Revision: 321281 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 01:19:07 -0000 Author: ngie Date: Thu Jul 20 01:19:05 2017 New Revision: 321281 URL: https://svnweb.freebsd.org/changeset/base/321281 Log: MFC r290570: Reduce the Makefile snippet complexity a bit - Set BINDIR to TESTSDIR globally (and subsequently, remove all `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`) - Set MAN to "" globally, instead of per-PROG Modified: stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 ============================================================================== --- stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Thu Jul 20 01:13:09 2017 (r321280) +++ stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Thu Jul 20 01:19:05 2017 (r321281) @@ -11,9 +11,6 @@ ${TESTGROUP}= ${TESTFILES} ${TESTGROUP}EXE= ${TESTEXES} ${TESTGROUP}EXEMODE= 0555 -${TESTGROUP}DIR= ${TESTSDIR} -${TESTGROUP}EXEDIR= ${TESTSDIR} - TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh" @@ -32,13 +29,14 @@ CLEANFILES+= ${TESTWRAPPER}.sh PROGS= ${CFILES:T:S/.c$/.exe/g} .for prog in ${PROGS} SRCS.${prog}+= ${prog:S/.exe$/.c/} -BINDIR.${prog}= ${TESTSDIR} -MAN.${prog}= .if exists(${prog:S/^tst.//:S/.exe$/.d/}) SRCS.${prog}+= ${prog:S/^tst.//:S/.exe$/.d/} .endif .endfor + +BINDIR= ${TESTSDIR} +MAN= # Some tests depend on the internals of their corresponding test programs, # so make sure the optimizer doesn't interfere with them. From owner-svn-src-all@freebsd.org Thu Jul 20 04:32: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 E928FDA81A8; Thu, 20 Jul 2017 04:32:07 +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 BE1967FF3F; Thu, 20 Jul 2017 04:32:07 +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 v6K4W6aX023757; Thu, 20 Jul 2017 04:32:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K4W6Hh023756; Thu, 20 Jul 2017 04:32:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200432.v6K4W6Hh023756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 04:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321282 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 321282 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 04:32:08 -0000 Author: ngie Date: Thu Jul 20 04:32:06 2017 New Revision: 321282 URL: https://svnweb.freebsd.org/changeset/base/321282 Log: Some trivial style(9) fixes - Delete trailing whitespace. - Fix leading indentation (convert single column spaces to tabs). - Convert "[Ff]all through" to "FALLTHROUGH", per implicit project style/spelling. Reviewed by: sbruno Differential Revision: D11665 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jul 20 01:19:05 2017 (r321281) +++ head/sys/dev/e1000/if_em.c Thu Jul 20 04:32:06 2017 (r321282) @@ -203,7 +203,7 @@ static pci_vendor_info_t igb_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) PRO/1000 PCI-Express Network Driver"), PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) PRO/1000 PCI-Express Network Driver"), PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), + PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), PVID(0x8086, E1000_DEV_ID_I211_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), @@ -231,8 +231,8 @@ static int em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t static void em_if_queues_free(if_ctx_t ctx); static uint64_t em_if_get_counter(if_ctx_t, ift_counter); -static void em_if_init(if_ctx_t ctx); -static void em_if_stop(if_ctx_t ctx); +static void em_if_init(if_ctx_t ctx); +static void em_if_stop(if_ctx_t ctx); static void em_if_media_status(if_ctx_t, struct ifmediareq *); static int em_if_media_change(if_ctx_t ctx); static int em_if_mtu_set(if_ctx_t ctx, uint32_t mtu); @@ -357,11 +357,11 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_detach, em_if_detach), DEVMETHOD(ifdi_shutdown, em_if_shutdown), DEVMETHOD(ifdi_suspend, em_if_suspend), - DEVMETHOD(ifdi_resume, em_if_resume), + DEVMETHOD(ifdi_resume, em_if_resume), DEVMETHOD(ifdi_init, em_if_init), DEVMETHOD(ifdi_stop, em_if_stop), DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign), - DEVMETHOD(ifdi_intr_enable, em_if_enable_intr), + DEVMETHOD(ifdi_intr_enable, em_if_enable_intr), DEVMETHOD(ifdi_intr_disable, em_if_disable_intr), DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc), DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc), @@ -1401,7 +1401,7 @@ em_msix_link(void *arg) u32 reg_icr; ++adapter->link_irq; - MPASS(adapter->hw.back != NULL); + MPASS(adapter->hw.back != NULL); reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); if (reg_icr & E1000_ICR_RXO) @@ -1720,9 +1720,9 @@ em_if_update_admin_status(if_ctx_t ctx) break; /* VF device is type_unknown */ case e1000_media_type_unknown: - e1000_check_for_link(hw); + e1000_check_for_link(hw); link_check = !hw->mac.get_link_status; - /* Fall thru */ + /* FALLTHROUGH */ default: break; } @@ -2536,15 +2536,15 @@ em_reset(if_ctx_t ctx) case e1000_vfadapt_i350: /* 16-byte granularity */ hw->fc.low_water = hw->fc.high_water - 16; - break; - case e1000_ich9lan: - case e1000_ich10lan: + break; + case e1000_ich9lan: + case e1000_ich10lan: if (if_getmtu(ifp) > ETHERMTU) { hw->fc.high_water = 0x2800; hw->fc.low_water = hw->fc.high_water - 8; break; } - /* else fall thru */ + /* FALLTHROUGH */ default: if (hw->mac.type == e1000_80003es2lan) hw->fc.pause_time = 0xFFFF; @@ -2611,7 +2611,7 @@ em_initialize_rss_mapping(struct adapter *adapter) for (i = 0; i < 32; ++i) E1000_WRITE_REG(hw, E1000_RETA(i), reta); - E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q | + E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q | E1000_MRQC_RSS_FIELD_IPV4_TCP | E1000_MRQC_RSS_FIELD_IPV4 | E1000_MRQC_RSS_FIELD_IPV6_TCP_EX | @@ -2698,8 +2698,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) arc4rand(&rss_key, sizeof(rss_key), 0); #endif for (i = 0; i < 10; i++) - E1000_WRITE_REG_ARRAY(hw, - E1000_RSSRK(0), i, rss_key[i]); + E1000_WRITE_REG_ARRAY(hw, E1000_RSSRK(0), i, rss_key[i]); /* * Configure the RSS fields to hash upon. @@ -2766,7 +2765,7 @@ em_setup_interface(if_ctx_t ctx) /* Enable only WOL MAGIC by default */ if (adapter->wol) { if_setcapenablebit(ifp, IFCAP_WOL_MAGIC, - IFCAP_WOL_MCAST| IFCAP_WOL_UCAST); + IFCAP_WOL_MCAST| IFCAP_WOL_UCAST); } else { if_setcapenablebit(ifp, 0, IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST| IFCAP_WOL_UCAST); @@ -2838,7 +2837,7 @@ em_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u txr->tx_base = (struct e1000_tx_desc *)vaddrs[i*ntxqs]; txr->tx_paddr = paddrs[i*ntxqs]; } - + device_printf(iflib_get_dev(ctx), "allocated for %d tx_queues\n", adapter->tx_num_queues); return (0); fail: @@ -2863,7 +2862,7 @@ em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u adapter->rx_num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(iflib_get_dev(ctx), "Unable to allocate queue memory\n"); error = ENOMEM; - goto fail; + goto fail; } for (i = 0, que = adapter->rx_queues; i < nrxqsets; i++, que++) { @@ -2903,7 +2902,7 @@ em_if_queues_free(if_ctx_t ctx) txr->tx_rsq = NULL; } free(adapter->tx_queues, M_DEVBUF); - adapter->tx_queues = NULL; + adapter->tx_queues = NULL; } if (rx_que != NULL) { @@ -3178,7 +3177,7 @@ em_initialize_receive_unit(if_ctx_t ctx) u64 bus_addr = rxr->rx_paddr; #if 0 u32 rdt = adapter->rx_num_queues -1; /* default */ -#endif +#endif E1000_WRITE_REG(hw, E1000_RDLEN(i), scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended)); @@ -3233,7 +3232,7 @@ em_initialize_receive_unit(if_ctx_t ctx) srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; rctl |= E1000_RCTL_SZ_2048; } - + /* * If TX flow control is disabled and there's >1 queue defined, * enable DROP. @@ -3271,7 +3270,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl &= 0xFFF00000; rxdctl |= IGB_RX_PTHRESH; rxdctl |= IGB_RX_HTHRESH << 8; - rxdctl |= IGB_RX_WTHRESH << 16; + rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } } else if (adapter->hw.mac.type >= e1000_pch2lan) { @@ -3400,7 +3399,7 @@ em_if_disable_intr(if_ctx_t ctx) /* * Bit of a misnomer, what this really means is * to enable OS management of the system... aka - * to disable special hardware management features + * to disable special hardware management features */ static void em_init_manageability(struct adapter *adapter) @@ -3786,7 +3785,7 @@ static void em_if_led_func(if_ctx_t ctx, int onoff) { struct adapter *adapter = iflib_get_softc(ctx); - + if (onoff) { e1000_setup_led(&adapter->hw); e1000_led_on(&adapter->hw); @@ -3932,7 +3931,7 @@ static uint64_t em_if_get_counter(if_ctx_t ctx, ift_counter cnt) { struct adapter *adapter = iflib_get_softc(ctx); - struct ifnet *ifp = iflib_get_ifp(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); switch (cnt) { case IFCOUNTER_COLLISIONS: @@ -3969,7 +3968,7 @@ static void em_add_hw_stats(struct adapter *adapter) { device_t dev = iflib_get_dev(adapter->ctx); - struct em_tx_queue *tx_que = adapter->tx_queues; + struct em_tx_queue *tx_que = adapter->tx_queues; struct em_rx_queue *rx_que = adapter->rx_queues; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); @@ -4214,7 +4213,7 @@ em_add_hw_stats(struct adapter *adapter) /* Interrupt Stats */ - int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "interrupts", + int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "interrupts", CTLFLAG_RD, NULL, "Interrupt Statistics"); int_list = SYSCTL_CHILDREN(int_node); @@ -4391,7 +4390,7 @@ em_set_flowcntl(SYSCTL_HANDLER_ARGS) case e1000_fc_none: adapter->hw.fc.requested_mode = input; adapter->fc = input; - break; + break; default: /* Do nothing */ return (error); @@ -4439,7 +4438,7 @@ em_sysctl_debug_info(SYSCTL_HANDLER_ARGS) if (result == 1) { adapter = (struct adapter *) arg1; em_print_debug_info(adapter); - } + } return (error); } From owner-svn-src-all@freebsd.org Thu Jul 20 05:43: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 95B26DA924C; Thu, 20 Jul 2017 05:43:49 +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 60126816A4; Thu, 20 Jul 2017 05:43:49 +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 v6K5hmnT052499; Thu, 20 Jul 2017 05:43:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K5hmlD052498; Thu, 20 Jul 2017 05:43:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200543.v6K5hmlD052498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 05:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321283 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 321283 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 05:43:49 -0000 Author: ngie Date: Thu Jul 20 05:43:48 2017 New Revision: 321283 URL: https://svnweb.freebsd.org/changeset/base/321283 Log: procstat(8): clarify program usage - Visualize mutually exclusive options and their corresponding arguments. - Try to make the subtleties that are expressed in the code, and potentially in the manpages, more apparent. Modified: head/usr.bin/procstat/procstat.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Thu Jul 20 04:32:06 2017 (r321282) +++ head/usr.bin/procstat/procstat.c Thu Jul 20 05:43:48 2017 (r321283) @@ -50,12 +50,23 @@ static void usage(void) { - xo_error("usage: procstat [--libxo] [-CHhn] [-M core] " + xo_error( + "usage: procstat [--libxo] [-Hhn] [-M core] " "[-N system] [-w interval]\n" - " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -L | -r | -s | \n" - " -S | -t | -v | -x]\n" - " [-a | pid | core ...]\n"); + " [-S | -b | -c | -e | -i | -j | -k | -kk | " + "-l | -r | -s | \n" + " -t | -v | -x]\n" + " [-a | pid ... | core ...]\n" + " procstat [--libxo] -Cf [-hn] [-M core] " + "[-N system] [-a | pid ... | core ...]\n" + " [-S | -b | -c | -e | -i | -j | -k | -kk | " + "-l | -r | -s | \n" + " procstat [--libxo] -L [-hn] [-M core] " + "[-N system] [-w interval]\n" + " [-S | -b | -c | -e | -i | -j | -k | -kk | " + "-l | -r | -s | \n" + " -t | -v | -x]\n" + " [core ...]\n"); xo_finish(); exit(EX_USAGE); } From owner-svn-src-all@freebsd.org Thu Jul 20 06:47: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 42A55DAA0E2; Thu, 20 Jul 2017 06:47:08 +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 120E082CA3; Thu, 20 Jul 2017 06:47:08 +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 v6K6l7jO076556; Thu, 20 Jul 2017 06:47:07 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K6l7Hq076554; Thu, 20 Jul 2017 06:47:07 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707200647.v6K6l7Hq076554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 20 Jul 2017 06:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321284 - in head/sys: amd64/include sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys: amd64/include sys X-SVN-Commit-Revision: 321284 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 06:47:08 -0000 Author: rlibby Date: Thu Jul 20 06:47:06 2017 New Revision: 321284 URL: https://svnweb.freebsd.org/changeset/base/321284 Log: efi: restrict visibility of EFIABI_ATTR-declared functions In-tree gcc (4.2) doesn't understand __attribute__((ms_abi)) (EFIABI_ATTR). Avoid declaring functions with that attribute when the compiler is detected to be gcc < 4.4. Reviewed by: kib, imp (previous version) Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11636 Modified: head/sys/amd64/include/efi.h head/sys/sys/efi.h Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 (r321283) +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 (r321284) @@ -36,8 +36,14 @@ * XXX: from gcc 6.2 manual: * Note, the ms_abi attribute for Microsoft Windows 64-bit targets * currently requires the -maccumulate-outgoing-args option. + * + * Avoid EFIABI_ATTR declarations for compilers that don't support it. + * GCC support began in version 4.4. */ +#if defined(__clang__) || defined(__GNUC__) && \ + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) #define EFIABI_ATTR __attribute__((ms_abi)) +#endif #ifdef _KERNEL struct uuid; Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Thu Jul 20 05:43:48 2017 (r321283) +++ head/sys/sys/efi.h Thu Jul 20 06:47:06 2017 (r321284) @@ -122,6 +122,9 @@ struct efi_tblhdr { uint32_t __res; }; +#ifdef _KERNEL + +#ifdef EFIABI_ATTR struct efi_rt { struct efi_tblhdr rt_hdr; efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *) @@ -144,6 +147,7 @@ struct efi_rt { efi_status (*rt_reset)(enum efi_reset, efi_status, u_long, efi_char *) EFIABI_ATTR; }; +#endif struct efi_systbl { struct efi_tblhdr st_hdr; @@ -163,7 +167,6 @@ struct efi_systbl { uint64_t st_cfgtbl; }; -#ifdef _KERNEL extern vm_paddr_t efi_systbl_phys; #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Thu Jul 20 06:54: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 D2D59DAA365; Thu, 20 Jul 2017 06:54:59 +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 9FC18830FA; Thu, 20 Jul 2017 06:54:59 +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 v6K6swco080501; Thu, 20 Jul 2017 06:54:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K6swaP080500; Thu, 20 Jul 2017 06:54:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707200654.v6K6swaP080500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 20 Jul 2017 06:54:58 +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: r321285 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 321285 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 06:54:59 -0000 Author: kib Date: Thu Jul 20 06:54:58 2017 New Revision: 321285 URL: https://svnweb.freebsd.org/changeset/base/321285 Log: MFC r320936,r320937,r320938: Fix size argument to vm_pager_allocate(). Modified: stable/11/sys/amd64/amd64/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/efirt.c ============================================================================== --- stable/11/sys/amd64/amd64/efirt.c Thu Jul 20 06:47:06 2017 (r321284) +++ stable/11/sys/amd64/amd64/efirt.c Thu Jul 20 06:54:58 2017 (r321285) @@ -192,8 +192,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 20 07:13: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 6A8E9DAA80C; Thu, 20 Jul 2017 07:13:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 38013838A3; Thu, 20 Jul 2017 07:13:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K7DQnJ088674; Thu, 20 Jul 2017 07:13:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K7DQit088673; Thu, 20 Jul 2017 07:13:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707200713.v6K7DQit088673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 20 Jul 2017 07:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321286 - head/sys/dev/hyperv/storvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/storvsc X-SVN-Commit-Revision: 321286 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 07:13:27 -0000 Author: sephe Date: Thu Jul 20 07:13:26 2017 New Revision: 321286 URL: https://svnweb.freebsd.org/changeset/base/321286 Log: hyperv/storvsc: Force SPC3 for CDROM attached. This unbreaks the CDROM attaching on GEN2 VMs. On GEN1 VMs, CDROM is attached to emulated ATA controller. PR: 220790 Submitted by: Hongjiang Zhang MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11634 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 20 06:54:58 2017 (r321285) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 20 07:13:26 2017 (r321286) @@ -2210,6 +2210,23 @@ storvsc_io_done(struct hv_storvsc_request *reqp) resp_buf[3], resp_buf[4]); } /* + * XXX: Hyper-V (since win2012r2) responses inquiry with + * unknown version (0) for GEN-2 DVD device. + * Manually set the version number to SPC3 in order to + * ask CAM to continue probing with "PROBE_REPORT_LUNS". + * see probedone() in scsi_xpt.c + */ + if (SID_TYPE(inq_data) == T_CDROM && + inq_data->version == 0 && + (vmstor_proto_version >= VMSTOR_PROTOCOL_VERSION_WIN8)) { + inq_data->version = SCSI_REV_SPC3; + if (bootverbose) { + xpt_print(ccb->ccb_h.path, + "set version from 0 to %d\n", + inq_data->version); + } + } + /* * XXX: Manually fix the wrong response returned from WS2012 */ if (!is_scsi_valid(inq_data) && @@ -2218,7 +2235,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) 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[2] = SCSI_REV_SPC3; resp_buf[3] = 2; // resp fmt must be 2 if (bootverbose) xpt_print(ccb->ccb_h.path, From owner-svn-src-all@freebsd.org Thu Jul 20 08:11: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 5E6A0DAB86A; Thu, 20 Jul 2017 08:11:08 +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 0E93D123F; Thu, 20 Jul 2017 08:11:07 +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 v6K8B79H011327; Thu, 20 Jul 2017 08:11:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K8B67r011321; Thu, 20 Jul 2017 08:11:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707200811.v6K8B67r011321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Jul 2017 08:11: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: r321287 - stable/11/usr.sbin/sesutil X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/usr.sbin/sesutil X-SVN-Commit-Revision: 321287 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 08:11:08 -0000 Author: bapt Date: Thu Jul 20 08:11:06 2017 New Revision: 321287 URL: https://svnweb.freebsd.org/changeset/base/321287 Log: MFC r320267, r320270-r320271, r320478 r320267: Do not use sprintf(3) when not needed, while here, prefer snprintf(3) over sprintf(3) r320270: Directly print the extra status instead of filling a buffer then printing it. This prepares the code to make it libxo friendly Reviewed by: manu, Nikita Kozlov (nikita elyzion.net) Sponsored by: Gandi.net r320271: sesutil no longer depends on libsbuf Sponsored by: Gandi.net r320478: Add libxo(3) support to sesutil(8) This is useful to simplify parsing "sesutil map" Submitted by: nikita.kozlov@blade-group.com Relnotes: yes Reviewed by: Allanjude, bapt Differential revision: https://reviews.freebsd.org/D11372 Sponsored by: blade Modified: stable/11/usr.sbin/sesutil/Makefile stable/11/usr.sbin/sesutil/Makefile.depend stable/11/usr.sbin/sesutil/eltsub.c stable/11/usr.sbin/sesutil/eltsub.h stable/11/usr.sbin/sesutil/sesutil.8 stable/11/usr.sbin/sesutil/sesutil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/sesutil/Makefile ============================================================================== --- stable/11/usr.sbin/sesutil/Makefile Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/Makefile Thu Jul 20 08:11:06 2017 (r321287) @@ -4,6 +4,6 @@ PROG= sesutil SRCS= sesutil.c eltsub.c MAN= sesutil.8 -LIBADD= sbuf +LIBADD= xo .include Modified: stable/11/usr.sbin/sesutil/Makefile.depend ============================================================================== --- stable/11/usr.sbin/sesutil/Makefile.depend Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/Makefile.depend Thu Jul 20 08:11:06 2017 (r321287) @@ -8,8 +8,7 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libcompiler_rt \ - lib/libsbuf \ + lib/libcompiler_rt .include Modified: stable/11/usr.sbin/sesutil/eltsub.c ============================================================================== --- stable/11/usr.sbin/sesutil/eltsub.c Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/eltsub.c Thu Jul 20 08:11:06 2017 (r321287) @@ -32,15 +32,14 @@ * mjacob@feral.com */ -#include #include -#include #include #include #include #include #include +#include #include "eltsub.h" @@ -51,181 +50,95 @@ */ #define TEMPERATURE_OFFSET 20 -char * +const char * geteltnm(int type) { static char rbuf[132]; switch (type) { case ELMTYP_UNSPECIFIED: - sprintf(rbuf, "Unspecified"); - break; + return ("Unspecified"); case ELMTYP_DEVICE: - sprintf(rbuf, "Device Slot"); - break; + return ("Device Slot"); case ELMTYP_POWER: - sprintf(rbuf, "Power Supply"); - break; + return ("Power Supply"); case ELMTYP_FAN: - sprintf(rbuf, "Cooling"); - break; + return ("Cooling"); case ELMTYP_THERM: - sprintf(rbuf, "Temperature Sensors"); - break; + return ("Temperature Sensors"); case ELMTYP_DOORLOCK: - sprintf(rbuf, "Door Lock"); - break; + return ("Door Lock"); case ELMTYP_ALARM: - sprintf(rbuf, "Audible alarm"); - break; + return ("Audible alarm"); case ELMTYP_ESCC: - sprintf(rbuf, "Enclosure Services Controller Electronics"); - break; + return ("Enclosure Services Controller Electronics"); case ELMTYP_SCC: - sprintf(rbuf, "SCC Controller Electronics"); - break; + return ("SCC Controller Electronics"); case ELMTYP_NVRAM: - sprintf(rbuf, "Nonvolatile Cache"); - break; + return ("Nonvolatile Cache"); case ELMTYP_INV_OP_REASON: - sprintf(rbuf, "Invalid Operation Reason"); - break; + return ("Invalid Operation Reason"); case ELMTYP_UPS: - sprintf(rbuf, "Uninterruptible Power Supply"); - break; + return ("Uninterruptible Power Supply"); case ELMTYP_DISPLAY: - sprintf(rbuf, "Display"); - break; + return ("Display"); case ELMTYP_KEYPAD: - sprintf(rbuf, "Key Pad Entry"); - break; + return ("Key Pad Entry"); case ELMTYP_ENCLOSURE: - sprintf(rbuf, "Enclosure"); - break; + return ("Enclosure"); case ELMTYP_SCSIXVR: - sprintf(rbuf, "SCSI Port/Transceiver"); - break; + return ("SCSI Port/Transceiver"); case ELMTYP_LANGUAGE: - sprintf(rbuf, "Language"); - break; + return ("Language"); case ELMTYP_COMPORT: - sprintf(rbuf, "Communication Port"); - break; + return ("Communication Port"); case ELMTYP_VOM: - sprintf(rbuf, "Voltage Sensor"); - break; + return ("Voltage Sensor"); case ELMTYP_AMMETER: - sprintf(rbuf, "Current Sensor"); - break; + return ("Current Sensor"); case ELMTYP_SCSI_TGT: - sprintf(rbuf, "SCSI Target Port"); - break; + return ("SCSI Target Port"); case ELMTYP_SCSI_INI: - sprintf(rbuf, "SCSI Initiator Port"); - break; + return ("SCSI Initiator Port"); case ELMTYP_SUBENC: - sprintf(rbuf, "Simple Subenclosure"); - break; + return ("Simple Subenclosure"); case ELMTYP_ARRAY_DEV: - sprintf(rbuf, "Array Device Slot"); - break; + return ("Array Device Slot"); case ELMTYP_SAS_EXP: - sprintf(rbuf, "SAS Expander"); - break; + return ("SAS Expander"); case ELMTYP_SAS_CONN: - sprintf(rbuf, "SAS Connector"); - break; + return ("SAS Connector"); default: - (void) sprintf(rbuf, "", type); - break; + snprintf(rbuf, sizeof(rbuf), "", type); + return (rbuf); } - return (rbuf); } -char * +const char * scode2ascii(u_char code) { static char rbuf[32]; switch (code & 0xf) { case SES_OBJSTAT_UNSUPPORTED: - sprintf(rbuf, "Unsupported"); - break; + return ("Unsupported"); case SES_OBJSTAT_OK: - sprintf(rbuf, "OK"); - break; + return ("OK"); case SES_OBJSTAT_CRIT: - sprintf(rbuf, "Critical"); - break; + return ("Critical"); case SES_OBJSTAT_NONCRIT: - sprintf(rbuf, "Noncritical"); - break; + return ("Noncritical"); case SES_OBJSTAT_UNRECOV: - sprintf(rbuf, "Unrecoverable"); - break; + return ("Unrecoverable"); case SES_OBJSTAT_NOTINSTALLED: - sprintf(rbuf, "Not Installed"); - break; + return ("Not Installed"); case SES_OBJSTAT_UNKNOWN: - sprintf(rbuf, "Unknown"); - break; + return ("Unknown"); case SES_OBJSTAT_NOTAVAIL: - sprintf(rbuf, "Not Available"); - break; + return ("Not Available"); case SES_OBJSTAT_NOACCESS: - sprintf(rbuf, "No Access Allowed"); - break; + return ("No Access Allowed"); default: - sprintf(rbuf, "", code & 0xf); - break; + snprintf(rbuf, sizeof(rbuf), "", code & 0xf); + return (rbuf); } - return (rbuf); -} - -struct sbuf * -stat2sbuf(int eletype, u_char *cstat) -{ - struct sbuf *buf; - - buf = sbuf_new_auto(); - if (buf == NULL) - err(EXIT_FAILURE, "sbuf_new_auto()"); - - if (cstat[0] & 0x40) - sbuf_printf(buf, "\t\t- Predicted Failure\n"); - if (cstat[0] & 0x20) - sbuf_printf(buf, "\t\t- Disabled\n"); - if (cstat[0] & 0x10) - sbuf_printf(buf, "\t\t- Swapped\n"); - switch (eletype) { - case ELMTYP_DEVICE: - if (cstat[2] & 0x02) - sbuf_printf(buf, "\t\t- LED=locate\n"); - if (cstat[2] & 0x20) - sbuf_printf(buf, "\t\t- LED=fault\n"); - break; - case ELMTYP_ARRAY_DEV: - if (cstat[2] & 0x02) - sbuf_printf(buf, "\t\t- LED=locate\n"); - if (cstat[2] & 0x20) - sbuf_printf(buf, "\t\t- LED=fault\n"); - break; - case ELMTYP_FAN: - sbuf_printf(buf, "\t\t- Speed: %d rpm\n", - (((0x7 & cstat[1]) << 8) + cstat[2]) * 10); - break; - case ELMTYP_THERM: - if (cstat[2]) { - sbuf_printf(buf, "\t\t- Temperature: %d C\n", - cstat[2] - TEMPERATURE_OFFSET); - } else { - sbuf_printf(buf, "\t\t- Temperature: -reserved-\n"); - } - break; - case ELMTYP_VOM: - sbuf_printf(buf, "\t\t- Voltage: %.2f V\n", - be16dec(cstat + 2) / 100.0); - break; - } - sbuf_finish(buf); - return (buf); } Modified: stable/11/usr.sbin/sesutil/eltsub.h ============================================================================== --- stable/11/usr.sbin/sesutil/eltsub.h Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/eltsub.h Thu Jul 20 08:11:06 2017 (r321287) @@ -32,6 +32,5 @@ * mjacob@feral.com */ -char *geteltnm(int); -char *scode2ascii(u_char); -struct sbuf *stat2sbuf(int, u_char *); +const char *geteltnm(int); +const char *scode2ascii(u_char); Modified: stable/11/usr.sbin/sesutil/sesutil.8 ============================================================================== --- stable/11/usr.sbin/sesutil/sesutil.8 Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/sesutil.8 Thu Jul 20 08:11:06 2017 (r321287) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 6, 2015 +.Dd June 29, 2017 .Dt SESUTIL 8 .Os .Sh NAME @@ -43,9 +43,11 @@ .Op on | off .Nm .Cm map +.Op Fl -libxo Ar options .Op Fl u Ar /dev/sesN .Nm .Cm status +.Op Fl -libxo Ar options .Op Fl u Ar /dev/sesN .Sh DESCRIPTION The @@ -55,6 +57,12 @@ Services (SES) devices. .Pp List of supported commands: .Bl -tag -width indent +.It Fl -libxo +Generate output via +.Xr libxo 3 +in a selection of different human and machine readable formats. +See +.Xr xo_parse_args 3 .It Cm fault Oo Fl u Ar /dev/sesN Oc Ao Ar disk | Li all Ac Op on | off Change the state of the external fault LED associated with .Ar disk . @@ -114,6 +122,8 @@ Turn on the fault LED for a drive bay not associated w .Pp .Dl Nm Cm fault -u /dev/ses2 7 on .Sh SEE ALSO +.Xr libxo 3 , +.Xr xo_parse_args 3 , .Xr ses 4 .Sh HISTORY The Modified: stable/11/usr.sbin/sesutil/sesutil.c ============================================================================== --- stable/11/usr.sbin/sesutil/sesutil.c Thu Jul 20 07:13:26 2017 (r321286) +++ stable/11/usr.sbin/sesutil/sesutil.c Thu Jul 20 08:11:06 2017 (r321287) @@ -29,10 +29,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include -#include #include #include @@ -46,16 +46,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "eltsub.h" +#define SESUTIL_XO_VERSION "1" + static int encstatus(int argc, char **argv); static int fault(int argc, char **argv); static int locate(int argc, char **argv); static int objmap(int argc, char **argv); static int sesled(int argc, char **argv, bool fault); +static void sesutil_print(bool *title, const char *fmt, ...) __printflike(2,3); static struct command { const char *name; @@ -115,7 +119,7 @@ do_led(int fd, unsigned int idx, bool onoff, bool setf o.elm_idx = idx; if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &o) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); } o.cstat[0] |= 0x80; if (setfault) { @@ -132,7 +136,7 @@ do_led(int fd, unsigned int idx, bool onoff, bool setf if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &o) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_SETELMSTAT"); + xo_err(EXIT_FAILURE, "ENCIOC_SETELMSTAT"); } } @@ -178,7 +182,7 @@ sesled(int argc, char **argv, bool setfault) if (*endptr == '\0') { endptr = strrchr(uflag, '*'); if (endptr != NULL && *endptr == '*') { - warnx("Must specifying a SES device (-u) to use a SES " + xo_warnx("Must specifying a SES device (-u) to use a SES " "id# to identify a disk"); usage(stderr, (setfault ? "fault" : "locate")); } @@ -202,7 +206,7 @@ sesled(int argc, char **argv, bool setfault) if (glob((uflag != NULL ? uflag : "/dev/ses[0-9]*"), 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); - errx(EXIT_FAILURE, "No SES devices found"); + xo_errx(EXIT_FAILURE, "No SES devices found"); } ndisks = 0; @@ -218,32 +222,32 @@ sesled(int argc, char **argv, bool setfault) * accessing all devices */ if (errno == EACCES && g.gl_pathc > 1) { - err(EXIT_FAILURE, "unable to access SES device"); + xo_err(EXIT_FAILURE, "unable to access SES device"); } - warn("unable to access SES device: %s", g.gl_pathv[i]); + xo_warn("unable to access SES device: %s", g.gl_pathv[i]); continue; } if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETNELM"); + xo_err(EXIT_FAILURE, "ENCIOC_GETNELM"); } objp = calloc(nobj, sizeof(encioc_element_t)); if (objp == NULL) { close(fd); - err(EXIT_FAILURE, "calloc()"); + xo_err(EXIT_FAILURE, "calloc()"); } if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); } if (isses) { if (sesid > nobj) { close(fd); - errx(EXIT_FAILURE, + xo_errx(EXIT_FAILURE, "Requested SES ID does not exist"); } do_led(fd, sesid, onoff, setfault); @@ -262,7 +266,7 @@ sesled(int argc, char **argv, bool setfault) objdn.elm_devnames = calloc(128, sizeof(char)); if (objdn.elm_devnames == NULL) { close(fd); - err(EXIT_FAILURE, "calloc()"); + xo_err(EXIT_FAILURE, "calloc()"); } if (ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t) &objdn) <0) { @@ -282,7 +286,7 @@ sesled(int argc, char **argv, bool setfault) } globfree(&g); if (ndisks == 0 && all == false) { - errx(EXIT_FAILURE, "Count not find the SES id of device '%s'", + xo_errx(EXIT_FAILURE, "Count not find the SES id of device '%s'", disk); } @@ -303,10 +307,71 @@ fault(int argc, char **argv) return (sesled(argc, argv, true)); } +#define TEMPERATURE_OFFSET 20 +static void +sesutil_print(bool *title, const char *fmt, ...) +{ + va_list args; + + if (!*title) { + xo_open_container("extra_status"); + xo_emit("\t\tExtra status:\n"); + *title = true; + } + va_start(args, fmt); + xo_emit_hv(NULL, fmt, args); + va_end(args); +} + +static void +print_extra_status(int eletype, u_char *cstat) +{ + bool title = false; + + if (cstat[0] & 0x40) { + sesutil_print(&title, "\t\t-{e:predicted_failure/true} Predicted Failure\n"); + } + if (cstat[0] & 0x20) { + sesutil_print(&title, "\t\t-{e:disabled/true} Disabled\n"); + } + if (cstat[0] & 0x10) { + sesutil_print(&title, "\t\t-{e:swapped/true} Swapped\n"); + } + switch (eletype) { + case ELMTYP_DEVICE: + case ELMTYP_ARRAY_DEV: + if (cstat[2] & 0x02) { + sesutil_print(&title, "\t\t- LED={q:led/locate}\n"); + } + if (cstat[2] & 0x20) { + sesutil_print(&title, "\t\t- LED={q:led/fault}\n"); + } + break; + case ELMTYP_FAN: + sesutil_print(&title, "\t\t- Speed: {:speed/%d}{Uw:rpm}\n", + (((0x7 & cstat[1]) << 8) + cstat[2]) * 10); + break; + case ELMTYP_THERM: + if (cstat[2]) { + sesutil_print(&title, "\t\t- Temperature: {:temperature/%d}{Uw:C}\n", + cstat[2] - TEMPERATURE_OFFSET); + } else { + sesutil_print(&title, "\t\t- Temperature: -{q:temperature/reserved}-\n"); + } + break; + case ELMTYP_VOM: + sesutil_print(&title, "\t\t- Voltage: {:voltage/%.2f}{Uw:V}\n", + be16dec(cstat + 2) / 100.0); + break; + } + if (title) { + xo_close_container("extra_status"); + } +} + static int objmap(int argc, char **argv __unused) { - struct sbuf *extra; encioc_string_t stri; encioc_elm_devnames_t e_devname; encioc_elm_status_t e_status; @@ -325,8 +390,11 @@ objmap(int argc, char **argv __unused) /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); - errx(EXIT_FAILURE, "No SES devices found"); + xo_errx(EXIT_FAILURE, "No SES devices found"); } + xo_set_version(SESUTIL_XO_VERSION); + xo_open_container("sesutil"); + xo_open_list("enclosures"); for (i = 0; i < g.gl_pathc; i++) { /* ensure we only got numbers after ses */ if (strspn(g.gl_pathv[i] + 8, "0123456789") != @@ -339,38 +407,40 @@ objmap(int argc, char **argv __unused) * accessing all devices */ if (errno == EACCES && g.gl_pathc > 1) { - err(EXIT_FAILURE, "unable to access SES device"); + xo_err(EXIT_FAILURE, "unable to access SES device"); } - warn("unable to access SES device: %s", g.gl_pathv[i]); + xo_warn("unable to access SES device: %s", g.gl_pathv[i]); continue; } if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETNELM"); + xo_err(EXIT_FAILURE, "ENCIOC_GETNELM"); } e_ptr = calloc(nobj, sizeof(encioc_element_t)); if (e_ptr == NULL) { close(fd); - err(EXIT_FAILURE, "calloc()"); + xo_err(EXIT_FAILURE, "calloc()"); } if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) e_ptr) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); } - printf("%s:\n", g.gl_pathv[i] + 5); + xo_open_instance("enclosures"); + xo_emit("{t:enc/%s}:\n", g.gl_pathv[i] + 5); stri.bufsiz = sizeof(str); stri.buf = &str[0]; if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0) - printf("\tEnclosure Name: %s\n", stri.buf); + xo_emit("\tEnclosure Name: {t:name/%s}\n", stri.buf); stri.bufsiz = sizeof(str); stri.buf = &str[0]; if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0) - printf("\tEnclosure ID: %s\n", stri.buf); + xo_emit("\tEnclosure ID: {t:id/%s}\n", stri.buf); + xo_open_list("elements"); for (j = 0; j < nobj; j++) { /* Get the status of the element */ memset(&e_status, 0, sizeof(e_status)); @@ -378,7 +448,7 @@ objmap(int argc, char **argv __unused) if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &e_status) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); } /* Get the description of the element */ memset(&e_desc, 0, sizeof(e_desc)); @@ -387,12 +457,12 @@ objmap(int argc, char **argv __unused) e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); if (e_desc.elm_desc_str == NULL) { close(fd); - err(EXIT_FAILURE, "calloc()"); + xo_err(EXIT_FAILURE, "calloc()"); } if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc) < 0) { close(fd); - err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); } /* Get the device name(s) of the element */ memset(&e_devname, 0, sizeof(e_devname)); @@ -401,39 +471,40 @@ objmap(int argc, char **argv __unused) e_devname.elm_devnames = calloc(128, sizeof(char)); if (e_devname.elm_devnames == NULL) { close(fd); - err(EXIT_FAILURE, "calloc()"); + xo_err(EXIT_FAILURE, "calloc()"); } if (ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t) &e_devname) <0) { /* We don't care if this fails */ e_devname.elm_devnames[0] = '\0'; } - printf("\tElement %u, Type: %s\n", e_ptr[j].elm_idx, + xo_open_instance("elements"); + xo_emit("\tElement {:id/%u}, Type: {:type/%s}\n", e_ptr[j].elm_idx, geteltnm(e_ptr[j].elm_type)); - printf("\t\tStatus: %s (0x%02x 0x%02x 0x%02x 0x%02x)\n", + xo_emit("\t\tStatus: {:status/%s} ({q:status_code/0x%02x 0x%02x 0x%02x 0x%02x})\n", scode2ascii(e_status.cstat[0]), e_status.cstat[0], e_status.cstat[1], e_status.cstat[2], e_status.cstat[3]); if (e_desc.elm_desc_len > 0) { - printf("\t\tDescription: %s\n", + xo_emit("\t\tDescription: {:description/%s}\n", e_desc.elm_desc_str); } if (e_devname.elm_names_len > 0) { - printf("\t\tDevice Names: %s\n", + xo_emit("\t\tDevice Names: {:device_names/%s}\n", e_devname.elm_devnames); } - extra = stat2sbuf(e_ptr[j].elm_type, e_status.cstat); - if (sbuf_len(extra) > 0) { - printf("\t\tExtra status:\n%s", - sbuf_data(extra)); - } - sbuf_delete(extra); + print_extra_status(e_ptr[j].elm_type, e_status.cstat); + xo_close_instance("elements"); free(e_devname.elm_devnames); } + xo_close_list("elements"); free(e_ptr); close(fd); } globfree(&g); + xo_close_list("enclosures"); + xo_close_container("sesutil"); + xo_finish(); return (EXIT_SUCCESS); } @@ -454,8 +525,12 @@ encstatus(int argc, char **argv __unused) /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); - errx(EXIT_FAILURE, "No SES devices found"); + xo_errx(EXIT_FAILURE, "No SES devices found"); } + + xo_set_version(SESUTIL_XO_VERSION); + xo_open_container("sesutil"); + xo_open_list("enclosures"); for (i = 0; i < g.gl_pathc; i++) { /* ensure we only got numbers after ses */ if (strspn(g.gl_pathv[i] + 8, "0123456789") != @@ -468,56 +543,61 @@ encstatus(int argc, char **argv __unused) * accessing all devices */ if (errno == EACCES && g.gl_pathc > 1) { - err(EXIT_FAILURE, "unable to access SES device"); + xo_err(EXIT_FAILURE, "unable to access SES device"); } - warn("unable to access SES device: %s", g.gl_pathv[i]); + xo_warn("unable to access SES device: %s", g.gl_pathv[i]); continue; } if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) { + xo_err(EXIT_FAILURE, "ENCIOC_GETENCSTAT"); close(fd); - err(EXIT_FAILURE, "ENCIOC_GETENCSTAT"); } - printf("%s: ", g.gl_pathv[i] + 5); + xo_open_instance("enclosures"); + xo_emit("{:enc/%s}: ", g.gl_pathv[i] + 5); e = 0; if (estat == 0) { if (status == 0) { status = 1; } - printf("OK"); + xo_emit("{q:status/OK}"); } else { if (estat & SES_ENCSTAT_INFO) { - printf("INFO"); + xo_emit("{lq:status/INFO}"); e++; } if (estat & SES_ENCSTAT_NONCRITICAL) { if (e) - printf(","); - printf("NONCRITICAL"); + xo_emit(","); + xo_emit("{lq:status/NONCRITICAL}"); e++; } if (estat & SES_ENCSTAT_CRITICAL) { if (e) - printf(","); - printf("CRITICAL"); + xo_emit(","); + xo_emit("{lq:status/CRITICAL}"); e++; status = -1; } if (estat & SES_ENCSTAT_UNRECOV) { if (e) - printf(","); - printf("UNRECOV"); + xo_emit(","); + xo_emit("{lq:status/UNRECOV}"); e++; status = -1; } } - printf("\n"); - + xo_close_instance("enclosures"); + xo_emit("\n"); close(fd); } globfree(&g); + xo_close_list("enclosures"); + xo_close_container("sesutil"); + xo_finish(); + if (status == 1) { return (EXIT_SUCCESS); } else { @@ -530,6 +610,10 @@ main(int argc, char **argv) { int i, ch; struct command *cmd = NULL; + + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); uflag = "/dev/ses[0-9]*"; while ((ch = getopt_long(argc, argv, "u:", NULL, NULL)) != -1) { From owner-svn-src-all@freebsd.org Thu Jul 20 08:29: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 7FB64DAC060; Thu, 20 Jul 2017 08:29:42 +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 2BFD72065; Thu, 20 Jul 2017 08:29:41 +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 04AC2D6A741; Thu, 20 Jul 2017 18:01:15 +1000 (AEST) Date: Thu, 20 Jul 2017 18:01:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Libby cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys In-Reply-To: <201707200647.v6K6l7Hq076554@repo.freebsd.org> Message-ID: <20170720172157.W1152@besplex.bde.org> References: <201707200647.v6K6l7Hq076554@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=jI-barIBCsiQtmrUQxoA: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: Thu, 20 Jul 2017 08:29:42 -0000 On Thu, 20 Jul 2017, Ryan Libby wrote: > Log: > efi: restrict visibility of EFIABI_ATTR-declared functions > > In-tree gcc (4.2) doesn't understand __attribute__((ms_abi)) > (EFIABI_ATTR). Avoid declaring functions with that attribute when the > compiler is detected to be gcc < 4.4. Thanks. I used to work around this using -Dms_abi=. > Modified: head/sys/amd64/include/efi.h > ============================================================================== > --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 (r321283) > +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 (r321284) > @@ -36,8 +36,14 @@ > * XXX: from gcc 6.2 manual: > * Note, the ms_abi attribute for Microsoft Windows 64-bit targets > * currently requires the -maccumulate-outgoing-args option. > + * > + * Avoid EFIABI_ATTR declarations for compilers that don't support it. > + * GCC support began in version 4.4. > */ > +#if defined(__clang__) || defined(__GNUC__) && \ > + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) > #define EFIABI_ATTR __attribute__((ms_abi)) This is still broken. ms_abi is in the application namespace. Thus my hack of defining it to nothing is valid, and so is defining it to 'syntax error', but the latter shows the brokenness of EFIABI_ATTR. > +#endif > > #ifdef _KERNEL > struct uuid; > > Modified: head/sys/sys/efi.h > ============================================================================== > --- head/sys/sys/efi.h Thu Jul 20 05:43:48 2017 (r321283) > +++ head/sys/sys/efi.h Thu Jul 20 06:47:06 2017 (r321284) > @@ -122,6 +122,9 @@ struct efi_tblhdr { > uint32_t __res; > }; > > +#ifdef _KERNEL > + > +#ifdef EFIABI_ATTR > struct efi_rt { > struct efi_tblhdr rt_hdr; > efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *) > @@ -144,6 +147,7 @@ struct efi_rt { > efi_status (*rt_reset)(enum efi_reset, efi_status, u_long, > efi_char *) EFIABI_ATTR; This was more broken when it was outside of _KERNEL. > }; > +#endif > > struct efi_systbl { > struct efi_tblhdr st_hdr; > @@ -163,7 +167,6 @@ struct efi_systbl { > uint64_t st_cfgtbl; > }; > > -#ifdef _KERNEL > extern vm_paddr_t efi_systbl_phys; > #endif /* _KERNEL */ This bug is not very common. There seem to be no instances of it in (only sys/cdefs.h uses __attribute__(()), and it seems to use underscores for all the attributes). Grepping sys/include/*.h for attribute shows the following bugs: X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); The commented-out ms_abi was only a style bug. Now it is a larger style bug -- it is different and worse than amd64. All uses of the packed attribute are bugs since it changes the ABI for compilers that don't use it. ofed has much larger bugs for it: - it hard-codes __attribute__ instead of using __packed from cdefs.h - it mis-hard-codes __attribute__ using the application namespace - it uses gnu style (space before parentheses). Perhaps ofed is supposed to use linux style instead of gnu style, but even linux (2.6.10 include directory) uses no spaces after __attribute__ more than half the time (it has a measly 420 instances with spaces and 538 without. FreeBSD has a whole 30 instances of __attribute__ in cdefs.h and most of the instances not in there are bugs). Grepping sys/*/* for attribute shows the following bugs: X bsm/audit.h:typedef u_int64_t au_asflgs_t __attribute__ ((aligned (8))); X libkern/explicit_bzero.c:__attribute__((weak)) void __explicit_bzero_hook(void *, size_t); X libkern/explicit_bzero.c:__attribute__((weak)) void X net/ieee8023ad_lacp.c: __attribute__((__format__(__printf__, 2, 3))); X net/netmap.h: uint8_t __attribute__((__aligned__(NM_CACHE_ALIGN))) sem[128]; X net/netmap_user.h: static void *__xxzt[] __attribute__ ((unused)) = X netinet/sctp.h:#define SCTP_PACKED __attribute__((packed)) X netinet/sctp_header.h:#define SCTP_PACKED __attribute__((packed)) X netinet/sctp_input.c:__attribute__((noinline)) X netinet/sctp_input.c:__attribute__((noinline)) X netinet/sctp_os_bsd.h:#define SCTP_UNUSED __attribute__((unused)) X opencrypto/gfmult.h:#define __aligned(x) __attribute__((__aligned__(x))) X xen/blkif.h: uint64_t __attribute__((__aligned__(8))) id; X xen/blkif.h: uint64_t __attribute__((__aligned__(8))) id; X xen/xen_intr.h: __attribute__((format(printf, 2, 3))); Almost all can be fixed by using the FreeBSD wrapper in cdefs.h. I think ms_abi is MD so it doesn't belong there, but almost everything else does. Bruce From owner-svn-src-all@freebsd.org Thu Jul 20 09:08: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 38758DAD076; Thu, 20 Jul 2017 09:08:34 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::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 AC109389B; Thu, 20 Jul 2017 09:08:33 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id v105so37875546wrb.0; Thu, 20 Jul 2017 02:08:33 -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=m9yp+x6BZ6R4WPTNytEwb5cwzMFo+kWSQNxU2+xu4m8=; b=TT7XL+GFUZKOTE/ViLiJLzYMcnuyGlbobj7q/DJleiBLbZ8uZFiMUwr+9CYeKLWzH7 hyKhrIANE/3g+Ua4InNFPUd1drfXBBXjpu/FdQJs0qRGVMe8d+fFGR47cxjM/KAWvNWJ C3WILcXevRRJEnG17S8VIldyMVaV5FIiRyUc58nlizERVEkCeaqL6OebxOlCd6RcFR3N brmm/mCdwYGvyhzU7Dlnrq/LxJnkc3+8DcsqWVeNOgeFNs0qS6gsyOKHGkCPbhTtEB0/ 8gssWvxux9Rr5f3Ko4KGI4xpX4HhUM0Fm5leGmx+npMTIc9E4YTpRjxNM43JlkEqbojC cGYw== 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=m9yp+x6BZ6R4WPTNytEwb5cwzMFo+kWSQNxU2+xu4m8=; b=VMNnWzlgqlnKxScRDQdhC1vl6vSoZd/mGjKJFNknCi5s/kMOM7eaWsUDWO/GU61NE4 NfpDRlGsK7aCXTza9pjU79RKuB3+uK2x92gHEpr7jyVQf0wwl6JW+dqUM1daRZwsdzuu gqeOiAEJwtHlx7fRrAnKp172eXcKGdarTHir4Pm52Yz2bW31CR5rfh43YW9mzSQlCWzP 6UH6P6/RdsFbtYC1FWvvyWhw/EqV4kI/1cklv+6Da3zSUpRpEav3w8JUhKsk+Q0MPxdg JqAHY79hnKs/rLkqFpr9tQreayOx77zrp09ZKzui3rolfNhzMk1ZCgzzTzm7MQZ1v8Kq /4Iw== X-Gm-Message-State: AIVw113sHHk0LUeya1y4fbC2jLtQBp7HMPncd5+PwadGixaf+z7+774k /klyYvi/Ap4yJyFKr66tFgcyMPbX0En8 X-Received: by 10.223.131.67 with SMTP id 61mr6592999wrd.54.1500541711498; Thu, 20 Jul 2017 02:08:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.72 with HTTP; Thu, 20 Jul 2017 02:08:30 -0700 (PDT) In-Reply-To: <20170720172157.W1152@besplex.bde.org> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> From: Ryan Libby Date: Thu, 20 Jul 2017 02:08:30 -0700 Message-ID: Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys To: Bruce Evans , kib@freebsd.org 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: Thu, 20 Jul 2017 09:08:34 -0000 On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: > On Thu, 20 Jul 2017, Ryan Libby wrote: >> Modified: head/sys/amd64/include/efi.h >> >> ============================================================================== >> --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 >> (r321283) >> +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 >> (r321284) >> @@ -36,8 +36,14 @@ >> * XXX: from gcc 6.2 manual: >> * Note, the ms_abi attribute for Microsoft Windows 64-bit targets >> * currently requires the -maccumulate-outgoing-args option. >> + * >> + * Avoid EFIABI_ATTR declarations for compilers that don't support it. >> + * GCC support began in version 4.4. >> */ >> +#if defined(__clang__) || defined(__GNUC__) && \ >> + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) >> #define EFIABI_ATTR __attribute__((ms_abi)) > > > This is still broken. ms_abi is in the application namespace. Thus > my hack of defining it to nothing is valid, and so is defining it to > 'syntax error', but the latter shows the brokenness of EFIABI_ATTR. To be clear, you're referring to how ms_abi is spelled here without underscores? I can prepare a follow-up to spell it as __attribute__((__ms_abi__)) >> +#endif >> >> #ifdef _KERNEL >> struct uuid; >> >> Modified: head/sys/sys/efi.h >> >> ============================================================================== >> --- head/sys/sys/efi.h Thu Jul 20 05:43:48 2017 (r321283) >> +++ head/sys/sys/efi.h Thu Jul 20 06:47:06 2017 (r321284) >> @@ -122,6 +122,9 @@ struct efi_tblhdr { >> uint32_t __res; >> }; >> >> +#ifdef _KERNEL >> + >> +#ifdef EFIABI_ATTR >> struct efi_rt { >> struct efi_tblhdr rt_hdr; >> efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *) >> @@ -144,6 +147,7 @@ struct efi_rt { >> efi_status (*rt_reset)(enum efi_reset, efi_status, u_long, >> efi_char *) EFIABI_ATTR; > > > This was more broken when it was outside of _KERNEL. > >> }; >> +#endif >> >> struct efi_systbl { >> struct efi_tblhdr st_hdr; >> @@ -163,7 +167,6 @@ struct efi_systbl { >> uint64_t st_cfgtbl; >> }; >> >> -#ifdef _KERNEL >> extern vm_paddr_t efi_systbl_phys; >> #endif /* _KERNEL */ > > > This bug is not very common. There seem to be no instances of it in > (only sys/cdefs.h uses __attribute__(()), and it seems to use > underscores for all the attributes). Grepping sys/include/*.h for > attribute shows the following bugs: > > X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) > X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ > X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; > X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); > > The commented-out ms_abi was only a style bug. Now it is a larger style > bug -- it is different and worse than amd64. I'm not sure what to do about i386 there (again beyond fixing up the spelling in the comment). Maybe the unsupported architectures should just not be declaring EFIABI_ATTR at all? (Thoughts, kib?) From owner-svn-src-all@freebsd.org Thu Jul 20 09:19: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 5A23DDAD581; Thu, 20 Jul 2017 09:19:45 +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 212506359A; Thu, 20 Jul 2017 09:19:44 +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 77AF0106124; Thu, 20 Jul 2017 19:19:37 +1000 (AEST) Date: Thu, 20 Jul 2017 19:19:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Libby cc: Bruce Evans , kib@freebsd.org, Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys In-Reply-To: Message-ID: <20170720190955.U1634@besplex.bde.org> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=hSAPkCe7wNuG41XxVuwA: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: Thu, 20 Jul 2017 09:19:45 -0000 On Thu, 20 Jul 2017, Ryan Libby wrote: > On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: >> On Thu, 20 Jul 2017, Ryan Libby wrote: >>> Modified: head/sys/amd64/include/efi.h >>> >>> ============================================================================== >>> --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 >>> (r321283) >>> +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 >>> (r321284) >>> @@ -36,8 +36,14 @@ >>> * XXX: from gcc 6.2 manual: >>> * Note, the ms_abi attribute for Microsoft Windows 64-bit targets >>> * currently requires the -maccumulate-outgoing-args option. >>> + * >>> + * Avoid EFIABI_ATTR declarations for compilers that don't support it. >>> + * GCC support began in version 4.4. >>> */ >>> +#if defined(__clang__) || defined(__GNUC__) && \ >>> + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) >>> #define EFIABI_ATTR __attribute__((ms_abi)) >> >> >> This is still broken. ms_abi is in the application namespace. Thus >> my hack of defining it to nothing is valid, and so is defining it to >> 'syntax error', but the latter shows the brokenness of EFIABI_ATTR. > > To be clear, you're referring to how ms_abi is spelled here without > underscores? I can prepare a follow-up to spell it as > __attribute__((__ms_abi__)) Yes. >> ... >> X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) >> X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ >> X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; >> X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); >> X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> >> The commented-out ms_abi was only a style bug. Now it is a larger style >> bug -- it is different and worse than amd64. > > I'm not sure what to do about i386 there (again beyond fixing up the > spelling in the comment). Maybe the unsupported architectures should > just not be declaring EFIABI_ATTR at all? (Thoughts, kib?) Maybe it can go in x86 with a different ifdef for clang. Or if it just doesn't work on i386, don't define or use EFIABI_ATTR. Bruce From owner-svn-src-all@freebsd.org Thu Jul 20 09:35: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 53AA6DADA0A; Thu, 20 Jul 2017 09:35:41 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1E19263F7C; Thu, 20 Jul 2017 09:35:41 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K9ZesU046520; Thu, 20 Jul 2017 09:35:40 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K9Ze4v046517; Thu, 20 Jul 2017 09:35:40 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201707200935.v6K9Ze4v046517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 20 Jul 2017 09:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r321288 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 321288 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 09:35:41 -0000 Author: cognet Date: Thu Jul 20 09:35:39 2017 New Revision: 321288 URL: https://svnweb.freebsd.org/changeset/base/321288 Log: Add Marcin Wojtas (mw@ as a new src committer. Marcin has been doing too many good work on the Marvell Armada code to be left unpunished. As this commit suggests, I'll act as his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Jul 20 08:11:06 2017 (r321287) +++ svnadmin/conf/access Thu Jul 20 09:35:39 2017 (r321288) @@ -147,6 +147,7 @@ mm mmel mp mr +mw n_hibma devnull neel netchild Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jul 20 08:11:06 2017 (r321287) +++ svnadmin/conf/mentors Thu Jul 20 09:35:39 2017 (r321288) @@ -22,6 +22,7 @@ jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko kevans emaste mahrens mckusick +mw cognet peterj jhb Co-mentor: grog rgrimes grehan rlibby markj From owner-svn-src-all@freebsd.org Thu Jul 20 10:33: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 4C52CC08C5F; Thu, 20 Jul 2017 10:33:31 +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 E8DCD65AE1; Thu, 20 Jul 2017 10:33:30 +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 v6KAXOJj047365 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Jul 2017 13:33:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6KAXOJj047365 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6KAXOVa047364; Thu, 20 Jul 2017 13:33:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Jul 2017 13:33:24 +0300 From: Konstantin Belousov To: Ryan Libby Cc: Bruce Evans , Ryan Libby , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys Message-ID: <20170720103323.GG1935@kib.kiev.ua> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Thu, 20 Jul 2017 10:33:31 -0000 On Thu, Jul 20, 2017 at 02:08:30AM -0700, Ryan Libby wrote: > On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: > > On Thu, 20 Jul 2017, Ryan Libby wrote: > >> Modified: head/sys/amd64/include/efi.h > >> > >> ============================================================================== > >> --- head/sys/amd64/include/efi.h Thu Jul 20 05:43:48 2017 > >> (r321283) > >> +++ head/sys/amd64/include/efi.h Thu Jul 20 06:47:06 2017 > >> (r321284) > >> @@ -36,8 +36,14 @@ > >> * XXX: from gcc 6.2 manual: > >> * Note, the ms_abi attribute for Microsoft Windows 64-bit targets > >> * currently requires the -maccumulate-outgoing-args option. > >> + * > >> + * Avoid EFIABI_ATTR declarations for compilers that don't support it. > >> + * GCC support began in version 4.4. > >> */ > >> +#if defined(__clang__) || defined(__GNUC__) && \ > >> + (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) > >> #define EFIABI_ATTR __attribute__((ms_abi)) > > > > > > This is still broken. ms_abi is in the application namespace. Thus > > my hack of defining it to nothing is valid, and so is defining it to > > 'syntax error', but the latter shows the brokenness of EFIABI_ATTR. > > To be clear, you're referring to how ms_abi is spelled here without > underscores? I can prepare a follow-up to spell it as > __attribute__((__ms_abi__)) Spelling it __ms_abi__ is fine but perhaphs unnecessary because it is used only under _KERNEL. I do not object against changing the spelling, of course. > > >> +#endif > >> > >> #ifdef _KERNEL > >> struct uuid; > >> > >> Modified: head/sys/sys/efi.h > >> > >> ============================================================================== > >> --- head/sys/sys/efi.h Thu Jul 20 05:43:48 2017 (r321283) > >> +++ head/sys/sys/efi.h Thu Jul 20 06:47:06 2017 (r321284) > >> @@ -122,6 +122,9 @@ struct efi_tblhdr { > >> uint32_t __res; > >> }; > >> > >> +#ifdef _KERNEL > >> + > >> +#ifdef EFIABI_ATTR > >> struct efi_rt { > >> struct efi_tblhdr rt_hdr; > >> efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *) > >> @@ -144,6 +147,7 @@ struct efi_rt { > >> efi_status (*rt_reset)(enum efi_reset, efi_status, u_long, > >> efi_char *) EFIABI_ATTR; > > > > > > This was more broken when it was outside of _KERNEL. > > > >> }; > >> +#endif > >> > >> struct efi_systbl { > >> struct efi_tblhdr st_hdr; > >> @@ -163,7 +167,6 @@ struct efi_systbl { > >> uint64_t st_cfgtbl; > >> }; > >> > >> -#ifdef _KERNEL > >> extern vm_paddr_t efi_systbl_phys; > >> #endif /* _KERNEL */ > > > > > > This bug is not very common. There seem to be no instances of it in > > (only sys/cdefs.h uses __attribute__(()), and it seems to use > > underscores for all the attributes). Grepping sys/include/*.h for > > attribute shows the following bugs: > > > > X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) > > X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ > > X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; > > X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); > > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); > > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); > > > > The commented-out ms_abi was only a style bug. Now it is a larger style > > bug -- it is different and worse than amd64. > > I'm not sure what to do about i386 there (again beyond fixing up the > spelling in the comment). Maybe the unsupported architectures should > just not be declaring EFIABI_ATTR at all? (Thoughts, kib?) I think i386 should be treated exactly same as amd64, i.e. EFIABI_ATTR should be not defined if gcc < 4.4. Or I do not understand the scope of the question. From owner-svn-src-all@freebsd.org Thu Jul 20 11:09: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 193C2C0979D; Thu, 20 Jul 2017 11:09:35 +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 E788E66A89; Thu, 20 Jul 2017 11:09:34 +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 v6KB9Y0S083149; Thu, 20 Jul 2017 11:09:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KB9XAe083147; Thu, 20 Jul 2017 11:09:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707201109.v6KB9XAe083147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 20 Jul 2017 11:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321289 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321289 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 11:09:35 -0000 Author: tuexen Date: Thu Jul 20 11:09:33 2017 New Revision: 321289 URL: https://svnweb.freebsd.org/changeset/base/321289 Log: Fix the explicit EOR mode. If the final messages is not complete, send an ABORT. Joint work with rrs@ MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_ss_functions.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Jul 20 09:35:39 2017 (r321288) +++ head/sys/netinet/sctp_indata.c Thu Jul 20 11:09:33 2017 (r321289) @@ -4293,47 +4293,44 @@ again: ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; } + if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (asoc->stream_queue_cnt == 1) && + (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { + struct mbuf *op_err; + + *abort_now = 1; + /* XXX */ + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; + } if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && (asoc->stream_queue_cnt == 0)) { - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - /* Need to abort here */ - struct mbuf *op_err; + struct sctp_nets *netp; - abort_out_now: - *abort_now = 1; - /* XXX */ - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; } else { - struct sctp_nets *netp; - - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_stop_timers_for_shutdown(stcb); - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } - sctp_send_shutdown(stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, netp); + netp = asoc->primary_destination; } + sctp_send_shutdown(stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, + stcb->sctp_ep, stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, netp); } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - goto abort_out_now; - } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); @@ -4989,48 +4986,45 @@ hopeless_peer: ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; } + if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (asoc->stream_queue_cnt == 1) && + (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { + struct mbuf *op_err; + + *abort_now = 1; + /* XXX */ + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; + } if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && (asoc->stream_queue_cnt == 0)) { - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - /* Need to abort here */ - struct mbuf *op_err; + struct sctp_nets *netp; - abort_out_now: - *abort_now = 1; - /* XXX */ - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; } else { - struct sctp_nets *netp; - - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_stop_timers_for_shutdown(stcb); - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } - sctp_send_shutdown(stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, netp); + netp = asoc->primary_destination; } + sctp_send_shutdown(stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, + stcb->sctp_ep, stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, netp); return; } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - goto abort_out_now; - } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Thu Jul 20 09:35:39 2017 (r321288) +++ head/sys/netinet/sctp_ss_functions.c Thu Jul 20 11:09:33 2017 (r321289) @@ -268,9 +268,23 @@ sctp_ss_default_set_value(struct sctp_tcb *stcb SCTP_U } static int -sctp_ss_default_is_user_msgs_incomplete(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_association *asoc SCTP_UNUSED) +sctp_ss_default_is_user_msgs_incomplete(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_association *asoc) { - return (0); + struct sctp_stream_out *strq; + struct sctp_stream_queue_pending *sp; + + if (asoc->stream_queue_cnt != 1) { + return (0); + } + strq = asoc->ss_data.locked_on_sending; + if (strq == NULL) { + return (0); + } + sp = TAILQ_FIRST(&strq->outqueue); + if (sp == NULL) { + return (0); + } + return (!sp->msg_is_complete); } /* From owner-svn-src-all@freebsd.org Thu Jul 20 11:36: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 101F8C0A4ED; Thu, 20 Jul 2017 11:36:27 +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 CD98267843; Thu, 20 Jul 2017 11:36:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KBaP5D095205; Thu, 20 Jul 2017 11:36:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KBaP8n095204; Thu, 20 Jul 2017 11:36:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707201136.v6KBaP8n095204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jul 2017 11:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321290 - stable/11/sys/geom X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/geom X-SVN-Commit-Revision: 321290 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 11:36:27 -0000 Author: mav Date: Thu Jul 20 11:36:25 2017 New Revision: 321290 URL: https://svnweb.freebsd.org/changeset/base/321290 Log: MFC r320729: Add GEOM::descr attribute for symmetry with GEOM::ident. Modified: stable/11/sys/geom/geom_disk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom_disk.c ============================================================================== --- stable/11/sys/geom/geom_disk.c Thu Jul 20 11:09:33 2017 (r321289) +++ stable/11/sys/geom/geom_disk.c Thu Jul 20 11:36:25 2017 (r321290) @@ -497,6 +497,8 @@ g_disk_start(struct bio *bp) break; else if (g_handleattr_str(bp, "GEOM::ident", dp->d_ident)) break; + else if (g_handleattr_str(bp, "GEOM::descr", dp->d_descr)) + break; else if (g_handleattr_uint16_t(bp, "GEOM::hba_vendor", dp->d_hba_vendor)) break; From owner-svn-src-all@freebsd.org Thu Jul 20 11:37: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 7856BC0A563; Thu, 20 Jul 2017 11:37:03 +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 478656796F; Thu, 20 Jul 2017 11:37:03 +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 v6KBb20V095286; Thu, 20 Jul 2017 11:37:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KBb20T095285; Thu, 20 Jul 2017 11:37:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707201137.v6KBb20T095285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jul 2017 11:37: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: r321291 - stable/10/sys/geom X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/geom X-SVN-Commit-Revision: 321291 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 11:37:03 -0000 Author: mav Date: Thu Jul 20 11:37:02 2017 New Revision: 321291 URL: https://svnweb.freebsd.org/changeset/base/321291 Log: MFC r320729: Add GEOM::descr attribute for symmetry with GEOM::ident. Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu Jul 20 11:36:25 2017 (r321290) +++ stable/10/sys/geom/geom_disk.c Thu Jul 20 11:37:02 2017 (r321291) @@ -502,6 +502,8 @@ g_disk_start(struct bio *bp) break; else if (g_handleattr_str(bp, "GEOM::ident", dp->d_ident)) break; + else if (g_handleattr_str(bp, "GEOM::descr", dp->d_descr)) + break; else if (g_handleattr_uint16_t(bp, "GEOM::hba_vendor", dp->d_hba_vendor)) break; From owner-svn-src-all@freebsd.org Thu Jul 20 14:50: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 1D5C3C79CC8; Thu, 20 Jul 2017 14:50:15 +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 DE2AF6C543; Thu, 20 Jul 2017 14:50:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KEoDY0072461; Thu, 20 Jul 2017 14:50:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KEoDJ3072460; Thu, 20 Jul 2017 14:50:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707201450.v6KEoDJ3072460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 20 Jul 2017 14:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321292 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321292 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 14:50:15 -0000 Author: tuexen Date: Thu Jul 20 14:50:13 2017 New Revision: 321292 URL: https://svnweb.freebsd.org/changeset/base/321292 Log: Deal with listening socket correctly. Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Thu Jul 20 11:37:02 2017 (r321291) +++ head/sys/netinet/sctp_os_bsd.h Thu Jul 20 14:50:13 2017 (r321292) @@ -392,8 +392,8 @@ typedef struct callout sctp_os_timer_t; (sb).sb_mb = NULL; \ (sb).sb_mbcnt = 0; -#define SCTP_SB_LIMIT_RCV(so) so->so_rcv.sb_hiwat -#define SCTP_SB_LIMIT_SND(so) so->so_snd.sb_hiwat +#define SCTP_SB_LIMIT_RCV(so) (SOLISTENING(so) ? so->sol_sbrcv_hiwat : so->so_rcv.sb_hiwat) +#define SCTP_SB_LIMIT_SND(so) (SOLISTENING(so) ? so->sol_sbsnd_hiwat : so->so_snd.sb_hiwat) /* * routes, output, etc. From owner-svn-src-all@freebsd.org Thu Jul 20 15:28: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 02897C7A69F; Thu, 20 Jul 2017 15:28:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0AEA6D505; Thu, 20 Jul 2017 15:28:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KFSmnc088614; Thu, 20 Jul 2017 15:28:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KFSmGR088613; Thu, 20 Jul 2017 15:28:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707201528.v6KFSmGR088613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jul 2017 15:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321293 - head/bin/date X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/date X-SVN-Commit-Revision: 321293 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 15:28:50 -0000 Author: emaste Date: Thu Jul 20 15:28:48 2017 New Revision: 321293 URL: https://svnweb.freebsd.org/changeset/base/321293 Log: date: avoid crash on invalid time localtime(3) returns NULL when passed an invalid time_t but date(1) previously did not handle it. Exit with an error in that case. PR: 220828 Reported by: Vinícius Zavam Reviewed by: cem, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11660 Modified: head/bin/date/date.c Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Thu Jul 20 14:50:13 2017 (r321292) +++ head/bin/date/date.c Thu Jul 20 15:28:48 2017 (r321293) @@ -85,7 +85,7 @@ main(int argc, char *argv[]) int set_timezone; struct vary *v; const struct vary *badv; - struct tm lt; + struct tm *lt; struct stat sb; v = NULL; @@ -174,8 +174,10 @@ main(int argc, char *argv[]) if (*argv && **argv == '+') format = *argv + 1; - lt = *localtime(&tval); - badv = vary_apply(v, <); + lt = localtime(&tval); + if (lt == NULL) + errx(1, "invalid time"); + badv = vary_apply(v, lt); if (badv) { fprintf(stderr, "%s: Cannot apply date adjustment\n", badv->arg); @@ -191,7 +193,7 @@ main(int argc, char *argv[]) */ setlocale(LC_TIME, "C"); - (void)strftime(buf, sizeof(buf), format, <); + (void)strftime(buf, sizeof(buf), format, lt); (void)printf("%s\n", buf); if (fflush(stdout)) err(1, "stdout"); @@ -210,6 +212,8 @@ setthetime(const char *fmt, const char *p, int jflag, int century; lt = localtime(&tval); + if (lt == NULL) + errx(1, "invalid time"); lt->tm_isdst = -1; /* divine correct DST */ if (fmt != NULL) { From owner-svn-src-all@freebsd.org Thu Jul 20 15:52: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 554B4C7AE73; Thu, 20 Jul 2017 15:52:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BEC96E597; Thu, 20 Jul 2017 15:52:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KFqaUL001511; Thu, 20 Jul 2017 15:52:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KFqaku001510; Thu, 20 Jul 2017 15:52:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707201552.v6KFqaku001510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jul 2017 15:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321294 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 321294 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 15:52:37 -0000 Author: emaste Date: Thu Jul 20 15:52:36 2017 New Revision: 321294 URL: https://svnweb.freebsd.org/changeset/base/321294 Log: acpidump: use C99 designated initializers Submitted by: Guangyuan Yang Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11659 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 15:28:48 2017 (r321293) +++ head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 15:52:36 2017 (r321294) @@ -392,16 +392,25 @@ acpi_print_local_nmi(u_int lint, uint16_t mps_flags) acpi_print_mps_flags(mps_flags); } -static const char *apic_types[] = { "Local APIC", "IO APIC", "INT Override", - "NMI", "Local APIC NMI", - "Local APIC Override", "IO SAPIC", - "Local SAPIC", "Platform Interrupt", - "Local X2APIC", "Local X2APIC NMI", - "GIC CPU Interface Structure", - "GIC Distributor Structure", - "GICv2m MSI Frame", - "GIC Redistributor Structure", - "GIC ITS Structure" }; +static const char *apic_types[] = { + [ACPI_MADT_TYPE_LOCAL_APIC] = "Local APIC", + [ACPI_MADT_TYPE_IO_APIC] = "IO APIC", + [ACPI_MADT_TYPE_INTERRUPT_OVERRIDE] = "INT Override", + [ACPI_MADT_TYPE_NMI_SOURCE] = "NMI", + [ACPI_MADT_TYPE_LOCAL_APIC_NMI] = "Local APIC NMI", + [ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE] = "Local APIC Override", + [ACPI_MADT_TYPE_IO_SAPIC] = "IO SAPIC", + [ACPI_MADT_TYPE_LOCAL_SAPIC] = "Local SAPIC", + [ACPI_MADT_TYPE_INTERRUPT_SOURCE] = "Platform Interrupt", + [ACPI_MADT_TYPE_LOCAL_X2APIC] = "Local X2APIC", + [ACPI_MADT_TYPE_LOCAL_X2APIC_NMI] = "Local X2APIC NMI", + [ACPI_MADT_TYPE_GENERIC_INTERRUPT] = "GIC CPU Interface Structure", + [ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR] = "GIC Distributor Structure", + [ACPI_MADT_TYPE_GENERIC_MSI_FRAME] = "GICv2m MSI Frame", + [ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR] = "GIC Redistributor Structure", + [ACPI_MADT_TYPE_GENERIC_TRANSLATOR] = "GIC ITS Structure" +}; + static const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT", "Corrected Platform Error" }; @@ -1076,7 +1085,12 @@ acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp) printf("\tProximity Domain=%d\n", mp->ProximityDomain); } -static const char *srat_types[] = { "CPU", "Memory", "X2APIC", "GICC" }; +static const char *srat_types[] = { + [ACPI_SRAT_TYPE_CPU_AFFINITY] = "CPU", + [ACPI_SRAT_TYPE_MEMORY_AFFINITY] = "Memory", + [ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY] = "X2APIC", + [ACPI_SRAT_TYPE_GICC_AFFINITY] = "GICC" +}; static void acpi_print_srat(ACPI_SUBTABLE_HEADER *srat) From owner-svn-src-all@freebsd.org Thu Jul 20 16: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 19FB1C7B710; Thu, 20 Jul 2017 16:24:31 +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 D10C66F6E6; Thu, 20 Jul 2017 16:24:30 +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 v6KGOTP8014888; Thu, 20 Jul 2017 16:24:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KGOTme014885; Thu, 20 Jul 2017 16:24:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707201624.v6KGOTme014885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jul 2017 16:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321295 - in head/lib: libc/sys librt X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/lib: libc/sys librt X-SVN-Commit-Revision: 321295 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 16:24:31 -0000 Author: asomers Date: Thu Jul 20 16:24:29 2017 New Revision: 321295 URL: https://svnweb.freebsd.org/changeset/base/321295 Log: Remove some private symbols from librt Private functions like __aio_read and _aio_read were exposed in FBSDprivate_1.0 by r169090, even though they've never been used outside of librt. Also, remove some weak references from r156136 that have never resolved. Reviewed by: kib MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11649 Modified: head/lib/libc/sys/Symbol.map head/lib/librt/Symbol.map head/lib/librt/aio.c Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Jul 20 15:52:36 2017 (r321294) +++ head/lib/libc/sys/Symbol.map Thu Jul 20 16:24:29 2017 (r321295) @@ -469,21 +469,13 @@ FBSDprivate_1.0 { __sys_acct; _adjtime; __sys_adjtime; - _aio_cancel; __sys_aio_cancel; - _aio_error; __sys_aio_error; - _aio_fsync; __sys_aio_fsync; - _aio_read; __sys_aio_read; - _aio_return; __sys_aio_return; - _aio_suspend; __sys_aio_suspend; - _aio_waitcomplete; __sys_aio_waitcomplete; - _aio_write; __sys_aio_write; _audit; __sys_audit; @@ -727,7 +719,6 @@ FBSDprivate_1.0 { __sys_lgetfh; _link; __sys_link; - _lio_listio; __sys_lio_listio; _listen; __sys_listen; Modified: head/lib/librt/Symbol.map ============================================================================== --- head/lib/librt/Symbol.map Thu Jul 20 15:52:36 2017 (r321294) +++ head/lib/librt/Symbol.map Thu Jul 20 16:24:29 2017 (r321295) @@ -31,16 +31,6 @@ FBSD_1.5 { }; FBSDprivate_1.0 { - _aio_read; - _aio_write; - _aio_return; - _aio_waitcomplete; - _aio_fsync; - __aio_read; - __aio_write; - __aio_return; - __aio_waitcomplete; - __aio_fsync; _mq_open; _mq_close; _mq_notify; Modified: head/lib/librt/aio.c ============================================================================== --- head/lib/librt/aio.c Thu Jul 20 15:52:36 2017 (r321294) +++ head/lib/librt/aio.c Thu Jul 20 16:24:29 2017 (r321295) @@ -39,15 +39,10 @@ #include "sigev_thread.h" #include "un-namespace.h" -__weak_reference(__aio_read, _aio_read); __weak_reference(__aio_read, aio_read); -__weak_reference(__aio_write, _aio_write); __weak_reference(__aio_write, aio_write); -__weak_reference(__aio_return, _aio_return); __weak_reference(__aio_return, aio_return); -__weak_reference(__aio_waitcomplete, _aio_waitcomplete); __weak_reference(__aio_waitcomplete, aio_waitcomplete); -__weak_reference(__aio_fsync, _aio_fsync); __weak_reference(__aio_fsync, aio_fsync); typedef void (*aio_func)(union sigval val, struct aiocb *iocb); From owner-svn-src-all@freebsd.org Thu Jul 20 17:15: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 03763C7C4C9; Thu, 20 Jul 2017 17:15:20 +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 C654F70C46; Thu, 20 Jul 2017 17:15:19 +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 v6KHFJ85034830; Thu, 20 Jul 2017 17:15:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KHFJrn034829; Thu, 20 Jul 2017 17:15:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201707201715.v6KHFJrn034829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 20 Jul 2017 17:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321296 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 321296 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 17:15:20 -0000 Author: kp Date: Thu Jul 20 17:15:18 2017 New Revision: 321296 URL: https://svnweb.freebsd.org/changeset/base/321296 Log: MFC r312943 Do not run the pf purge thread while the VNET variables are not initialized, this can cause a divide by zero (if the VNET initialization takes to long to complete). PR: 220830 Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Thu Jul 20 16:24:29 2017 (r321295) +++ stable/11/sys/netpfil/pf/pf.c Thu Jul 20 17:15:18 2017 (r321296) @@ -129,6 +129,8 @@ VNET_DEFINE(int, pf_tcp_secret_init); #define V_pf_tcp_secret_init VNET(pf_tcp_secret_init) VNET_DEFINE(int, pf_tcp_iss_off); #define V_pf_tcp_iss_off VNET(pf_tcp_iss_off) +VNET_DECLARE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) /* * Queue for pf_intr() sends. @@ -1439,6 +1441,12 @@ pf_purge_thread(void *unused __unused) pf_end_threads++; wakeup(pf_purge_thread); kproc_exit(0); + } + + /* Wait while V_pf_default_rule.timeout is initialized. */ + if (V_pf_vnet_active == 0) { + CURVNET_RESTORE(); + continue; } /* Process 1/interval fraction of the state table every run. */ From owner-svn-src-all@freebsd.org Thu Jul 20 17:22: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 A2DDEC7C77E; Thu, 20 Jul 2017 17:22:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 668B871080; Thu, 20 Jul 2017 17:22:11 +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 v6KHMA6c038799; Thu, 20 Jul 2017 17:22:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KHMAsK038798; Thu, 20 Jul 2017 17:22:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201707201722.v6KHMAsK038798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Jul 2017 17:22: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: r321297 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 321297 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 17:22:11 -0000 Author: pfg Date: Thu Jul 20 17:22:10 2017 New Revision: 321297 URL: https://svnweb.freebsd.org/changeset/base/321297 Log: Revert r316779: Remove (yet again) the definition for the GCC __nonnull() attribute. While GCC's __nonnull__ attribute is generally useful to prevent misuse of some functions it also tends to do rather dangerous "optimizations". Now that we have replaced all such uses with the clang nullability qualifiers, the GCC attribute is unnecessary. The version was left around and kept for 11.1-Release for old versions of GCC from ports. Newer versions of GCC are not attempting to "fix" the system includes so this should not have any side effect and matches what we do in -current. Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Thu Jul 20 17:15:18 2017 (r321296) +++ stable/11/sys/sys/cdefs.h Thu Jul 20 17:22:10 2017 (r321297) @@ -376,14 +376,6 @@ #define __noinline #endif -#if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) -#define __nonnull_all __attribute__((__nonnull__)) -#else -#define __nonnull(x) -#define __nonnull_all -#endif - #if __GNUC_PREREQ__(3, 4) #define __fastcall __attribute__((__fastcall__)) #define __result_use_check __attribute__((__warn_unused_result__)) From owner-svn-src-all@freebsd.org Thu Jul 20 17:31: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 DCC1FC7CB7E; Thu, 20 Jul 2017 17:31:28 +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 B8E5A7160E; Thu, 20 Jul 2017 17:31:28 +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 v6KHVROu039149; Thu, 20 Jul 2017 17:31:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KHVRKZ039148; Thu, 20 Jul 2017 17:31:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707201731.v6KHVRKZ039148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jul 2017 17:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321298 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 321298 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 17:31:29 -0000 Author: emaste Date: Thu Jul 20 17:31:27 2017 New Revision: 321298 URL: https://svnweb.freebsd.org/changeset/base/321298 Log: acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table) Submitted by: Guangyuan Yang MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11479 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 17:22:10 2017 (r321297) +++ head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 17:31:27 2017 (r321298) @@ -40,6 +40,7 @@ #include #include #include +#include #include "acpidump.h" @@ -70,6 +71,8 @@ static void acpi_print_srat_memory(ACPI_SRAT_MEM_AFFIN static void acpi_print_srat(ACPI_SUBTABLE_HEADER *srat); static void acpi_handle_srat(ACPI_TABLE_HEADER *sdp); static void acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp); +static void acpi_print_nfit(ACPI_NFIT_HEADER *nfit); +static void acpi_handle_nfit(ACPI_TABLE_HEADER *sdp); static void acpi_print_sdt(ACPI_TABLE_HEADER *sdp); static void acpi_print_fadt(ACPI_TABLE_HEADER *sdp); static void acpi_print_facs(ACPI_TABLE_FACS *facs); @@ -79,6 +82,8 @@ static void acpi_print_rsd_ptr(ACPI_TABLE_RSDP *rp); static void acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp); static void acpi_walk_subtables(ACPI_TABLE_HEADER *table, void *first, void (*action)(ACPI_SUBTABLE_HEADER *)); +static void acpi_walk_nfit(ACPI_TABLE_HEADER *table, void *first, + void (*action)(ACPI_NFIT_HEADER *)); /* Size of an address. 32-bit for ACPI 1.0, 64-bit for ACPI 2.0 and up. */ static int addr_size; @@ -281,6 +286,27 @@ acpi_walk_subtables(ACPI_TABLE_HEADER *table, void *fi } static void +acpi_walk_nfit(ACPI_TABLE_HEADER *table, void *first, + void (*action)(ACPI_NFIT_HEADER *)) +{ + ACPI_NFIT_HEADER *subtable; + char *end; + + subtable = first; + end = (char *)table + table->Length; + while ((char *)subtable < end) { + printf("\n"); + if (subtable->Length < sizeof(ACPI_NFIT_HEADER)) { + warnx("invalid subtable length %u", subtable->Length); + return; + } + action(subtable); + subtable = (ACPI_NFIT_HEADER *)((char *)subtable + + subtable->Length); + } +} + +static void acpi_print_cpu(u_char cpu_id) { @@ -1141,7 +1167,175 @@ acpi_handle_srat(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } +static const char *nfit_types[] = { + [ACPI_NFIT_TYPE_SYSTEM_ADDRESS] = "System Address", + [ACPI_NFIT_TYPE_MEMORY_MAP] = "Memory Map", + [ACPI_NFIT_TYPE_INTERLEAVE] = "Interleave", + [ACPI_NFIT_TYPE_SMBIOS] = "SMBIOS", + [ACPI_NFIT_TYPE_CONTROL_REGION] = "Control Region", + [ACPI_NFIT_TYPE_DATA_REGION] = "Data Region", + [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address" +}; + + static void +acpi_print_nfit(ACPI_NFIT_HEADER *nfit) +{ + char *uuidstr; + uint32_t status; + + ACPI_NFIT_SYSTEM_ADDRESS *sysaddr; + ACPI_NFIT_MEMORY_MAP *mmap; + ACPI_NFIT_INTERLEAVE *ileave; + ACPI_NFIT_SMBIOS *smbios; + ACPI_NFIT_CONTROL_REGION *ctlreg; + ACPI_NFIT_DATA_REGION *datareg; + ACPI_NFIT_FLUSH_ADDRESS *fladdr; + + if (nfit->Type < nitems(nfit_types)) + printf("\tType=%s\n", nfit_types[nfit->Type]); + else + printf("\tType=%u (unknown)\n", nfit->Type); + switch (nfit->Type) { + case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: + sysaddr = (ACPI_NFIT_SYSTEM_ADDRESS *)nfit; + printf("\tRangeIndex=%u\n", (u_int)sysaddr->RangeIndex); + printf("\tProximityDomain=%u\n", + (u_int)sysaddr->ProximityDomain); + uuid_to_string((uuid_t *)(sysaddr->RangeGuid), + &uuidstr, &status); + if (status != uuid_s_ok) + errx(1, "uuid_to_string: status=%u", status); + printf("\tRangeGuid=%s\n", uuidstr); + free(uuidstr); + printf("\tAddress=0x%016jx\n", (uintmax_t)sysaddr->Address); + printf("\tLength=0x%016jx\n", (uintmax_t)sysaddr->Length); + printf("\tMemoryMapping=0x%016jx\n", + (uintmax_t)sysaddr->MemoryMapping); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_## flag, #flag) + + printf("\tFlags="); + PRINTFLAG(sysaddr->Flags, ADD_ONLINE_ONLY); + PRINTFLAG(sysaddr->Flags, PROXIMITY_VALID); + PRINTFLAG_END(); + +#undef PRINTFLAG + + break; + case ACPI_NFIT_TYPE_MEMORY_MAP: + mmap = (ACPI_NFIT_MEMORY_MAP *)nfit; + printf("\tDeviceHandle=%u\n", (u_int)mmap->DeviceHandle); + printf("\tPhysicalId=%u\n", (u_int)mmap->PhysicalId); + printf("\tRegionId=%u\n", (u_int)mmap->RegionId); + printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex); + printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex); + printf("\tRegionSize=0x%016jx\n", (uintmax_t)mmap->RegionSize); + printf("\tRegionOffset=0x%016jx\n", + (uintmax_t)mmap->RegionOffset); + printf("\tAddress=0x%016jx\n", (uintmax_t)mmap->Address); + printf("\tInterleaveIndex=%u\n", (u_int)mmap->InterleaveIndex); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_MEM_## flag, #flag) + + printf("\tFlags="); + PRINTFLAG(mmap->Flags, SAVE_FAILED); + PRINTFLAG(mmap->Flags, RESTORE_FAILED); + PRINTFLAG(mmap->Flags, FLUSH_FAILED); + PRINTFLAG(mmap->Flags, NOT_ARMED); + PRINTFLAG(mmap->Flags, HEALTH_OBSERVED); + PRINTFLAG(mmap->Flags, HEALTH_ENABLED); + PRINTFLAG(mmap->Flags, MAP_FAILED); + PRINTFLAG_END(); + +#undef PRINTFLAG + + break; + case ACPI_NFIT_TYPE_INTERLEAVE: + ileave = (ACPI_NFIT_INTERLEAVE *)nfit; + printf("\tInterleaveIndex=%u\n", + (u_int)ileave->InterleaveIndex); + printf("\tLineCount=%u\n", (u_int)ileave->LineCount); + printf("\tLineSize=%u\n", (u_int)ileave->LineSize); + /* XXX ileave->LineOffset[i] output is not supported */ + break; + case ACPI_NFIT_TYPE_SMBIOS: + smbios = (ACPI_NFIT_SMBIOS *)nfit; + /* XXX smbios->Data[x] output is not supported */ + break; + case ACPI_NFIT_TYPE_CONTROL_REGION: + ctlreg = (ACPI_NFIT_CONTROL_REGION *)nfit; + printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex); + printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId); + printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId); + printf("\tRevisionId=%u\n", (u_int)ctlreg->RevisionId); + printf("\tSubsystemVendorId=0x%04x\n", + (u_int)ctlreg->SubsystemVendorId); + printf("\tSubsystemDeviceId=0x%04x\n", + (u_int)ctlreg->SubsystemDeviceId); + printf("\tSubsystemRevisionId=%u\n", + (u_int)ctlreg->SubsystemRevisionId); + printf("\tValidFields=%u\n", (u_int)ctlreg->ValidFields); + printf("\tManufacturingLocation=%u\n", + (u_int)ctlreg->ManufacturingLocation); + printf("\tManufacturingDate=%u\n", + (u_int)ctlreg->ManufacturingDate); + printf("\tSerialNumber=%u\n", + (u_int)ctlreg->SerialNumber); + printf("\tWindows=%u\n", (u_int)ctlreg->Windows); + printf("\tWindowSize=0x%016jx\n", + (uintmax_t)ctlreg->WindowSize); + printf("\tCommandOffset=0x%016jx\n", + (uintmax_t)ctlreg->CommandOffset); + printf("\tCommandSize=0x%016jx\n", + (uintmax_t)ctlreg->CommandSize); + printf("\tStatusOffset=0x%016jx\n", + (uintmax_t)ctlreg->StatusOffset); + printf("\tStatusSize=0x%016jx\n", + (uintmax_t)ctlreg->StatusSize); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_## flag, #flag) + + printf("\tFlags="); + PRINTFLAG(mmap->Flags, ADD_ONLINE_ONLY); + PRINTFLAG(mmap->Flags, PROXIMITY_VALID); + PRINTFLAG_END(); + +#undef PRINTFLAG + + break; + case ACPI_NFIT_TYPE_DATA_REGION: + datareg = (ACPI_NFIT_DATA_REGION *)nfit; + printf("\tRegionIndex=%u\n", (u_int)datareg->RegionIndex); + printf("\tWindows=%u\n", (u_int)datareg->Windows); + printf("\tOffset=0x%016jx\n", (uintmax_t)datareg->Offset); + printf("\tSize=0x%016jx\n", (uintmax_t)datareg->Size); + printf("\tCapacity=0x%016jx\n", (uintmax_t)datareg->Capacity); + printf("\tStartAddress=0x%016jx\n", + (uintmax_t)datareg->StartAddress); + break; + case ACPI_NFIT_TYPE_FLUSH_ADDRESS: + fladdr = (ACPI_NFIT_FLUSH_ADDRESS *)nfit; + printf("\tDeviceHandle=%u\n", (u_int)fladdr->DeviceHandle); + printf("\tHintCount=%u\n", (u_int)fladdr->HintCount); + /* XXX fladdr->HintAddress[i] output is not supported */ + break; + } +} + +static void +acpi_handle_nfit(ACPI_TABLE_HEADER *sdp) +{ + ACPI_TABLE_NFIT *nfit; + + printf(BEGIN_COMMENT); + acpi_print_sdt(sdp); + nfit = (ACPI_TABLE_NFIT *)sdp; + acpi_walk_nfit(sdp, (nfit + 1), acpi_print_nfit); + printf(END_COMMENT); +} + +static void acpi_print_sdt(ACPI_TABLE_HEADER *sdp) { printf(" "); @@ -1456,6 +1650,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp) acpi_handle_tcpa(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_DMAR, 4)) acpi_handle_dmar(sdp); + else if (!memcmp(sdp->Signature, ACPI_SIG_NFIT, 4)) + acpi_handle_nfit(sdp); else { printf(BEGIN_COMMENT); acpi_print_sdt(sdp); From owner-svn-src-all@freebsd.org Thu Jul 20 17:36: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 DF1DCC7CD1F; Thu, 20 Jul 2017 17:36:18 +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 AC9CA719FB; Thu, 20 Jul 2017 17:36:18 +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 v6KHaHuG043053; Thu, 20 Jul 2017 17:36:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KHaHc0043052; Thu, 20 Jul 2017 17:36:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707201736.v6KHaHc0043052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jul 2017 17:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321299 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 321299 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 17:36:19 -0000 Author: emaste Date: Thu Jul 20 17:36:17 2017 New Revision: 321299 URL: https://svnweb.freebsd.org/changeset/base/321299 Log: acpidump: add GIC ITS srat type From ACPI 6.2, 5.2.16.5 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 17:31:27 2017 (r321298) +++ head/usr.sbin/acpi/acpidump/acpi.c Thu Jul 20 17:36:17 2017 (r321299) @@ -1115,7 +1115,8 @@ static const char *srat_types[] = { [ACPI_SRAT_TYPE_CPU_AFFINITY] = "CPU", [ACPI_SRAT_TYPE_MEMORY_AFFINITY] = "Memory", [ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY] = "X2APIC", - [ACPI_SRAT_TYPE_GICC_AFFINITY] = "GICC" + [ACPI_SRAT_TYPE_GICC_AFFINITY] = "GICC", + [ACPI_SRAT_TYPE_GIC_ITS_AFFINITY] = "GIC ITS", }; static void From owner-svn-src-all@freebsd.org Thu Jul 20 18:02: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 E0769C7D510; Thu, 20 Jul 2017 18:02:26 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAA13730F6; Thu, 20 Jul 2017 18:02:26 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KI2PKx056786; Thu, 20 Jul 2017 18:02:25 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KI2Pcs056784; Thu, 20 Jul 2017 18:02:25 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201707201802.v6KI2Pcs056784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 20 Jul 2017 18:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r321300 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: rstone X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 321300 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 18:02:27 -0000 Author: rstone Date: Thu Jul 20 18:02:25 2017 New Revision: 321300 URL: https://svnweb.freebsd.org/changeset/base/321300 Log: Welcome Matt Joras (mjoras@) as a new src committer. Matt has been doing work at various layers of the network stack. I will be his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Jul 20 17:36:17 2017 (r321299) +++ svnadmin/conf/access Thu Jul 20 18:02:25 2017 (r321300) @@ -143,6 +143,7 @@ mckusick melifaro mizhka mjg +mjoras mm mmel mp Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jul 20 17:36:17 2017 (r321299) +++ svnadmin/conf/mentors Thu Jul 20 18:02:25 2017 (r321300) @@ -22,6 +22,7 @@ jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko kevans emaste mahrens mckusick +mjoras rstone mw cognet peterj jhb Co-mentor: grog rgrimes grehan From owner-svn-src-all@freebsd.org Thu Jul 20 18:14: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 43B20C7DAAE; Thu, 20 Jul 2017 18:14:28 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1376C73953; Thu, 20 Jul 2017 18:14:28 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KIERcC061274; Thu, 20 Jul 2017 18:14:27 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KIERaG061273; Thu, 20 Jul 2017 18:14:27 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201707201814.v6KIERaG061273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Thu, 20 Jul 2017 18:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321301 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321301 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 18:14:28 -0000 Author: mjoras Date: Thu Jul 20 18:14:27 2017 New Revision: 321301 URL: https://svnweb.freebsd.org/changeset/base/321301 Log: Add myself and mentor line to committers-src.dot. Approved by: rstone (mentor) Differential Revision: https://reviews.freebsd.org/D11672 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Jul 20 18:02:25 2017 (r321300) +++ head/share/misc/committers-src.dot Thu Jul 20 18:14:27 2017 (r321301) @@ -244,6 +244,7 @@ melifaro [label="Alexander V. Chernikov\nmelifaro@Free mizhka [label="Michael Zhilin\nmizhka@FreeBSD.org\n2016/07/19"] mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] mjg [label="Mateusz Guzik\nmjg@FreeBSD.org\n2012/06/04"] +mjoras [label="Matt Joras\nmjoras@FreeBSD.org\n2017/07/12"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] mmel [label="Michal Meloun\nmmel@FreeBSD.org\n2015/11/01"] monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] @@ -720,6 +721,7 @@ rrs -> jchandra rrs -> tuexen rstone -> markj +rstone -> mjoras ru -> ceri ru -> cjc From owner-svn-src-all@freebsd.org Thu Jul 20 18:22: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 B9419C7DD04; Thu, 20 Jul 2017 18:22:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8445973EB0; Thu, 20 Jul 2017 18:22:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KIMnAa065194; Thu, 20 Jul 2017 18:22:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KIMnAS065193; Thu, 20 Jul 2017 18:22:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707201822.v6KIMnAS065193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jul 2017 18:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321302 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 321302 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 18:22:50 -0000 Author: emaste Date: Thu Jul 20 18:22:49 2017 New Revision: 321302 URL: https://svnweb.freebsd.org/changeset/base/321302 Log: add arm64 objcopy output target for embedfs PR: 220877 Submitted by: David NewHamlet MFC after: 1 week Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Jul 20 18:14:27 2017 (r321301) +++ head/sys/conf/kern.pre.mk Thu Jul 20 18:22:49 2017 (r321302) @@ -251,6 +251,7 @@ EMBEDFS_ARCH.${MACHINE_ARCH}!= sed -n '/OUTPUT_ARCH/s/ EMBEDFS_FORMAT.arm?= elf32-littlearm EMBEDFS_FORMAT.armv6?= elf32-littlearm +EMBEDFS_FORMAT.aarch64?= elf64-littleaarch64 EMBEDFS_FORMAT.mips?= elf32-tradbigmips EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips EMBEDFS_FORMAT.mips64?= elf64-tradbigmips From owner-svn-src-all@freebsd.org Thu Jul 20 20:15: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 3C39DC7F530; Thu, 20 Jul 2017 20:15:40 +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 05CB176B7B; Thu, 20 Jul 2017 20:15:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KKFd2d010195; Thu, 20 Jul 2017 20:15:39 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KKFcjV010188; Thu, 20 Jul 2017 20:15:38 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707202015.v6KKFcjV010188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 20 Jul 2017 20:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321303 - in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 321303 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 20:15:40 -0000 Author: mm Date: Thu Jul 20 20:15:38 2017 New Revision: 321303 URL: https://svnweb.freebsd.org/changeset/base/321303 Log: MFC r320927,320931,320932: Bump libarchive to 3.3.2 Vendor changes: PR #901: don't depend on stdin in a testcase Relnotes: yes Modified: stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c stable/11/usr.bin/bsdcat/Makefile stable/11/usr.bin/cpio/Makefile stable/11/usr.bin/tar/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/contrib/libarchive/NEWS Thu Jul 20 20:15:38 2017 (r321303) @@ -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: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/contrib/libarchive/libarchive/archive.h Thu Jul 20 20:15:38 2017 (r321303) @@ -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 */ @@ -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: stable/11/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 20:15:38 2017 (r321303) @@ -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 Modified: stable/11/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 20:15:38 2017 (r321303) @@ -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: stable/11/usr.bin/bsdcat/Makefile ============================================================================== --- stable/11/usr.bin/bsdcat/Makefile Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/usr.bin/bsdcat/Makefile Thu Jul 20 20:15:38 2017 (r321303) @@ -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: stable/11/usr.bin/cpio/Makefile ============================================================================== --- stable/11/usr.bin/cpio/Makefile Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/usr.bin/cpio/Makefile Thu Jul 20 20:15:38 2017 (r321303) @@ -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: stable/11/usr.bin/tar/Makefile ============================================================================== --- stable/11/usr.bin/tar/Makefile Thu Jul 20 18:22:49 2017 (r321302) +++ stable/11/usr.bin/tar/Makefile Thu Jul 20 20:15:38 2017 (r321303) @@ -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 20 20:16: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 D1ED7C7F5BF; Thu, 20 Jul 2017 20:16:19 +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 95EEA76CD1; Thu, 20 Jul 2017 20:16:19 +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 v6KKGIFD010419; Thu, 20 Jul 2017 20:16:18 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KKGI8r010411; Thu, 20 Jul 2017 20:16:18 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707202016.v6KKGI8r010411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 20 Jul 2017 20:16: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: r321304 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 321304 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 20:16:19 -0000 Author: mm Date: Thu Jul 20 20:16:18 2017 New Revision: 321304 URL: https://svnweb.freebsd.org/changeset/base/321304 Log: MFC r320927,320931,320932: Bump libarchive to 3.3.2 Vendor changes: PR #901: don't depend on stdin in a testcase Relnotes: yes Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/NEWS Thu Jul 20 20:16:18 2017 (r321304) @@ -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: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/archive.h Thu Jul 20 20:16:18 2017 (r321304) @@ -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 */ @@ -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: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 20:16:18 2017 (r321304) @@ -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 Modified: stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 20:16:18 2017 (r321304) @@ -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: stable/10/usr.bin/bsdcat/Makefile ============================================================================== --- stable/10/usr.bin/bsdcat/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/bsdcat/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -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: stable/10/usr.bin/cpio/Makefile ============================================================================== --- stable/10/usr.bin/cpio/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/cpio/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -6,7 +6,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive LIBARCHIVECONFDIR= ${.CURDIR}/../../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: stable/10/usr.bin/tar/Makefile ============================================================================== --- stable/10/usr.bin/tar/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/tar/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -4,7 +4,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../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 20 20:27: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 F279CC7F8D7; Thu, 20 Jul 2017 20:27:20 +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 BFDD077342; Thu, 20 Jul 2017 20:27: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 v6KKRJvu014765; Thu, 20 Jul 2017 20:27:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KKRJBR014764; Thu, 20 Jul 2017 20:27:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707202027.v6KKRJBR014764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Jul 2017 20:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321305 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 321305 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 20:27:21 -0000 Author: dim Date: Thu Jul 20 20:27:19 2017 New Revision: 321305 URL: https://svnweb.freebsd.org/changeset/base/321305 Log: Fix printf format warning in zfs_module.c Clang 5.0.0 got better warnings about print format strings using %zd, and this leads to the following -Werror warning on e.g. arm: sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); ^~~~~~~~~~ Fix this by casting off_t arguments to intmax_t, and using %jd instead. Reviewed by: tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11678 Modified: head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Thu Jul 20 20:16:18 2017 (r321304) +++ head/sys/boot/efi/boot1/zfs_module.c Thu Jul 20 20:27:19 2017 (r321305) @@ -182,8 +182,8 @@ load(const char *filepath, dev_info_t *devinfo, void * if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) != EFI_SUCCESS) { - printf("Failed to allocate load buffer %zd for pool '%s' for '%s' " - "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); + printf("Failed to allocate load buffer %jd for pool '%s' for '%s' " + "(%lu)\n", (intmax_t)st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); return (EFI_INVALID_PARAMETER); } From owner-svn-src-all@freebsd.org Thu Jul 20 20:28:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2795C7F96C; Thu, 20 Jul 2017 20:28:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70684774A8; Thu, 20 Jul 2017 20:28:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KKSVHS014862; Thu, 20 Jul 2017 20:28:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KKSVap014861; Thu, 20 Jul 2017 20:28:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707202028.v6KKSVap014861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Jul 2017 20:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321306 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321306 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 20:28:32 -0000 Author: dim Date: Thu Jul 20 20:28:31 2017 New Revision: 321306 URL: https://svnweb.freebsd.org/changeset/base/321306 Log: Fix printf format warning in iflib.c Clang 5.0.0 got better warnings about printf format strings using %zd, and this leads to the following -Werror warning on e.g. arm: sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~ sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~~~~ Fix this by casting bus_size_t arguments to uintmax_t, and using %ju instead. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11679 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jul 20 20:27:19 2017 (r321305) +++ head/sys/net/iflib.c Thu Jul 20 20:28:31 2017 (r321306) @@ -1513,8 +1513,8 @@ iflib_txsd_alloc(iflib_txq_t txq) NULL, /* lockfuncarg */ &txq->ift_desc_tag))) { device_printf(dev,"Unable to allocate TX DMA tag: %d\n", err); - device_printf(dev,"maxsize: %zd nsegments: %d maxsegsize: %zd\n", - sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); + device_printf(dev,"maxsize: %ju nsegments: %d maxsegsize: %ju\n", + (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } if ((err = bus_dma_tag_create(bus_get_dma_tag(dev), From owner-svn-src-all@freebsd.org Thu Jul 20 23:02:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8262DCFDDF8; Thu, 20 Jul 2017 23:02:06 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c: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 144A07FCC7; Thu, 20 Jul 2017 23:02:06 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id w191so148273wmw.1; Thu, 20 Jul 2017 16:02:06 -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=TW8dP0xSqXLfTkWca3dFHb+QEAJaQCFxG1bz4amyYn8=; b=MgmHtnID7IBBRDJ3DQDFMEcWvnO1nATq7WgYnIzM34HRSJ87SZaDqzjvxcEo3wDDba 8HNjZDnQrTHVMA1lP4uE9ivx8mFMIQnr2RO8a+yu5c6CEuISFFHu/vq8RkMU8avqR/S0 OcAF8nk7wYeyBNz89n3duP71usN+ElsiDBqq4TuKxX0BOuAWcKxxkzkbv6esQAJn4UrG +ykXDENi/+kMqXtAx68401OClz20sfrYlmaX4MM336skOGc8HlhyYL8ByPgFH9gWKyzR guowRUtUbxSSS0gOOpwxyq1ornapmH7NWJJhDZ7JY93PENLdXloLS+rYWpFvKmdzbjhg frUA== 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=TW8dP0xSqXLfTkWca3dFHb+QEAJaQCFxG1bz4amyYn8=; b=CHpQ8N24vKP6x28SBasrYwOlWvbeNd9n3U/AG/n66sA4O4450O5846jWwCqO+24aTk 3LMhD1abZJzqw5dcF1+FEc1DV7KH22S403AQaERuKsz1zSueO+riq+Xu/PVceoFadbzE BKiewEibHNSDz4n8yiLCSHFiz28WvsLF2uppi1I6GvJd6r/SxQQBpzDegQW8+WXIPdyG 9e9k1Uxzc6Y0TvKGbqeG62QezNWyyzUtb2klkqCe0ScpX4VqkkqqRYcUWh5c5tk7z7dH zKDesfV6XxLDBHio8qJmBjvRPUn7IJq+EfxOVWIBk5f0tpHMwnn8y720EasBzAWAW/jY SEag== X-Gm-Message-State: AIVw111z8PGc2xUSR/QqZAHkF7I4qBbgielR9efgvbFqN4EBB8KFz2Oi 7kXU9EcOqQnWdJ2L6bZOaAZtiV7CCw== X-Received: by 10.28.229.72 with SMTP id c69mr3599611wmh.77.1500591723087; Thu, 20 Jul 2017 16:02:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.161.72 with HTTP; Thu, 20 Jul 2017 16:02:02 -0700 (PDT) In-Reply-To: <20170720103323.GG1935@kib.kiev.ua> References: <201707200647.v6K6l7Hq076554@repo.freebsd.org> <20170720172157.W1152@besplex.bde.org> <20170720103323.GG1935@kib.kiev.ua> From: Ryan Libby Date: Thu, 20 Jul 2017 16:02:02 -0700 Message-ID: Subject: Re: svn commit: r321284 - in head/sys: amd64/include sys To: Konstantin Belousov Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, imp@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, 20 Jul 2017 23:02:06 -0000 On Thu, Jul 20, 2017 at 3:33 AM, Konstantin Belousov wrote: > On Thu, Jul 20, 2017 at 02:08:30AM -0700, Ryan Libby wrote: >> On Thu, Jul 20, 2017 at 1:01 AM, Bruce Evans wrote: [...] >> > This bug is not very common. There seem to be no instances of it in >> > (only sys/cdefs.h uses __attribute__(()), and it seems to use >> > underscores for all the attributes). Grepping sys/include/*.h for >> > attribute shows the following bugs: >> > >> > X amd64/include/efi.h:#define EFIABI_ATTR __attribute__((ms_abi)) >> > X i386/include/efi.h:#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ >> > X ofed/include/rdma/ib_user_mad.h:typedef unsigned long __attribute__((aligned(4))) packed_ulong; >> > X ofed/include/rdma/ib_smi.h:} __attribute__ ((packed)); >> > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> > X ofed/include/rdma/ib_mad.h:} __attribute__ ((packed)); >> > >> > The commented-out ms_abi was only a style bug. Now it is a larger style >> > bug -- it is different and worse than amd64. >> >> I'm not sure what to do about i386 there (again beyond fixing up the >> spelling in the comment). Maybe the unsupported architectures should >> just not be declaring EFIABI_ATTR at all? (Thoughts, kib?) > > I think i386 should be treated exactly same as amd64, i.e. EFIABI_ATTR > should be not defined if gcc < 4.4. Or I do not understand the scope > of the question. After googling around [1] and a quick check of the spec [2], it now seems to me that the i386 comment might just be erroneous. I think the right solution for sys/i386/include/efi.h may just be to delete the comment and leave that EFIAPI_ATTR macro definition as empty (always, no compiler version check) in order to use the native calling convention. [1] http://wiki.osdev.org/UEFI#Calling_Conventions [2] http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf From owner-svn-src-all@freebsd.org Thu Jul 20 23: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 28852CFE133; Thu, 20 Jul 2017 23:15:52 +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 E63AA801D6; Thu, 20 Jul 2017 23:15:51 +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 v6KNFosS084884; Thu, 20 Jul 2017 23:15:50 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KNFo9R084883; Thu, 20 Jul 2017 23:15:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707202315.v6KNFo9R084883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 20 Jul 2017 23:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321308 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 321308 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 23:15:52 -0000 Author: rmacklem Date: Thu Jul 20 23:15:50 2017 New Revision: 321308 URL: https://svnweb.freebsd.org/changeset/base/321308 Log: r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers. r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for the NFSv4.1 session. If rsize,wsize are not specified as options, the value of nm_rsize, nm_wsize is 0 at session creation, resulting in values for request/response that are too small. This patch fixes the problem. A workaround is to specify rsize=N,wsize=N mount options explicitly, so they are set before session creation. This bug only affects NFSv4.1 mounts against some non-FreeBSD servers. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Jul 20 20:37:23 2017 (r321307) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Jul 20 23:15:50 2017 (r321308) @@ -4672,8 +4672,14 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc uint32_t crflags, maxval, *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - int error, irdcnt; + int error, irdcnt, rsiz, wsiz; + rsiz = nmp->nm_rsize; + if (rsiz == 0) + rsiz = NFS_MAXBSIZE; + wsiz = nmp->nm_wsize; + if (wsiz == 0) + wsiz = NFS_MAXBSIZE; nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); *tl++ = sep->nfsess_clientid.lval[0]; @@ -4687,8 +4693,8 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc /* Fill in fore channel attributes. */ NFSM_BUILD(tl, uint32_t *, 7 * NFSX_UNSIGNED); *tl++ = 0; /* Header pad size */ - *tl++ = txdr_unsigned(nmp->nm_wsize + NFS_MAXXDR);/* Max request size */ - *tl++ = txdr_unsigned(nmp->nm_rsize + NFS_MAXXDR);/* Max reply size */ + *tl++ = txdr_unsigned(wsiz + NFS_MAXXDR);/* Max request size */ + *tl++ = txdr_unsigned(rsiz + NFS_MAXXDR);/* Max reply size */ *tl++ = txdr_unsigned(4096); /* Max response size cached */ *tl++ = txdr_unsigned(20); /* Max operations */ *tl++ = txdr_unsigned(64); /* Max slots */ From owner-svn-src-all@freebsd.org Thu Jul 20 23:39: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 0D101CFE81F; Thu, 20 Jul 2017 23:39:52 +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 CE33D80A8F; Thu, 20 Jul 2017 23:39:51 +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 v6KNdoWa092956; Thu, 20 Jul 2017 23:39:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KNdoD0092953; Thu, 20 Jul 2017 23:39:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707202339.v6KNdoD0092953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 20 Jul 2017 23:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r321309 - in releng/11.1: . lib/csu/common sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/11.1: . lib/csu/common sys/conf X-SVN-Commit-Revision: 321309 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 23:39:52 -0000 Author: gjb Date: Thu Jul 20 23:39:50 2017 New Revision: 321309 URL: https://svnweb.freebsd.org/changeset/base/321309 Log: - Switch releng/11.1 to -RELEASE. - Add the anticipated 11.1-RELEASE date to UPDATING. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.1/UPDATING releng/11.1/lib/csu/common/crtbrand.c releng/11.1/sys/conf/newvers.sh Modified: releng/11.1/UPDATING ============================================================================== --- releng/11.1/UPDATING Thu Jul 20 23:15:50 2017 (r321308) +++ releng/11.1/UPDATING Thu Jul 20 23:39:50 2017 (r321309) @@ -16,6 +16,9 @@ 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. +20170725: + 11.1-RELEASE. + 20170518: arm64 builds now use the base system LLD 4.0.0 linker by default, instead of requiring that the aarch64-binutils port or package be Modified: releng/11.1/lib/csu/common/crtbrand.c ============================================================================== --- releng/11.1/lib/csu/common/crtbrand.c Thu Jul 20 23:15:50 2017 (r321308) +++ releng/11.1/lib/csu/common/crtbrand.c Thu Jul 20 23:39:50 2017 (r321309) @@ -62,5 +62,5 @@ static const struct { .descsz = sizeof(int32_t), .type = ABI_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1101001 }; Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Thu Jul 20 23:15:50 2017 (r321308) +++ releng/11.1/sys/conf/newvers.sh Thu Jul 20 23:39:50 2017 (r321309) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RC3" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Thu Jul 20 23:44: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 07B6BCFEA2A; Thu, 20 Jul 2017 23:44:41 +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 C82E280EA8; Thu, 20 Jul 2017 23:44:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KNieib097062; Thu, 20 Jul 2017 23:44:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KNidgJ097060; Thu, 20 Jul 2017 23:44:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707202344.v6KNidgJ097060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 20 Jul 2017 23:44:39 +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: r321310 - in stable/11: release/doc/share/xml sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11: release/doc/share/xml sys/conf X-SVN-Commit-Revision: 321310 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 23:44:41 -0000 Author: gjb Date: Thu Jul 20 23:44:39 2017 New Revision: 321310 URL: https://svnweb.freebsd.org/changeset/base/321310 Log: - Set stable/11 from -PRERELEASE back to -STABLE. - Update version entities in release.ent. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/release.ent stable/11/sys/conf/newvers.sh Modified: stable/11/release/doc/share/xml/release.ent ============================================================================== --- stable/11/release/doc/share/xml/release.ent Thu Jul 20 23:39:50 2017 (r321309) +++ stable/11/release/doc/share/xml/release.ent Thu Jul 20 23:44:39 2017 (r321310) @@ -6,7 +6,7 @@ - + - + - + Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jul 20 23:39:50 2017 (r321309) +++ stable/11/sys/conf/newvers.sh Thu Jul 20 23:44:39 2017 (r321310) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Thu Jul 20 23:54: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 A3792CFEC41; Thu, 20 Jul 2017 23:54:19 +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 72F9081296; Thu, 20 Jul 2017 23:54:19 +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 v6KNsIlt001272; Thu, 20 Jul 2017 23:54:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KNsItI001270; Thu, 20 Jul 2017 23:54:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707202354.v6KNsItI001270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 20 Jul 2017 23:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321311 - in stable/11/release/doc: en_US.ISO8859-1/errata share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/release/doc: en_US.ISO8859-1/errata share/xml X-SVN-Commit-Revision: 321311 X-SVN-Commit-Repository: base MIME-Version: 1.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, 20 Jul 2017 23:54:19 -0000 Author: gjb Date: Thu Jul 20 23:54:18 2017 New Revision: 321311 URL: https://svnweb.freebsd.org/changeset/base/321311 Log: - Fix the 'release.prev' entity for the 11.1-RELEASE errata. - Prune stale entries from 11.0-RELEASE. - Bump copyright year. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml stable/11/release/doc/share/xml/release.ent Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jul 20 23:44:39 2017 (r321310) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jul 20 23:54:18 2017 (r321311) @@ -23,7 +23,7 @@ $FreeBSD$ - 2016 + 2017 The &os; Documentation Project @@ -95,17 +95,6 @@ - An issue was discovered with Amazon® EC2™ - images which would cause the virtual machine to hang during - boot when upgrading from previous FreeBSD versions. New - EC2™ installations are not affected, but existing - installations running earlier releases are advised to wait - until the issue is resolved in an Errata Notice before - upgrading. An Errata Notice to address this is planned - following the release. - - - &os;/&arch.i386; installed on ZFS may crash during boot when the ZFS pool mount is attempted while booting an unmodified GENERIC kernel. @@ -131,35 +120,6 @@ boot - A bug was diagnosed in interaction of the - pmap_activate() function and - TLB shootdown IPI - handler on amd64 systems which have PCID - features but do not implement the INVPCID - instruction. On such machines, such as SandyBridge™ - and IvyBridge™ microarchitectures, set the loader - tunable vm.pmap.pcid_enabled=0 during - boot: - - set vm.pmap.pcid_enabled=0 -boot - - Add this line to - /boot/loader.conf for the change to - persist across reboots: - - To check if the system is affected, check - &man.dmesg.8; for PCID listed in the - "Features2", and absence of - INVPCID in the "Structured Extended - Features". If the PCID feature is - not present, or INVPCID is present, - system is not affected. - - vm.pmap.pcid_enabled=0 - - - The Release Notes erroneously states the WITH_SYSTEM_COMPILER &man.src.conf.5; option is enabled by default, however this was disabled @@ -167,89 +127,7 @@ boot - The release announcement stated "Wireless support - for 802.11n has been added." This was intended to - state "Wireless support for 802.11n has been added for - additional wireless network drivers." - - - - Some release notes pertaining to the Cavium ThunderX - platform (the &os;/&arch.arm64; reference platform) were - omitted: - - - - Support for the Cavium Virtualized - NIC ethernet driver has been added. - - - - Support for the GICv3 and ITS device - drivers has been added. - - - - Support for PCI Enhanced Allocation - support has been added. - - - - - - [2016-10-20] Several recent Dell - systems fail to find a bootable disk when the system boots - in Legacy/BIOS/CSM mode, the boot disk is partitioned with - GPT, and the Active flag in the - Protective MBR is not set. To work - around this issue, either configure the system to boot in - UEFI mode, or choose the "GPT - + Active" scheme. - - - - [2016-10-21] Support for sha512 and - skein checksumming has been added to the - ZFS filesystem. This was not mentioned - in the release notes. - - Systems being upgraded from earlier &os; releases with - ZFS will see a message in zpool - status output noting the pool is not at the - latest version, and some features may not be enabled. - Additional instructions on how to update - ZFS pools to the latest version and - update the boot blocks for all boot drives in the pool will - also be provided in the output. - - This information is also documented in - /usr/src/UPDATING, which is included if - the src component is selected during - installation. - - - - [2016-10-21] The size of the GPT - enabled ZFS boot blocks - (/boot/gptzfsboot) has increased past - 64K. Systems upgraded from older releases may experience - a problem where the size of the existing - "freebsd-boot" partition is too small to hold the - new gptzfsboot. - - Systems where the boot partition is immediately followed - by the swap partition, such as those installed via - &man.bsdinstall.8;, can resize the swap partition slightly - using the &man.gpart.8; resize command, - so space can be reclaimed to increase the size of the - freebsd-boot partition. - - - - [2016-10-21] Due to a bug in earlier versions of + [2017-07-21] Due to a bug in earlier versions of &man.clang.1; that is difficult to work around in the upgrade process, to upgrade the system from sources via buildworld to -CURRENT or &release;, it is necessary to Modified: stable/11/release/doc/share/xml/release.ent ============================================================================== --- stable/11/release/doc/share/xml/release.ent Thu Jul 20 23:44:39 2017 (r321310) +++ stable/11/release/doc/share/xml/release.ent Thu Jul 20 23:54:18 2017 (r321311) @@ -11,7 +11,7 @@ - +