From owner-svn-src-all@freebsd.org Sun May 1 02:19:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F64AD9B1F; Sun, 1 May 2016 02:19:50 +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 56A531B66; Sun, 1 May 2016 02:19:50 +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 u412Jn3m060066; Sun, 1 May 2016 02:19:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u412JnU3060064; Sun, 1 May 2016 02:19:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605010219.u412JnU3060064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 02:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298871 - in head/sbin: growfs newfs_nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 02:19:50 -0000 Author: pfg Date: Sun May 1 02:19:49 2016 New Revision: 298871 URL: https://svnweb.freebsd.org/changeset/base/298871 Log: sbin: use our howmany() macro when available through . Modified: head/sbin/growfs/debug.c head/sbin/newfs_nandfs/newfs_nandfs.c Modified: head/sbin/growfs/debug.c ============================================================================== --- head/sbin/growfs/debug.c Sat Apr 30 23:42:46 2016 (r298870) +++ head/sbin/growfs/debug.c Sun May 1 02:19:49 2016 (r298871) @@ -518,7 +518,8 @@ dbg_dump_frmap(struct fs *sb, const char cp = (unsigned char *)cg_blksfree(cgr); if (sb->fs_old_nspf) - e = howmany((sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf), CHAR_BIT); + e = howmany(sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf, + CHAR_BIT); else e = 0; for (j = 0; j < e; j += 32) { Modified: head/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.c Sat Apr 30 23:42:46 2016 (r298870) +++ head/sbin/newfs_nandfs/newfs_nandfs.c Sun May 1 02:19:49 2016 (r298871) @@ -132,7 +132,7 @@ static uint32_t nuserfiles; static uint32_t seg_nblocks; static uint32_t seg_endblock; -#define SIZE_TO_BLOCK(size) (((size) + (blocksize - 1)) / blocksize) +#define SIZE_TO_BLOCK(size) howmany(size, blocksize) static uint32_t nandfs_first_block(void) From owner-svn-src-all@freebsd.org Sun May 1 02:24:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A994AAD9D81; Sun, 1 May 2016 02:24:06 +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 84E101FA5; Sun, 1 May 2016 02:24:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u412O5ni062874; Sun, 1 May 2016 02:24:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u412O5tG062869; Sun, 1 May 2016 02:24:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605010224.u412O5tG062869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 02:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298872 - in head/sbin: dump fsck_ffs geom/class/virstor recoverdisk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 02:24:06 -0000 Author: pfg Date: Sun May 1 02:24:05 2016 New Revision: 298872 URL: https://svnweb.freebsd.org/changeset/base/298872 Log: sbin: ake use of our rounddown() macro when sys/param.h is available. No functional change. Modified: head/sbin/dump/main.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/suj.c head/sbin/geom/class/virstor/geom_virstor.c head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/dump/main.c Sun May 1 02:24:05 2016 (r298872) @@ -267,7 +267,7 @@ main(int argc, char *argv[]) } if (blocksperfile) - blocksperfile = blocksperfile / ntrec * ntrec; /* round down */ + blocksperfile = rounddown(blocksperfile, ntrec); else if (!unlimited) { /* * Determine how to default tape size and density Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/fsck_ffs/inode.c Sun May 1 02:24:05 2016 (r298872) @@ -293,7 +293,7 @@ ginode(ino_t inumber) if (pbp != NULL) pbp->b_flags &= ~B_INUSE; pbp = getdatablk(iblk, sblock.fs_bsize, BT_INODES); - startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); + startinum = rounddown(inumber, INOPB(&sblock)); } if (sblock.fs_magic == FS_UFS1_MAGIC) return ((union dinode *) Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/fsck_ffs/suj.c Sun May 1 02:24:05 2016 (r298872) @@ -911,7 +911,7 @@ ino_isat(ino_t parent, off_t diroff, ino * certain we hit a valid record and not some junk in the middle * of a file name. Stop when we reach or pass the expected offset. */ - dpoff = (doff / DIRBLKSIZ) * DIRBLKSIZ; + dpoff = rounddown(doff, DIRBLKSIZ); do { dp = (struct direct *)&block[dpoff]; if (dpoff == doff) Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/geom/class/virstor/geom_virstor.c Sun May 1 02:24:05 2016 (r298872) @@ -255,7 +255,7 @@ virstor_label(struct gctl_req *req) if (md.md_chunk_size % MAXPHYS != 0) { /* XXX: This is not strictly needed, but it's convenient to * impose some limitations on it, so why not MAXPHYS. */ - size_t new_size = (md.md_chunk_size / MAXPHYS) * MAXPHYS; + size_t new_size = rounddown(md.md_chunk_size, MAXPHYS); if (new_size < md.md_chunk_size) new_size += MAXPHYS; fprintf(stderr, "Resizing chunk size to be a multiple of " Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Sun May 1 02:19:49 2016 (r298871) +++ head/sbin/recoverdisk/recoverdisk.c Sun May 1 02:24:05 2016 (r298872) @@ -207,7 +207,7 @@ main(int argc, char * const argv[]) sectorsize = stripesize; minsize = sectorsize; - bigsize = (bigsize / sectorsize) * sectorsize; + bigsize = rounddown(bigsize, sectorsize); error = ioctl(fdr, DIOCGMEDIASIZE, &t); if (error < 0) @@ -222,7 +222,7 @@ main(int argc, char * const argv[]) for (ch = 0; (bigsize >> ch) > minsize; ch++) continue; medsize = bigsize >> (ch / 2); - medsize = (medsize / minsize) * minsize; + medsize = rounddown(medsize, minsize); fprintf(stderr, "Bigsize = %zu, medsize = %zu, minsize = %zu\n", bigsize, medsize, minsize); From owner-svn-src-all@freebsd.org Sun May 1 02:31:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC7ECAD9E20; Sun, 1 May 2016 02:31:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4FC12BF; Sun, 1 May 2016 02:31:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u412VMQw065814; Sun, 1 May 2016 02:31:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u412VMVX065813; Sun, 1 May 2016 02:31:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605010231.u412VMVX065813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 02:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298873 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 02:31:23 -0000 Author: pfg Date: Sun May 1 02:31:22 2016 New Revision: 298873 URL: https://svnweb.freebsd.org/changeset/base/298873 Log: restore: drop casts for calloc(). Modified: head/sbin/restore/symtab.c Modified: head/sbin/restore/symtab.c ============================================================================== --- head/sbin/restore/symtab.c Sun May 1 02:24:05 2016 (r298872) +++ head/sbin/restore/symtab.c Sun May 1 02:31:22 2016 (r298873) @@ -535,9 +535,8 @@ initsymtable(char *filename) vprintf(stdout, "Initialize symbol table.\n"); if (filename == NULL) { entrytblsize = maxino / HASHFACTOR; - entry = (struct entry **) - calloc((unsigned)entrytblsize, sizeof(struct entry *)); - if (entry == (struct entry **)NULL) + entry = calloc((unsigned)entrytblsize, sizeof(struct entry *)); + if (entry == NULL) panic("no memory for entry table\n"); ep = addentry(".", ROOTINO, NODE); ep->e_flags |= NEW; From owner-svn-src-all@freebsd.org Sun May 1 02:39:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5749B0F036; Sun, 1 May 2016 02:39:40 +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 B6F3816FD; Sun, 1 May 2016 02:39:40 +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 u412dd2X066175; Sun, 1 May 2016 02:39:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u412ddXW066174; Sun, 1 May 2016 02:39:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605010239.u412ddXW066174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 02:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298874 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 02:39:41 -0000 Author: pfg Date: Sun May 1 02:39:39 2016 New Revision: 298874 URL: https://svnweb.freebsd.org/changeset/base/298874 Log: restore: fix resource handle leak. CID: 1007784 MFC after: 5 days Modified: head/sbin/restore/symtab.c Modified: head/sbin/restore/symtab.c ============================================================================== --- head/sbin/restore/symtab.c Sun May 1 02:31:22 2016 (r298873) +++ head/sbin/restore/symtab.c Sun May 1 02:39:39 2016 (r298874) @@ -559,6 +559,7 @@ initsymtable(char *filename) fprintf(stderr, "read: %s\n", strerror(errno)); panic("cannot read symbol table file %s\n", filename); } + (void)close(fd); switch (command) { case 'r': /* From owner-svn-src-all@freebsd.org Sun May 1 05:01:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E956EB266CC; Sun, 1 May 2016 05:01:11 +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 A8DAF1B0A; Sun, 1 May 2016 05:01:11 +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 u4151AM9009502; Sun, 1 May 2016 05:01:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4151AcX009501; Sun, 1 May 2016 05:01:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605010501.u4151AcX009501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 May 2016 05:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298875 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 05:01:12 -0000 Author: adrian Date: Sun May 1 05:01:10 2016 New Revision: 298875 URL: https://svnweb.freebsd.org/changeset/base/298875 Log: [iwn] fill in the TX command rate info flags consistently. The Linux driver sets the rate_n_flags regardless of whether it's being sent using firmware rate control or local rate control. This includes the antenna configuration. Thanks to Kyle Evans for pointing this out to me and doing some investigation/testing on his end. Tested: * Intel 7260 STA, 2G and 5G networks Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun May 1 02:39:39 2016 (r298874) +++ head/sys/dev/iwm/if_iwm.c Sun May 1 05:01:10 2016 (r298875) @@ -2572,9 +2572,7 @@ iwm_tx_rateidx_lookup(struct iwm_softc * } /* - * Fill in various bit for management frames, and leave them - * unfilled for data frames (firmware takes care of that). - * Return the selected TX rate. + * Fill in the rate related information for a transmit command. */ static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in, @@ -2606,28 +2604,28 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, st IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); - /* XXX no rate_n_flags? */ - return &iwm_rates[ridx]; - } - - /* - * For non-data, use the lowest supported rate for the given - * operational mode. - * - * Note: there may not be any rate control information available. - * This driver currently assumes if we're transmitting data - * frames, use the rate control table. Grr. - * - * XXX TODO: use the configured rate for the traffic type! - */ - if (ic->ic_curmode == IEEE80211_MODE_11A) { + } else { /* - * XXX this assumes the mode is either 11a or not 11a; - * definitely won't work for 11n. + * For non-data, use the lowest supported rate for the given + * operational mode. + * + * Note: there may not be any rate control information available. + * This driver currently assumes if we're transmitting data + * frames, use the rate control table. Grr. + * + * XXX TODO: use the configured rate for the traffic type! + * XXX TODO: this should be per-vap, not curmode; as we later + * on we'll want to handle off-channel stuff (eg TDLS). */ - ridx = IWM_RIDX_OFDM; - } else { - ridx = IWM_RIDX_CCK; + if (ic->ic_curmode == IEEE80211_MODE_11A) { + /* + * XXX this assumes the mode is either 11a or not 11a; + * definitely won't work for 11n. + */ + ridx = IWM_RIDX_OFDM; + } else { + ridx = IWM_RIDX_CCK; + } } rinfo = &iwm_rates[ridx]; @@ -2642,7 +2640,6 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, st rate_flags = 1 << IWM_RATE_MCS_ANT_POS; if (IWM_RIDX_IS_CCK(ridx)) rate_flags |= IWM_RATE_MCS_CCK_MSK; - /* XXX hard-coded tx rate */ tx->rate_n_flags = htole32(rate_flags | rinfo->plcp); return rinfo; From owner-svn-src-all@freebsd.org Sun May 1 08:22:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C88FBB288E3; Sun, 1 May 2016 08:22:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E9F1F54; Sun, 1 May 2016 08:22:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u418MBKb073548; Sun, 1 May 2016 08:22:11 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u418MBaa073545; Sun, 1 May 2016 08:22:11 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605010822.u418MBaa073545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 1 May 2016 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298876 - in head: lib/libutil sbin/hastd usr.bin/newgrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 08:22:12 -0000 Author: ed Date: Sun May 1 08:22:11 2016 New Revision: 298876 URL: https://svnweb.freebsd.org/changeset/base/298876 Log: Remove useless calls to basename(). There are a couple of places in the source three where we call basename() on constant strings. This is bad, because the prototype standardized by POSIX allows the implementation to use its argument as a storage buffer. This change eliminates some of these unportable calls to basename() in cases where it was only added for cosmetical reasons, namely to trim argv[0]. There's nothing wrong with setting argv[0] to the full path. Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D6093 Modified: head/lib/libutil/pw_util.c head/sbin/hastd/hooks.c head/usr.bin/newgrp/newgrp.c Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Sun May 1 05:01:10 2016 (r298875) +++ head/lib/libutil/pw_util.c Sun May 1 08:22:11 2016 (r298876) @@ -58,7 +58,6 @@ static const char rcsid[] = #include #include #include -#include #include #include #include @@ -315,7 +314,7 @@ pw_edit(int notsetuid) (void)setuid(getuid()); } errno = 0; - execlp(editor, basename(editor), tempname, (char *)NULL); + execlp(editor, editor, tempname, (char *)NULL); _exit(errno); default: /* parent */ Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Sun May 1 05:01:10 2016 (r298875) +++ head/sbin/hastd/hooks.c Sun May 1 08:22:11 2016 (r298876) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -352,7 +351,7 @@ hook_execv(const char *path, va_list ap) return; memset(args, 0, sizeof(args)); - args[0] = basename(path); + args[0] = __DECONST(char *, path); for (ii = 1; ii < sizeof(args) / sizeof(args[0]); ii++) { args[ii] = va_arg(ap, char *); if (args[ii] == NULL) Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Sun May 1 05:01:10 2016 (r298875) +++ head/usr.bin/newgrp/newgrp.c Sun May 1 08:22:11 2016 (r298876) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -290,7 +289,7 @@ loginshell(void) if (ticket != NULL) setenv("KRBTKFILE", ticket, 1); - if (asprintf(args, "-%s", basename(shell)) < 0) + if (asprintf(args, "-%s", shell) < 0) err(1, "asprintf"); args[1] = NULL; @@ -306,6 +305,6 @@ doshell(void) shell = pwd->pw_shell; if (*shell == '\0') shell = _PATH_BSHELL; - execl(shell, basename(shell), (char *)NULL); + execl(shell, shell, (char *)NULL); err(1, "%s", shell); } From owner-svn-src-all@freebsd.org Sun May 1 14:27:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0AF8B28B71; Sun, 1 May 2016 14:27:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D02C19DB; Sun, 1 May 2016 14:27:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41ERRW5081945; Sun, 1 May 2016 14:27:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41ERR8t081943; Sun, 1 May 2016 14:27:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605011427.u41ERR8t081943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 May 2016 14:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298877 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 14:27:29 -0000 Author: avos Date: Sun May 1 14:27:27 2016 New Revision: 298877 URL: https://svnweb.freebsd.org/changeset/base/298877 Log: iwm: switch to ieee80211_add_channel() - Switch to ieee80211_add_channel(). - Parse/set more channel flags (DFS, NOADHOC). - Add ic_getradiocaps() method. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6150 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun May 1 08:22:11 2016 (r298876) +++ head/sys/dev/iwm/if_iwm.c Sun May 1 14:27:27 2016 (r298877) @@ -166,12 +166,15 @@ const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 5 GHz */ - 36, 40, 44 , 48, 52, 56, 60, 64, + 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165 }; #define IWM_NUM_2GHZ_CHANNELS 14 +_Static_assert(nitems(iwm_nvm_channels) <= IWM_NUM_CHANNELS, + "IWM_NUM_CHANNELS is too small"); + /* * XXX For now, there's simply a fixed set of rate table entries * that are populated. @@ -241,8 +244,12 @@ static int iwm_nvm_read_chunk(struct iwm uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, uint16_t *); -static void iwm_init_channel_map(struct iwm_softc *, - const uint16_t * const); +static uint32_t iwm_eeprom_channel_flags(uint16_t); +static void iwm_add_channel_band(struct iwm_softc *, + struct ieee80211_channel[], int, int *, int, int, + const uint8_t[]); +static void iwm_init_channel_map(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, const uint16_t *, const uint16_t *, uint8_t, uint8_t); @@ -1634,6 +1641,7 @@ enum nvm_sku_bits { * @IWM_NVM_CHANNEL_IBSS: usable as an IBSS channel * @IWM_NVM_CHANNEL_ACTIVE: active scanning allowed * @IWM_NVM_CHANNEL_RADAR: radar detection required + * XXX cannot find this (DFS) flag in iwl-nvm-parse.c * @IWM_NVM_CHANNEL_DFS: dynamic freq selection candidate * @IWM_NVM_CHANNEL_WIDE: 20 MHz channel okay (?) * @IWM_NVM_CHANNEL_40MHZ: 40 MHz channel okay (?) @@ -1653,97 +1661,91 @@ enum iwm_nvm_channel_flags { }; /* - * Add a channel to the net80211 channel list. - * - * ieee is the ieee channel number - * ch_idx is channel index. - * mode is the channel mode - CHAN_A, CHAN_B, CHAN_G. - * ch_flags is the iwm channel flags. - * - * Return 0 on OK, < 0 on error. + * Translate EEPROM flags to net80211. */ -static int -iwm_init_net80211_channel(struct iwm_softc *sc, int ieee, int ch_idx, - int mode, uint16_t ch_flags) +static uint32_t +iwm_eeprom_channel_flags(uint16_t ch_flags) { - /* XXX for now, no overflow checking! */ - struct ieee80211com *ic = &sc->sc_ic; - int is_5ghz, flags; - struct ieee80211_channel *channel; - - channel = &ic->ic_channels[ic->ic_nchans++]; - channel->ic_ieee = ieee; + uint32_t nflags; - is_5ghz = ch_idx >= IWM_NUM_2GHZ_CHANNELS; - if (!is_5ghz) { - flags = IEEE80211_CHAN_2GHZ; - channel->ic_flags = mode; - } else { - flags = IEEE80211_CHAN_5GHZ; - channel->ic_flags = mode; + nflags = 0; + if ((ch_flags & IWM_NVM_CHANNEL_ACTIVE) == 0) + nflags |= IEEE80211_CHAN_PASSIVE; + if ((ch_flags & IWM_NVM_CHANNEL_IBSS) == 0) + nflags |= IEEE80211_CHAN_NOADHOC; + if (ch_flags & IWM_NVM_CHANNEL_RADAR) { + nflags |= IEEE80211_CHAN_DFS; + /* Just in case. */ + nflags |= IEEE80211_CHAN_NOADHOC; } - channel->ic_freq = ieee80211_ieee2mhz(ieee, flags); - if (!(ch_flags & IWM_NVM_CHANNEL_ACTIVE)) - channel->ic_flags |= IEEE80211_CHAN_PASSIVE; - return (0); + return (nflags); } static void -iwm_init_channel_map(struct iwm_softc *sc, const uint16_t * const nvm_ch_flags) +iwm_add_channel_band(struct iwm_softc *sc, struct ieee80211_channel chans[], + int maxchans, int *nchans, int ch_idx, int ch_num, const uint8_t bands[]) { - struct ieee80211com *ic = &sc->sc_ic; - struct iwm_nvm_data *data = &sc->sc_nvm; - int ch_idx; + const uint16_t * const nvm_ch_flags = sc->sc_nvm.nvm_ch_flags; + uint32_t nflags; uint16_t ch_flags; - int hw_value; + uint8_t ieee; + int error; - for (ch_idx = 0; ch_idx < nitems(iwm_nvm_channels); ch_idx++) { + for (; ch_idx < ch_num; ch_idx++) { ch_flags = le16_to_cpup(nvm_ch_flags + ch_idx); - - if (ch_idx >= IWM_NUM_2GHZ_CHANNELS && - !data->sku_cap_band_52GHz_enable) - ch_flags &= ~IWM_NVM_CHANNEL_VALID; + ieee = iwm_nvm_channels[ch_idx]; if (!(ch_flags & IWM_NVM_CHANNEL_VALID)) { IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Ch. %d Flags %x [%sGHz] - No traffic\n", - iwm_nvm_channels[ch_idx], - ch_flags, + ieee, ch_flags, (ch_idx >= IWM_NUM_2GHZ_CHANNELS) ? "5.2" : "2.4"); continue; } - hw_value = iwm_nvm_channels[ch_idx]; - - /* 5GHz? */ - if (ch_idx >= IWM_NUM_2GHZ_CHANNELS) { - (void) iwm_init_net80211_channel(sc, hw_value, - ch_idx, - IEEE80211_CHAN_A, - ch_flags); - } else { - (void) iwm_init_net80211_channel(sc, hw_value, - ch_idx, - IEEE80211_CHAN_B, - ch_flags); - /* If it's not channel 13, also add 11g */ - if (hw_value != 13) - (void) iwm_init_net80211_channel(sc, hw_value, - ch_idx, - IEEE80211_CHAN_G, - ch_flags); - } + nflags = iwm_eeprom_channel_flags(ch_flags); + error = ieee80211_add_channel(chans, maxchans, nchans, + ieee, 0, 0, nflags, bands); + if (error != 0) + break; IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Ch. %d Flags %x [%sGHz] - Added\n", - iwm_nvm_channels[ch_idx], - ch_flags, + ieee, ch_flags, (ch_idx >= IWM_NUM_2GHZ_CHANNELS) ? "5.2" : "2.4"); } - ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); +} + +static void +iwm_init_channel_map(struct ieee80211com *ic, int maxchans, int *nchans, + struct ieee80211_channel chans[]) +{ + struct iwm_softc *sc = ic->ic_softc; + struct iwm_nvm_data *data = &sc->sc_nvm; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + + memset(bands, 0, sizeof(bands)); + /* 1-13: 11b/g channels. */ + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + iwm_add_channel_band(sc, chans, maxchans, nchans, 0, + IWM_NUM_2GHZ_CHANNELS - 1, bands); + + /* 14: 11b channel only. */ + clrbit(bands, IEEE80211_MODE_11G); + iwm_add_channel_band(sc, chans, maxchans, nchans, + IWM_NUM_2GHZ_CHANNELS - 1, 1, bands); + + if (data->sku_cap_band_52GHz_enable) { + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11A); + iwm_add_channel_band(sc, chans, maxchans, nchans, + IWM_NUM_2GHZ_CHANNELS, + nitems(iwm_nvm_channels) - IWM_NUM_2GHZ_CHANNELS, bands); + } } static int @@ -1792,7 +1794,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->hw_addr[4] = hw_addr[5]; data->hw_addr[5] = hw_addr[4]; - iwm_init_channel_map(sc, &nvm_sw[IWM_NVM_CHANNELS]); + memcpy(data->nvm_ch_flags, &nvm_sw[IWM_NVM_CHANNELS], + sizeof(data->nvm_ch_flags)); data->calib_version = 255; /* TODO: this value will prevent some checks from failing, we need to check if this @@ -4778,6 +4781,9 @@ iwm_preinit(void *arg) sizeof(ic->ic_sup_rates[IEEE80211_MODE_11A])); IWM_UNLOCK(sc); + iwm_init_channel_map(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); + /* * At this point we've committed - if we fail to do setup, * we now also have to tear down the net80211 state. @@ -4790,6 +4796,7 @@ iwm_preinit(void *arg) ic->ic_scan_start = iwm_scan_start; ic->ic_scan_end = iwm_scan_end; ic->ic_update_mcast = iwm_update_mcast; + ic->ic_getradiocaps = iwm_init_channel_map; ic->ic_set_channel = iwm_set_channel; ic->ic_scan_curchan = iwm_scan_curchan; ic->ic_scan_mindwell = iwm_scan_mindwell; Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Sun May 1 08:22:11 2016 (r298876) +++ head/sys/dev/iwm/if_iwmvar.h Sun May 1 14:27:27 2016 (r298877) @@ -196,6 +196,9 @@ struct iwm_nvm_data { uint8_t radio_cfg_dash; uint8_t radio_cfg_pnum; uint8_t valid_tx_ant, valid_rx_ant; +#define IWM_NUM_CHANNELS 39 + + uint16_t nvm_ch_flags[IWM_NUM_CHANNELS]; uint16_t nvm_version; uint8_t max_tx_pwr_half_dbm; From owner-svn-src-all@freebsd.org Sun May 1 16:10:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0EC7B29144; Sun, 1 May 2016 16:10:57 +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 9C4681507; Sun, 1 May 2016 16:10:57 +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 u41GAuJB012478; Sun, 1 May 2016 16:10:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GAuqH012474; Sun, 1 May 2016 16:10:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011610.u41GAuqH012474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298878 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:10:58 -0000 Author: pfg Date: Sun May 1 16:10:56 2016 New Revision: 298878 URL: https://svnweb.freebsd.org/changeset/base/298878 Log: localedef(1): minor spelling fixes on comments. No functional change. Modified: head/usr.bin/localedef/charmap.c head/usr.bin/localedef/collate.c head/usr.bin/localedef/scanner.c head/usr.bin/localedef/time.c Modified: head/usr.bin/localedef/charmap.c ============================================================================== --- head/usr.bin/localedef/charmap.c Sun May 1 14:27:27 2016 (r298877) +++ head/usr.bin/localedef/charmap.c Sun May 1 16:10:56 2016 (r298878) @@ -324,7 +324,7 @@ add_charmap_char(const char *name, int v /* * POSIX insists that certain entries be present, even when not in the - * orginal charmap file. + * original charmap file. */ void add_charmap_posix(void) Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Sun May 1 14:27:27 2016 (r298877) +++ head/usr.bin/localedef/collate.c Sun May 1 16:10:56 2016 (r298878) @@ -1120,7 +1120,7 @@ dump_collate(void) collate_chain_t *chain; /* - * We have to run throught a preliminary pass to identify all the + * We have to run through a preliminary pass to identify all the * weights that we use for each sorting level. */ for (i = 0; i < NUM_WT; i++) { Modified: head/usr.bin/localedef/scanner.c ============================================================================== --- head/usr.bin/localedef/scanner.c Sun May 1 14:27:27 2016 (r298877) +++ head/usr.bin/localedef/scanner.c Sun May 1 16:10:56 2016 (r298878) @@ -181,7 +181,7 @@ static struct token { /* * These are keywords used in the charmap file. Note that - * Solaris orginally used angle brackets to wrap some of them, + * Solaris originally used angle brackets to wrap some of them, * but we removed that to simplify our parser. The first of these * items are "global items." */ Modified: head/usr.bin/localedef/time.c ============================================================================== --- head/usr.bin/localedef/time.c Sun May 1 14:27:27 2016 (r298877) +++ head/usr.bin/localedef/time.c Sun May 1 16:10:56 2016 (r298878) @@ -262,7 +262,7 @@ dump_time(void) * NOTE: If date_fmt is not specified, then we'll default to * using the %c for date. This is reasonable for most * locales, although for reasons that I don't understand - * Solaris historically has had a seperate format for date. + * Solaris historically has had a separate format for date. */ if ((putl_category(tm.X_fmt, f) == EOF) || (putl_category(tm.x_fmt, f) == EOF) || From owner-svn-src-all@freebsd.org Sun May 1 16:13:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D18B29276; Sun, 1 May 2016 16:13:06 +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 A2A2019A1; Sun, 1 May 2016 16:13:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GD5Sn014572; Sun, 1 May 2016 16:13:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GD5rp014566; Sun, 1 May 2016 16:13:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011613.u41GD5rp014566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298879 - in head/usr.bin: iscsictl m4 timeout timeout/tests whereis xlint/lint2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:13:06 -0000 Author: pfg Date: Sun May 1 16:13:05 2016 New Revision: 298879 URL: https://svnweb.freebsd.org/changeset/base/298879 Log: usr.bin: minor spelling fixes on comments. No functional change. Modified: head/usr.bin/iscsictl/iscsictl.c head/usr.bin/m4/eval.c head/usr.bin/timeout/tests/timeout.sh head/usr.bin/timeout/timeout.c head/usr.bin/whereis/whereis.c head/usr.bin/xlint/lint2/chk.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/iscsictl/iscsictl.c Sun May 1 16:13:05 2016 (r298879) @@ -771,7 +771,7 @@ main(int argc, char **argv) xo_errx(1, "at most one of -A, -M, -R, or -L may be specified"); /* - * Note that we ignore unneccessary/inapplicable "-c" flag; so that + * Note that we ignore unnecessary/inapplicable "-c" flag; so that * people can do something like "alias ISCSICTL="iscsictl -c path" * in shell scripts. */ Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/m4/eval.c Sun May 1 16:13:05 2016 (r298879) @@ -895,7 +895,7 @@ dosub(const char *argv[], int argc) * function of ICON language. Within mapvec, we replace every character * of "from" with the corresponding character in "to". * If "to" is shorter than "from", than the corresponding entries are null, - * which means that those characters dissapear altogether. + * which means that those characters disappear altogether. */ static void map(char *dest, const char *src, const char *from, const char *to) Modified: head/usr.bin/timeout/tests/timeout.sh ============================================================================== --- head/usr.bin/timeout/tests/timeout.sh Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/timeout/tests/timeout.sh Sun May 1 16:13:05 2016 (r298879) @@ -83,7 +83,7 @@ exit_numbers_body() -s exit:124 \ -x timeout .1 sleep 1 - # With preserv status exit shoudl be 128 + TERM aka 143 + # With preserv status exit should be 128 + TERM aka 143 atf_check \ -o empty \ -e empty \ Modified: head/usr.bin/timeout/timeout.c ============================================================================== --- head/usr.bin/timeout/timeout.c Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/timeout/timeout.c Sun May 1 16:13:05 2016 (r298879) @@ -227,7 +227,7 @@ main(int argc, char **argv) argv++; if (!foreground) { - /* Aquire a reaper */ + /* Acquire a reaper */ if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) err(EX_OSERR, "Fail to acquire the reaper"); } Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/whereis/whereis.c Sun May 1 16:13:05 2016 (r298879) @@ -505,7 +505,7 @@ main(int argc, char **argv) (rlen = matches[1].rm_eo - matches[1].rm_so) > 0) { /* - * man -w found formated + * man -w found formatted * page, need to pick up * source page name. */ Modified: head/usr.bin/xlint/lint2/chk.c ============================================================================== --- head/usr.bin/xlint/lint2/chk.c Sun May 1 16:10:56 2016 (r298878) +++ head/usr.bin/xlint/lint2/chk.c Sun May 1 16:13:05 2016 (r298879) @@ -459,7 +459,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym promote = def != NULL && def->s_osdef; /* - * If we compair with a definition or declaration, we must perform + * If we compare with a definition or declaration, we must perform * the same checks for qualifiers in indirected types as in * assignments. */ From owner-svn-src-all@freebsd.org Sun May 1 16:16:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B623B29306; Sun, 1 May 2016 16:16:13 +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 28EA81B28; Sun, 1 May 2016 16:16:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GGCZJ014711; Sun, 1 May 2016 16:16:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GGCgL014709; Sun, 1 May 2016 16:16:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011616.u41GGCgL014709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298880 - in head/release/picobsd: build tinyware/ns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:16:13 -0000 Author: pfg Date: Sun May 1 16:16:11 2016 New Revision: 298880 URL: https://svnweb.freebsd.org/changeset/base/298880 Log: picobsd: minor spelling fixes. Modified: head/release/picobsd/build/picobsd head/release/picobsd/tinyware/ns/ns.c Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun May 1 16:13:05 2016 (r298879) +++ head/release/picobsd/build/picobsd Sun May 1 16:16:11 2016 (r298880) @@ -363,7 +363,7 @@ do_install() { return fi dialog --title "Build ${THETYPE} completed" --inputbox \ -"\nThe build process was completed successfuly.\n\ +"\nThe build process was completed successfully.\n\ `cat .build.reply` \n\n\ Now we are going to install the image on the floppy.\n\ Please insert a blank floppy in /dev/fd0.\\n Modified: head/release/picobsd/tinyware/ns/ns.c ============================================================================== --- head/release/picobsd/tinyware/ns/ns.c Sun May 1 16:13:05 2016 (r298879) +++ head/release/picobsd/tinyware/ns/ns.c Sun May 1 16:16:11 2016 (r298880) @@ -700,7 +700,7 @@ stats(char *proto) return 0; if (pflag) { if (proto == NULL) { - fprintf(stderr, "Option '-p' requires paramter.\n"); + fprintf(stderr, "Option '-p' requires parameter.\n"); usage(); exit(-1); } From owner-svn-src-all@freebsd.org Sun May 1 16:20:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1FDAB293A8; Sun, 1 May 2016 16:20:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1E431D2A; Sun, 1 May 2016 16:20:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GKFsl014902; Sun, 1 May 2016 16:20:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GKEvW014889; Sun, 1 May 2016 16:20:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011620.u41GKEvW014889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298881 - in head/tools: build/mk regression/sockets/so_setfib tools/fixwhite tools/ipw tools/nanobsd tools/nanobsd/dhcpd tools/nanobsd/embedded tools/shlib-compat tools/wtap/vis_map to... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:20:17 -0000 Author: pfg Date: Sun May 1 16:20:14 2016 New Revision: 298881 URL: https://svnweb.freebsd.org/changeset/base/298881 Log: tools: minor spelling fixes. Mostly comments but also some user-visible strings. MFC after: 2 weeks Modified: head/tools/build/mk/Makefile.boot head/tools/regression/sockets/so_setfib/so_setfib.c head/tools/tools/fixwhite/fixwhite.1 head/tools/tools/fixwhite/fixwhite.c head/tools/tools/ipw/ipwstats.c head/tools/tools/nanobsd/defaults.sh head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/embedded/README head/tools/tools/nanobsd/embedded/common head/tools/tools/shlib-compat/shlib-compat.py head/tools/tools/wtap/vis_map/vis_map.c head/tools/tools/wtap/wtap/wtap.c Modified: head/tools/build/mk/Makefile.boot ============================================================================== --- head/tools/build/mk/Makefile.boot Sun May 1 16:16:11 2016 (r298880) +++ head/tools/build/mk/Makefile.boot Sun May 1 16:20:14 2016 (r298881) @@ -5,5 +5,5 @@ DPADD+= ${WORLDTMP}/legacy/usr/lib/libe LDADD+= -legacy LDFLAGS+= -L${WORLDTMP}/legacy/usr/lib -# we do not want to capture dependencies refering to the above +# we do not want to capture dependencies referring to the above UPDATE_DEPENDFILE= no Modified: head/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- head/tools/regression/sockets/so_setfib/so_setfib.c Sun May 1 16:16:11 2016 (r298880) +++ head/tools/regression/sockets/so_setfib/so_setfib.c Sun May 1 16:20:14 2016 (r298881) @@ -175,7 +175,7 @@ main(int argc __unused, char *argv[] __u return (0); } - /* Initalize randomness. */ + /* Initialize randomness. */ srandomdev(); /* Get number of FIBs supported by kernel. */ Modified: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- head/tools/tools/fixwhite/fixwhite.1 Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/fixwhite/fixwhite.1 Sun May 1 16:20:14 2016 (r298881) @@ -43,6 +43,6 @@ trailing whitespace characters from ever Multiple successive empty lines are merged together. If the whitespace at the beginning of a sentence is exactly a multiple of eight spaces, the whitespace is replaced by tabs. -Also, spaces preceeding tabs will be merged into the tab character. +Also, spaces preceding tabs will be merged into the tab character. .Sh AUTHORS .An Ed Schouten Aq Mt ed@FreeBSD.org Modified: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- head/tools/tools/fixwhite/fixwhite.c Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/fixwhite/fixwhite.c Sun May 1 16:20:14 2016 (r298881) @@ -95,7 +95,7 @@ savewhite(char c, bool leading) savebyte(' '); break; case '\t': - /* Convert preceeding spaces to tabs. */ + /* Convert preceding spaces to tabs. */ ncolumn = (column / 8 + 1) * 8; while (peekbyte(1, ' ')) { queuelen--; Modified: head/tools/tools/ipw/ipwstats.c ============================================================================== --- head/tools/tools/ipw/ipwstats.c Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/ipw/ipwstats.c Sun May 1 16:20:14 2016 (r298881) @@ -89,7 +89,7 @@ static const struct statistic tbl[] = { { 27, "Number of reassociation requests transmitted", INT }, { 28, "Number of reassociation responses transmitted", INT }, { 29, "Number of probe requests transmitted", INT }, - { 30, "Number of probe reponses transmitted", INT }, + { 30, "Number of probe responses transmitted", INT }, { 31, "Number of beacons transmitted", INT }, { 32, "Number of ATIM frames transmitted", INT }, { 33, "Number of disassociation requests transmitted", INT }, @@ -137,7 +137,7 @@ static const struct statistic tbl[] = { { 89, "Number of reassociation requests received", INT }, { 90, "Number of reassociation responses received", INT }, { 91, "Number of probe requests received", INT }, - { 92, "Number of probe reponses received", INT }, + { 92, "Number of probe responses received", INT }, { 93, "Number of beacons received", INT }, { 94, "Number of ATIM frames received", INT }, { 95, "Number of disassociation requests received", INT }, Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/nanobsd/defaults.sh Sun May 1 16:20:14 2016 (r298881) @@ -97,7 +97,7 @@ NANO_CUSTOMIZE="" # Late customize commands. NANO_LATE_CUSTOMIZE="" -# Newfs paramters to use +# Newfs parameters to use NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" # The drive name of the media at runtime @@ -348,7 +348,7 @@ build_kernel ( ) ( # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. - # Although MODULES_OVERRIDE can be defined in the kenrel config + # Although MODULES_OVERRIDE can be defined in the kernel config # file to override this behavior. Just set NANO_MODULES=default. set -o xtrace cd "${NANO_SRC}" Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/nanobsd/dhcpd/common Sun May 1 16:20:14 2016 (r298881) @@ -229,7 +229,7 @@ add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` shift - # Check if package allready exist + # Check if package already exist # Need to: # 1. check ARCH of this package! # 2. Add a trap Modified: head/tools/tools/nanobsd/embedded/README ============================================================================== --- head/tools/tools/nanobsd/embedded/README Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/nanobsd/embedded/README Sun May 1 16:20:14 2016 (r298881) @@ -35,13 +35,13 @@ qemu-sparc64.cfg Create a bootable sparc rpi.cfg Create a bootable image for Raspberry Pi B rpi2.cfg Create a bootable image for Raspberry Pi2 sam9260ek.cfg Create a bootable image for an Atmel SAM9260-EK - evaluation board (still needs a kenrel loaded + evaluation board (still needs a kernel loaded into dataflash or NAND, so experimental). sam9g20ek.cfg Create a bootable image for an Atmel SAM9G20-EK - evaluation board (still needs a kenrel loaded + evaluation board (still needs a kernel loaded into dataflash or NAND, so experimental). Also works on many after-market boards that are somewhat - compatible with the refernce board. + compatible with the references board. QEMU command lines for serial console access Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/nanobsd/embedded/common Sun May 1 16:20:14 2016 (r298881) @@ -38,7 +38,7 @@ # Missing in base: # o mkimg setting active partition # o mkimg starting at arbitrary offset (needed for A10, et al) -# o mtools still needed becuase we have no makefs -t msdos +# o mtools still needed because we have no makefs -t msdos # o nanobsd doesn't record changes to WORLDTEMP in customization # scripts yet, so we have kludge to pick up all files # o easy way for pkg to grab files from other repos and put that Modified: head/tools/tools/shlib-compat/shlib-compat.py ============================================================================== --- head/tools/tools/shlib-compat/shlib-compat.py Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/shlib-compat/shlib-compat.py Sun May 1 16:20:14 2016 (r298881) @@ -936,7 +936,7 @@ class DwarfdumpParser(Parser): tag.tag in DwarfdumpParser.external_tags)): if offset in self.offsetmap: raise ValueError("Dwarf dump parse error: " + - "symbol is aleady defined at offset 0x%x" % offset) + "symbol is already defined at offset 0x%x" % offset) self.offsetmap[offset] = tag if len(self.stack) > 0: prev = self.stack.pop() Modified: head/tools/tools/wtap/vis_map/vis_map.c ============================================================================== --- head/tools/tools/wtap/vis_map/vis_map.c Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/wtap/vis_map/vis_map.c Sun May 1 16:20:14 2016 (r298881) @@ -110,7 +110,7 @@ main(int argc, const char* argv[]) link_op(&l); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); exit(1); } exit(0); Modified: head/tools/tools/wtap/wtap/wtap.c ============================================================================== --- head/tools/tools/wtap/wtap/wtap.c Sun May 1 16:16:11 2016 (r298880) +++ head/tools/tools/wtap/wtap/wtap.c Sun May 1 16:20:14 2016 (r298881) @@ -75,7 +75,7 @@ int main( int argc, const char* argv[]) delete(id); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); return -1; } return 0; From owner-svn-src-all@freebsd.org Sun May 1 16:29:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04A3B29527; Sun, 1 May 2016 16:29:03 +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 BAC8A1102; Sun, 1 May 2016 16:29:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GT2sl017891; Sun, 1 May 2016 16:29:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GT2eD017886; Sun, 1 May 2016 16:29:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011629.u41GT2eD017886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298882 - in head/share: examples/ipfilter examples/kld/cdev/test mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:29:04 -0000 Author: pfg Date: Sun May 1 16:29:02 2016 New Revision: 298882 URL: https://svnweb.freebsd.org/changeset/base/298882 Log: share: minor spelling fixes. Mostly comments but these tend to be user-visible. MFC after: 2 weeks Modified: head/share/examples/ipfilter/ipf-howto.txt head/share/examples/kld/cdev/test/Makefile head/share/mk/bsd.cpu.mk head/share/mk/bsd.subdir.mk head/share/mk/local.gendirdeps.mk Modified: head/share/examples/ipfilter/ipf-howto.txt ============================================================================== --- head/share/examples/ipfilter/ipf-howto.txt Sun May 1 16:20:14 2016 (r298881) +++ head/share/examples/ipfilter/ipf-howto.txt Sun May 1 16:29:02 2016 (r298882) @@ -1036,11 +1036,11 @@ In this case, the server is running n it's not a server, it's a client. And this client doesn't want unauthorized packets entering its IP stack at all. However, the client wants full access to the internet and -the reply packets that such privledge entails. This simple +the reply packets that such privilege entails. This simple ruleset creates state entries for every new outgoing TCP session. Again, since a state entry is created, these new TCP sessions are free to talk back and forth as they please -without the hinderance or inspection of the firewall rule- +without the hindrance or inspection of the firewall rule- set. We mentioned that this also works for UDP and ICMP: block in quick on tun0 all @@ -1271,7 +1271,7 @@ forgeries and allow fragments: This works because every packet that should be allowed through makes it into the state table before the blocking rules are reached. The only scan this won't detect is a SYN -scan itself. If you're truely worried about that, you might +scan itself. If you're truly worried about that, you might even want to log all initial SYN packets. 3.6. Responding To a Blocked Packet Modified: head/share/examples/kld/cdev/test/Makefile ============================================================================== --- head/share/examples/kld/cdev/test/Makefile Sun May 1 16:20:14 2016 (r298881) +++ head/share/examples/kld/cdev/test/Makefile Sun May 1 16:29:02 2016 (r298882) @@ -73,7 +73,7 @@ WARNS?= 5 MODSTAT= /sbin/kldstat load: - @echo "This test program will call the sample kld characer device "; + @echo "This test program will call the sample kld character device "; @echo "driver." @echo @echo "The sample driver will display a message on the" Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sun May 1 16:20:14 2016 (r298881) +++ head/share/mk/bsd.cpu.mk Sun May 1 16:29:02 2016 (r298882) @@ -122,10 +122,10 @@ _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 _CPUCFLAGS = -march=${CPUTYPE} . else # Common values for FreeBSD -# arm: (any arm v4 or v5 processor you are targetting) +# arm: (any arm v4 or v5 processor you are targeting) # arm920t, arm926ej-s, marvell-pj4, fa526, fa626, # fa606te, fa626te, fa726te -# armv6: (any arm v7 or v8 processor you are targetting and the arm1176jzf-s) +# armv6: (any arm v7 or v8 processor you are targeting and the arm1176jzf-s) # arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, # cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, # cortex-a72, exynos-m1 Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Sun May 1 16:20:14 2016 (r298881) +++ head/share/mk/bsd.subdir.mk Sun May 1 16:29:02 2016 (r298882) @@ -16,7 +16,7 @@ # # SUBDIR A list of subdirectories that should be built as well. # Each of the targets will execute the same target in the -# subdirectories. SUBDIR.yes is automatically appeneded +# subdirectories. SUBDIR.yes is automatically appended # to this list. # # +++ targets +++ Modified: head/share/mk/local.gendirdeps.mk ============================================================================== --- head/share/mk/local.gendirdeps.mk Sun May 1 16:20:14 2016 (r298881) +++ head/share/mk/local.gendirdeps.mk Sun May 1 16:29:02 2016 (r298882) @@ -3,7 +3,7 @@ # we need a keyword, this noise is to prevent it being expanded GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @:M*F*}'; -# supress optional/auto dependecies +# suppress optional/auto dependencies # local.dirdeps.mk will put them in if necessary GENDIRDEPS_FILTER+= \ Nbin/cat.host \ From owner-svn-src-all@freebsd.org Sun May 1 16:36:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326E5B296AC; Sun, 1 May 2016 16:36:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03484151B; Sun, 1 May 2016 16:36:15 +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 u41GaF18020871; Sun, 1 May 2016 16:36:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GaFOt020869; Sun, 1 May 2016 16:36:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011636.u41GaFOt020869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298883 - in head/usr.sbin/bluetooth: btpand hccontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:36:16 -0000 Author: pfg Date: Sun May 1 16:36:14 2016 New Revision: 298883 URL: https://svnweb.freebsd.org/changeset/base/298883 Log: bluetooth: minor spelling fixes. User-visible strings. MFC after: 2 weeks Modified: head/usr.sbin/bluetooth/btpand/btpand.c head/usr.sbin/bluetooth/hccontrol/node.c Modified: head/usr.sbin/bluetooth/btpand/btpand.c ============================================================================== --- head/usr.sbin/bluetooth/btpand/btpand.c Sun May 1 16:29:02 2016 (r298882) +++ head/usr.sbin/bluetooth/btpand/btpand.c Sun May 1 16:36:14 2016 (r298883) @@ -66,7 +66,7 @@ static const struct { const char * desc; } services[] = { { "PANU", SDP_SERVICE_CLASS_PANU, "Personal Area Networking User" }, - { "NAP", SDP_SERVICE_CLASS_NAP, "Network Acess Point" }, + { "NAP", SDP_SERVICE_CLASS_NAP, "Network Access Point" }, { "GN", SDP_SERVICE_CLASS_GN, "Group Network" }, }; Modified: head/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/node.c Sun May 1 16:29:02 2016 (r298882) +++ head/usr.sbin/bluetooth/hccontrol/node.c Sun May 1 16:36:14 2016 (r298883) @@ -592,7 +592,7 @@ struct hci_command node_commands[] = { "Write the value of the Role Switch parameter for the HCI node. By default,\n" \ "if Role Switch is supported, local device will try to perform Role Switch\n" \ "and become Master on incoming connection. Some devices do not support Role\n" \ -"Switch and thus incomming connections from such devices will fail. Setting\n" \ +"Switch and thus incoming connections from such devices will fail. Setting\n" \ "this parameter to zero will prevent Role Switch and thus accepting device\n" \ "will remain Slave", &hci_write_node_role_switch From owner-svn-src-all@freebsd.org Sun May 1 16:38:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E79B29719; Sun, 1 May 2016 16:38:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 513DD17A5; Sun, 1 May 2016 16:38:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GcDbg020988; Sun, 1 May 2016 16:38:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GcCu3020978; Sun, 1 May 2016 16:38:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011638.u41GcCu3020978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298884 - in head/usr.sbin: bsdconfig/share bsdconfig/share/media bsdconfig/share/packages bsdconfig/startup/share bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:38:14 -0000 Author: pfg Date: Sun May 1 16:38:12 2016 New Revision: 298884 URL: https://svnweb.freebsd.org/changeset/base/298884 Log: usr.sbin/bsdconfig: minor spelling fixes on comments. No functional change. Modified: head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/geom.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcvar.subr head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/common.subr Sun May 1 16:38:12 2016 (r298884) @@ -167,7 +167,7 @@ f_debug_init() [ "$debugFile" ] && { [ "${debug+set}" ] || debug=1; } # - # Make debugging persistant if set + # Make debugging persistent if set # [ "$debug" ] && export debug [ "$debugFile" ] && export debugFile @@ -175,7 +175,7 @@ f_debug_init() # # Truncate debug file unless requested otherwise. Note that we will # trim a leading plus (`+') from the value of debugFile to support - # persistant meaning that f_dprintf() should print both to standard + # persistent meaning that f_dprintf() should print both to standard # output and $debugFile (minus the leading plus, of course). # local _debug_file="${debugFile#+}" Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun May 1 16:38:12 2016 (r298884) @@ -105,10 +105,10 @@ DIALOG_ESC=255 # # When manually sizing Xdialog(1) widgets such as calendar and timebox, you'll # need to know the size of the embedded GUI objects because the height passed -# to Xdialog(1) for these widgets has to be tall enough to accomodate them. +# to Xdialog(1) for these widgets has to be tall enough to accommodate them. # # These values are helpful when manually sizing with dialog(1) too, but in a -# different way. dialog(1) does not make you accomodate the custom items in the +# different way. dialog(1) does not make you accommodate the custom items in the # height (but does for width) -- a height of 3 will display three lines and a # full calendar, for example (whereas Xdialog will truncate the calendar if # given a height of 3). For dialog(1), use these values for making sure that @@ -703,7 +703,7 @@ f_dialog_buttonbox_size() # Adjust height if desired if [ "$__var_height" ]; then - # Add height to accomodate the buttons + # Add height to accommodate the buttons __height_bbox_size=$(( $__height_bbox_size + 2 )) # Adjust for clipping with Xdialog(1) on Linux/GTK2 @@ -1382,7 +1382,7 @@ f_dialog_calendar_size() __height=$( echo "$__prompt" | f_number_of_lines ) if [ "$USE_XDIALOG" ]; then - # Add height to accomodate for embedded calendar widget + # Add height to accommodate for embedded calendar widget __height=$(( $__height + $DIALOG_CALENDAR_HEIGHT - 1 )) # Also, bump height if backtitle is enabled Modified: head/usr.sbin/bsdconfig/share/geom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/geom.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/geom.subr Sun May 1 16:38:12 2016 (r298884) @@ -91,7 +91,7 @@ f_struct_define GEOM_PROVIDER_CONFIG \ # f_geom_get_all # # Parse sysctl(8) `kern.geom.confxml' data into a series of structs. GEOM -# classes are at the top of the heirarchy and are stored as numbered structs +# classes are at the top of the hierarchy and are stored as numbered structs # from 1 to $NGEOM_CLASSES (set by this function) named `geom_class_C'. GEOM # objects within each class are stored as numbered structs from 1 to `ngeoms' # (a property of the GEOM class struct) named `geom_class_C_geom_N' (where C Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun May 1 16:38:12 2016 (r298884) @@ -1129,7 +1129,7 @@ f_host_lookup() # allows you to have a mostly non-interactive script that still # prompts for network setup/confirmation. # -# After successfull execution, the following variables are set: +# After successful execution, the following variables are set: # # VAR_IFCONFIG + $device (e.g., `ifconfig_em0') # Defines the ifconfig(8) properties specific to $device. Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun May 1 16:38:12 2016 (r298884) @@ -123,7 +123,7 @@ f_index_initialize() # # - # Calculate digest used to determine if the on-disk persistant cache + # Calculate digest used to determine if the on-disk persistent cache # INDEX (containing this digest on the first line) is valid and can be # used to quickly populate the environment. # @@ -135,7 +135,7 @@ f_index_initialize() fi # - # Check to see if the persistant cache INDEX file exists + # Check to see if the persistent cache INDEX file exists # if [ -f "$PACKAGES_INDEX_CACHEFILE" ]; then # @@ -184,7 +184,7 @@ f_index_initialize() ) | sort )' # - # Attempt to create the persistant on-disk cache + # Attempt to create the persistent on-disk cache # # Create a new temporary file to write to Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun May 1 16:38:12 2016 (r298884) @@ -143,7 +143,7 @@ f_package_select() # f_package_deselect $package ... # -# Remove $package from teh list of tracked/selected packages. If $package is +# Remove $package from the list of tracked/selected packages. If $package is # not being tracked (doesn't appear in $SELECTED_PACKAGES), this function # amounts to having no effet. # @@ -187,7 +187,7 @@ f_package_detect_installed() # Also calculates the total number of installed/selected packages stored as # $_All_ninstalled and $_All_nselected. # -# Calculations are peformed by checking "marks". A "mark" is stored as +# Calculations are performed by checking "marks". A "mark" is stored as # $_mark_$varpkg -- where $varpkg is the product of `f_str2varname $package # varpkg'. A mark can be "X" for an installed package, `I' for a package that # is marked for installation, "R" for a package that is marked for re-install, Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sun May 1 16:38:12 2016 (r298884) @@ -124,7 +124,7 @@ f_startup_rcconf_map() # # - # Calculate digest used to determine if the on-disk global persistant + # Calculate digest used to determine if the on-disk global persistent # cache file (containing this digest on the first line) is valid and # can be used to quickly populate the cache value for immediate return. # @@ -132,7 +132,7 @@ f_startup_rcconf_map() __rc_defaults_digest=$( exec 2> /dev/null; md5 < "$RC_DEFAULTS" ) # - # Check to see if the global persistant cache file exists + # Check to see if the global persistent cache file exists # if [ -f "$STARTUP_RCCONF_MAP_CACHEFILE" ]; then # @@ -176,7 +176,7 @@ f_startup_rcconf_map() # # If we reach this point, we need to generate the data from scratch - # (and after we do, we'll attempt to create the global persistant + # (and after we do, we'll attempt to create the global persistent # cache file to speed up future executions). # @@ -215,7 +215,7 @@ f_startup_rcconf_map() fi # - # Attempt to create the persistant global cache + # Attempt to create the persistent global cache # # Create a new temporary file to write to Modified: head/usr.sbin/bsdconfig/startup/share/rcvar.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcvar.subr Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdconfig/startup/share/rcvar.subr Sun May 1 16:38:12 2016 (r298884) @@ -121,7 +121,7 @@ f_startup_rcvar_map() # # Calculate a digest given the checksums of all dependencies (scripts # and the defaults file). This digest will be used to determine if an - # on-disk global persistant cache file (containg this digest on the + # on-disk global persistent cache file (containg this digest on the # first line) is valid and can be used to quickly populate the cache # value for immediate return. # @@ -130,7 +130,7 @@ f_startup_rcvar_map() cksum "$RC_DEFAULTS" $__rc_script_list 2> /dev/null | md5 ) # - # Check to see if the global persistant cache file exists + # Check to see if the global persistent cache file exists # if [ -f "$STARTUP_RCVAR_MAP_CACHEFILE" ]; then # @@ -174,7 +174,7 @@ f_startup_rcvar_map() # # If we reach this point, we need to generate the data from scratch - # (and after we do, we'll attempt to create the global persistant + # (and after we do, we'll attempt to create the global persistent # cache file to speed up future executions). # @@ -208,7 +208,7 @@ f_startup_rcvar_map() fi # - # Attempt to create/update the persistant global cache + # Attempt to create/update the persistent global cache # # Create a new temporary file to write to Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 1 16:36:14 2016 (r298883) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 1 16:38:12 2016 (r298884) @@ -1321,7 +1321,7 @@ zfs_create_boot() # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." - # Stick the ZFS boot loader in the "convienient hole" after + # Stick the ZFS boot loader in the "convenient hole" after # the ZFS internal metadata for disk in $disks; do f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ From owner-svn-src-all@freebsd.org Sun May 1 16:40:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B375B2983F; Sun, 1 May 2016 16:40:57 +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 6C6BF19C2; Sun, 1 May 2016 16:40:57 +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 u41Geusk021131; Sun, 1 May 2016 16:40:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GeucS021129; Sun, 1 May 2016 16:40:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011640.u41GeucS021129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298885 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:40:57 -0000 Author: pfg Date: Sun May 1 16:40:56 2016 New Revision: 298885 URL: https://svnweb.freebsd.org/changeset/base/298885 Log: pmcstat: minor spelling fixes. Mostly comments bur also a user-visible string. MFC after: 2 weeks Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 1 16:38:12 2016 (r298884) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 1 16:40:56 2016 (r298885) @@ -830,7 +830,7 @@ pmcpl_ct_node_printchild(struct pmcpl_ct /* * Child cost. - * TODO: attach child cost to the real position in the funtion. + * TODO: attach child cost to the real position in the function. * TODO: cfn= / call addr() / addr(call ) */ for (i=0 ; ipct_narc; i++) { Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Sun May 1 16:38:12 2016 (r298884) +++ head/usr.sbin/pmcstat/pmcstat_log.c Sun May 1 16:40:56 2016 (r298885) @@ -1372,7 +1372,7 @@ pmcstat_analyze_log(void) assert(args.pa_flags & FLAG_DO_ANALYSIS); if (elf_version(EV_CURRENT) == EV_NONE) - err(EX_UNAVAILABLE, "Elf library intialization failed"); + err(EX_UNAVAILABLE, "Elf library initialization failed"); while (pmclog_read(args.pa_logparser, &ev) == 0) { assert(ev.pl_state == PMCLOG_OK); From owner-svn-src-all@freebsd.org Sun May 1 16:41:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B66B2988C; Sun, 1 May 2016 16:41:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 639E51CA2; Sun, 1 May 2016 16:41:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GfQHU023782; Sun, 1 May 2016 16:41:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GfPgk023772; Sun, 1 May 2016 16:41:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011641.u41GfPgk023772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298886 - in head/usr.sbin: camdd cron/cron ctladm gssd jail lpr/common_source lpr/lpd nandsim rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:41:27 -0000 Author: pfg Date: Sun May 1 16:41:25 2016 New Revision: 298886 URL: https://svnweb.freebsd.org/changeset/base/298886 Log: usr.sbin: minor spelling fixes on comments. No functional change. Modified: head/usr.sbin/camdd/camdd.c head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/popen.c head/usr.sbin/ctladm/ctladm.c head/usr.sbin/gssd/gssd.c head/usr.sbin/jail/jailparse.y head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/lpd/recvjob.c head/usr.sbin/nandsim/nandsim_cfgparse.c head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/camdd/camdd.c Sun May 1 16:41:25 2016 (r298886) @@ -446,7 +446,7 @@ static int need_status = 0; #endif -/* Generically usefull offsets into the peripheral private area */ +/* Generically useful offsets into the peripheral private area */ #define ppriv_ptr0 periph_priv.entries[0].ptr #define ppriv_ptr1 periph_priv.entries[1].ptr #define ppriv_field0 periph_priv.entries[0].field Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/cron/cron/cron.c Sun May 1 16:41:25 2016 (r298886) @@ -228,7 +228,7 @@ cron_tick(cron_db *db, int secres) register user *u; register entry *e; - /* make 0-based values out of these so we can use them as indicies + /* make 0-based values out of these so we can use them as indices */ second = (secres == 0) ? 0 : tm->tm_sec -FIRST_SECOND; minute = tm->tm_min -FIRST_MINUTE; @@ -289,7 +289,7 @@ cron_tick(cron_db *db, int secres) time_t difftime = TargetTime + tm->tm_gmtoff - diff; gmtime_r(&difftime, &otztm); - /* make 0-based values out of these so we can use them as indicies + /* make 0-based values out of these so we can use them as indices */ otzsecond = (secres == 0) ? 0 : otztm.tm_sec -FIRST_SECOND; otzminute = otztm.tm_min -FIRST_MINUTE; Modified: head/usr.sbin/cron/cron/popen.c ============================================================================== --- head/usr.sbin/cron/cron/popen.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/cron/cron/popen.c Sun May 1 16:41:25 2016 (r298886) @@ -47,7 +47,7 @@ static const char rcsid[] = #define WANT_GLOBBING 0 /* - * Special version of popen which avoids call to shell. This insures noone + * Special version of popen which avoids call to shell. This insures no one * may create a pipe to a hidden program as a side effect of a list or dir * command. */ Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/ctladm/ctladm.c Sun May 1 16:41:25 2016 (r298886) @@ -2922,7 +2922,7 @@ cctl_islist_end_element(void *user_data, /* Nothing. */ } else { /* - * Unknown element; ignore it for forward compatiblity. + * Unknown element; ignore it for forward compatibility. */ } Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/gssd/gssd.c Sun May 1 16:41:25 2016 (r298886) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); struct gss_resource { LIST_ENTRY(gss_resource) gr_link; - uint64_t gr_id; /* indentifier exported to kernel */ + uint64_t gr_id; /* identifier exported to kernel */ void* gr_res; /* GSS-API resource pointer */ }; LIST_HEAD(gss_resource_list, gss_resource) gss_resources; Modified: head/usr.sbin/jail/jailparse.y ============================================================================== --- head/usr.sbin/jail/jailparse.y Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/jail/jailparse.y Sun May 1 16:41:25 2016 (r298886) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); /* * A config file is a series of jails (containing parameters) and jail-less - * parameters which realy belong to a global pseudo-jail. + * parameters which really belong to a global pseudo-jail. */ conf : ; Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/lpr/common_source/common.c Sun May 1 16:41:25 2016 (r298886) @@ -640,7 +640,7 @@ trstat_write(struct printer *pp, tr_send * a host as it receives a datafile. * user= - user who sent the job (if known) * secs= - seconds it took to transfer the file - * bytes= - number of bytes transfered (ie, "bytecount") + * bytes= - number of bytes transferred (ie, "bytecount") * bps=e - Bytes/sec (if the transfer was "big enough" * for this to be useful) * ! top= - type of printer (if the type is defined in Modified: head/usr.sbin/lpr/lpd/recvjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/recvjob.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/lpr/lpd/recvjob.c Sun May 1 16:41:25 2016 (r298886) @@ -140,7 +140,7 @@ recvjob(const char *printer) /* * Read printer jobs sent by lpd and copy them to the spooling directory. - * Return the number of jobs successfully transfered. + * Return the number of jobs successfully transferred. */ static int readjob(struct printer *pp) @@ -356,7 +356,7 @@ read_number(const char *fn) } /* - * Remove all the files associated with the current job being transfered. + * Remove all the files associated with the current job being transferred. */ static void rcleanup(int signo __unused) Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c ============================================================================== --- head/usr.sbin/nandsim/nandsim_cfgparse.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/nandsim/nandsim_cfgparse.c Sun May 1 16:41:25 2016 (r298886) @@ -528,7 +528,7 @@ parse_config(char *cfgfname, const char error("Controller#%d already created\n", ctrls[i].num); else if (err == EINVAL) - error("Incorrect controler number (%d)\n", + error("Incorrect controller number (%d)\n", ctrls[i].num); else error("Could not created controller#%d\n", Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Sun May 1 16:40:56 2016 (r298885) +++ head/usr.sbin/rtadvd/rtadvd.c Sun May 1 16:41:25 2016 (r298886) @@ -1223,7 +1223,7 @@ udiff(uint32_t u, uint32_t v) return (u >= v ? u - v : v - u); } -/* return a non-zero value if the received prefix is inconsitent with ours */ +/* return a non-zero value if the received prefix is inconsistent with ours */ static int prefix_check(struct nd_opt_prefix_info *pinfo, struct rainfo *rai, struct sockaddr_in6 *from) From owner-svn-src-all@freebsd.org Sun May 1 16:43:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F58B2990A; Sun, 1 May 2016 16:43:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C05E31EE2; Sun, 1 May 2016 16:43:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GhMn5023896; Sun, 1 May 2016 16:43:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GhME5023891; Sun, 1 May 2016 16:43:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011643.u41GhME5023891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 16:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298887 - in head/etc: . ntp rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:43:24 -0000 Author: pfg Date: Sun May 1 16:43:22 2016 New Revision: 298887 URL: https://svnweb.freebsd.org/changeset/base/298887 Log: etc: minor spelling fixes. Mostly comments but these tend to be user-visible. MFC after: 2 weeks Modified: head/etc/ntp/leap-seconds head/etc/protocols head/etc/rc.d/sendmail head/etc/rc.initdiskless Modified: head/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Sun May 1 16:41:25 2016 (r298886) +++ head/etc/ntp/leap-seconds Sun May 1 16:43:22 2016 (r298887) @@ -46,7 +46,7 @@ # by the International Bureau of Weights and Measures # (BIPM). See www.bipm.fr for more information. # -# 3. The current defintion of the relationship between UTC +# 3. The current definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different # time scales were in use before than epoch, and it can be # quite difficult to compute precise timestamps and time Modified: head/etc/protocols ============================================================================== --- head/etc/protocols Sun May 1 16:41:25 2016 (r298886) +++ head/etc/protocols Sun May 1 16:43:22 2016 (r298887) @@ -43,7 +43,7 @@ merit-inp 32 MERIT-INP # MERIT Internoda dccp 33 DCCP # Datagram Congestion Control Protocol 3pc 34 3PC # Third Party Connect Protocol idpr 35 IDPR # Inter-Domain Policy Routing Protocol -xtp 36 XTP # Xpress Tranfer Protocol +xtp 36 XTP # Xpress Transfer Protocol ddp 37 DDP # Datagram Delivery Protocol idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto tp++ 39 TP++ # TP++ Transport Protocol Modified: head/etc/rc.d/sendmail ============================================================================== --- head/etc/rc.d/sendmail Sun May 1 16:41:25 2016 (r298886) +++ head/etc/rc.d/sendmail Sun May 1 16:43:22 2016 (r298887) @@ -79,7 +79,7 @@ sendmail_cert_create() crlnumber = \$dir/crlnumber # the current crl number crl = \$dir/crl.pem # The current CRL private_key = \$dir/cakey.pem - x509_extensions = usr_cert # The extentions to add to the cert + x509_extensions = usr_cert # The extensions to add to the cert name_opt = ca_default # Subject Name options cert_opt = ca_default # Certificate field options default_days = 365 # how long to certify for @@ -100,7 +100,7 @@ sendmail_cert_create() default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes - x509_extensions = v3_ca # The extentions to add to the self signed cert + x509_extensions = v3_ca # The extensions to add to the self signed cert string_mask = utf8only prompt = no [ req_distinguished_name ] Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Sun May 1 16:41:25 2016 (r298886) +++ head/etc/rc.initdiskless Sun May 1 16:43:22 2016 (r298887) @@ -103,7 +103,7 @@ # will be created. In case of multiple entries for the same # directory M, the last one in the scanning order is used. # NOTE: If you only need to create a memory filesystem but not -# initialize it from a template, it is preferrable to specify +# initialize it from a template, it is preferable to specify # it in fstab e.g. as "md /tmp mfs -s=30m,rw 0 0" # # /conf/T/SUBDIR.cpio.gz From owner-svn-src-all@freebsd.org Sun May 1 16:48:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7059FB29A5B; Sun, 1 May 2016 16:48:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4235A11C5; Sun, 1 May 2016 16:48:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41Gm3Hb024095; Sun, 1 May 2016 16:48:03 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41Gm3B3024094; Sun, 1 May 2016 16:48:03 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201605011648.u41Gm3B3024094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sun, 1 May 2016 16:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298888 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:48:04 -0000 Author: jamie Date: Sun May 1 16:48:03 2016 New Revision: 298888 URL: https://svnweb.freebsd.org/changeset/base/298888 Log: typo Submitted by: Jimmy Olgeni Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun May 1 16:43:22 2016 (r298887) +++ head/usr.sbin/jail/jail.8 Sun May 1 16:48:03 2016 (r298888) @@ -653,7 +653,7 @@ its keys. If set to .Dq disable , the jail cannot perform any sysvmsg-related system calls. -.It Va sysvsem, sysvmsg +.It Va sysvsem, sysvshm Allow access to SYSV IPC semaphore and shared memory primitives, in the same manner as .Va sysvmsg. From owner-svn-src-all@freebsd.org Sun May 1 16:49:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B850B29ABB; Sun, 1 May 2016 16:49:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB341329; Sun, 1 May 2016 16:49:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41GnWxh024193; Sun, 1 May 2016 16:49:32 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41GnWVd024192; Sun, 1 May 2016 16:49:32 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201605011649.u41GnWVd024192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sun, 1 May 2016 16:49: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: r298889 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 16:49:33 -0000 Author: jamie Date: Sun May 1 16:49:32 2016 New Revision: 298889 URL: https://svnweb.freebsd.org/changeset/base/298889 Log: MFC r298888: typo Submitted by: Jimmy Olgeni Modified: stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Sun May 1 16:48:03 2016 (r298888) +++ stable/10/usr.sbin/jail/jail.8 Sun May 1 16:49:32 2016 (r298889) @@ -653,7 +653,7 @@ its keys. If set to .Dq disable , the jail cannot perform any sysvmsg-related system calls. -.It Va sysvsem, sysvmsg +.It Va sysvsem, sysvshm Allow access to SYSV IPC semaphore and shared memory primitives, in the same manner as .Va sysvmsg. From owner-svn-src-all@freebsd.org Sun May 1 17:46:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D44B295A0; Sun, 1 May 2016 17:46:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CADD41CEC; Sun, 1 May 2016 17:46:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41HkuBq042313; Sun, 1 May 2016 17:46:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41HkuvL042310; Sun, 1 May 2016 17:46:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605011746.u41HkuvL042310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 May 2016 17:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298890 - in head/sys: dev/firewire i386/bios sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 17:46:58 -0000 Author: kib Date: Sun May 1 17:46:56 2016 New Revision: 298890 URL: https://svnweb.freebsd.org/changeset/base/298890 Log: Make it explicit that D_MEM cdevsw d_flag is to signify that the driver is (or behaves identically to) /dev/mem. Remove the D_MEM flag from random drivers. Note that currently the D_MEM flag does not affect any behaviour, but this going to change in the next commit. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D6149 Modified: head/sys/dev/firewire/fwdev.c head/sys/i386/bios/smapi.c head/sys/sys/conf.h Modified: head/sys/dev/firewire/fwdev.c ============================================================================== --- head/sys/dev/firewire/fwdev.c Sun May 1 16:49:32 2016 (r298889) +++ head/sys/dev/firewire/fwdev.c Sun May 1 17:46:56 2016 (r298890) @@ -80,7 +80,6 @@ struct cdevsw firewire_cdevsw = { .d_mmap = fw_mmap, .d_strategy = fw_strategy, .d_name = "fw", - .d_flags = D_MEM }; struct fw_drv1 { Modified: head/sys/i386/bios/smapi.c ============================================================================== --- head/sys/i386/bios/smapi.c Sun May 1 16:49:32 2016 (r298889) +++ head/sys/i386/bios/smapi.c Sun May 1 17:46:56 2016 (r298890) @@ -80,7 +80,7 @@ static struct cdevsw smapi_cdevsw = { .d_version = D_VERSION, .d_ioctl = smapi_ioctl, .d_name = "smapi", - .d_flags = D_MEM | D_NEEDGIANT, + .d_flags = D_NEEDGIANT, }; static void smapi_identify(driver_t *, device_t); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sun May 1 16:49:32 2016 (r298889) +++ head/sys/sys/conf.h Sun May 1 17:46:56 2016 (r298890) @@ -138,7 +138,7 @@ typedef int dumper_t( #define D_TAPE 0x0001 #define D_DISK 0x0002 #define D_TTY 0x0004 -#define D_MEM 0x0008 +#define D_MEM 0x0008 /* /dev/(k)mem */ #ifdef _KERNEL From owner-svn-src-all@freebsd.org Sun May 1 17:48:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C328B2961C; Sun, 1 May 2016 17:48:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430921E79; Sun, 1 May 2016 17:48:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41Hmh1p042415; Sun, 1 May 2016 17:48:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41Hmh5i042414; Sun, 1 May 2016 17:48:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605011748.u41Hmh5i042414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 May 2016 17:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298891 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 17:48:44 -0000 Author: kib Date: Sun May 1 17:48:43 2016 New Revision: 298891 URL: https://svnweb.freebsd.org/changeset/base/298891 Log: Avoid duplicated calls to pmap_page_get_memattr(). Avoid logging inconsistency for the /dev/mem device at all. The driver leaves memattr intact, and the corrective action in the device pager handles it right. In the logged warning, name the driver we blame, and show memory attributes values. Reported and tested by: pho Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D6149 Modified: head/sys/vm/device_pager.c Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Sun May 1 17:46:56 2016 (r298890) +++ head/sys/vm/device_pager.c Sun May 1 17:48:43 2016 (r298891) @@ -299,7 +299,7 @@ old_dev_pager_fault(vm_object_t object, struct cdevsw *csw; struct file *fpop; struct thread *td; - vm_memattr_t memattr; + vm_memattr_t memattr, memattr1; int ref, ret; memattr = object->memattr; @@ -327,10 +327,18 @@ old_dev_pager_fault(vm_object_t object, /* If "paddr" is a real page, perform a sanity check on "memattr". */ if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL && - pmap_page_get_memattr(m_paddr) != memattr) { - memattr = pmap_page_get_memattr(m_paddr); - printf( - "WARNING: A device driver has set \"memattr\" inconsistently.\n"); + (memattr1 = pmap_page_get_memattr(m_paddr)) != memattr) { + /* + * For the /dev/mem d_mmap routine to return the + * correct memattr, pmap_page_get_memattr() needs to + * be called, which we do there. + */ + if ((csw->d_flags & D_MEM) == 0) { + printf("WARNING: Device driver %s has set " + "\"memattr\" inconsistently (drv %u pmap %u).\n", + csw->d_name, memattr, memattr1); + } + memattr = memattr1; } if (((*mres)->flags & PG_FICTITIOUS) != 0) { /* From owner-svn-src-all@freebsd.org Sun May 1 17:55:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46802B297F5; Sun, 1 May 2016 17:55:46 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10B2012F1; Sun, 1 May 2016 17:55:45 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41HtjEv045274; Sun, 1 May 2016 17:55:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41Htjj1045273; Sun, 1 May 2016 17:55:45 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201605011755.u41Htjj1045273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 1 May 2016 17:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298892 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 17:55:46 -0000 Author: gnn Date: Sun May 1 17:55:45 2016 New Revision: 298892 URL: https://svnweb.freebsd.org/changeset/base/298892 Log: Add a manual page for pkt-gen. Sponsored by: EMC / Isilon Storage Division Added: head/tools/tools/netmap/pkt-gen.8 (contents, props changed) Added: head/tools/tools/netmap/pkt-gen.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netmap/pkt-gen.8 Sun May 1 17:55:45 2016 (r298892) @@ -0,0 +1,179 @@ +.\" Copyright (c) 2016, George V. Neville-Neil +.\" 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 1, 2016 +.Dt PKT-GEN 8 +.Os +.Sh NAME +.Nm pkt-gen +.Nd Packet generator for use with +.Xr netmap 4 +.Sh SYNOPSIS +.Bl -item -compact +.It +.Nm +.Op Fl i Ar interface +.Op Fl f Ar function +.Op Fl n Ar count +.Op Fl t Ar pkts_to_send +.Op Fl r Ar pkts_to_receive +.Op Fl l Ar pkt_size +.Op Fl d Ar dst_ip[:port[-dst_ip:port]] +.Op Fl s Ar src_ip[:port[-src_ip:port]] +.Op Fl D Ar dst-mac +.Op Fl S Ar src-mac +.Op Fl a Ar cpu_id +.Op Fl b Ar burst size +.Op Fl c Ar cores +.Op Fl p Ar threads +.Op Fl T Ar report_ms +.Op Fl P +.Op Fl w Ar wait_for_link_time +.Op Fl R Ar rate +.Op Fl X +.Op Fl H Ar len +.Op Fl P Ar xfile +.Op Fl z +.Op Fl Z +.Sh DESCRIPTION +.Nm +generates and receives raw network packets using +.Xr netmap 4 . +The arguments are as follows: +.Pp +.Bl -tag -width Ds +.It Fl i Ar interface +Network interface name. +.It Fl f Ar function tx rx ping pong +Set the function to transmit, receive of ping/pong. +.It Fl n count +Number of iterations (can be 0). +.It Fl t pkts_to_send +Number of packets to send. Also forces transmit mode. +.It Fl r Ar pkts_to_receive +Number of packets to receive. Also forces rx mode. +.It Fl l Ar pkt_size +Packet size in bytes excluding CRC. +.It Fl d Ar dst_ip[:port[-dst_ip:port]] +Destination IPv4 address and port, single or range. +.It Fl s Ar src_ip[:port[-src_ip:port]] +Source IPv4 address and port, single or range. +.It Fl D Ar dst-mac +Destination MAC address in colon notation. +.It Fl S Ar src-mac +Source MAC address in colon notation. +.It Fl a Ar cpu_id +Tie +.Nm +to a particular CPU core using +.Xr setaffinity 2. +.It Fl b Ar burst size +Set the size of a burst of packets. +.It Fl c Ar cores +Number of cores to use. +.It Fl p Ar threads +Number of threads to use. +.It Fl T Ar report_ms +Number of milliseconds between reports. +.It Fl P +Use libpcap instead of netmap for reading or writing. +.It Fl w Ar wait_for_link_time +Number of seconds to wait to make sure that the network link is up. A +network device driver may take some time to create a new +transmit/receive ring pair when +.Xr netmap 4 +requests one. +.It Fl R Ar rate +Packet transmission rate. Not setting the packet transmission rate tells +.Nm +to transmit packets as quickly as possible. On servers from 2010 on-wards +.Xr netmap 4 +is able to completely use all of the bandwidth of a 10 or 40Gbps link, +so this option should be used unless your intention is to saturate the link. +.It Fl X +Dump payload transmitted or received. +.It Fl H Ar len +Add empty virtio-net-header with size 'len'. This option is only use +with Virtual Machine technologies that use virtio as a network interface. +.It Fl P Ar file +Load the packet from a pcap file rather than constructing it inside of +.Nm +.It Fl z +Use random IPv4 src address/port +.It Fl Z +Use random IPv4 dst address/port +.El +.Pp +.Nm +is a raw packet generator that can utilize either +.Xr netmap 4 +or +.Xr bpf 4 +but which is most often uses with +.Xr netmap 4 . +The +.Ar interface name +used depends upon how the underlying Ethernet driver exposes its +transmit and receive rings to +.Xr netmap 4 . +Most modern network interfaces that support 10Gbps and higher speeds +have several transmit and receive rings that are used by the operating +system to balance traffic across the interface. +.Nm +can peel off one or more of the transmit or receive rings for its own +use without interfering with packets that might otherwise be destined +for the host. For example on a system with a Chelsio Network +Interface Card (NIC) the interface specification of +.Ar -i netmap:ncxl0 +gives +.Nm +access to a pair of transmit and receive rings that are separate from +the more commonly known cxl0 interface, which is used by the operating +system's TCP/IP stack. +.Sh EXAMPLES +Capture and count all packets arriving on the operating system's cxl0 +interface. Using this will block packets from reaching the operating +system's network stack. +.Dl +.Pp +.Nm +-i cxl0 -f rx +.Pp +Send a stream of fake DNS packets between two hosts with a packet +length of 128 bytes. You must set the destination MAC address for +packets to be received by the target host. +.Pp +.Dl +.Nm +-i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 +.Sh FILES +.Xr netmap 4 +.Sh SEE ALSO +.Xr netmap 4 +.Sh AUTHORS +This manual page was written by +.An George V. Neville-Neil Aq gnn@FreeBSD.org . From owner-svn-src-all@freebsd.org Sun May 1 18:09:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E024B29AA4; Sun, 1 May 2016 18:09:36 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B24A51966; Sun, 1 May 2016 18:09:35 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41I9YQr048467; Sun, 1 May 2016 18:09:34 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41I9YsG048466; Sun, 1 May 2016 18:09:34 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201605011809.u41I9YsG048466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 1 May 2016 18:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298893 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 18:09:36 -0000 Author: bcr (doc committer) Date: Sun May 1 18:09:34 2016 New Revision: 298893 URL: https://svnweb.freebsd.org/changeset/base/298893 Log: Provide an example to the kqueue man page, showing a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D6082 Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Sun May 1 17:55:45 2016 (r298892) +++ head/lib/libc/sys/kqueue.2 Sun May 1 18:09:34 2016 (r298893) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2015 +.Dd May 1, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -603,6 +603,57 @@ will be set to indicate the error condit If the time limit expires, then .Fn kevent returns 0. +.Sh EXAMPLES +.Bd -literal -compact +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + struct kevent event; /* Event we want to monitor */ + struct kevent tevent; /* Event triggered */ + int kq, fd, ret; + + if (argc != 2) + err(EXIT_FAILURE, "Usage: %s path\en", argv[0]); + fd = open(argv[1], O_RDONLY); + if (fd == -1) + err(EXIT_FAILURE, "Failed to open '%s'", argv[1]); + + /* Create kqueue. */ + kq = kqueue(); + if (kq == -1) + err(EXIT_FAILURE, "kqueue() failed"); + + /* Initialize kevent structure. */ + EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE, + 0, NULL); + /* Attach event to the kqueue. */ + ret = kevent(kq, &event, 1, NULL, 0, NULL); + if (ret == -1) + err(EXIT_FAILURE, "kevent register"); + if (event.flags & EV_ERROR) + errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); + + for (;;) { + /* Sleep until something happens. */ + ret = kevent(kq, NULL, 0, &tevent, 1, NULL); + if (ret == -1) { + err(EXIT_FAILURE, "kevent wait"); + } else if (ret > 0) { + printf("Something was written in '%s'\en", argv[1]); + } + } +} +.Ed .Sh ERRORS The .Fn kqueue From owner-svn-src-all@freebsd.org Sun May 1 18:15:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C745AB29D89; Sun, 1 May 2016 18:15:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21591F96; Sun, 1 May 2016 18:15:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41IFelm051491; Sun, 1 May 2016 18:15:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41IFedJ051489; Sun, 1 May 2016 18:15:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605011815.u41IFedJ051489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 May 2016 18:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298894 - head/sys/dev/otus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 18:15:41 -0000 Author: avos Date: Sun May 1 18:15:40 2016 New Revision: 298894 URL: https://svnweb.freebsd.org/changeset/base/298894 Log: otus: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (from ieee80211_init_channels()). - Sort channels (ieee80211_add_channel_list_* requirement). - Add ic_getradiocaps() method. Added channels: 2GHz band: 12, 13 and 14. 5GHz band: 34, 38, 42, 46 and 165. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6145 Modified: head/sys/dev/otus/if_otus.c head/sys/dev/otus/if_otusreg.h Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Sun May 1 18:09:34 2016 (r298893) +++ head/sys/dev/otus/if_otus.c Sun May 1 18:15:40 2016 (r298894) @@ -132,6 +132,8 @@ static device_detach_t otus_detach; static int otus_attachhook(struct otus_softc *); void otus_get_chanlist(struct otus_softc *); +static void otus_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); int otus_load_firmware(struct otus_softc *, const char *, uint32_t); int otus_open_pipes(struct otus_softc *); @@ -624,7 +626,6 @@ otus_attachhook(struct otus_softc *sc) struct ieee80211com *ic = &sc->sc_ic; usb_device_request_t req; uint32_t in, out; - uint8_t bands[IEEE80211_MODE_BYTES]; int error; /* Not locked */ @@ -742,20 +743,8 @@ otus_attachhook(struct otus_softc *sc) /* Build the list of supported channels. */ otus_get_chanlist(sc); #else - /* Set supported .11b and .11g rates. */ - memset(bands, 0, sizeof(bands)); - if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) { - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - } - if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11A) { - setbit(bands, IEEE80211_MODE_11A); - } -#if 0 - if (sc->sc_ht) - setbit(bands, IEEE80211_MODE_11NG); -#endif - ieee80211_init_channels(ic, NULL, bands); + otus_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); #endif ieee80211_ifattach(ic); @@ -763,6 +752,7 @@ otus_attachhook(struct otus_softc *sc) ic->ic_scan_start = otus_scan_start; ic->ic_scan_end = otus_scan_end; ic->ic_set_channel = otus_set_channel; + ic->ic_getradiocaps = otus_getradiocaps; ic->ic_vap_create = otus_vap_create; ic->ic_vap_delete = otus_vap_delete; ic->ic_update_mcast = otus_update_mcast; @@ -820,6 +810,32 @@ otus_get_chanlist(struct otus_softc *sc) } } +static void +otus_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct otus_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + /* Set supported .11b and .11g rates. */ + memset(bands, 0, sizeof(bands)); + if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) { + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); +#if 0 + if (sc->sc_ht) + setbit(bands, IEEE80211_MODE_11NG); +#endif + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + ar_chans, 14, bands, 0); + } + if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11A) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + &ar_chans[14], nitems(ar_chans) - 14, bands, 0); + } +} + int otus_load_firmware(struct otus_softc *sc, const char *name, uint32_t addr) { Modified: head/sys/dev/otus/if_otusreg.h ============================================================================== --- head/sys/dev/otus/if_otusreg.h Sun May 1 18:09:34 2016 (r298893) +++ head/sys/dev/otus/if_otusreg.h Sun May 1 18:15:40 2016 (r298894) @@ -348,8 +348,8 @@ struct ar_evt_tx_comp { /* List of supported channels. */ static const uint8_t ar_chans[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, - 128, 132, 136, 140, 149, 153, 157, 161, 165, 34, 38, 42, 46 + 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, 100, 104, 108, + 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 }; /* From owner-svn-src-all@freebsd.org Sun May 1 18:53:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64BC7B2937E; Sun, 1 May 2016 18:53:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E4061D4D; Sun, 1 May 2016 18:53:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41IrClv063193; Sun, 1 May 2016 18:53:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41IrC6W063192; Sun, 1 May 2016 18:53:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605011853.u41IrC6W063192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 May 2016 18:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298895 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 18:53:13 -0000 Author: avos Date: Sun May 1 18:53:12 2016 New Revision: 298895 URL: https://svnweb.freebsd.org/changeset/base/298895 Log: rum: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (from ieee80211_init_channels()). - Add ic_getradiocaps() method. Added channels: 2GHz band: 12, 13 and 14. 5Ghz band: 34, 38, 42, 46 and 165. Tested with WUSB54GC, STA / MONITOR modes. Differential Revision: https://reviews.freebsd.org/D6125 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun May 1 18:15:40 2016 (r298894) +++ head/sys/dev/usb/wlan/if_rum.c Sun May 1 18:53:12 2016 (r298895) @@ -269,6 +269,8 @@ static int rum_raw_xmit(struct ieee8021 static void rum_scan_start(struct ieee80211com *); static void rum_scan_end(struct ieee80211com *); static void rum_set_channel(struct ieee80211com *); +static void rum_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static int rum_get_rssi(struct rum_softc *, uint8_t); static void rum_ratectl_start(struct rum_softc *, struct ieee80211_node *); @@ -336,6 +338,14 @@ static const struct { { 107, 0x04 } }; +static const uint8_t rum_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + +static const uint8_t rum_chan_5ghz[] = + { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, + 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 149, 153, 157, 161, 165 }; + static const struct rfprog { uint8_t chan; uint32_t r1, r2, r3, r4; @@ -477,7 +487,6 @@ rum_attach(device_t self) struct rum_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error, ntries; @@ -548,12 +557,8 @@ rum_attach(device_t self) IEEE80211_CRYPTO_TKIPMIC | IEEE80211_CRYPTO_TKIP; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + rum_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_update_promisc = rum_update_promisc; @@ -561,6 +566,7 @@ rum_attach(device_t self) ic->ic_scan_start = rum_scan_start; ic->ic_scan_end = rum_scan_end; ic->ic_set_channel = rum_set_channel; + ic->ic_getradiocaps = rum_getradiocaps; ic->ic_transmit = rum_transmit; ic->ic_parent = rum_parent; ic->ic_vap_create = rum_vap_create; @@ -3165,6 +3171,26 @@ rum_set_channel(struct ieee80211com *ic) RUM_UNLOCK(sc); } +static void +rum_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct rum_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rum_chan_2ghz, nitems(rum_chan_2ghz), bands, 0); + + if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + rum_chan_5ghz, nitems(rum_chan_5ghz), bands, 0); + } +} + static int rum_get_rssi(struct rum_softc *sc, uint8_t raw) { From owner-svn-src-all@freebsd.org Sun May 1 19:37:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A504B29C02; Sun, 1 May 2016 19:37:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0CF31DA4; Sun, 1 May 2016 19:37:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41JbZ9A075522; Sun, 1 May 2016 19:37:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41JbXYZ075508; Sun, 1 May 2016 19:37:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011937.u41JbXYZ075508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 19:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298896 - in head/lib: libedit libfetch libgssapi libkiconv libkvm libpmc libsdp libusb libvmmapi msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 19:37:36 -0000 Author: pfg Date: Sun May 1 19:37:33 2016 New Revision: 298896 URL: https://svnweb.freebsd.org/changeset/base/298896 Log: lib: minor spelling fixes in comments. No functional change. Modified: head/lib/libedit/chartype.h head/lib/libedit/refresh.c head/lib/libfetch/common.c head/lib/libgssapi/gss_accept_sec_context.c head/lib/libkiconv/quirks.c head/lib/libkvm/kvm.c head/lib/libkvm/kvm_pcpu.c head/lib/libkvm/kvm_vnet.c head/lib/libpmc/libpmc.c head/lib/libsdp/sdp.h head/lib/libusb/libusb20_desc.c head/lib/libvmmapi/vmmapi.h head/lib/msun/src/k_rem_pio2.c head/lib/msun/src/s_cbrt.c Modified: head/lib/libedit/chartype.h ============================================================================== --- head/lib/libedit/chartype.h Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libedit/chartype.h Sun May 1 19:37:33 2016 (r298896) @@ -204,11 +204,11 @@ protected size_t ct_enc_width(Char); #endif #ifndef NARROWCHAR -/* Encode a characted into the destination buffer, provided there is sufficent +/* Encode a characted into the destination buffer, provided there is sufficient * buffer space available. Returns the number of bytes used up (zero if the * character cannot be encoded, -1 if there was not enough space available). */ -/* The maximum buffer size to hold the most unwieldly visual representation, +/* The maximum buffer size to hold the most unwieldy visual representation, * in this case \U+nnnnn. */ #define VISUAL_WIDTH_MAX ((size_t)8) Modified: head/lib/libedit/refresh.c ============================================================================== --- head/lib/libedit/refresh.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libedit/refresh.c Sun May 1 19:37:33 2016 (r298896) @@ -561,7 +561,7 @@ re_update_line(EditLine *el, Char *old, nls = ++n; /* - * find same begining and same end + * find same beginning and same end */ osb = ols; nsb = nls; Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libfetch/common.c Sun May 1 19:37:33 2016 (r298896) @@ -471,7 +471,7 @@ fetch_ssl_hname_match(const char *h, siz if (!fetch_ssl_hname_equal(hdot - delta, delta, mdot1 - delta, delta)) return (0); - /* all tests succeded, it's a match */ + /* all tests succeeded, it's a match */ return (1); } @@ -1349,7 +1349,7 @@ fetch_netrc_auth(struct url *url) * which the proxy should not be consulted; the contents is a comma-, * or space-separated list of domain names. A single asterisk will * override all proxy variables and no transactions will be proxied - * (for compatability with lynx and curl, see the discussion at + * (for compatibility with lynx and curl, see the discussion at * ). */ int Modified: head/lib/libgssapi/gss_accept_sec_context.c ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libgssapi/gss_accept_sec_context.c Sun May 1 19:37:33 2016 (r298896) @@ -135,7 +135,7 @@ choose_mech(const gss_buffer_t input, gs return (GSS_S_COMPLETE); } else if (input->length == 0) { /* - * There is the a wierd mode of SPNEGO (in CIFS and + * There is the a weird mode of SPNEGO (in CIFS and * SASL GSS-SPENGO where the first token is zero * length and the acceptor returns a mech_list, lets * hope that is what is happening now. Modified: head/lib/libkiconv/quirks.c ============================================================================== --- head/lib/libkiconv/quirks.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libkiconv/quirks.c Sun May 1 19:37:33 2016 (r298896) @@ -41,10 +41,10 @@ * * For example, the eucJP and Unocode mapping rule is based on * the JIS standard. Since Microsoft uses cp932 for Unicode mapping - * witch is not truly based on the JIS standard, reading a file + * which is not truly based on the JIS standard, reading a file * system created by Microsoft Windows family using eucJP/Unicode * mapping rule will cause a problem. That's why we define eucJP-ms here. - * The eucJP-ms has been defined by The Open Group Japan Vendor Coucil. + * The eucJP-ms has been defined by The Open Group Japan Vendor Council. * * Well, Apple Mac OS also has their own Unicode mappings, * but we won't require these quirks here, because HFS doesn't have Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libkvm/kvm.c Sun May 1 19:37:33 2016 (r298896) @@ -237,7 +237,7 @@ _kvm_is_minidump(kvm_t *kd) * header from the core before treating it as an ELF header. * * We can add that here if we can get a change to libelf to support - * an inital offset into the file. Alternatively we could patch + * an initial offset into the file. Alternatively we could patch * savecore to extract cores from a regular file instead. */ int @@ -756,7 +756,7 @@ kvm_nlist2(kvm_t *kd, struct kvm_nlist * { /* - * If called via the public interface, permit intialization of + * If called via the public interface, permit initialization of * further virtualized modules on demand. */ return (_kvm_nlist(kd, nl, 1)); Modified: head/lib/libkvm/kvm_pcpu.c ============================================================================== --- head/lib/libkvm/kvm_pcpu.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libkvm/kvm_pcpu.c Sun May 1 19:37:33 2016 (r298896) @@ -266,7 +266,7 @@ _kvm_dpcpu_init(kvm_t *kd) } /* - * Check whether the dpcpu module has been initialized sucessfully or not, + * Check whether the dpcpu module has been initialized successfully or not, * initialize it if permitted. */ int Modified: head/lib/libkvm/kvm_vnet.c ============================================================================== --- head/lib/libkvm/kvm_vnet.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libkvm/kvm_vnet.c Sun May 1 19:37:33 2016 (r298896) @@ -127,7 +127,7 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid /* * First, find the process for this pid. If we are working on a - * dump, either locate the thread dumptid is refering to or proc0. + * dump, either locate the thread dumptid is referring to or proc0. * Based on either, take the address of the ucred. */ credp = 0; @@ -208,7 +208,7 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid } /* - * Check whether the vnet module has been initialized sucessfully + * Check whether the vnet module has been initialized successfully * or not, initialize it if permitted. */ int Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libpmc/libpmc.c Sun May 1 19:37:33 2016 (r298896) @@ -3240,7 +3240,7 @@ pmc_init(void) if (PMC_CALL(GETMODULEVERSION, &abi_version) < 0) return (pmc_syscall = -1); - /* ignore patch & minor numbers for the comparision */ + /* ignore patch & minor numbers for the comparison */ if ((abi_version & 0xFF000000) != (PMC_VERSION & 0xFF000000)) { errno = EPROGMISMATCH; return (pmc_syscall = -1); Modified: head/lib/libsdp/sdp.h ============================================================================== --- head/lib/libsdp/sdp.h Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libsdp/sdp.h Sun May 1 19:37:33 2016 (r298896) @@ -561,7 +561,7 @@ void sdp_print (uint3 * bdaddr_t bdaddr; local BD_ADDR (or ANY) * profile data[pdu->len - sizeof(uuid) - sizeof(bdaddr)] * - * in successful reponse additional data will contain 4 bytes record handle + * in successful response additional data will contain 4 bytes record handle * * * SDP_PDU_SERVICE_UNREGISTER_REQUEST Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libusb/libusb20_desc.c Sun May 1 19:37:33 2016 (r298896) @@ -135,7 +135,7 @@ libusb20_parse_config_desc(const void *c /* * Make a copy of the config descriptor, so that the caller can free - * the inital config descriptor pointer! + * the initial config descriptor pointer! */ memcpy((void *)(lub_endpoint + nendpoint), config_desc, pcdesc.len); Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sun May 1 18:53:12 2016 (r298895) +++ head/lib/libvmmapi/vmmapi.h Sun May 1 19:37:33 2016 (r298896) @@ -176,7 +176,7 @@ int vm_get_hpet_capabilities(struct vmct /* * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. - * The 'iovcnt' should be big enough to accomodate all GPA segments. + * The 'iovcnt' should be big enough to accommodate all GPA segments. * * retval fault Interpretation * 0 0 Success Modified: head/lib/msun/src/k_rem_pio2.c ============================================================================== --- head/lib/msun/src/k_rem_pio2.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/msun/src/k_rem_pio2.c Sun May 1 19:37:33 2016 (r298896) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); * jk+1 must be 2 larger than you might expect so that our * recomputation test works. (Up to 24 bits in the integer * part (the 24 bits of it that we compute) and 23 bits in - * the fraction part may be lost to cancelation before we + * the fraction part may be lost to cancellation before we * recompute.) * * jz local integer variable indicating the number of Modified: head/lib/msun/src/s_cbrt.c ============================================================================== --- head/lib/msun/src/s_cbrt.c Sun May 1 18:53:12 2016 (r298895) +++ head/lib/msun/src/s_cbrt.c Sun May 1 19:37:33 2016 (r298896) @@ -59,7 +59,7 @@ cbrt(double x) * error of about 1 in 16. Adding a bias of -0.03306235651 to the * (e%3+m)/3 term reduces the error to about 1 in 32. With the IEEE * floating point representation, for finite positive normal values, - * ordinary integer divison of the value in bits magically gives + * ordinary integer division of the value in bits magically gives * almost exactly the RHS of the above provided we first subtract the * exponent bias (1023 for doubles) and later add it back. We do the * subtraction virtually to keep e >= 0 so that ordinary integer From owner-svn-src-all@freebsd.org Sun May 1 19:39:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16A03B29CA2; Sun, 1 May 2016 19:39:25 +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 CC9A11F39; Sun, 1 May 2016 19:39:24 +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 u41JdOHi075626; Sun, 1 May 2016 19:39:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41JdNIU075622; Sun, 1 May 2016 19:39:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605011939.u41JdNIU075622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 19:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298897 - in head/libexec: ftpd rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 19:39:25 -0000 Author: pfg Date: Sun May 1 19:39:23 2016 New Revision: 298897 URL: https://svnweb.freebsd.org/changeset/base/298897 Log: libexec: minor spelling fixes in comments. No functional change. Modified: head/libexec/ftpd/ftpd.c head/libexec/ftpd/popen.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Sun May 1 19:37:33 2016 (r298896) +++ head/libexec/ftpd/ftpd.c Sun May 1 19:39:23 2016 (r298897) @@ -2048,7 +2048,7 @@ pdata_err: } while (0) /* - * Tranfer the contents of "instr" to "outstr" peer using the appropriate + * Transfer the contents of "instr" to "outstr" peer using the appropriate * encapsulation of the data subject to Mode, Structure, and Type. * * NB: Form isn't handled. Modified: head/libexec/ftpd/popen.c ============================================================================== --- head/libexec/ftpd/popen.c Sun May 1 19:37:33 2016 (r298896) +++ head/libexec/ftpd/popen.c Sun May 1 19:39:23 2016 (r298897) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #define MAXGLOBARGS 1000 /* - * Special version of popen which avoids call to shell. This ensures noone + * Special version of popen which avoids call to shell. This ensures no one * may create a pipe to a hidden program as a side effect of a list or dir * command. */ Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Sun May 1 19:37:33 2016 (r298896) +++ head/libexec/rtld-elf/malloc.c Sun May 1 19:39:23 2016 (r298897) @@ -328,7 +328,7 @@ free(cp) * old malloc man page, it realloc's an already freed block. Usually * this is the last block it freed; occasionally it might be farther * back. We have to search all the free lists for the block in order - * to determine its bucket: 1st we make one pass thru the lists + * to determine its bucket: 1st we make one pass through the lists * checking only the first block in each; if that fails we search * ``realloc_srchlen'' blocks in each list for a match (the variable * is extern so the caller can modify it). If that fails we just copy Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun May 1 19:37:33 2016 (r298896) +++ head/libexec/rtld-elf/rtld.c Sun May 1 19:39:23 2016 (r298897) @@ -822,7 +822,7 @@ origin_subst_one(Obj_Entry *obj, char *r kw_len = strlen(kw); /* - * First, count the number of the keyword occurences, to + * First, count the number of the keyword occurrences, to * preallocate the final string. */ for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) { From owner-svn-src-all@freebsd.org Sun May 1 20:54:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 780E5B29F7E; Sun, 1 May 2016 20:54: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 458381952; Sun, 1 May 2016 20:54: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 u41KsTbr000419; Sun, 1 May 2016 20:54:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41KsTSQ000418; Sun, 1 May 2016 20:54:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605012054.u41KsTSQ000418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 May 2016 20:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298898 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 20:54:30 -0000 Author: kib Date: Sun May 1 20:54:29 2016 New Revision: 298898 URL: https://svnweb.freebsd.org/changeset/base/298898 Log: As a reader service, explain NOTE_LINK reporting for the directories. Submitted by: Vladimir Kondratyev MFC after: 1 week Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Sun May 1 19:39:23 2016 (r298897) +++ head/lib/libc/sys/kqueue.2 Sun May 1 20:54:29 2016 (r298898) @@ -381,6 +381,10 @@ The file referenced by the descriptor wa The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK The link count on the file changed. +In particular, the +.Dv NOTE_LINK +event is reported if a subdirectory was created or deleted inside +the directory referenced by the descriptor. .It Dv NOTE_RENAME The file referenced by the descriptor was renamed. .It Dv NOTE_REVOKE From owner-svn-src-all@freebsd.org Sun May 1 20:57:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49256B2901E; Sun, 1 May 2016 20:57:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1165F1BD6; Sun, 1 May 2016 20:57:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41KvBNP000717; Sun, 1 May 2016 20:57:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41KvBs8000714; Sun, 1 May 2016 20:57:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605012057.u41KvBs8000714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 May 2016 20:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298899 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 20:57:12 -0000 Author: avos Date: Sun May 1 20:57:10 2016 New Revision: 298899 URL: https://svnweb.freebsd.org/changeset/base/298899 Log: net80211: calculate IEEE80211_MODE_BYTES / IEEE80211_CHAN_BYTES instead of hardcoding it. Suggested by: adrian Modified: head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Sun May 1 20:54:29 2016 (r298898) +++ head/sys/net80211/_ieee80211.h Sun May 1 20:57:10 2016 (r298899) @@ -70,7 +70,7 @@ enum ieee80211_phymode { IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ }; #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) -#define IEEE80211_MODE_BYTES 2 /* howmany(IEEE80211_MODE_MAX, NBBY) */ +#define IEEE80211_MODE_BYTES howmany(IEEE80211_MODE_MAX, NBBY) /* * Operating mode. Devices do not necessarily support @@ -147,7 +147,7 @@ struct ieee80211_channel { }; #define IEEE80211_CHAN_MAX 256 -#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ +#define IEEE80211_CHAN_BYTES howmany(IEEE80211_CHAN_MAX, NBBY) #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ #define IEEE80211_CHAN_ANYC \ ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun May 1 20:54:29 2016 (r298898) +++ head/sys/net80211/ieee80211_freebsd.h Sun May 1 20:57:10 2016 (r298899) @@ -28,7 +28,7 @@ #define _NET80211_IEEE80211_FREEBSD_H_ #ifdef _KERNEL -#include +#include #include #include #include From owner-svn-src-all@freebsd.org Sun May 1 21:07:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5729CB297D8; Sun, 1 May 2016 21:07:01 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE001832; Sun, 1 May 2016 21:07:01 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41L70fI003866; Sun, 1 May 2016 21:07:00 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41L6xY8003858; Sun, 1 May 2016 21:06:59 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605012106.u41L6xY8003858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 1 May 2016 21:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298900 - in head/sys/boot: common efi/libefi i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 21:07:01 -0000 Author: allanjude Date: Sun May 1 21:06:59 2016 New Revision: 298900 URL: https://svnweb.freebsd.org/changeset/base/298900 Log: bcache read ahead may attempt to read past end of disk The new bcache code does not know the size of the disk, and therefore may attempt to read past the end of the disk while trying to fill its read-ahead cache. This is usually not an issue, it fails gracefully on all of my machines, but some BIOSes seem to retry the reads for up to 30 seconds each, resulting in a long stall during boot Submitted by: Toomas Soome Reviewed by: jhb, np Differential Revision: https://reviews.freebsd.org/D6109 Modified: head/sys/boot/common/bcache.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/common/bcache.c ============================================================================== --- head/sys/boot/common/bcache.c Sun May 1 20:57:10 2016 (r298899) +++ head/sys/boot/common/bcache.c Sun May 1 21:06:59 2016 (r298900) @@ -272,20 +272,43 @@ read_strategy(void *devdata, int rw, dad for (i = 0; i < p_size; i++) { bcache_invalidate(bc, p_blk + i); } + r_size = 0; + /* + * with read-ahead, it may happen we are attempting to read past + * disk end, as bcache has no information about disk size. + * in such case we should get partial read if some blocks can be + * read or error, if no blocks can be read. + * in either case we should return the data in bcache and only + * return error if there is no data. + */ result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0, p_size * bcache_blksize, p_buf, &r_size); - if (result) - goto done; - r_size /= bcache_blksize; for (i = 0; i < r_size; i++) bcache_insert(bc, p_blk + i); - bcache_rablks += ra; - bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, buf, - size); + /* update ra statistics */ + if (r_size != 0) { + if (r_size < p_size) + bcache_rablks += (p_size - r_size); + else + bcache_rablks += ra; + } + + /* check how much data can we copy */ + for (i = 0; i < nblk; i++) { + if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) + break; + } + + size = i * bcache_blksize; + if (size != 0) { + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, + buf, size); + result = 0; + } done: if ((result == 0) && (rsize != NULL)) @@ -349,8 +372,16 @@ bcache_strategy(void *devdata, int rw, d ret = read_strategy(devdata, rw, blk, offset, csize, buf+total, &isize); - if (ret != 0) - return (ret); + + /* + * we may have error from read ahead, if we have read some data + * return partial read. + */ + if (ret != 0 || isize == 0) { + if (total != 0) + ret = 0; + break; + } blk += (offset+isize) / bcache_blksize; offset = 0; total += isize; Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Sun May 1 20:57:10 2016 (r298899) +++ head/sys/boot/efi/libefi/efipart.c Sun May 1 21:06:59 2016 (r298900) @@ -321,6 +321,15 @@ efipart_realstrategy(void *devdata, int if (size == 0 || (size % 512) != 0) return (EIO); + off = blk * 512; + /* make sure we don't read past disk end */ + if ((off + size) / blkio->Media->BlockSize - 1 > + blkio->Media->LastBlock) { + size = blkio->Media->LastBlock + 1 - + off / blkio->Media->BlockSize; + size = size * blkio->Media->BlockSize; + } + if (rsize != NULL) *rsize = size; @@ -335,7 +344,6 @@ efipart_realstrategy(void *devdata, int return (ENOMEM); error = 0; - off = blk * 512; blk = off / blkio->Media->BlockSize; blkoff = off % blkio->Media->BlockSize; blksz = blkio->Media->BlockSize - blkoff; Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Sun May 1 20:57:10 2016 (r298899) +++ head/sys/boot/i386/libi386/bioscd.c Sun May 1 21:06:59 2016 (r298900) @@ -271,14 +271,25 @@ bc_realstrategy(void *devdata, int rw, d if (rsize) *rsize = 0; - if (blks && bc_read(unit, dblk, blks, buf)) { + if ((blks = bc_read(unit, dblk, blks, buf)) < 0) { DEBUG("read error"); return (EIO); + } else { + if (size / BIOSCD_SECSIZE > blks) { + if (rsize) + *rsize = blks * BIOSCD_SECSIZE; + return (0); + } } #ifdef BD_SUPPORT_FRAGS DEBUG("frag read %d from %lld+%d to %p", fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE)); - if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) { + if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf) != 1) { + if (blks) { + if (rsize) + *rsize = blks * BIOSCD_SECSIZE; + return (0); + } DEBUG("frag read error"); return(EIO); } @@ -292,6 +303,7 @@ bc_realstrategy(void *devdata, int rw, d /* Max number of sectors to bounce-buffer at a time. */ #define CD_BOUNCEBUF 8 +/* return negative value for an error, otherwise blocks read */ static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest) { @@ -368,6 +380,8 @@ bc_read(int unit, daddr_t dblk, int blks result = V86_CY(v86.efl); if (result == 0) break; + /* fall back to 1 sector read */ + x = 1; } #ifdef DISK_DEBUG @@ -376,6 +390,11 @@ bc_read(int unit, daddr_t dblk, int blks DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), result ? "failed" : "ok"); DEBUG("unit %d status 0x%x", unit, error); + + /* still an error? break off */ + if (result != 0) + break; + if (bbuf != NULL) bcopy(bbuf, p, x * BIOSCD_SECSIZE); p += (x * BIOSCD_SECSIZE); @@ -384,7 +403,11 @@ bc_read(int unit, daddr_t dblk, int blks } /* hexdump(dest, (blks * BIOSCD_SECSIZE)); */ - return(0); + + if (blks - resid == 0) + return (-1); /* read failed */ + + return (blks - resid); } /* Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Sun May 1 20:57:10 2016 (r298899) +++ head/sys/boot/i386/libi386/biosdisk.c Sun May 1 21:06:59 2016 (r298900) @@ -508,6 +508,18 @@ bd_realstrategy(void *devdata, int rw, d if (rsize) *rsize = 0; + if (dblk >= BD(dev).bd_sectors) { + DEBUG("IO past disk end %llu", (unsigned long long)dblk); + return (EIO); + } + + if (dblk + blks > BD(dev).bd_sectors) { + /* perform partial read */ + blks = BD(dev).bd_sectors - dblk; + size = blks * BD(dev).bd_sectorsize; + DEBUG("short read %d", blks); + } + switch(rw){ case F_READ: DEBUG("read %d from %lld to %p", blks, dblk, buf); From owner-svn-src-all@freebsd.org Sun May 1 21:17:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A05B29AA5; Sun, 1 May 2016 21:17:32 +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 239F01E8B; Sun, 1 May 2016 21:17:32 +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 u41LHVqF007200; Sun, 1 May 2016 21:17:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41LHV7b007197; Sun, 1 May 2016 21:17:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605012117.u41LHV7b007197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 1 May 2016 21:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298901 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 21:17:32 -0000 Author: pfg Date: Sun May 1 21:17:30 2016 New Revision: 298901 URL: https://svnweb.freebsd.org/changeset/base/298901 Log: restore: promote some getfiles() parameters to size_t. This is based on a change from OpenBSD: "Fix restore so that it can actually restore files larger than 4GB by changing the type of "size" to off_t in getfiles() plus little dependent type cleanup, from Daniel Lucq." It is an important for machines with 32 bit longs. While here unsign the flags, also from OpenBSD. Obtained from: OpenBSD (through bitrig, I hate CVS) MFC after: 2 weeks Modified: head/sbin/restore/dirs.c head/sbin/restore/extern.h head/sbin/restore/tape.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Sun May 1 21:06:59 2016 (r298900) +++ head/sbin/restore/dirs.c Sun May 1 21:17:30 2016 (r298901) @@ -85,7 +85,7 @@ struct modeinfo { mode_t mode; uid_t uid; gid_t gid; - int flags; + u_int flags; int extsize; }; @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct static void flushent(void); static struct inotab *inotablookup(ino_t); static RST_DIR *opendirfile(const char *); -static void putdir(char *, long); -static void putdirattrs(char *, long); +static void putdir(char *, size_t); +static void putdirattrs(char *, size_t); static void putent(struct direct *); static void rst_seekdir(RST_DIR *, long, long); static long rst_telldir(RST_DIR *); @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) * Put the directory entries in the directory file */ static void -putdir(char *buf, long size) +putdir(char *buf, size_t size) { struct direct *dp; - long loc, i; + size_t loc, i; for (loc = 0; loc < size; ) { dp = (struct direct *)(buf + loc); @@ -356,12 +356,12 @@ putdir(char *buf, long size) "reclen not multiple of 4 "); if (dp->d_reclen < DIRSIZ(0, dp)) vprintf(stdout, - "reclen less than DIRSIZ (%d < %zu) ", + "reclen less than DIRSIZ (%u < %zu) ", dp->d_reclen, DIRSIZ(0, dp)); #if NAME_MAX < 255 if (dp->d_namlen > NAME_MAX) vprintf(stdout, - "reclen name too big (%d > %d) ", + "reclen name too big (%u > %u) ", dp->d_namlen, NAME_MAX); #endif vprintf(stdout, "\n"); @@ -418,7 +418,7 @@ flushent(void) * Save extended attributes for a directory entry to a file. */ static void -putdirattrs(char *buf, long size) +putdirattrs(char *buf, size_t size) { if (mf != NULL && fwrite(buf, size, 1, mf) != 1) Modified: head/sbin/restore/extern.h ============================================================================== --- head/sbin/restore/extern.h Sun May 1 21:06:59 2016 (r298900) +++ head/sbin/restore/extern.h Sun May 1 21:17:30 2016 (r298901) @@ -54,8 +54,8 @@ void freeentry(struct entry *); void freename(char *); int genliteraldir(char *, ino_t); char *gentempname(struct entry *); -void getfile(void (*)(char *, long), void (*)(char *, long), - void (*)(char *, long)); +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), + void (*)(char *, size_t)); void getvol(long); void initsymtable(char *); int inodetype(ino_t); @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); void treescan(char *, ino_t, long (*)(char *, ino_t, int)); ino_t upperbnd(ino_t); long verifyfile(char *, ino_t, int); -void xtrnull(char *, long); +void xtrnull(char *, size_t); /* From ../dump/dumprmt.c */ void rmtclose(void); Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sun May 1 21:06:59 2016 (r298900) +++ head/sbin/restore/tape.c Sun May 1 21:17:30 2016 (r298901) @@ -104,10 +104,10 @@ static int checksum(int *); static void findinode(struct s_spcl *); static void findtapeblksize(void); static char *setupextattr(int); -static void xtrattr(char *, long); +static void xtrattr(char *, size_t); static void set_extattr_link(char *, void *, int); static void set_extattr_fd(int, char *, void *, int); -static void skiphole(void (*)(char *, long), long *); +static void skiphole(void (*)(char *, size_t), size_t *); static int gethead(struct s_spcl *); static void readtape(char *); static void setdumpnum(void); @@ -115,12 +115,12 @@ static u_long swabl(u_long); static u_char *swablong(u_char *, int); static u_char *swabshort(u_char *, int); static void terminateinput(void); -static void xtrfile(char *, long); -static void xtrlnkfile(char *, long); -static void xtrlnkskip(char *, long); -static void xtrmap(char *, long); -static void xtrmapskip(char *, long); -static void xtrskip(char *, long); +static void xtrfile(char *, size_t); +static void xtrlnkfile(char *, size_t); +static void xtrlnkskip(char *, size_t); +static void xtrmap(char *, size_t); +static void xtrmapskip(char *, size_t); +static void xtrskip(char *, size_t); /* * Set up an input source @@ -566,7 +566,7 @@ printdumpinfo(void) int extractfile(char *name) { - int flags; + u_int flags; uid_t uid; gid_t gid; mode_t mode; @@ -932,7 +932,7 @@ skipfile(void) * Skip a hole in an output file */ static void -skiphole(void (*skip)(char *, long), long *seekpos) +skiphole(void (*skip)(char *, size_t), size_t *seekpos) { char buf[MAXBSIZE]; @@ -949,14 +949,14 @@ skiphole(void (*skip)(char *, long), lon * to the skip function. */ void -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), - void (*skip)(char *, long)) +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), + void (*skip)(char *, size_t)) { int i; - off_t size; - long seekpos; + volatile off_t size; + size_t seekpos; int curblk, attrsize; - void (*fillit)(char *, long); + void (*fillit)(char *, size_t); char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; char junk[TP_BSIZE]; @@ -1093,7 +1093,7 @@ setupextattr(int extsize) * Extract the next block of extended attributes. */ static void -xtrattr(char *buf, long size) +xtrattr(char *buf, size_t size) { if (extloc + size > extbufsize) @@ -1106,7 +1106,7 @@ xtrattr(char *buf, long size) * Write out the next block of a file. */ static void -xtrfile(char *buf, long size) +xtrfile(char *buf, size_t size) { if (Nflag) @@ -1123,7 +1123,7 @@ xtrfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrskip(char *buf, long size) +xtrskip(char *buf, size_t size) { if (lseek(ofile, size, SEEK_CUR) == -1) { @@ -1138,7 +1138,7 @@ xtrskip(char *buf, long size) * Collect the next block of a symbolic link. */ static void -xtrlnkfile(char *buf, long size) +xtrlnkfile(char *buf, size_t size) { pathlen += size; @@ -1155,7 +1155,7 @@ xtrlnkfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrlnkskip(char *buf, long size) +xtrlnkskip(char *buf, size_t size) { fprintf(stderr, "unallocated block in symbolic link %s\n", @@ -1167,7 +1167,7 @@ xtrlnkskip(char *buf, long size) * Collect the next block of a bit map. */ static void -xtrmap(char *buf, long size) +xtrmap(char *buf, size_t size) { memmove(map, buf, size); @@ -1179,7 +1179,7 @@ xtrmap(char *buf, long size) */ /* ARGSUSED */ static void -xtrmapskip(char *buf, long size) +xtrmapskip(char *buf, size_t size) { panic("hole in map\n"); @@ -1191,7 +1191,7 @@ xtrmapskip(char *buf, long size) */ /* ARGSUSED */ void -xtrnull(char *buf, long size) +xtrnull(char *buf, size_t size) { return; From owner-svn-src-all@freebsd.org Sun May 1 21:48:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B491DB29302; Sun, 1 May 2016 21:48:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5E01DFB; Sun, 1 May 2016 21:48:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41LmtLJ016228; Sun, 1 May 2016 21:48:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41Lmt1Y016222; Sun, 1 May 2016 21:48:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605012148.u41Lmt1Y016222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 1 May 2016 21:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298902 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 21:48:56 -0000 Author: tuexen Date: Sun May 1 21:48:55 2016 New Revision: 298902 URL: https://svnweb.freebsd.org/changeset/base/298902 Log: When a client uses UDP encapsulation and lists IP addresses in the INIT chunk, enable UDP encapsulation for all those addresses. This helps clients using a userland stack to support multihoming if they are not behind a NAT. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet/sctp_input.c Sun May 1 21:48:55 2016 (r298902) @@ -465,7 +465,7 @@ sctp_process_init_ack(struct mbuf *m, in /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, (offset + sizeof(struct sctp_init_chunk)), initack_limit, - src, dst, NULL))) { + src, dst, NULL, stcb->asoc.port))) { op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Problem with address parameters"); SCTPDBG(SCTP_DEBUG_INPUT1, @@ -1672,7 +1672,7 @@ sctp_process_cookie_existing(struct mbuf */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; return (NULL); @@ -1799,7 +1799,7 @@ sctp_process_cookie_existing(struct mbuf } if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; return (NULL); @@ -2011,7 +2011,7 @@ sctp_process_cookie_existing(struct mbuf if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; @@ -2123,6 +2123,7 @@ sctp_process_cookie_new(struct mbuf *m, stcb = sctp_aloc_assoc(inp, init_src, &error, ntohl(initack_cp->init.initiate_tag), vrf_id, ntohs(initack_cp->init.num_outbound_streams), + port, (struct thread *)NULL ); if (stcb == NULL) { @@ -2212,7 +2213,7 @@ sctp_process_cookie_new(struct mbuf *m, /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, - src, dst, init_src)) { + src, dst, init_src, port)) { atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2371,12 +2372,6 @@ sctp_process_cookie_new(struct mbuf *m, (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, SCTP_RTT_FROM_NON_DATA); -#if defined(INET) || defined(INET6) - if (((*netp)->port == 0) && (port != 0)) { - sctp_pathmtu_adjustment(stcb, (uint16_t) ((*netp)->mtu - sizeof(struct udphdr))); - } - (*netp)->port = port; -#endif } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2718,7 +2713,7 @@ sctp_handle_cookie_echo(struct mbuf *m, */ if (netl == NULL) { /* TSNH! Huh, why do I need to add this address here? */ - if (sctp_add_remote_addr(*stcb, to, NULL, (*stcb)->asoc.port, + if (sctp_add_remote_addr(*stcb, to, NULL, port, SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { return (NULL); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet/sctp_output.c Sun May 1 21:48:55 2016 (r298902) @@ -12765,8 +12765,8 @@ sctp_lower_sosend(struct socket *so, #endif stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, - p - ); + inp->sctp_ep.port, + p); if (stcb == NULL) { /* Error is setup for us in the call */ goto out_unlocked; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet/sctp_pcb.c Sun May 1 21:48:55 2016 (r298902) @@ -4045,7 +4045,7 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.smallest_mtu = net->mtu; } if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; + sctp_pathmtu_adjustment(stcb, net->mtu); } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4191,7 +4191,7 @@ try_again: struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t vrf_id, - uint16_t o_streams, + uint16_t o_streams, uint16_t port, struct thread *p ) { @@ -4384,7 +4384,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, LIST_INSERT_HEAD(head, stcb, sctp_asocs); SCTP_INP_INFO_WUNLOCK(); - if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, asoc->port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { + if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { /* failure.. memory error? */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); @@ -6068,7 +6068,7 @@ int sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, int offset, int limit, struct sockaddr *src, struct sockaddr *dst, - struct sockaddr *altsa) + struct sockaddr *altsa, uint16_t port) { /* * grub through the INIT pulling addresses and loading them to the @@ -6159,7 +6159,7 @@ sctp_load_addresses_from_init(struct sct #ifdef INET case AF_INET: if (stcb->asoc.scope.ipv4_addr_legal) { - if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { + if (sctp_add_remote_addr(stcb, sa, NULL, port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { return (-1); } } @@ -6168,7 +6168,7 @@ sctp_load_addresses_from_init(struct sct #ifdef INET6 case AF_INET6: if (stcb->asoc.scope.ipv6_addr_legal) { - if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { + if (sctp_add_remote_addr(stcb, sa, NULL, port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { return (-2); } } @@ -6253,7 +6253,7 @@ sctp_load_addresses_from_init(struct sct /* the assoc was freed? */ return (-7); } - if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_4)) { + if (sctp_add_remote_addr(stcb, sa, NULL, port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_4)) { return (-8); } } else if (stcb_tmp == stcb) { @@ -6348,7 +6348,7 @@ sctp_load_addresses_from_init(struct sct * we must add the address, no scope * set */ - if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_5)) { + if (sctp_add_remote_addr(stcb, sa, NULL, port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_5)) { return (-17); } } else if (stcb_tmp == stcb) { Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet/sctp_pcb.h Sun May 1 21:48:55 2016 (r298902) @@ -585,7 +585,7 @@ void sctp_inpcb_free(struct sctp_inpcb * struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, - int *, uint32_t, uint32_t, uint16_t, struct thread *); + int *, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); @@ -616,7 +616,7 @@ void sctp_del_local_addr_restricted(stru int sctp_load_addresses_from_init(struct sctp_tcb *, struct mbuf *, int, int, - struct sockaddr *, struct sockaddr *, struct sockaddr *); + struct sockaddr *, struct sockaddr *, struct sockaddr *, uint16_t); int sctp_set_primary_addr(struct sctp_tcb *, struct sockaddr *, Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet/sctp_usrreq.c Sun May 1 21:48:55 2016 (r298902) @@ -1474,6 +1474,7 @@ sctp_do_connect_x(struct socket *so, str /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, + inp->sctp_ep.port, (struct thread *)p ); if (stcb == NULL) { @@ -6999,7 +7000,9 @@ sctp_connect(struct socket *so, struct s } vrf_id = inp->def_vrf_id; /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, + inp->sctp_ep.port, p); if (stcb == NULL) { /* Gak! no memory */ goto out_now; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun May 1 21:17:30 2016 (r298901) +++ head/sys/netinet6/sctp6_usrreq.c Sun May 1 21:48:55 2016 (r298902) @@ -919,7 +919,9 @@ sctp6_connect(struct socket *so, struct return (EALREADY); } /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, + inp->sctp_ep.port, p); SCTP_ASOC_CREATE_UNLOCK(inp); if (stcb == NULL) { /* Gak! no memory */ From owner-svn-src-all@freebsd.org Sun May 1 22:00:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19D72B2954C; Sun, 1 May 2016 22:00:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B2D124B; Sun, 1 May 2016 22:00:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41M0fPi019380; Sun, 1 May 2016 22:00:41 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41M0fnL019379; Sun, 1 May 2016 22:00:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605012200.u41M0fnL019379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 May 2016 22:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298903 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 22:00:42 -0000 Author: avos Date: Sun May 1 22:00:40 2016 New Revision: 298903 URL: https://svnweb.freebsd.org/changeset/base/298903 Log: iwn: switch to ieee80211_add_channel*() Switch to add_channel / add_channel_ht40 + pass channel's TX power for the last. Tested by: dhw Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6141 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 1 21:48:55 2016 (r298902) +++ head/sys/dev/iwn/if_iwn.c Sun May 1 22:00:40 2016 (r298903) @@ -2381,12 +2381,24 @@ iwn_read_eeprom_band(struct iwn_softc *s { struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; - struct ieee80211_channel *c; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t chan; - int i, nflags; + int i, error, nflags; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + memset(bands, 0, sizeof(bands)); + if (n == 0) { + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + if (sc->sc_flags & IWN_FLAG_HAS_11N) + setbit(bands, IEEE80211_MODE_11NG); + } else { + setbit(bands, IEEE80211_MODE_11A); + if (sc->sc_flags & IWN_FLAG_HAS_11N) + setbit(bands, IEEE80211_MODE_11NA); + } + for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, @@ -2396,49 +2408,20 @@ iwn_read_eeprom_band(struct iwn_softc *s continue; } - if (*nchans >= maxchans) - break; - chan = band->chan[i]; nflags = iwn_eeprom_channel_flags(&channels[i]); - - c = &chans[(*nchans)++]; - c->ic_ieee = chan; - c->ic_maxregpower = channels[i].maxpwr; - c->ic_maxpower = 2*c->ic_maxregpower; - - if (n == 0) { /* 2GHz band */ - c->ic_freq = ieee80211_ieee2mhz(chan, IEEE80211_CHAN_G); - /* G =>'s B is supported */ - c->ic_flags = IEEE80211_CHAN_B | nflags; - - if (*nchans >= maxchans) - break; - - c = &chans[(*nchans)++]; - c[0] = c[-1]; - c->ic_flags = IEEE80211_CHAN_G | nflags; - } else { /* 5GHz band */ - c->ic_freq = ieee80211_ieee2mhz(chan, IEEE80211_CHAN_A); - c->ic_flags = IEEE80211_CHAN_A | nflags; - } + error = ieee80211_add_channel(chans, maxchans, nchans, + chan, 0, channels[i].maxpwr, nflags, bands); + if (error != 0) + break; /* Save maximum allowed TX power for this channel. */ + /* XXX wrong */ sc->maxpwr[chan] = channels[i].maxpwr; DPRINTF(sc, IWN_DEBUG_RESET, "add chan %d flags 0x%x maxpwr %d\n", chan, channels[i].flags, channels[i].maxpwr); - - if (sc->sc_flags & IWN_FLAG_HAS_11N) { - if (*nchans >= maxchans) - break; - - /* add HT20, HT40 added separately */ - c = &chans[(*nchans)++]; - c[0] = c[-1]; - c->ic_flags |= IEEE80211_CHAN_HT20; - } } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); @@ -2449,12 +2432,10 @@ static void iwn_read_eeprom_ht40(struct iwn_softc *sc, int n, int maxchans, int *nchans, struct ieee80211_channel chans[]) { - struct ieee80211com *ic = &sc->sc_ic; struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; - struct ieee80211_channel *c, *cent, *extc; uint8_t chan; - int i, nflags; + int i, error, nflags; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__); @@ -2472,46 +2453,33 @@ iwn_read_eeprom_ht40(struct iwn_softc *s continue; } - if (*nchans + 1 >= maxchans) - break; - chan = band->chan[i]; nflags = iwn_eeprom_channel_flags(&channels[i]); - - /* - * Each entry defines an HT40 channel pair; find the - * center channel, then the extension channel above. - */ - cent = ieee80211_find_channel_byieee(ic, chan, - (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); - if (cent == NULL) { /* XXX shouldn't happen */ + nflags |= (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A); + error = ieee80211_add_channel_ht40(chans, maxchans, nchans, + chan, channels[i].maxpwr, nflags); + switch (error) { + case EINVAL: device_printf(sc->sc_dev, "%s: no entry for channel %d\n", __func__, chan); continue; - } - extc = ieee80211_find_channel(ic, cent->ic_freq+20, - (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); - if (extc == NULL) { + case ENOENT: DPRINTF(sc, IWN_DEBUG_RESET, "%s: skip chan %d, extension channel not found\n", __func__, chan); continue; + case ENOBUFS: + device_printf(sc->sc_dev, + "%s: channel table is full!\n", __func__); + break; + case 0: + DPRINTF(sc, IWN_DEBUG_RESET, + "add ht40 chan %d flags 0x%x maxpwr %d\n", + chan, channels[i].flags, channels[i].maxpwr); + /* FALLTHROUGH */ + default: + break; } - - DPRINTF(sc, IWN_DEBUG_RESET, - "add ht40 chan %d flags 0x%x maxpwr %d\n", - chan, channels[i].flags, channels[i].maxpwr); - - c = &chans[(*nchans)++]; - c[0] = cent[0]; - c->ic_extieee = extc->ic_ieee; - c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40U | nflags; - c = &chans[(*nchans)++]; - c[0] = extc[0]; - c->ic_extieee = cent->ic_ieee; - c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40D | nflags; } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); From owner-svn-src-all@freebsd.org Sun May 1 22:00:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574CDB29550; Sun, 1 May 2016 22:00:44 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19F561251; Sun, 1 May 2016 22:00:44 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u41M0hbM019437; Sun, 1 May 2016 22:00:43 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u41M0fSL019423; Sun, 1 May 2016 22:00:41 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201605012200.u41M0fSL019423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 1 May 2016 22:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298904 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 01 May 2016 22:00:44 -0000 Author: wblock (doc committer) Date: Sun May 1 22:00:41 2016 New Revision: 298904 URL: https://svnweb.freebsd.org/changeset/base/298904 Log: Spelling fixes supplied by pfg@, detected with codespell, plus additional misspellings detected by igor. MFC after: 1 week Modified: head/share/man/man4/cxgbe.4 head/share/man/man4/ds3231.4 head/share/man/man4/ng_car.4 head/share/man/man4/ng_nat.4 head/share/man/man4/random.4 head/share/man/man4/uplcom.4 head/share/man/man9/counter.9 head/share/man/man9/fpu_kern.9 head/share/man/man9/hash.9 head/share/man/man9/lock.9 head/share/man/man9/pci.9 head/share/man/man9/sysctl.9 head/share/man/man9/timeout.9 head/share/man/man9/zone.9 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/cxgbe.4 Sun May 1 22:00:41 2016 (r298904) @@ -236,7 +236,7 @@ long as it is compatible with the driver the one already on the card. The default is 1. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the begining of an Ethernet +The number of bytes of padding inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. Modified: head/share/man/man4/ds3231.4 ============================================================================== --- head/share/man/man4/ds3231.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/ds3231.4 Sun May 1 22:00:41 2016 (r298904) @@ -65,9 +65,9 @@ dev.ds3231.0.32khz_enable: 1 .It Va dev.ds3231.%d.temperature The read-only value of the current temperature read by the RTC. .It Va dev.ds3231.%d.temp_conv -Start a new temperature convertion. +Start a new temperature conversion. When read as 1, a temperature conversion is in progress. -When read as 0 and then set to 1, a temperature convertion is started. +When read as 0 and then set to 1, a temperature conversion is started. The temperature conversion runs automatically on power up and once every 64 seconds afterward. .It Va dev.ds3231.%d.bbsqw Modified: head/share/man/man4/ng_car.4 ============================================================================== --- head/share/man/man4/ng_car.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/ng_car.4 Sun May 1 22:00:41 2016 (r298904) @@ -123,9 +123,9 @@ Return current node configuration as .Vt "struct ng_car_bulkconf" .Bd -literal struct ng_car_hookconf { - uint64_t cbs; /* Commited burst size (bytes) */ + uint64_t cbs; /* Committed burst size (bytes) */ uint64_t ebs; /* Exceeded/Peak burst size (bytes) */ - uint64_t cir; /* Commited information rate (bits/s) */ + uint64_t cir; /* Committed information rate (bits/s) */ uint64_t pir; /* Peak information rate (bits/s) */ uint8_t green_action; /* Action for green packets */ uint8_t yellow_action; /* Action for yellow packets */ @@ -162,7 +162,7 @@ Return node statistics as .Bd -literal struct ng_car_hookstats { uint64_t passed_pkts; /* Counter for passed packets */ - uint64_t droped_pkts; /* Counter for droped packets */ + uint64_t droped_pkts; /* Counter for dropped packets */ uint64_t green_pkts; /* Counter for green packets */ uint64_t yellow_pkts; /* Counter for yellow packets */ uint64_t red_pkts; /* Counter for red packets */ Modified: head/share/man/man4/ng_nat.4 ============================================================================== --- head/share/man/man4/ng_nat.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/ng_nat.4 Sun May 1 22:00:41 2016 (r298904) @@ -259,7 +259,7 @@ struct ng_nat_libalias_info { .Ed In case of .Nm -failed to retreive a certain counter +failed to retrieve a certain counter from its .Xr libalias instance, the corresponding field is returned as Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/random.4 Sun May 1 22:00:41 2016 (r298904) @@ -113,7 +113,7 @@ all settings are read-only. The .Pa kern.random.fortuna.minpoolsize sysctl is used -to set the seed threshhold. +to set the seed threshold. A smaller number gives a faster seed, but a less secure one. In practice, Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man4/uplcom.4 Sun May 1 22:00:41 2016 (r298904) @@ -98,7 +98,7 @@ HAL Corporation Crossam2+USB IR commande .It Hama USB RS-232 Serial Adapter .It -Hamlet exagerate XURS232 +Hamlet exaggerate XURS232 .It HP LD220 Point-Of-Sale (POS) Display .It Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/counter.9 Sun May 1 22:00:41 2016 (r298904) @@ -80,7 +80,7 @@ update faster than simple arithmetic on Thus .Nm is considered suitable for accounting in the performance-critical -code pathes. +code paths. .Bl -tag -width indent .It Fn counter_u64_alloc wait Allocate a new 64-bit unsigned counter. Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/fpu_kern.9 Sun May 1 22:00:41 2016 (r298904) @@ -139,7 +139,7 @@ function ends the region started by .Fn fpu_kern_enter . The uses of FPU in the kernel after the call to .Fn fpu_kern_leave -are erronous until the next call to +are erroneous until the next call to .Fn fpu_kern_enter is performed. The function takes the Modified: head/share/man/man9/hash.9 ============================================================================== --- head/share/man/man9/hash.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/hash.9 Sun May 1 22:00:41 2016 (r298904) @@ -139,7 +139,7 @@ uses same hashing algorithm as the .Fn jenkins_hash function, but works only on .Ft uint32_t -sized arrays, thus is simplier and faster. +sized arrays, thus is simpler and faster. It accepts an array of .Ft uint32_t values in its first argument and size of this array in the second argument. Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/lock.9 Sun May 1 22:00:41 2016 (r298904) @@ -215,7 +215,7 @@ The flag allows exclusive requests to pr even if the current thread owns shared locks. This is safe since shared lock is guaranteed to not recurse, and is used when thread is known to held unrelated shared locks, to not cause -unneccessary starvation. An example is +unnecessary starvation. An example is .Dv vp locking in VFS .Xr lookup 9 , Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/pci.9 Sun May 1 22:00:41 2016 (r298904) @@ -761,7 +761,7 @@ function assigns the .Fa *count messages allocated to the first .Fa *count -table indicies. +table indices. If .Fn pci_alloc_msix is not able to allocate any messages, Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/sysctl.9 Sun May 1 22:00:41 2016 (r298904) @@ -616,14 +616,14 @@ flags to be set indicating the read and This is a read-only sysctl. .It Dv CTLFLAG_RDTUN This is a read-only sysctl and tunable which is tried fetched once -from the system enviroment early during module load or system boot. +from the system environment early during module load or system boot. .It Dv CTLFLAG_WR This is a writable sysctl. .It Dv CTLFLAG_RW This sysctl is readable and writable. .It Dv CTLFLAG_RWTUN This is a readable and writeable sysctl and tunable which is tried -fetched once from the system enviroment early during module load or +fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_NOFETCH In case the node is marked as a tunable using the CTLFLAG_[XX]TUN, @@ -647,7 +647,7 @@ When iterating the sysctl name space, do .It Dv CTLFLAG_TUN Advisory flag that a system tunable also exists for this variable. The initial sysctl value is tried fetched once from the system -enviroment early during module load or system boot. +environment early during module load or system boot. .It Dv CTLFLAG_DYN Dynamically created OIDs automatically get this flag set. .It Dv CTLFLAG_VNET @@ -697,7 +697,7 @@ SYSCTL_STRING(_kern, KERN_BOOTFILE, boot * the variable pointer and size are provided, as well as a format * string for sysctl(8). */ -static l_fp pps_freq; /* scaled frequence offset (ns/s) */ +static l_fp pps_freq; /* scaled frequency offset (ns/s) */ SYSCTL_OPAQUE(_kern_ntp_pll, OID_AUTO, pps_freq, CTLFLAG_RD, &pps_freq, sizeof(pps_freq), "I", ""); Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/timeout.9 Sun May 1 22:00:41 2016 (r298904) @@ -239,7 +239,7 @@ The function cancels a callout .Fa c if it is currently pending. -If the callout is pending and successfuly stopped, then +If the callout is pending and successfully stopped, then .Fn callout_stop returns a value of one. If the callout is not set, or Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sun May 1 22:00:40 2016 (r298903) +++ head/share/man/man9/zone.9 Sun May 1 22:00:41 2016 (r298904) @@ -187,7 +187,7 @@ This flag requires either or .Dv UMA_ZONE_HASH , since subsystem requires a mechanism to find a book-keeping structure -to an item beeing freed. +to an item being freed. The subsystem may choose to prefer offpage book-keeping for certain zones implicitly. .It Dv UMA_ZONE_ZINIT From owner-svn-src-all@freebsd.org Mon May 2 00:44:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C504AD9A8C; Mon, 2 May 2016 00:44:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF3E1365; Mon, 2 May 2016 00:44:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u420iJTm069740; Mon, 2 May 2016 00:44:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u420iJZo069739; Mon, 2 May 2016 00:44:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020044.u420iJZo069739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 00:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298905 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 00:44:20 -0000 Author: araujo Date: Mon May 2 00:44:19 2016 New Revision: 298905 URL: https://svnweb.freebsd.org/changeset/base/298905 Log: Use MIN() macro from sys/param.h. Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6119 Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun May 1 22:00:41 2016 (r298904) +++ head/sbin/growfs/growfs.c Mon May 2 00:44:19 2016 (r298905) @@ -348,8 +348,7 @@ initcg(int cylno, time_t modtime, int fs acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? - sblock.fs_ipg : 2 * INOPB(&sblock); + acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock)); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; From owner-svn-src-all@freebsd.org Mon May 2 00:45:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C090AD9B94; Mon, 2 May 2016 00:45:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA7816E9; Mon, 2 May 2016 00:45:47 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u420jlJl069871; Mon, 2 May 2016 00:45:47 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u420jkiT069870; Mon, 2 May 2016 00:45:46 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020045.u420jkiT069870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 00:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298906 - head/sbin/newfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 00:45:48 -0000 Author: araujo Date: Mon May 2 00:45:46 2016 New Revision: 298906 URL: https://svnweb.freebsd.org/changeset/base/298906 Log: Use MIN()/MAX() macros from sys/param.h. Reviewed by: trasz MFC after: 2 weeks. Differential Revision: https://reviews.freebsd.org/D6118 Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Mon May 2 00:44:19 2016 (r298905) +++ head/sbin/newfs/mkfs.c Mon May 2 00:45:46 2016 (r298906) @@ -613,8 +613,7 @@ restart: } for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize) wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)), - sblock.fs_cssize - i < sblock.fs_bsize ? - sblock.fs_cssize - i : sblock.fs_bsize, + MIN(sblock.fs_cssize - i, sblock.fs_bsize), ((char *)fscs) + i); /* * Update information about this partition in pack @@ -660,8 +659,7 @@ initcg(int cylno, time_t utime) acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? - sblock.fs_ipg : 2 * INOPB(&sblock); + acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock)); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -771,7 +769,7 @@ initcg(int cylno, time_t utime) * Write out the duplicate super block, the cylinder group map * and two blocks worth of inodes in a single write. */ - start = sblock.fs_bsize > SBLOCKSIZE ? sblock.fs_bsize : SBLOCKSIZE; + start = MAX(sblock.fs_bsize, SBLOCKSIZE); bcopy((char *)&acg, &iobuf[start], sblock.fs_cgsize); start += sblock.fs_bsize; dp1 = (struct ufs1_dinode *)(&iobuf[start]); From owner-svn-src-all@freebsd.org Mon May 2 01:28:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0589EB22D57; Mon, 2 May 2016 01:28:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4F171040; Mon, 2 May 2016 01:28:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421SMdv081663; Mon, 2 May 2016 01:28:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421SLuD081659; Mon, 2 May 2016 01:28:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020128.u421SLuD081659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298907 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:28:23 -0000 Author: araujo Date: Mon May 2 01:28:21 2016 New Revision: 298907 URL: https://svnweb.freebsd.org/changeset/base/298907 Log: Use MIN/MAX macros from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Mon May 2 00:45:46 2016 (r298906) +++ head/sbin/fsck_ffs/fsutil.c Mon May 2 01:28:21 2016 (r298907) @@ -365,8 +365,7 @@ flush(int fd, struct bufarea *bp) for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) { blwrite(fswritefd, (char *)sblock.fs_csp + i, fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag), - sblock.fs_cssize - i < sblock.fs_bsize ? - sblock.fs_cssize - i : sblock.fs_bsize); + MIN(sblock.fs_cssize - i, sblock.fs_bsize)); } } @@ -673,7 +672,7 @@ blzero(int fd, ufs2_daddr_t blk, long si if (lseek(fd, offset, 0) < 0) rwerror("SEEK BLK", blk); while (size > 0) { - len = size > ZEROBUFSIZE ? ZEROBUFSIZE : size; + len = MIN(ZEROBUFSIZE, size); if (write(fd, zero, len) != len) rwerror("WRITE BLK", blk); blk += len / dev_bsize; @@ -718,8 +717,7 @@ check_cgmagic(int cg, struct bufarea *cg cgp->cg_magic = CG_MAGIC; cgp->cg_cgx = cg; cgp->cg_niblk = sblock.fs_ipg; - cgp->cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? - sblock.fs_ipg : 2 * INOPB(&sblock); + cgp->cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock)); if (cgbase(&sblock, cg) + sblock.fs_fpg < sblock.fs_size) cgp->cg_ndblk = sblock.fs_fpg; else Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Mon May 2 00:45:46 2016 (r298906) +++ head/sbin/fsck_ffs/inode.c Mon May 2 01:28:21 2016 (r298907) @@ -465,7 +465,7 @@ cacheino(union dinode *dp, ino_t inumber inp->i_number = inumber; inp->i_isize = DIP(dp, di_size); inp->i_numblks = blks; - for (i = 0; i < (blks < NDADDR ? blks : NDADDR); i++) + for (i = 0; i < MIN(blks, NDADDR); i++) inp->i_blks[i] = DIP(dp, di_db[i]); if (blks > NDADDR) for (i = 0; i < NIADDR; i++) Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Mon May 2 00:45:46 2016 (r298906) +++ head/sbin/fsck_ffs/pass2.c Mon May 2 01:28:21 2016 (r298907) @@ -182,9 +182,7 @@ pass2(void) memset(dp, 0, sizeof(struct ufs2_dinode)); DIP_SET(dp, di_mode, IFDIR); DIP_SET(dp, di_size, inp->i_isize); - for (i = 0; - i < (inp->i_numblksi_numblks : NDADDR); - i++) + for (i = 0; i < MIN(inp->i_numblks, NDADDR); i++) DIP_SET(dp, di_db[i], inp->i_blks[i]); if (inp->i_numblks > NDADDR) for (i = 0; i < NIADDR; i++) Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Mon May 2 00:45:46 2016 (r298906) +++ head/sbin/fsck_ffs/setup.c Mon May 2 01:28:21 2016 (r298907) @@ -245,8 +245,7 @@ setup(char *dev) goto badsb; } for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) { - size = sblock.fs_cssize - i < sblock.fs_bsize ? - sblock.fs_cssize - i : sblock.fs_bsize; + size = MIN(sblock.fs_cssize - i, sblock.fs_bsize); readcnt[sblk.b_type]++; if (blread(fsreadfd, (char *)sblock.fs_csp + i, fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag), From owner-svn-src-all@freebsd.org Mon May 2 01:40:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4F8B291C2; Mon, 2 May 2016 01:40:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCE818C5; Mon, 2 May 2016 01:40:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421eViM084973; Mon, 2 May 2016 01:40:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421eVS3084972; Mon, 2 May 2016 01:40:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020140.u421eVS3084972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298908 - head/sbin/dumpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:40:32 -0000 Author: araujo Date: Mon May 2 01:40:31 2016 New Revision: 298908 URL: https://svnweb.freebsd.org/changeset/base/298908 Log: Use MIN macro from sys/param.h. MFC after: 2 weeks Modified: head/sbin/dumpfs/dumpfs.c Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Mon May 2 01:28:21 2016 (r298907) +++ head/sbin/dumpfs/dumpfs.c Mon May 2 01:40:31 2016 (r298908) @@ -353,8 +353,7 @@ dumpcg(void) for (i = 1; i < afs.fs_contigsumsize; i++) { if ((i - 1) % 8 == 0) printf("\nclusters %d-%d:", i, - afs.fs_contigsumsize - 1 < i + 7 ? - afs.fs_contigsumsize - 1 : i + 7); + MIN(afs.fs_contigsumsize - 1, i + 7)); printf("\t%d", cg_clustersum(&acg)[i]); } printf("\nclusters size %d and over: %d\n", From owner-svn-src-all@freebsd.org Mon May 2 01:43:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63111B293D1; Mon, 2 May 2016 01:43:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6B31CF9; Mon, 2 May 2016 01:43:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421hMao087678; Mon, 2 May 2016 01:43:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421hMAQ087677; Mon, 2 May 2016 01:43:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020143.u421hMAQ087677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298909 - head/usr.sbin/inetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:43:23 -0000 Author: araujo Date: Mon May 2 01:43:22 2016 New Revision: 298909 URL: https://svnweb.freebsd.org/changeset/base/298909 Log: Use MAX macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Mon May 2 01:40:31 2016 (r298908) +++ head/usr.sbin/inetd/inetd.c Mon May 2 01:43:22 2016 (r298909) @@ -1934,7 +1934,7 @@ more: if (sep->se_bi && sep->se_bi->bi_maxchild >= 0) sep->se_maxchild = sep->se_bi->bi_maxchild; else if (sep->se_accept) - sep->se_maxchild = maxchild > 0 ? maxchild : 0; + sep->se_maxchild = MAX(maxchild, 0); else sep->se_maxchild = 1; } From owner-svn-src-all@freebsd.org Mon May 2 01:45:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C532B29471; Mon, 2 May 2016 01:45:53 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB3E1E86; Mon, 2 May 2016 01:45:53 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421jqlS087818; Mon, 2 May 2016 01:45:52 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421jqij087817; Mon, 2 May 2016 01:45:52 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020145.u421jqij087817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298910 - head/usr.sbin/lpr/lpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:45:53 -0000 Author: araujo Date: Mon May 2 01:45:52 2016 New Revision: 298910 URL: https://svnweb.freebsd.org/changeset/base/298910 Log: Use MIN macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/lpr/lpc/lpc.c Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Mon May 2 01:43:22 2016 (r298909) +++ head/usr.sbin/lpr/lpc/lpc.c Mon May 2 01:45:52 2016 (r298910) @@ -182,7 +182,7 @@ cmdscanner(void) if ((bp = el_gets(el, &num)) == NULL || num == 0) quit(0, NULL); - len = (num > MAX_CMDLINE - 1) ? MAX_CMDLINE - 1 : num; + len = MIN(MAX_CMDLINE - 1, num); memcpy(cmdline, bp, len); cmdline[len] = 0; history(hist, &he, H_ENTER, bp); From owner-svn-src-all@freebsd.org Mon May 2 01:47:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98A6FB294E2; Mon, 2 May 2016 01:47:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AEDB1015; Mon, 2 May 2016 01:47:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421lD9L087912; Mon, 2 May 2016 01:47:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421lDmP087911; Mon, 2 May 2016 01:47:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020147.u421lDmP087911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298911 - head/usr.sbin/makefs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:47:14 -0000 Author: araujo Date: Mon May 2 01:47:13 2016 New Revision: 298911 URL: https://svnweb.freebsd.org/changeset/base/298911 Log: Use MIN/MAX macros from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/makefs/ffs/mkfs.c Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Mon May 2 01:45:52 2016 (r298910) +++ head/usr.sbin/makefs/ffs/mkfs.c Mon May 2 01:47:13 2016 (r298911) @@ -610,8 +610,7 @@ initcg(int cylno, time_t utime, const fs acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? - sblock.fs_ipg : 2 * INOPB(&sblock); + acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock)); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk >> sblock.fs_fragshift; @@ -730,7 +729,7 @@ initcg(int cylno, time_t utime, const fs * Write out the duplicate super block, the cylinder group map * and two blocks worth of inodes in a single write. */ - start = sblock.fs_bsize > SBLOCKSIZE ? sblock.fs_bsize : SBLOCKSIZE; + start = MAX(sblock.fs_bsize, SBLOCKSIZE); memcpy(&iobuf[start], &acg, sblock.fs_cgsize); if (fsopts->needswap) ffs_cg_swap(&acg, (struct cg*)&iobuf[start], &sblock); From owner-svn-src-all@freebsd.org Mon May 2 01:49:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2148CB29563; Mon, 2 May 2016 01:49:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2C36119A; Mon, 2 May 2016 01:49:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u421nhGK088024; Mon, 2 May 2016 01:49:43 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u421nhLg088023; Mon, 2 May 2016 01:49:43 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605020149.u421nhLg088023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 2 May 2016 01:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298912 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 01:49:44 -0000 Author: araujo Date: Mon May 2 01:49:42 2016 New Revision: 298912 URL: https://svnweb.freebsd.org/changeset/base/298912 Log: Use MIN macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon May 2 01:47:13 2016 (r298911) +++ head/usr.sbin/mountd/mountd.c Mon May 2 01:49:42 2016 (r298912) @@ -3171,7 +3171,7 @@ makemask(struct sockaddr_storage *ssp, i return (-1); for (i = 0; i < len; i++) { - bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen; + bits = MIN(CHAR_BIT, bitlen); *p++ = (u_char)~0 << (CHAR_BIT - bits); bitlen -= bits; } From owner-svn-src-all@freebsd.org Mon May 2 02:13:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35966B29B0C; Mon, 2 May 2016 02:13:24 +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 E58401D01; Mon, 2 May 2016 02:13:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u422DNKH096981; Mon, 2 May 2016 02:13:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u422DNQC096980; Mon, 2 May 2016 02:13:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605020213.u422DNQC096980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 02:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298913 - head/usr.sbin/quot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 02:13:24 -0000 Author: pfg Date: Mon May 2 02:13:22 2016 New Revision: 298913 URL: https://svnweb.freebsd.org/changeset/base/298913 Log: quot: make use of our rounddown() macro when is available. No functional change. Modified: head/usr.sbin/quot/quot.c Modified: head/usr.sbin/quot/quot.c ============================================================================== --- head/usr.sbin/quot/quot.c Mon May 2 01:49:42 2016 (r298912) +++ head/usr.sbin/quot/quot.c Mon May 2 02:13:22 2016 (r298913) @@ -142,7 +142,7 @@ get_inode(int fd, struct fs *super, ino_ if (!ipbuf && !(ipbuf = malloc(INOSZ(super)))) errx(1, "allocate inodes"); - last = (ino / INOCNT(super)) * INOCNT(super); + last = rounddown(ino, INOCNT(super)); if (lseek(fd, (off_t)ino_to_fsba(super, last) << super->fs_fshift, 0) < (off_t)0 || read(fd, ipbuf, INOSZ(super)) != (ssize_t)INOSZ(super)) err(1, "read inodes"); @@ -414,7 +414,7 @@ dofsizes(int fd, struct fs *super, char errx(1, "allocate fsize structure"); fp->fsz_next = *fsp; *fsp = fp; - fp->fsz_first = (ksz / FSZCNT) * FSZCNT; + fp->fsz_first = rounddown(ksz, FSZCNT); fp->fsz_last = fp->fsz_first + FSZCNT; for (i = FSZCNT; --i >= 0;) { fp->fsz_count[i] = 0; From owner-svn-src-all@freebsd.org Mon May 2 02:15:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01498B29B80; Mon, 2 May 2016 02:15:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6D941E63; Mon, 2 May 2016 02:15:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u422F65C097082; Mon, 2 May 2016 02:15:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u422F5nZ097081; Mon, 2 May 2016 02:15:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605020215.u422F5nZ097081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 02:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298914 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 02:15:07 -0000 Author: pfg Date: Mon May 2 02:15:05 2016 New Revision: 298914 URL: https://svnweb.freebsd.org/changeset/base/298914 Log: rpcbind: use our roundup() macro when available through . No functional change. Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc_com.c Mon May 2 02:13:22 2016 (r298913) +++ head/usr.sbin/rpcbind/rpcb_svc_com.c Mon May 2 02:15:05 2016 (r298914) @@ -634,7 +634,7 @@ rpcbproc_callit_com(struct svc_req *rqst /* * Should be multiple of 4 for XDR. */ - sendsz = ((sendsz + 3) / 4) * 4; + sendsz = roundup(sendsz, 4); if (sendsz > RPC_BUF_MAX) { #ifdef notyet buf_alloc = alloca(sendsz); /* not in IDR2? */ From owner-svn-src-all@freebsd.org Mon May 2 04:15:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6658AB29A42; Mon, 2 May 2016 04:15:16 +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 33CBF1E26; Mon, 2 May 2016 04:15:16 +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 u424FFMF033103; Mon, 2 May 2016 04:15:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u424FFYQ033101; Mon, 2 May 2016 04:15:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605020415.u424FFYQ033101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 04:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298915 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 04:15:16 -0000 Author: adrian Date: Mon May 2 04:15:15 2016 New Revision: 298915 URL: https://svnweb.freebsd.org/changeset/base/298915 Log: [mwl] s/struct device/device_t/ Submitted by: kmacy Modified: head/sys/dev/mwl/if_mwlvar.h head/sys/dev/mwl/mwlhal.h Modified: head/sys/dev/mwl/if_mwlvar.h ============================================================================== --- head/sys/dev/mwl/if_mwlvar.h Mon May 2 02:15:05 2016 (r298914) +++ head/sys/dev/mwl/if_mwlvar.h Mon May 2 04:15:15 2016 (r298915) @@ -37,6 +37,7 @@ #define _DEV_MWL_MVVAR_H #include +#include #include #include #include Modified: head/sys/dev/mwl/mwlhal.h ============================================================================== --- head/sys/dev/mwl/mwlhal.h Mon May 2 02:15:05 2016 (r298914) +++ head/sys/dev/mwl/mwlhal.h Mon May 2 04:15:15 2016 (r298915) @@ -71,15 +71,13 @@ enum { MWL_WME_AC_VO = 3, /* voice access category */ }; -struct device; - struct mwl_hal { bus_space_handle_t mh_ioh; /* BAR 1 copied from softc */ bus_space_tag_t mh_iot; uint32_t mh_imask; /* interrupt mask */ /* remainder is opaque to driver */ }; -struct mwl_hal *mwl_hal_attach(struct device *dev, uint16_t devid, +struct mwl_hal *mwl_hal_attach(device_t dev, uint16_t devid, bus_space_handle_t ioh, bus_space_tag_t iot, bus_dma_tag_t tag); void mwl_hal_detach(struct mwl_hal *); From owner-svn-src-all@freebsd.org Mon May 2 05:37:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D50F5B22F46; Mon, 2 May 2016 05:37:26 +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 A571B175A; Mon, 2 May 2016 05:37:26 +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 u425bP0d057817; Mon, 2 May 2016 05:37:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u425bPd4057816; Mon, 2 May 2016 05:37:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605020537.u425bPd4057816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 05:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298918 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 05:37:26 -0000 Author: adrian Date: Mon May 2 05:37:25 2016 New Revision: 298918 URL: https://svnweb.freebsd.org/changeset/base/298918 Log: s/struct device */device_t/ Submitted by: kmacy Modified: head/sys/dev/usb/net/if_mos.c Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Mon May 2 05:29:28 2016 (r298917) +++ head/sys/dev/usb/net/if_mos.c Mon May 2 05:37:25 2016 (r298918) @@ -418,7 +418,7 @@ mos_write_mcast(struct mos_softc *sc, u_ } static int -mos_miibus_readreg(struct device *dev, int phy, int reg) +mos_miibus_readreg(device_t dev, int phy, int reg) { struct mos_softc *sc = device_get_softc(dev); uWord val; From owner-svn-src-all@freebsd.org Mon May 2 05:43:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5361CB2A186; Mon, 2 May 2016 05:43:48 +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 12F701D82; Mon, 2 May 2016 05:43:47 +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 u425hl9a061126; Mon, 2 May 2016 05:43:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u425hlP5061125; Mon, 2 May 2016 05:43:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605020543.u425hlP5061125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 05:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298919 - head/sys/dev/otus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 05:43:48 -0000 Author: adrian Date: Mon May 2 05:43:46 2016 New Revision: 298919 URL: https://svnweb.freebsd.org/changeset/base/298919 Log: [otus] implement monitor mode. * break out the operating mode and rx filter into new functions, rather than them being hard-coded * if we're in sniffer mode or not associated, set the BSS MAC to all zero, rather than relying on a chip reset to do it for us * add comments about .. how interestingly buggy the chip is. Tested: * AR9170 + AR9102, STA+monitor mode Obtained from: linux carl9170 (general chip workings, constant definitions) Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Mon May 2 05:37:25 2016 (r298918) +++ head/sys/dev/otus/if_otus.c Mon May 2 05:43:46 2016 (r298919) @@ -181,6 +181,8 @@ int otus_set_multi(struct otus_softc *) static int otus_updateedca(struct ieee80211com *); static void otus_updateedca_locked(struct otus_softc *); static void otus_updateslot(struct otus_softc *); +static void otus_set_operating_mode(struct otus_softc *sc); +static void otus_set_rx_filter(struct otus_softc *sc); int otus_init_mac(struct otus_softc *); uint32_t otus_phy_get_def(struct otus_softc *, uint32_t); int otus_set_board_values(struct otus_softc *, @@ -964,7 +966,7 @@ otus_alloc_cmd_list(struct otus_softc *s for (i = 0; i < ndata; i++) { struct otus_tx_cmd *dp = &cmd[i]; - dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT); + dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT | M_ZERO); dp->odata = NULL; if (dp->buf == NULL) { device_printf(sc->sc_dev, @@ -1028,7 +1030,7 @@ otus_alloc_list(struct otus_softc *sc, s struct otus_data *dp = &data[i]; dp->sc = sc; dp->m = NULL; - dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT); + dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT | M_ZERO); if (dp->buf == NULL) { device_printf(sc->sc_dev, "could not allocate buffer\n"); @@ -1142,6 +1144,7 @@ _otus_getbuf(struct otus_softc *sc) STAILQ_REMOVE_HEAD(&sc->sc_tx_inactive, next); else bf = NULL; + /* XXX bzero? */ return (bf); } @@ -1224,7 +1227,6 @@ otus_newstate(struct ieee80211vap *vap, struct otus_vap *uvp = OTUS_VAP(vap); struct ieee80211com *ic = vap->iv_ic; struct otus_softc *sc = ic->ic_softc; - struct ieee80211_node *ni; enum ieee80211_state ostate; ostate = vap->iv_state; @@ -1239,18 +1241,20 @@ otus_newstate(struct ieee80211vap *vap, /* XXX TODO: more fleshing out! */ switch (nstate) { + case IEEE80211_S_INIT: + otus_set_operating_mode(sc); + otus_set_rx_filter(sc); + break; case IEEE80211_S_RUN: - ni = ieee80211_ref_node(vap->iv_bss); - if (ic->ic_opmode == IEEE80211_M_STA) { otus_updateslot(sc); - otus_set_bssid(sc, ni->ni_bssid); + otus_set_operating_mode(sc); + otus_set_rx_filter(sc); /* Start calibration timer. */ taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_to, hz); } - ieee80211_free_node(ni); break; default: break; @@ -2355,6 +2359,7 @@ otus_set_multi(struct otus_softc *sc) otus_write(sc, AR_MAC_REG_GROUP_HASH_TBL_L, lo); otus_write(sc, AR_MAC_REG_GROUP_HASH_TBL_H, hi); r = otus_write_barrier(sc); + /* XXX operating mode? filter? */ OTUS_UNLOCK(sc); return (r); } @@ -2453,7 +2458,6 @@ otus_init_mac(struct otus_softc *sc) otus_write(sc, AR_MAC_REG_ACK_EXTENSION, 0x40); otus_write(sc, AR_MAC_REG_RETRY_MAX, 0); - otus_write(sc, AR_MAC_REG_SNIFFER, 0x2000000); otus_write(sc, AR_MAC_REG_RX_THRESHOLD, 0xc1f80); otus_write(sc, AR_MAC_REG_RX_PE_DELAY, 0x70); otus_write(sc, AR_MAC_REG_EIFS_AND_SIFS, 0xa144000); @@ -2465,13 +2469,14 @@ otus_init_mac(struct otus_softc *sc) otus_write(sc, AR_MAC_REG_BCN_HT1, 0x8000170); otus_write(sc, AR_MAC_REG_BACKOFF_PROTECT, 0x105); otus_write(sc, AR_MAC_REG_AMPDU_FACTOR, 0x10000a); - /* Filter any control frames, BAR is bit 24. */ -// otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500ffff); -// otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); + + otus_set_rx_filter(sc); + otus_write(sc, AR_MAC_REG_BASIC_RATE, 0x150f); otus_write(sc, AR_MAC_REG_MANDATORY_RATE, 0x150f); otus_write(sc, AR_MAC_REG_RTS_CTS_RATE, 0x10b01bb); otus_write(sc, AR_MAC_REG_ACK_TPC, 0x4003c1e); + /* Enable LED0 and LED1. */ otus_write(sc, AR_GPIO_REG_PORT_TYPE, 0x3); otus_write(sc, AR_GPIO_REG_PORT_DATA, 0x3); @@ -3067,55 +3072,88 @@ otus_led_newstate_type3(struct otus_soft #endif } +static uint8_t zero_macaddr[IEEE80211_ADDR_LEN] = { 0,0,0,0,0,0 }; + /* - * TODO: - * - * + If in monitor mode, set BSSID to all zeros, else the node BSSID. - * + Handle STA + monitor (eg tcpdump/promisc/radiotap) as well as - * pure monitor mode. + * Set up operating mode, MAC/BSS address and RX filter. */ -static int +static void otus_set_operating_mode(struct otus_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; - uint32_t rx_ctrl; - uint32_t frm_filt; - uint32_t cam_mode; - uint32_t rx_sniffer; + struct ieee80211vap *vap; + uint32_t cam_mode = AR_MAC_CAM_DEFAULTS; + uint32_t rx_ctrl = AR_MAC_RX_CTRL_DEAGG | AR_MAC_RX_CTRL_SHORT_FILTER; + uint32_t sniffer = AR_MAC_SNIFFER_DEFAULTS; + uint32_t enc_mode = 0x78; /* XXX */ + const uint8_t *macaddr; + uint8_t bssid[IEEE80211_ADDR_LEN]; + struct ieee80211_node *ni; OTUS_LOCK_ASSERT(sc); - /* XXX TODO: too many magic constants */ - rx_ctrl = 0x1; - /* Filter any control frames, BAR is bit 24. */ - frm_filt = 0x0500ffff; - cam_mode = 0x0f000002; /* XXX STA */ - rx_sniffer = 0x20000000; + /* + * If we're in sniffer mode or we don't have a MAC + * address assigned, ensure it gets reset to all-zero. + */ + IEEE80211_ADDR_COPY(bssid, zero_macaddr); + vap = TAILQ_FIRST(&ic->ic_vaps); + macaddr = ic->ic_macaddr; switch (ic->ic_opmode) { case IEEE80211_M_STA: - cam_mode = 0x0f000002; /* XXX STA */ - rx_ctrl = 0x1; - frm_filt = 0x0500ffff; - rx_sniffer = 0x20000000; + if (vap) { + ni = ieee80211_ref_node(vap->iv_bss); + IEEE80211_ADDR_COPY(bssid, ni->ni_bssid); + ieee80211_free_node(ni); + } + cam_mode |= AR_MAC_CAM_STA; + rx_ctrl |= AR_MAC_RX_CTRL_PASS_TO_HOST; break; case IEEE80211_M_MONITOR: - cam_mode = 0x0f000002; /* XXX STA */ - rx_ctrl = 0x1; - frm_filt = 0xffffffff; - rx_sniffer = 0x20000001; - break; + /* + * Note: monitor mode ends up causing the MAC to + * generate ACK frames for everything it sees. + * So don't do that; instead just put it in STA mode + * and disable RX filters. + */ default: + cam_mode |= AR_MAC_CAM_STA; + rx_ctrl |= AR_MAC_RX_CTRL_PASS_TO_HOST; break; } - otus_write(sc, AR_MAC_REG_SNIFFER, rx_sniffer); + /* + * TODO: if/when we do hardware encryption, ensure it's + * disabled if the NIC is in monitor mode. + */ + otus_write(sc, AR_MAC_REG_SNIFFER, sniffer); otus_write(sc, AR_MAC_REG_CAM_MODE, cam_mode); - otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, frm_filt); - otus_write(sc, AR_MAC_REG_RX_CONTROL, cam_mode); + otus_write(sc, AR_MAC_REG_ENCRYPTION, enc_mode); + otus_write(sc, AR_MAC_REG_RX_CONTROL, rx_ctrl); + otus_set_macaddr(sc, macaddr); + otus_set_bssid(sc, bssid); + /* XXX barrier? */ +} - (void) otus_write_barrier(sc); - return (0); +static void +otus_set_rx_filter(struct otus_softc *sc) +{ +// struct ieee80211com *ic = &sc->sc_ic; + + OTUS_LOCK_ASSERT(sc); + +#if 0 + if (ic->ic_allmulti > 0 || ic->ic_promisc > 0 || + ic->ic_opmode == IEEE80211_M_MONITOR) { + otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0xff00ffff); + } else { +#endif + /* Filter any control frames, BAR is bit 24. */ + otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500ffff); +#if 0 + } +#endif } int @@ -3139,7 +3177,8 @@ otus_init(struct otus_softc *sc) return error; } - (void) otus_set_macaddr(sc, ic->ic_macaddr); + otus_set_operating_mode(sc); + otus_set_rx_filter(sc); (void) otus_set_operating_mode(sc); sc->bb_reset = 1; /* Force cold reset. */ From owner-svn-src-all@freebsd.org Mon May 2 05:46:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88A03B2A245; Mon, 2 May 2016 05:46:50 +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 1E4F21F1D; Mon, 2 May 2016 05:46:50 +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 u425kn9f061305; Mon, 2 May 2016 05:46:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u425kmHi061290; Mon, 2 May 2016 05:46:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605020546.u425kmHi061290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 2 May 2016 05:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298920 - in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 05:46:50 -0000 Author: delphij Date: Mon May 2 05:46:47 2016 New Revision: 298920 URL: https://svnweb.freebsd.org/changeset/base/298920 Log: MFC r298192: MFV r298178: Update file to 5.26. Relnotes: yes Added: stable/10/contrib/file/magic/Magdir/bioinformatics - copied unchanged from r298192, head/contrib/file/magic/Magdir/bioinformatics stable/10/contrib/file/magic/Magdir/coff - copied unchanged from r298192, head/contrib/file/magic/Magdir/coff stable/10/contrib/file/magic/Magdir/der - copied unchanged from r298192, head/contrib/file/magic/Magdir/der stable/10/contrib/file/magic/Magdir/finger - copied unchanged from r298192, head/contrib/file/magic/Magdir/finger stable/10/contrib/file/magic/Magdir/flif - copied unchanged from r298192, head/contrib/file/magic/Magdir/flif stable/10/contrib/file/magic/Magdir/microfocus - copied unchanged from r298192, head/contrib/file/magic/Magdir/microfocus stable/10/contrib/file/magic/Magdir/polyml - copied unchanged from r298192, head/contrib/file/magic/Magdir/polyml stable/10/contrib/file/magic/Magdir/vacuum-cleaner - copied unchanged from r298192, head/contrib/file/magic/Magdir/vacuum-cleaner stable/10/contrib/file/src/der.c - copied unchanged from r298192, head/contrib/file/src/der.c stable/10/contrib/file/src/der.h - copied unchanged from r298192, head/contrib/file/src/der.h stable/10/contrib/file/src/dprintf.c - copied unchanged from r298192, head/contrib/file/src/dprintf.c Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/README stable/10/contrib/file/config.h.in stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/doc/file.man stable/10/contrib/file/doc/libmagic.man stable/10/contrib/file/magic/Magdir/android stable/10/contrib/file/magic/Magdir/animation stable/10/contrib/file/magic/Magdir/apple stable/10/contrib/file/magic/Magdir/archive stable/10/contrib/file/magic/Magdir/audio stable/10/contrib/file/magic/Magdir/c-lang stable/10/contrib/file/magic/Magdir/cafebabe stable/10/contrib/file/magic/Magdir/commands stable/10/contrib/file/magic/Magdir/compress stable/10/contrib/file/magic/Magdir/console stable/10/contrib/file/magic/Magdir/database stable/10/contrib/file/magic/Magdir/filesystems stable/10/contrib/file/magic/Magdir/fonts stable/10/contrib/file/magic/Magdir/fortran stable/10/contrib/file/magic/Magdir/hitachi-sh stable/10/contrib/file/magic/Magdir/images stable/10/contrib/file/magic/Magdir/intel stable/10/contrib/file/magic/Magdir/java stable/10/contrib/file/magic/Magdir/lisp stable/10/contrib/file/magic/Magdir/mach stable/10/contrib/file/magic/Magdir/macintosh stable/10/contrib/file/magic/Magdir/misctools stable/10/contrib/file/magic/Magdir/modem stable/10/contrib/file/magic/Magdir/msdos stable/10/contrib/file/magic/Magdir/msvc stable/10/contrib/file/magic/Magdir/msx stable/10/contrib/file/magic/Magdir/netbsd stable/10/contrib/file/magic/Magdir/psdbms stable/10/contrib/file/magic/Magdir/python stable/10/contrib/file/magic/Magdir/sendmail stable/10/contrib/file/magic/Magdir/sgml stable/10/contrib/file/magic/Magdir/sinclair stable/10/contrib/file/magic/Magdir/sql stable/10/contrib/file/magic/Magdir/terminfo stable/10/contrib/file/magic/Magdir/windows stable/10/contrib/file/magic/Magdir/wordprocessors stable/10/contrib/file/magic/Makefile.am stable/10/contrib/file/magic/Makefile.in stable/10/contrib/file/python/README stable/10/contrib/file/python/magic.py stable/10/contrib/file/python/setup.py stable/10/contrib/file/src/Makefile.am stable/10/contrib/file/src/Makefile.in stable/10/contrib/file/src/apprentice.c stable/10/contrib/file/src/ascmagic.c stable/10/contrib/file/src/compress.c stable/10/contrib/file/src/file.c stable/10/contrib/file/src/file.h stable/10/contrib/file/src/file_opts.h stable/10/contrib/file/src/fmtcheck.c stable/10/contrib/file/src/funcs.c stable/10/contrib/file/src/magic.c stable/10/contrib/file/src/magic.h stable/10/contrib/file/src/print.c stable/10/contrib/file/src/readcdf.c stable/10/contrib/file/src/readelf.c stable/10/contrib/file/src/readelf.h stable/10/contrib/file/src/softmagic.c stable/10/lib/libmagic/Makefile stable/10/lib/libmagic/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/ChangeLog Mon May 2 05:46:47 2016 (r298920) @@ -1,3 +1,49 @@ +2016-04-16 18:34 Christos Zoulas + + * release 5.25 + +2016-03-31 13:50 Christos Zoulas + + * make the number of bytes read from files configurable. + +2016-03-21 13:40 Christos Zoulas + + * Add bounds checks for DER code (discovered by Thomas Jarosch) + * Change indirect recursion limit to indirect use count and + bump from 15 to 50 to prevent abuse. + +2016-03-13 20:39 Christos Zoulas + + * Add -00 which prints filename\0description\0 + +2016-03-01 13:28 Christos Zoulas + + * Fix ID3 indirect parsing + +2016-01-19 10:18 Christos Zoulas + + * add DER parsing capability + +2015-11-13 10:35 Christos Zoulas + + * provide dprintf(3) for the OS's that don't have it. + +2015-11-11 16:25 Christos Zoulas + + * redo the compression code report decompression errors + +2015-11-10 23:25 Christos Zoulas + + * REG_STARTEND code is not working as expected, delete it. + +2015-11-09 16:05 Christos Zoulas + + * Add zlib support if we have it. + +2015-11-05 11:22 Christos Zoulas + + * PR/492: compression forking was broken with magic_buffer. + 2015-09-16 9:50 Christos Zoulas * release 5.25 Modified: stable/10/contrib/file/README ============================================================================== --- stable/10/contrib/file/README Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/README Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $ + @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ Mailing List: file@mx.gw.com Mailing List archives: http://mx.gw.com/pipermail/file/ @@ -67,17 +67,41 @@ in magic(5) format please, to the mainta COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install +src/localtime_r.c +src/magic.c +src/magic.h +src/mygetopt.h +src/newtest2.c +src/newtest3.c +src/pread.c +src/print.c +src/readcdf.c +src/readelf.c +src/readelf.h +src/regex.c +src/regex2.c +src/softmagic.c +src/strcasestr.c +src/strlcat.c +src/strlcpy.c +src/strndup.c +src/tar.h +src/teststrchr.c +src/vasprintf.c +src/x.c src/apprentice.c - parses /etc/magic to learn magic -src/asctime_r.c - replacement for OS's that don't have it. src/apptype.c - used for OS/2 specific application type magic -src/asprintf.c - replacement for OS's that don't have it. src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. +src/asctime_r.c - replacement for OS's that don't have it. +src/asprintf.c - replacement for OS's that don't have it. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. src/ctime_r.c - replacement for OS's that don't have it. +src/der.[ch] - parser for Distinguished Encoding Rules +src/dprintf.c - replacement for OS's that don't have it. src/elfclass.h - common code for elf 32/64. src/encoding.c - handles unicode encodings src/file.c - the main program @@ -88,10 +112,13 @@ src/fsmagic.c - first set of tests the p src/funcs.c - utilility functions src/getline.c - replacement for OS's that don't have it. src/getopt_long.c - replacement for OS's that don't have it. -src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore). -src/names.h - header file for ascmagic.c +src/gmtime_r.c - replacement for OS's that don't have it. +src/is_tar.c, tar.h - knows about Tape ARchive format (courtesy John Gilmore). +src/localtime_r.c - replacement for OS's that don't have it. src/magic.h.in - source file for magic.h +src/mygetopt.h - replacement for OS's that don't have it. src/magic.c - the libmagic api +src/names.h - header file for ascmagic.c src/pread.c - replacement for OS's that don't have it. src/print.c - print results, errors, warnings. src/readcdf.c - CDF wrapper. Modified: stable/10/contrib/file/config.h.in ============================================================================== --- stable/10/contrib/file/config.h.in Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/config.h.in Mon May 2 05:46:47 2016 (r298920) @@ -32,6 +32,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `dprintf' function. */ +#undef HAVE_DPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H Modified: stable/10/contrib/file/configure ============================================================================== --- stable/10/contrib/file/configure Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/configure Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.25. +# Generated by GNU Autoconf 2.69 for file 5.26. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.25' -PACKAGE_STRING='file 5.25' +PACKAGE_VERSION='5.26' +PACKAGE_STRING='file 5.26' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.25 to adapt to many kinds of systems. +\`configure' configures file 5.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.25:";; + short | recursive ) echo "Configuration of file 5.26:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.25 +file configure 5.26 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.25, which was +It was created by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.25' + VERSION='5.26' cat >>confdefs.h <<_ACEOF @@ -14385,6 +14385,19 @@ esac fi +ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" +if test "x$ac_cv_func_dprintf" = xyes; then : + $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" dprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" + ;; +esac + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 @@ -15036,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.25, which was +This file was extended by file $as_me 5.26, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15102,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.25 +file config.status 5.26 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/file/configure.ac ============================================================================== --- stable/10/contrib/file/configure.ac Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/configure.ac Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.25],[christos@astron.com]) +AC_INIT([file],[5.26],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -145,7 +145,7 @@ dnl Checks for functions AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary -AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck) +AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) dnl Checks for libraries AC_CHECK_LIB(z,gzopen) Modified: stable/10/contrib/file/doc/file.man ============================================================================== --- stable/10/contrib/file/doc/file.man Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/doc/file.man Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ -.Dd September 11, 2015 +.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ +.Dd March 13, 2016 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -317,6 +317,7 @@ Set various parameter limits. .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed .It Li regex Ta 8192 Ta length limit for regex searches +.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -358,6 +359,11 @@ Nice to .Xr cut 1 the output. This does not affect the separator, which is still printed. +.Pp +If this option is repeated more than once, then +.Nm +prints just the filename followed by a NUL followed by the description +(or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El Modified: stable/10/contrib/file/doc/libmagic.man ============================================================================== --- stable/10/contrib/file/doc/libmagic.man Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/doc/libmagic.man Mon May 2 05:46:47 2016 (r298920) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ +.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -225,7 +225,7 @@ It returns 0 on success and \-1 on failu .Pp The .Fn magic_compile -function can be used to compile the the colon +function can be used to compile the colon separated list of database files passed in as .Ar filename , or @@ -251,7 +251,7 @@ for the default database. .Pp The .Fn magic_load -function must be used to load the the colon +function must be used to load the colon separated list of database files passed in as .Ar filename , or @@ -282,7 +282,7 @@ The .Fn magic_getparam and .Fn magic_setparam -allow getting and setting various limits related to the the magic +allow getting and setting various limits related to the magic library. .Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent .It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" @@ -292,6 +292,7 @@ library. .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 .It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 +.It Li MAGIC_PARAM_BYTES_MAX Ta size_t Ta 1048576 .El .Pp The Modified: stable/10/contrib/file/magic/Magdir/android ============================================================================== --- stable/10/contrib/file/magic/Magdir/android Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/android Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $ +# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -128,7 +128,7 @@ # partition size in blocks ? #>>>>0x22 ulelong x \b*%d -# Android bootimg format +# Android sparse img format # From https://android.googlesource.com/\ # platform/system/core/+/master/libsparse/sparse_format.h 0 lelong 0xed26ff3a Android sparse image Modified: stable/10/contrib/file/magic/Magdir/animation ============================================================================== --- stable/10/contrib/file/magic/Magdir/animation Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/animation Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ +# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -76,6 +76,8 @@ >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP +>8 string dash \b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP +!:mime video/mp4 >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec >8 string dmpf \b, Digital Media Project >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) Modified: stable/10/contrib/file/magic/Magdir/apple ============================================================================== --- stable/10/contrib/file/magic/Magdir/apple Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/apple Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ +# $File: apple,v 1.32 2015/12/04 20:40:10 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -65,18 +65,48 @@ # Eric Fischer # AppleWorks word processor: -# -# This matches the standard tab stops for an AppleWorks file, but if -# a file has a tab stop set in the first four columns this will fail. -# +# URL: https://en.wikipedia.org/wiki/AppleWorks +# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx +# Update: Joerg Jenderek +# NOTE: # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. - -4 string O==== AppleWorks word processor data ->85 byte&0x01 >0 \b, zoomed ->90 byte&0x01 >0 \b, paginated ->92 byte&0x01 >0 \b, with mail merge -#>91 byte x \b, left margin %d +# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge +# the newer AppleWorks is from claris with extension CWK +4 string O +# test for unused bits of zoom- , paginated-boolean bytes +>84 ubequad ^0x00Fe00000000Fe00 +# look for tabstop definitions "=" no tab, "|" no tab +# "<" left tab,"^" center tab,">" right tab, "." decimal tab, +# unofficial "!" other , "\x8a" other +# official only if SFMinVers is nonzero +>>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor +# AppleWorks Word Processor File (Apple II) +# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" +# application/x-appleworks is mime type for claris version with cwk extension +!:mime application/x-appleworks3 +# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ +# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') +# $70 $1A $F8 $FF is this the apple type ? +#:apple pdospøÿ +!:ext awp +# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) +>>>183 ubyte 30 3.0 +>>>183 ubyte !30 +>>>>183 ubyte !0 0x%x +# usual tabstop start sequence "=====<" +>>>5 string x \b, tabstop ruler "%6.6s" +# tabstop ruler +#>>>5 string >\0 \b, tabstops "%-79s" +# zoom switch +>>>85 byte&0x01 >0 \b, zoomed +# whether paginated +>>>90 byte&0x01 >0 \b, paginated +# contains any mail-merge commands +>>>92 byte&0x01 >0 \b, with mail merge +# left margin in 1/10 inches ( normally 0 or 10 ) +>>>91 ubyte >0 +>>>>91 ubyte x \b, %d/10 inch left margin # AppleWorks database: # Modified: stable/10/contrib/file/magic/Magdir/archive ============================================================================== --- stable/10/contrib/file/magic/Magdir/archive Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/archive Mon May 2 05:46:47 2016 (r298920) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ +# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -246,7 +246,15 @@ # BA # TODO: idarc says "bytes 0-2 == bytes 3-5" # TTComp -0 string \0\6 TTComp archive data +# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive +# Update: Joerg Jenderek +# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others +0 string \0\6 +# look for first keyword of Panorama database *.pan +>12 search/261 DESIGN +# skip keyword with low entropy +>12 default x TTComp archive, binary, 4K dictionary +# (version 5.25) labeled the above entry as "TTComp archive data" # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation? 0 string ESP ESP archive data # ZPack @@ -544,55 +552,212 @@ >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) -2 string -lh0- LHarc 1.x/ARX archive data [lh0] -!:mime application/x-lharc -2 string -lh1- LHarc 1.x/ARX archive data [lh1] -!:mime application/x-lharc -2 string -lz4- LHarc 1.x archive data [lz4] -!:mime application/x-lharc -2 string -lz5- LHarc 1.x archive data [lz5] -!:mime application/x-lharc +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) +# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html +# +# check and display information of lharc (LHa,PMarc) file +0 name lharc-file +# check 1st character of method id like -lz4- -lh5- or -pm2- +>2 string - +# check 5th character of method id +>>6 string - +# check header level 0 1 2 3 +>>>20 ubyte <4 +# check 2nd, 3th and 4th character of method id +>>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b +!:mime application/x-lzh-compressed +# creator type "LHA " +!:apple ????LHA +# display archive type name like "LHa/LZS archive data" or "LArc archive" +>>>>>2 string -lz \b +!:ext lzs +# already known -lzs- -lz4- -lz5- with old names +>>>>>>2 string -lzs LHa/LZS archive data +>>>>>>3 regex \^lz[45] LHarc 1.x archive data +# missing -lz?- with wikipedia names +>>>>>>3 regex \^lz[2378] LArc archive +# display archive type name like "LHa (2.x) archive data" +>>>>>2 string -lh \b +# already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names +>>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data +# LHice archiver use ".ICE" as name extension instead usual one ".lzh" +# FOOBAR archiver use ".foo" as name extension instead usual one +# "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment +>>>>>>>2 string -lh1 \b +!:ext lha/lzh/ice +>>>>>>3 regex \^lh[23d] LHa 2.x? archive data +>>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data +>>>>>>3 regex \^lh[456] LHa (2.x) archive data +>>>>>>>2 string -lh5 \b +# https://en.wikipedia.org/wiki/BIOS +# Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like +# bios.rom , kd7_v14.bin, 1010.004, ... +!:ext lha/lzh/rom/bin +# missing -lh?- variants (Joe Jared) +>>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive +# UNLHA32 2.67a +>>>>>>2 string -lhx LHa (UNLHA32) archive +# lha archives with standard file name extensions ".lha" ".lzh" +>>>>>>3 regex !\^(lh1|lh5) \b +!:ext lha/lzh +# this should not happen if all -lh variants are described +>>>>>>2 default x LHa (unknown) archive +#!:ext lha +# PMarc +>>>>>3 regex \^pm[012] PMarc archive data +!:ext pma +# append method id without leading and trailing minus character +>>>>>3 string x [%3.3s] +>>>>>>0 use lharc-header +# +# check and display information of lharc header +0 name lharc-header +# header size 0x4 , 0x1b-0x61 +>0 ubyte x +# compressed data size != compressed file size +#>7 ulelong x \b, data size %d +# attribute: 0x2~?? 0x10~symlink|target 0x20~normal +#>19 ubyte x \b, 19_0x%x +# level identifier 0 1 2 3 +#>20 ubyte x \b, level %d +# time stamp +#>15 ubelong x DATE 0x%8.8x +# OS ID for level 1 +>20 ubyte 1 +# 0x20 types find for *.rom files +>>(21.b+24) ubyte <0x21 \b, 0x%x OS +# ascii type like M for MSDOS +>>(21.b+24) ubyte >0x20 \b, '%c' OS +# OS ID for level 2 +>20 ubyte 2 +#>>23 ubyte x \b, OS ID 0x%x +>>23 ubyte <0x21 \b, 0x%x OS +>>23 ubyte >0x20 \b, '%c' OS +# filename only for level 0 and 1 +>20 ubyte <2 +# length of filename +>>21 ubyte >0 \b, with +# filename +>>>21 pstring x "%s" +# +#2 string -lh0- LHarc 1.x/ARX archive data [lh0] +#!:mime application/x-lharc +2 string -lh0- +>0 use lharc-file +#2 string -lh1- LHarc 1.x/ARX archive data [lh1] +#!:mime application/x-lharc +2 string -lh1- +>0 use lharc-file +# NEW -lz2- ... -lz8- +2 string -lz2- +>0 use lharc-file +2 string -lz3- +>0 use lharc-file +2 string -lz4- +>0 use lharc-file +2 string -lz5- +>0 use lharc-file +2 string -lz7- +>0 use lharc-file +2 string -lz8- +>0 use lharc-file # [never seen any but the last; -lh4- reported in comp.compression:] -2 string -lzs- LHa/LZS archive data [lzs] -!:mime application/x-lha -2 string -lh\40- LHa 2.x? archive data [lh ] -!:mime application/x-lha -2 string -lhd- LHa 2.x? archive data [lhd] -!:mime application/x-lha -2 string -lh2- LHa 2.x? archive data [lh2] -!:mime application/x-lha -2 string -lh3- LHa 2.x? archive data [lh3] -!:mime application/x-lha -2 string -lh4- LHa (2.x) archive data [lh4] -!:mime application/x-lha -2 string -lh5- LHa (2.x) archive data [lh5] -!:mime application/x-lha -2 string -lh6- LHa (2.x) archive data [lh6] -!:mime application/x-lha -2 string -lh7- LHa (2.x)/LHark archive data [lh7] -!:mime application/x-lha ->20 byte x - header level %d +#2 string -lzs- LHa/LZS archive data [lzs] +2 string -lzs- +>0 use lharc-file +# According to wikipedia and others such a version does not exist +#2 string -lh\40- LHa 2.x? archive data [lh ] +#2 string -lhd- LHa 2.x? archive data [lhd] +2 string -lhd- +>0 use lharc-file +#2 string -lh2- LHa 2.x? archive data [lh2] +2 string -lh2- +>0 use lharc-file +#2 string -lh3- LHa 2.x? archive data [lh3] +2 string -lh3- +>0 use lharc-file +#2 string -lh4- LHa (2.x) archive data [lh4] +2 string -lh4- +>0 use lharc-file +#2 string -lh5- LHa (2.x) archive data [lh5] +2 string -lh5- +>0 use lharc-file +#2 string -lh6- LHa (2.x) archive data [lh6] +2 string -lh6- +>0 use lharc-file +#2 string -lh7- LHa (2.x)/LHark archive data [lh7] +2 string -lh7- +# !:mime application/x-lha +# >20 byte x - header level %d +>0 use lharc-file +# NEW -lh8- ... -lhe- , -lhx- +2 string -lh8- +>0 use lharc-file +2 string -lh9- +>0 use lharc-file +2 string -lha- +>0 use lharc-file +2 string -lhb- +>0 use lharc-file +2 string -lhc- +>0 use lharc-file +2 string -lhe- +>0 use lharc-file +2 string -lhx- +>0 use lharc-file # taken from idarc [JW] 2 string -lZ PUT archive data -2 string -lz LZS archive data +# already done by LHarc magics +# this should never happen if all sub types of LZS archive are identified +#2 string -lz LZS archive data 2 string -sw1- Swag archive data -# RAR archiver (Greg Roelofs, newt@uchicago.edu) -0 string Rar! RAR archive data, +0 name rar-file-header +>24 byte 15 \b, v1.5 +>24 byte 20 \b, v2.0 +>24 byte 29 \b, v4 +>15 byte 0 \b, os: MS-DOS +>15 byte 1 \b, os: OS/2 +>15 byte 2 \b, os: Win32 +>15 byte 3 \b, os: Unix +>15 byte 4 \b, os: Mac OS +>15 byte 5 \b, os: BeOS + +0 name rar-archive-header +>3 leshort&0x1ff >0 \b, flags: +>>3 leshort &0x01 ArchiveVolume +>>3 leshort &0x02 Commented +>>3 leshort &0x04 Locked +>>3 leshort &0x10 NewVolumeNaming +>>3 leshort &0x08 Solid +>>3 leshort &0x20 Authenticated +>>3 leshort &0x40 RecoveryRecordPresent +>>3 leshort &0x80 EncryptedBlockHeader +>>3 leshort &0x100 FirstVolume + +# RAR (Roshal Archive) archive +0 string Rar!\x1a\7\0 RAR archive data +!:mime application/x-rar +!:ext rar/cbr +# file header +>(0xc.l+9) byte 0x74 +>>(0xc.l+7) use rar-file-header +# subblock seems to share information with file header +>(0xc.l+9) byte 0x7a +>>(0xc.l+7) use rar-file-header +>9 byte 0x73 +>>7 use rar-archive-header + +0 string Rar!\x1a\7\1\0 RAR archive data, v5 +!:mime application/x-rar +!:ext rar + +# Very old RAR archive +# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf +0 string RE\x7e\x5e RAR archive data (44 byte x v%0x, ->10 byte >0 flags: ->>10 byte &0x01 Archive volume, ->>10 byte &0x02 Commented, ->>10 byte &0x04 Locked, ->>10 byte &0x08 Solid, ->>10 byte &0x20 Authenticated, ->35 byte 0 os: MS-DOS ->35 byte 1 os: OS/2 ->35 byte 2 os: Win32 ->35 byte 3 os: Unix -# some old version? idarc says: -0 string RE\x7e\x5e RAR archive data +!:ext rar/cbr # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) @@ -604,9 +769,12 @@ # PKZIP multi-volume archive 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip +!:ext zip/cbz # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\005\006 Zip archive data (empty) +!:mime application/zip +!:ext zip/cbz 0 string PK\003\004 # Specialised zip formats which start with a member named 'mimetype' @@ -764,12 +932,24 @@ 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/LHA_(file_format) # -2 string -pm0- PMarc archive data [pm0] -2 string -pm1- PMarc archive data [pm1] -2 string -pm2- PMarc archive data [pm2] +#2 string -pm0- PMarc archive data [pm0] +2 string -pm0- +>0 use lharc-file +#2 string -pm1- PMarc archive data [pm1] +2 string -pm1- +>0 use lharc-file +#2 string -pm2- PMarc archive data [pm2] +2 string -pm2- +>0 use lharc-file 2 string -pms- PMarc SFX archive (CP/M, DOS) +#!:mime application/x-foobar-exec +!:ext com 5 string -pc1- PopCom compressed executable (CP/M) +#!:mime application/x- +#!:ext com # From Rafael Laboissiere # The Project Revision Control System (see @@ -802,6 +982,9 @@ # Felix von Leitner 0 string d8:announce BitTorrent file !:mime application/x-bittorrent +# Durval Menezes, +0 string d13:announce-list BitTorrent file +!:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen 0 beshort 0x0e0f Atari MSA archive data @@ -889,19 +1072,16 @@ # From "Nelson A. de Oliveira" 0 string MPQ\032 MoPaQ (MPQ) archive -# From: Dirk Jagdmann -# xar archive format: http://code.google.com/p/xar/ -0 string xar! xar archive ->6 beshort x - version %d - # From: "Nelson A. de Oliveira" # .kgb 0 string KGB_arch KGB Archiver file >10 string x with compression level %.1s # xar (eXtensible ARchiver) archive +# xar archive format: http://code.google.com/p/xar/ # From: "David Remahl" 0 string xar! xar archive +!:mime application/x-xar #>4 beshort x header size %d >6 beshort x version %d, #>8 quad x compressed TOC: %d, @@ -975,3 +1155,9 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains +# Google Chrome extensions +# https://developer.chrome.com/extensions/crx +# https://developer.chrome.com/extensions/hosting +0 string Cr24 Google Chrome extension +!:mime application/x-chrome-extension +>4 ulong x \b, version %u Modified: stable/10/contrib/file/magic/Magdir/audio ============================================================================== --- stable/10/contrib/file/magic/Magdir/audio Mon May 2 05:43:46 2016 (r298919) +++ stable/10/contrib/file/magic/Magdir/audio Mon May 2 05:46:47 2016 (r298920) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $ +# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), @@ -585,7 +585,7 @@ 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music # musepak support From: "Jiri Pejchal" -0 string MP+ Musepack audio +0 string MP+ Musepack audio (MP+) !:mime audio/x-musepack >3 byte 255 \b, SV pre8 >3 byte&0xF 0x6 \b, SV 6 @@ -619,6 +619,9 @@ >>27 byte 114 \b, Beta 1.14 >>27 byte 115 \b, Alpha 1.15 +0 string MPCK Musepack audio (MPCK) +!:mime audio/x-musepack + # IMY # from http://filext.com/detaillist.php?extdetail=IMY # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm @@ -715,3 +718,41 @@ 0 string ZBOT >4 byte 0xc5 GVOX Encore music, version < 5.0 +# Summary: Garmin Voice Processing Module (WAVE audios) +# From: Joerg Jenderek +# URL: http://www.garmin.com/ +# Reference: http://turboccc.wikispaces.com/share/view/28622555 +# NOTE: there exist 2 other Garmin VPM formats +0 string AUDIMG +# skip text files starting with string "AUDIMG" +>13 ubyte <13 Garmin Voice Processing Module +!:mime audio/x-vpm-wav-garmin +!:ext vpm +# 3 bytes indicating the voice version (200,220) +>>6 string x \b, version %3.3s +# day of release (01-31) +>>12 ubyte x \b, %.2d +# month of release (01-12) +>>13 ubyte x \b.%.2d +# year of release (like 2006, 2007, 2008) +>>14 uleshort x \b.%.4d +# hour of release (0-23) +>>11 ubyte x %.2d +# minute of release (0-59) +>>10 ubyte x \b:%.2d +# second of release (0-59) +>>9 ubyte x \b:%.2d +# if you select a language like german on your garmin device +# you can only select voice modules with correponding language byte ID like 1 +>>18 ubyte x \b, language ID %d +# pointer to 1st audio WAV sample +>>16 uleshort >0 +>>>(16.s) ulelong >0 \b, at offset 0x%x +# WAV length +>>>>(16.s+4) ulelong >0 %d Bytes +# look for magic +>>>>>(&-8.l) string RIFF +# determine type by ./riff +>>>>>>&-4 indirect x \b +# 2 - ~ 131 WAV samples following same way + Copied: stable/10/contrib/file/magic/Magdir/bioinformatics (from r298192, head/contrib/file/magic/Magdir/bioinformatics) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/file/magic/Magdir/bioinformatics Mon May 2 05:46:47 2016 (r298920, copy of r298192, head/contrib/file/magic/Magdir/bioinformatics) @@ -0,0 +1,178 @@ + +#------------------------------------------------------------------------------ +# $File: bioinformatics,v 1.2 2016/02/14 15:53:53 christos Exp $ +# bioinfomatics: file(1) magic for Bioinfomatics file formats + +############################################################################### +# BGZF (Blocked GNU Zip Format) - gzip compatible, but also indexable +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string \037\213 +>3 byte &0x04 +>>12 string BC +>>>14 leshort &0x02 Blocked GNU Zip Format (BGZF; gzip compatible) +>>>>16 leshort x \b, block length %d +!:mime application/x-gzip + + +############################################################################### +# Tabix index file +# used by SAMtools bgzip/tabix (http://samtools.sourceforge.net/tabix.shtml) +############################################################################### +0 string TBI\1 SAMtools TBI (Tabix index format) +>0x04 lelong =1 \b, with %d reference sequence +>0x04 lelong >1 \b, with %d reference sequences +>0x08 lelong &0x10000 \b, using half-closed-half-open coordinates (BED style) +>0x08 lelong ^0x10000 +>>0x08 lelong =0 \b, using closed and one based coordinates (GFF style) +>>0x08 lelong =1 \b, using SAM format +>>0x08 lelong =2 \b, using VCF format +>0x0c lelong x \b, sequence name column: %d +>0x10 lelong x \b, region start column: %d +>0x08 lelong =0 +>>0x14 lelong x \b, region end column: %d +>0x18 byte x \b, comment character: %c +>0x1c lelong x \b, skip line count: %d + + +############################################################################### +# BAM (Binary Sequence Alignment/Map format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BAM\1 SAMtools BAM (Binary Sequence Alignment/Map) +>0x04 lelong >0 +>>&0x00 regex =^[@]HD\t.*VN: \b, with SAM header +>>>&0 regex =[0-9.]+ \b version %s +>>&(0x04) lelong >0 \b, with %d reference sequences + + +############################################################################### +# BAI (BAM indexing format) +# used by SAMtools (http://samtools.sourceforge.net/SAM1.pdf) +############################################################################### +0 string BAI\1 SAMtools BAI (BAM indexing format) +>0x04 lelong >0 \b, with %d reference sequences + + +############################################################################### +# CRAM (Binary Sequence Alignment/Map format) +############################################################################### +0 string CRAM CRAM +>0x04 byte >-1 version %d. +>0x05 byte >-1 \b%d +>0x06 string >\0 (identified as %s) + + +############################################################################### +# BCF (Binary Call Format), version 1 +# used by SAMtools & VCFtools (http://vcftools.sourceforge.net/bcf.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\4 +# length of seqnm data in bytes is positive +>&0x00 lelong >0 +# length of smpl data in bytes is positive +>>&(&-0x04) lelong >0 SAMtools BCF (Binary Call Format) +# length of meta in bytes +>>>&(&-0x04) lelong >0 +# have meta text string +>>>>&0x00 search ##samtoolsVersion= +>>>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.1 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\1 Binary Call Format (BCF) version 2.1 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + + +############################################################################### +# BCF (Binary Call Format), version 2.2 +# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf) +# data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it +############################################################################### +0 string BCF\2\2 Binary Call Format (BCF) version 2.2 +# length of header text +>&0x00 lelong >0 +# have header string +>>&0x00 search ##samtoolsVersion= +>>>&0x00 string x \b, generated by SAMtools version %s + +############################################################################### +# VCF (Variant Call Format) +# used by VCFtools (http://vcftools.sourceforge.net/) +############################################################################### +0 search ##fileformat=VCFv Variant Call Format (VCF) +>&0 string x \b version %s + +############################################################################### +# FASTQ +# used by MAQ (http://maq.sourceforge.net/fastq.shtml) +############################################################################### +# XXX Broken? +# @ +#0 regex =^@[A-Za-z0-9_.:-]+\?\n +# +#>&1 regex =^[A-Za-z\n.~]++ +# +[] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 2 13:13:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75350B290A6; Mon, 2 May 2016 13:13:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4182A1097; Mon, 2 May 2016 13:13: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 u42DDWUl095371; Mon, 2 May 2016 13:13:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42DDWXj095370; Mon, 2 May 2016 13:13:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605021313.u42DDWXj095370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 2 May 2016 13:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298921 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 13:13:33 -0000 Author: kib Date: Mon May 2 13:13:32 2016 New Revision: 298921 URL: https://svnweb.freebsd.org/changeset/base/298921 Log: Fix reporting of NOTE_LINK when directory link count changes due to rename removing or adding subdirectory entry. Discussed with and tested by: Vladimir Kondratyev NetBSD PR: 48958 (http://gnats.netbsd.org/48958) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon May 2 05:46:47 2016 (r298920) +++ head/sys/kern/vfs_subr.c Mon May 2 13:13:32 2016 (r298921) @@ -4650,10 +4650,26 @@ void vop_rename_post(void *ap, int rc) { struct vop_rename_args *a = ap; + long hint; if (!rc) { - VFS_KNOTE_UNLOCKED(a->a_fdvp, NOTE_WRITE); - VFS_KNOTE_UNLOCKED(a->a_tdvp, NOTE_WRITE); + hint = NOTE_WRITE; + if (a->a_fdvp == a->a_tdvp) { + if (a->a_tvp != NULL && a->a_tvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } else { + if (a->a_fvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + + if (a->a_fvp->v_type == VDIR && a->a_tvp != NULL && + a->a_tvp->v_type == VDIR) + hint &= ~NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } + VFS_KNOTE_UNLOCKED(a->a_fvp, NOTE_RENAME); if (a->a_tvp) VFS_KNOTE_UNLOCKED(a->a_tvp, NOTE_DELETE); From owner-svn-src-all@freebsd.org Mon May 2 13:18:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3588B292F9; Mon, 2 May 2016 13:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86F8616A1; Mon, 2 May 2016 13:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42DIHCw095845; Mon, 2 May 2016 13:18:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42DIHQQ095843; Mon, 2 May 2016 13:18:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605021318.u42DIHQQ095843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 2 May 2016 13:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298922 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 13:18:18 -0000 Author: kib Date: Mon May 2 13:18:17 2016 New Revision: 298922 URL: https://svnweb.freebsd.org/changeset/base/298922 Log: Issue NOTE_EXTEND when a directory entry is added to or removed from the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported. Submitted by: Vladimir Kondratyev MFC after: 2 weeks Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/vfs_subr.c Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Mon May 2 13:13:32 2016 (r298921) +++ head/lib/libc/sys/kqueue.2 Mon May 2 13:18:17 2016 (r298922) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2016 +.Dd May 2, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -376,7 +376,13 @@ was called on the file referenced by the .It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. .It Dv NOTE_EXTEND -The file referenced by the descriptor was extended. +For regular file, the file referenced by the descriptor was extended. +.Pp +For directory, reports that a directory entry was added or removed, +as the result of rename operation. +The +.Dv NOTE_EXTEND +event is not reported when a name is changed inside the directory. .It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon May 2 13:13:32 2016 (r298921) +++ head/sys/kern/vfs_subr.c Mon May 2 13:18:17 2016 (r298922) @@ -4660,6 +4660,7 @@ vop_rename_post(void *ap, int rc) VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); } else { + hint |= NOTE_EXTEND; if (a->a_fvp->v_type == VDIR) hint |= NOTE_LINK; VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); From owner-svn-src-all@freebsd.org Mon May 2 14:35:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9532EB289C6; Mon, 2 May 2016 14:35:58 +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 4E7081005; Mon, 2 May 2016 14:35:58 +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 u42EZvdJ020518; Mon, 2 May 2016 14:35:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42EZv01020516; Mon, 2 May 2016 14:35:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605021435.u42EZv01020516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 14:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298923 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 14:35:58 -0000 Author: pfg Date: Mon May 2 14:35:57 2016 New Revision: 298923 URL: https://svnweb.freebsd.org/changeset/base/298923 Log: dev/random: minor spelling fixes in comments. No functional change. Reviewed by: markm Approved by: so Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon May 2 13:18:17 2016 (r298922) +++ head/sys/dev/random/fortuna.c Mon May 2 14:35:57 2016 (r298923) @@ -250,7 +250,7 @@ random_fortuna_process_event(struct harv /*- * FS&K - Reseed() * This introduces new key material into the output generator. - * Additionaly it increments the output generator's counter + * Additionally it increments the output generator's counter * variable C. When C > 0, the output generator is seeded and * will deliver output. * The entropy_data buffer passed is a very specific size; the Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Mon May 2 13:18:17 2016 (r298922) +++ head/sys/dev/random/yarrow.c Mon May 2 14:35:57 2016 (r298923) @@ -96,7 +96,7 @@ static struct yarrow_state { u_int ys_slowoverthresh; /* slow pool overthreshhold reseed count */ struct ys_pool { u_int ysp_source_bits[ENTROPYSOURCE]; /* estimated bits of entropy per source */ - u_int ysp_thresh; /* pool reseed threshhold */ + u_int ysp_thresh; /* pool reseed threshold */ struct randomdev_hash ysp_hash; /* accumulated entropy */ } ys_pool[RANDOM_YARROW_NPOOLS];/* pool[0] is fast, pool[1] is slow */ bool ys_seeded; @@ -240,8 +240,8 @@ random_yarrow_process_event(struct harve } } /* - * If enough slow sources are over threshhold, then slow reseed - * else if any fast source over threshhold, then fast reseed. + * If enough slow sources are over threshold, then slow reseed + * else if any fast source over threshold, then fast reseed. */ if (overthreshhold[RANDOM_YARROW_SLOW] >= yarrow_state.ys_slowoverthresh) random_yarrow_reseed_internal(RANDOM_YARROW_SLOW); From owner-svn-src-all@freebsd.org Mon May 2 15:07:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2B6AB2A3B7; Mon, 2 May 2016 15:07:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9055512C5; Mon, 2 May 2016 15:07:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42F7hsB029686; Mon, 2 May 2016 15:07:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42F7hI3029685; Mon, 2 May 2016 15:07:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605021507.u42F7hI3029685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 2 May 2016 15:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298924 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 15:07:44 -0000 Author: bz Date: Mon May 2 15:07:43 2016 New Revision: 298924 URL: https://svnweb.freebsd.org/changeset/base/298924 Log: fgetc returns an int not a char. Found by: powerpc builds failing due to comparing with EOF raised: "comparison is always false due to limited range of data type" Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Mon May 2 14:35:57 2016 (r298923) +++ head/usr.bin/sdiff/sdiff.c Mon May 2 15:07:43 2016 (r298924) @@ -508,8 +508,7 @@ binexec(char *diffprog, char *f1, char * static int istextfile(FILE *f) { - int i; - char ch; + int ch, i; if (f == NULL) return (1); From owner-svn-src-all@freebsd.org Mon May 2 15:14:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CC9B2A646; Mon, 2 May 2016 15:14:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 765AD1A5C; Mon, 2 May 2016 15:14:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42FEGf3032655; Mon, 2 May 2016 15:14:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42FEGop032654; Mon, 2 May 2016 15:14:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605021514.u42FEGop032654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 2 May 2016 15:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298925 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 15:14:17 -0000 Author: avos Date: Mon May 2 15:14:16 2016 New Revision: 298925 URL: https://svnweb.freebsd.org/changeset/base/298925 Log: iwn: do not buffer frames for non-passive channels (it's not needed). Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon May 2 15:07:43 2016 (r298924) +++ head/sys/dev/iwn/if_iwn.c Mon May 2 15:14:16 2016 (r298925) @@ -2852,7 +2852,8 @@ iwn_newstate(struct ieee80211vap *vap, e sc->calib.state = IWN_CALIB_STATE_INIT; /* Wait until we hear a beacon before we transmit */ - sc->sc_beacon_wait = 1; + if (IEEE80211_IS_CHAN_PASSIVE(ic->ic_curchan)) + sc->sc_beacon_wait = 1; if ((error = iwn_auth(sc, vap)) != 0) { device_printf(sc->sc_dev, @@ -2870,7 +2871,8 @@ iwn_newstate(struct ieee80211vap *vap, e } /* Wait until we hear a beacon before we transmit */ - sc->sc_beacon_wait = 1; + if (IEEE80211_IS_CHAN_PASSIVE(ic->ic_curchan)) + sc->sc_beacon_wait = 1; /* * !RUN -> RUN requires setting the association id From owner-svn-src-all@freebsd.org Mon May 2 15:32:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BA62B2AAB4; Mon, 2 May 2016 15:32:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (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 F1DAF1742; Mon, 2 May 2016 15:32:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f66.google.com with SMTP id f63so27646116oig.0; Mon, 02 May 2016 08:32:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=9Vys6ep6K/OQTTU/y+K5MPO2nvzeny2PV9gpL8B5h4Y=; b=deHiS7l5zEBx/CoxZWsUB7ezjO9ngIzYg3mUiJGh8GWcHA3I+/3qEGyl9PxS0sXzfV fn59e6lXo/BTi7J8BlfEXKxtGl3K6hs4V4eS7Q9z6lnyF5rzMmFd8r5sZhCF3VDVmz5D nQNJPLQWujFhh9zaSsDWGa9mpcr2OXEVqZwNHeQlF9BnK5zSY0lnp22I83ZaMcngev8g 2RSeo0x4DntotsaaFEGySmYgs1ckiQOfWbxIIaWUhK1WrWd+rHfWZ9mLwaK7S3ILJV99 4/ryOx6+fdUmxj3eQ42kp04z//6iRHMmFc5xkCodv8tT7xvxLrpArYokdWQ+HIhzhq66 P2/Q== X-Gm-Message-State: AOPr4FUevKRPmczpqWVbwwRdAy3gvkeXOYA8v22Ldap9P4ZGEDt7MjZyR5AluaRl6ch2PA== X-Received: by 10.202.73.138 with SMTP id w132mr15052400oia.20.1462203132984; Mon, 02 May 2016 08:32:12 -0700 (PDT) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com. [209.85.214.169]) by smtp.gmail.com with ESMTPSA id cf3sm10730203obc.1.2016.05.02.08.32.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 08:32:12 -0700 (PDT) Received: by mail-ob0-f169.google.com with SMTP id j9so89714189obd.3; Mon, 02 May 2016 08:32:12 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.28.168 with SMTP id c8mr16185854obh.49.1462203132440; Mon, 02 May 2016 08:32:12 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Mon, 2 May 2016 08:32:12 -0700 (PDT) In-Reply-To: <201605021507.u42F7hI3029685@repo.freebsd.org> References: <201605021507.u42F7hI3029685@repo.freebsd.org> Date: Mon, 2 May 2016 08:32:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298924 - head/usr.bin/sdiff From: Conrad Meyer To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 15:32:20 -0000 Clang should really catch this too. Why didn't it? Best, Conrad On Mon, May 2, 2016 at 8:07 AM, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon May 2 15:07:43 2016 > New Revision: 298924 > URL: https://svnweb.freebsd.org/changeset/base/298924 > > Log: > fgetc returns an int not a char. > > Found by: powerpc builds failing due to comparing with EOF raised: > "comparison is always false due to limited range of data type" > > Modified: > head/usr.bin/sdiff/sdiff.c > > Modified: head/usr.bin/sdiff/sdiff.c > ============================================================================== > --- head/usr.bin/sdiff/sdiff.c Mon May 2 14:35:57 2016 (r298923) > +++ head/usr.bin/sdiff/sdiff.c Mon May 2 15:07:43 2016 (r298924) > @@ -508,8 +508,7 @@ binexec(char *diffprog, char *f1, char * > static int > istextfile(FILE *f) > { > - int i; > - char ch; > + int ch, i; > > if (f == NULL) > return (1); > From owner-svn-src-all@freebsd.org Mon May 2 15:55:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B309AEE0DB; Mon, 2 May 2016 15:55:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB141188; Mon, 2 May 2016 15:55:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 7A7BA25D3A8F; Mon, 2 May 2016 15:55:04 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 97E21D1F8BC; Mon, 2 May 2016 15:55:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id SVc-Gl5yj8p2; Mon, 2 May 2016 15:55:01 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:d97b:857d:5a4c:cb84] (unknown [IPv6:fde9:577b:c1a9:4410:d97b:857d:5a4c:cb84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E7873D1F8BA; Mon, 2 May 2016 15:55:00 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298924 - head/usr.bin/sdiff From: "Bjoern A. Zeeb" In-Reply-To: Date: Mon, 2 May 2016 15:54:28 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> References: <201605021507.u42F7hI3029685@repo.freebsd.org> To: cem@FreeBSD.org X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 15:55:14 -0000 > On 02 May 2016, at 15:32 , Conrad Meyer wrote: >=20 > Clang should really catch this too. Why didn=E2=80=99t it? It was only powerpc; sparc64 and mips were good as well. From owner-svn-src-all@freebsd.org Mon May 2 15:57:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E66FAEE195; Mon, 2 May 2016 15:57:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12461443; Mon, 2 May 2016 15:57:01 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id k142so195316990oib.1; Mon, 02 May 2016 08:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=kJ+Uskki26RB5FZXZK52EG6QRoQ/zVko/kD1CARm4+I=; b=SFnDxa2c0nEmQLXeHFV3p3nZpqAu/nLkAlYk6aSTwUy7jNXi8xuxke4BNs5G1ci7sO MbTFyyH5I72GdgaAKmYLsZUPBpDC8iI3JQF6oUWLqFo+UvTErGwu4kFpLiAurJ/M5tYz l2RpX8EKNT/s59AwcoomcZzWStuWhh9mdgaP9V7te1YDJpEJqw9QRNXFudzOZj6wOSFO Ad+CkQ8702CH5T60mTF6vQvszo9z6IOXov54Ej1VeV16xdvaySFC5JnFgouhRlrs8SqW 9/GtwjU4LTjvjdONM+hQ/agIw6nbSTM+dcbitSYskxwosKpHH+cZ4HrDqHAFqsUT2KmZ ryEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=kJ+Uskki26RB5FZXZK52EG6QRoQ/zVko/kD1CARm4+I=; b=Ru8L7SFojS3gHAM/3gu4TZsclfxtsQhMWHU2rKTrIMigRFv8fUbvYLX/dxLTMziqEV Rk11zisiQYTE8edil0N5cEb8WrlzMoFiqoTBbnxrSpVFh/oWdm5eaEtWIsIQpDQ5Bm2M RYKBXTq0PKSlwIfy/GJBVKTBVhHa6kJwZr4KKtDPHz4tymJ9ca3ZQsG4JvU4m7ticx0g TpiwdrZqvPbmpkOJpnIDPwWP7NoW1iIx3kwr6WBljMVTztHpaeCDrZMcMKTDlMtSakvo TBqsxWnUT9HsWkcGy2pz8tlcPP09QWdJfDVgBd3qfqMPIkZZl6T8CKqN20lgEwaVGRvX m7Dg== X-Gm-Message-State: AOPr4FXnCqPtcD1dlP9OpokXbuieDg5VJo6uy9iDOULJqaK+TZCU9v+JeAGf76D4Gu95Ge9uWaB8cK2ewU2EKg== MIME-Version: 1.0 X-Received: by 10.202.198.67 with SMTP id w64mr10327960oif.30.1462204621006; Mon, 02 May 2016 08:57:01 -0700 (PDT) Received: by 10.157.11.77 with HTTP; Mon, 2 May 2016 08:57:00 -0700 (PDT) In-Reply-To: <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> References: <201605021507.u42F7hI3029685@repo.freebsd.org> <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> Date: Mon, 2 May 2016 10:57:00 -0500 Message-ID: Subject: Re: svn commit: r298924 - head/usr.bin/sdiff From: Benjamin Kaduk To: "Bjoern A. Zeeb" Cc: "cem@FreeBSD.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 15:57:02 -0000 On Mon, May 2, 2016 at 10:54 AM, Bjoern A. Zeeb wrote: > > > On 02 May 2016, at 15:32 , Conrad Meyer wrote: > > > > Clang should really catch this too. Why didn=E2=80=99t it? > > It was only powerpc; sparc64 and mips were good as well. > > 'char' being signed vs. unsigned? -Ben From owner-svn-src-all@freebsd.org Mon May 2 16:08:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36CBBAEE5D7; Mon, 2 May 2016 16:08:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (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 052DD1C7E; Mon, 2 May 2016 16:08:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f66.google.com with SMTP id i2so27743204oib.3; Mon, 02 May 2016 09:08:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=Y3ZE/WMq6tKXjaTyXyv2ugGSkrb808n2K9TOTVg24bQ=; b=N0kLQDhHyFvbrKoZQ+/m6l+q9P87K8UEXI+f3MOnJjPHiMQDdnsMyepqpOHAtkgipC Fuq3qFTwEc7PZqWojkfjEYlnpkDvxPIEyqC/u0BuZnrwZ2NhFLa8mS8fCVWtEYb6Fdp+ PGN2UfyawtJtwik3pOzAVxB9wx9vzIaS7rVx6G/UTnJnJC0P25P/NKiD0ZUGk81O+A9H m3wB5t6L08GtjLi5JebuWUf8obgvtKw4szdJemrAGgKXKSvH5dRntfX5to8jpS7qxekw ssitsLPl8Zcp8lHWKutU6UNdJD4NZbSMO/8miYwcwtnOqpDzzH9JwHyt2z0vOGis8seN oM5g== X-Gm-Message-State: AOPr4FX0RtQsXXVWfrZU05Chx/zQpfAKjHs4Xf3tVIiVjf4CyyVYZHj4uIRrCES/Ti4g/g== X-Received: by 10.157.40.9 with SMTP id m9mr16208717otb.23.1462205314589; Mon, 02 May 2016 09:08:34 -0700 (PDT) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id tr6sm9580442obb.18.2016.05.02.09.08.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 09:08:34 -0700 (PDT) Received: by mail-oi0-f51.google.com with SMTP id v145so162365030oie.0; Mon, 02 May 2016 09:08:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.86.79 with SMTP id k76mr15215091oib.22.1462205313763; Mon, 02 May 2016 09:08:33 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Mon, 2 May 2016 09:08:33 -0700 (PDT) In-Reply-To: References: <201605021507.u42F7hI3029685@repo.freebsd.org> <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> Date: Mon, 2 May 2016 09:08:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298924 - head/usr.bin/sdiff From: Conrad Meyer To: Benjamin Kaduk Cc: "Bjoern A. Zeeb" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:08:36 -0000 On Mon, May 2, 2016 at 8:57 AM, Benjamin Kaduk wrote: > On Mon, May 2, 2016 at 10:54 AM, Bjoern A. Zeeb wrote: >> > On 02 May 2016, at 15:32 , Conrad Meyer wrote: >> > >> > Clang should really catch this too. Why didn=E2=80=99t it? >> >> It was only powerpc; sparc64 and mips were good as well. > > 'char' being signed vs. unsigned? Yeah, that occurred to me, but EOF should be out of range for any char type. I'd like ((char)getchar() =3D=3D EOF) to warn on all platforms. Best, Conrad From owner-svn-src-all@freebsd.org Mon May 2 16:11:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B07AEE6D4; Mon, 2 May 2016 16:11:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 185651F99; Mon, 2 May 2016 16:11:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8885825D3A6D; Mon, 2 May 2016 16:11:19 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id F3188D1F8BB; Mon, 2 May 2016 16:11:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id IfbckPiAoijI; Mon, 2 May 2016 16:11:17 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:d97b:857d:5a4c:cb84] (unknown [IPv6:fde9:577b:c1a9:4410:d97b:857d:5a4c:cb84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5516FD1F8BA; Mon, 2 May 2016 16:11:16 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298924 - head/usr.bin/sdiff From: "Bjoern A. Zeeb" In-Reply-To: Date: Mon, 2 May 2016 16:10:57 +0000 Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7DC09622-48D4-41C4-8913-9039D44BC1E7@FreeBSD.org> References: <201605021507.u42F7hI3029685@repo.freebsd.org> <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> To: cem@FreeBSD.org X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:11:23 -0000 > On 02 May 2016, at 16:08 , Conrad Meyer wrote: >=20 > On Mon, May 2, 2016 at 8:57 AM, Benjamin Kaduk = wrote: >> On Mon, May 2, 2016 at 10:54 AM, Bjoern A. Zeeb = wrote: >>>> On 02 May 2016, at 15:32 , Conrad Meyer wrote: >>>>=20 >>>> Clang should really catch this too. Why didn=E2=80=99t it? >>>=20 >>> It was only powerpc; sparc64 and mips were good as well. >>=20 >> 'char' being signed vs. unsigned? >=20 > Yeah, that occurred to me, but EOF should be out of range for any char > type. I'd like ((char)getchar() =3D=3D EOF) to warn on all platforms. I think we just define EOF to be -1. Someone should check, and that the = warning message might be misleading. From owner-svn-src-all@freebsd.org Mon May 2 16:13:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C80B6AEE7FA; Mon, 2 May 2016 16:13:12 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E0512A6; Mon, 2 May 2016 16:13:12 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GDBWe051885; Mon, 2 May 2016 16:13:11 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GDBph051884; Mon, 2 May 2016 16:13:11 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021613.u42GDBph051884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298926 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:13:12 -0000 Author: royger Date: Mon May 2 16:13:11 2016 New Revision: 298926 URL: https://svnweb.freebsd.org/changeset/base/298926 Log: xen/x86: don't lose event interrupts On slow platforms with unreliable TSC, such as QEMU emulated machines, it is possible for the FreeBSD kernel to request the next event in the past. In that case, in the current implementation of xentimer_vcpu_start_timer, we simply return -ETIME. To be precise Xen returns -ETIME and we pass it on. As a consequence we need to loop around to function to make sure that the timer is properly set. Instead it is better to always ask the hypervisor for a timer event, even if the timeout is past. To do that, remove the VCPU_SSHOTTMR_future flag. Submitted by: Stefano Stabellini Reviewed by: royger MFC after: 2 weeks Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Mon May 2 15:14:16 2016 (r298925) +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:13:11 2016 (r298926) @@ -267,7 +267,8 @@ xentimer_vcpu_start_timer(int vcpu, uint struct vcpu_set_singleshot_timer single; single.timeout_abs_ns = next_time; - single.flags = VCPU_SSHOTTMR_future; + /* Get an event anyway, even if the timeout is already expired */ + single.flags = 0; return (HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, vcpu, &single)); } From owner-svn-src-all@freebsd.org Mon May 2 16:13:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A0B0AEE852; Mon, 2 May 2016 16:13:56 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA61144E; Mon, 2 May 2016 16:13:55 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GDtPm051954; Mon, 2 May 2016 16:13:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GDtIJ051953; Mon, 2 May 2016 16:13:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021613.u42GDtIJ051953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298927 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:13:56 -0000 Author: royger Date: Mon May 2 16:13:55 2016 New Revision: 298927 URL: https://svnweb.freebsd.org/changeset/base/298927 Log: xen/timer: remove the timer setup loop With the removal of the usage of the VCPU_SSHOTTMR_future flag, now all errors from xentimer_vcpu_start_timer should be considered fatal, and the loop is no longer needed since in case of setting the timer in the past we will get an event interrupt right away (instead of returning ETIME). Sponsored by: Citrix Systems R&D MFC after : 2 weeks Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Mon May 2 16:13:11 2016 (r298926) +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:13:55 2016 (r298927) @@ -76,8 +76,6 @@ static devclass_t xentimer_devclass; #define XENTIMER_MIN_PERIOD_IN_NSEC 100*NSEC_IN_USEC #define XENCLOCK_RESOLUTION 10000000 -#define ETIME 62 /* Xen "bad time" error */ - #define XENTIMER_QUALITY 950 struct xentimer_pcpu_data { @@ -295,7 +293,7 @@ static int xentimer_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { - int error = 0, i = 0; + int error; struct xentimer_softc *sc = et->et_priv; int cpu = PCPU_GET(vcpu_id); struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); @@ -312,21 +310,8 @@ xentimer_et_start(struct eventtimer *et, first_in_ns = (((first >> 32) * NSEC_IN_SEC) + (((uint64_t)NSEC_IN_SEC * (uint32_t)first) >> 32)); - /* - * Retry any timer scheduling failures, where the hypervisor - * returns -ETIME. Sometimes even a 100us timer period isn't large - * enough, but larger period instances are relatively uncommon. - * - * XXX Remove the panics once et_start() and its consumers are - * equipped to deal with start failures. - */ - do { - if (++i == 60) - panic("can't schedule timer"); - next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; - error = xentimer_vcpu_start_timer(cpu, next_time); - } while (error == -ETIME); - + next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; + error = xentimer_vcpu_start_timer(cpu, next_time); if (error) panic("%s: Error %d setting singleshot timer to %"PRIu64"\n", device_get_nameunit(sc->dev), error, next_time); From owner-svn-src-all@freebsd.org Mon May 2 16:14:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8EBAEE926; Mon, 2 May 2016 16:14:56 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8671718D5; Mon, 2 May 2016 16:14:56 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GEtDc052307; Mon, 2 May 2016 16:14:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GEtuj052305; Mon, 2 May 2016 16:14:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021614.u42GEtuj052305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298928 - in head/sys: isa x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:14:56 -0000 Author: royger Date: Mon May 2 16:14:55 2016 New Revision: 298928 URL: https://svnweb.freebsd.org/changeset/base/298928 Log: atrtc: export function to set RTC This is going to be used by the Xen clock on Dom0 in order to set the RTC of the host. The current logic in atrtc_settime is moved to atrtc_set and the unused device_t parameter is removed from the atrtc_set function call so it can be safely used by other callers. Sponsored by: Citrix Systems R&D Reviewed by: kib, jhb Differential revision: https://reviews.freebsd.org/D6067 Modified: head/sys/isa/rtc.h head/sys/x86/isa/atrtc.c Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Mon May 2 16:13:55 2016 (r298927) +++ head/sys/isa/rtc.h Mon May 2 16:14:55 2016 (r298928) @@ -117,6 +117,7 @@ extern int atrtcclock_disable; int rtcin(int reg); void atrtc_restore(void); void writertc(int reg, u_char val); +void atrtc_set(struct timespec *ts); #endif #endif /* _I386_ISA_RTC_H_ */ Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Mon May 2 16:13:55 2016 (r298927) +++ head/sys/x86/isa/atrtc.c Mon May 2 16:14:55 2016 (r298928) @@ -151,6 +151,33 @@ atrtc_restore(void) rtcin(RTC_INTR); } +void +atrtc_set(struct timespec *ts) +{ + struct clocktime ct; + + clock_ts_to_ct(ts, &ct); + + /* Disable RTC updates and interrupts. */ + writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + + writertc(RTC_SEC, bin2bcd(ct.sec)); /* Write back Seconds */ + writertc(RTC_MIN, bin2bcd(ct.min)); /* Write back Minutes */ + writertc(RTC_HRS, bin2bcd(ct.hour)); /* Write back Hours */ + + writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ + writertc(RTC_DAY, bin2bcd(ct.day)); /* Write back Day */ + writertc(RTC_MONTH, bin2bcd(ct.mon)); /* Write back Month */ + writertc(RTC_YEAR, bin2bcd(ct.year % 100)); /* Write back Year */ +#ifdef USE_RTC_CENTURY + writertc(RTC_CENTURY, bin2bcd(ct.year / 100)); /* ... and Century */ +#endif + + /* Re-enable RTC updates and interrupts. */ + writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); +} + /********************************************************************** * RTC driver for subr_rtc */ @@ -297,28 +324,8 @@ atrtc_resume(device_t dev) static int atrtc_settime(device_t dev __unused, struct timespec *ts) { - struct clocktime ct; - - clock_ts_to_ct(ts, &ct); - - /* Disable RTC updates and interrupts. */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); - - writertc(RTC_SEC, bin2bcd(ct.sec)); /* Write back Seconds */ - writertc(RTC_MIN, bin2bcd(ct.min)); /* Write back Minutes */ - writertc(RTC_HRS, bin2bcd(ct.hour)); /* Write back Hours */ - writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ - writertc(RTC_DAY, bin2bcd(ct.day)); /* Write back Day */ - writertc(RTC_MONTH, bin2bcd(ct.mon)); /* Write back Month */ - writertc(RTC_YEAR, bin2bcd(ct.year % 100)); /* Write back Year */ -#ifdef USE_RTC_CENTURY - writertc(RTC_CENTURY, bin2bcd(ct.year / 100)); /* ... and Century */ -#endif - - /* Reenable RTC updates and interrupts. */ - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + atrtc_set(ts); return (0); } From owner-svn-src-all@freebsd.org Mon May 2 16:15:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2542AEE980; Mon, 2 May 2016 16:15:29 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C3DE1A8A; Mon, 2 May 2016 16:15:29 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GFSbA052376; Mon, 2 May 2016 16:15:28 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GFSeR052375; Mon, 2 May 2016 16:15:28 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021615.u42GFSeR052375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298929 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:15:29 -0000 Author: royger Date: Mon May 2 16:15:28 2016 New Revision: 298929 URL: https://svnweb.freebsd.org/changeset/base/298929 Log: xen/time: allow Dom0 to set the host time Dom0 should be able to set the host time. This is implemented by first writing to the RTC (as would be done on bare metal), and then using the XENPF_settime64 hypercall in order to force Xen to update the wallclock shared page of all domains. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Mon May 2 16:14:55 2016 (r298928) +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:15:28 2016 (r298929) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include "clock_if.h" static devclass_t xentimer_devclass; @@ -211,11 +214,32 @@ xen_fetch_uptime(struct timespec *ts) static int xentimer_settime(device_t dev __unused, struct timespec *ts) { + struct xen_platform_op settime; + int ret; + /* * Don't return EINVAL here; just silently fail if the domain isn't * privileged enough to set the TOD. */ - return (0); + if (!xen_initial_domain()) + return (0); + + /* Set the native RTC. */ + atrtc_set(ts); + + settime.cmd = XENPF_settime64; + settime.u.settime64.mbz = 0; + settime.u.settime64.secs = ts->tv_sec; + settime.u.settime64.nsecs = ts->tv_nsec; + settime.u.settime64.system_time = + xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); + + ret = HYPERVISOR_platform_op(&settime); + ret = ret != 0 ? xen_translate_error(ret) : 0; + if (ret != 0 && bootverbose) + device_printf(dev, "failed to set Xen PV clock: %d\n", ret); + + return (ret); } /** From owner-svn-src-all@freebsd.org Mon May 2 16:16:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C28AEEA2E; Mon, 2 May 2016 16:16:09 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 062701CCB; Mon, 2 May 2016 16:16:08 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GG8sd052446; Mon, 2 May 2016 16:16:08 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GG8Nj052445; Mon, 2 May 2016 16:16:08 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021616.u42GG8Nj052445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298930 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:16:09 -0000 Author: royger Date: Mon May 2 16:16:08 2016 New Revision: 298930 URL: https://svnweb.freebsd.org/changeset/base/298930 Log: xen/time: fix PV clock resolution The current resolution of the Xen PV clock is too high, which causes an adjustment of 5s to be applied to it. Reduce the resolution to be the same as the RTC plus one, so it's always selected as the best source when available on x86. Also don't reset the clock on resume, it's pointless and discards any previous adjustments. Sponsoted by: Citrix Systems R&D Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Mon May 2 16:15:28 2016 (r298929) +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:16:08 2016 (r298930) @@ -77,7 +77,7 @@ static devclass_t xentimer_devclass; /* Xen timers may fire up to 100us off */ #define XENTIMER_MIN_PERIOD_IN_NSEC 100*NSEC_IN_USEC -#define XENCLOCK_RESOLUTION 10000000 +#define XENCLOCK_RESOLUTION 1000001 /* ATRTC resolution + 1 */ #define XENTIMER_QUALITY 950 @@ -472,9 +472,6 @@ xentimer_resume(device_t dev) /* Reset the last uptime value */ pvclock_resume(); - /* Reset the RTC clock */ - inittodr(time_second); - /* Kick the timers on all CPUs */ smp_rendezvous(NULL, xentimer_percpu_resume, NULL, dev); From owner-svn-src-all@freebsd.org Mon May 2 16:19:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85EB0AEEAEC; Mon, 2 May 2016 16:19:29 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55D91E7F; Mon, 2 May 2016 16:19:28 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190f-ca3ff70000004b9e-71-57277e079042 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id F9.D8.19358.70E77275; Mon, 2 May 2016 12:19:19 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id u42GJIEs001920; Mon, 2 May 2016 12:19:19 -0400 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id u42GJFX2016503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 2 May 2016 12:19:17 -0400 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id u42GJEoY001093; Mon, 2 May 2016 12:19:14 -0400 (EDT) Date: Mon, 2 May 2016 12:19:14 -0400 (EDT) From: Benjamin Kaduk To: "Bjoern A. Zeeb" cc: cem@FreeBSD.org, Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r298924 - head/usr.bin/sdiff In-Reply-To: <7DC09622-48D4-41C4-8913-9039D44BC1E7@FreeBSD.org> Message-ID: References: <201605021507.u42F7hI3029685@repo.freebsd.org> <9AEBC481-D541-451F-82E0-7BCD571B0F93@FreeBSD.org> <7DC09622-48D4-41C4-8913-9039D44BC1E7@FreeBSD.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT0WWvUw83uPLCxOLYw6PsFkdmfWSx eDf3A7PFn/YpLBZ/Ni1ktWj6soDJgc1jxqf5LB47Z91lD2CK4rJJSc3JLEst0rdL4MqY+fsj c8FO7oqnZ6azNDD2cnYxcnJICJhItHzcxdzFyMUhJNDGJHHz5BcoZwOjxMeFixkhnINMEtse NjGCtAgJ1Et0XdjIBGKzCGhJbPk8kRnEZhNQkZj5ZiMbiC0ioCpxcetrsEnMAj8ZJV6s+88C khAWMJVY9/sK2CBOAXuJR9++sYPYvAKOElN+XmWCWPCRSeJQWzyILSqgI7F6/xQWiBpBiZMz nwDZHEBDAyTu3jeZwCgwC0lmFkIGJMwsoC7R+OAsG4StLXH/ZhvbAkaWVYyyKblVurmJmTnF qcm6xcmJeXmpRbomermZJXqpKaWbGEGBzinJv4NxToP3IUYBDkYlHl6PdLVwIdbEsuLK3EOM khxMSqK8k7LUw4X4kvJTKjMSizPii0pzUosPMUpwMCuJ8LYUA+V4UxIrq1KL8mFS0hwsSuK8 jAwMDEIC6YklqdmpqQWpRTBZGQ4OJQle01qgRsGi1PTUirTMnBKENBMHJ8hwHqDhN2tAhhcX JOYWZ6ZD5E8xKkqJ894FSQiAJDJK8+B6wYloN5PqK0ZxoFeEeYVBVvAAkxhc9yugwUxAg7PX q4IMLklESEk1MGZYXbrn63V3up3r7rfu8Z4vvilO5fjCc2ffBk72EGe2JyvenvBcGPx31fx5 O3XufyhqvX+C8daD53VuwZoldXvFduqteqgoekTX4+NUK4lFCcJqwq3zZPfGMD67uOVNfa5g iX7v7CPfdl1Rcvy248UqnbtHegU/Ol4V0PlvVPbgZ1fpk8kTTO8osRRnJBpqMRcVJwIAZQky XB8DAAA= Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:19:29 -0000 On Mon, 2 May 2016, Bjoern A. Zeeb wrote: > > > On 02 May 2016, at 16:08 , Conrad Meyer wrote: > > > > On Mon, May 2, 2016 at 8:57 AM, Benjamin Kaduk wrot= e: > >> On Mon, May 2, 2016 at 10:54 AM, Bjoern A. Zeeb wrote= : > >>>> On 02 May 2016, at 15:32 , Conrad Meyer wrote: > >>>> > >>>> Clang should really catch this too. Why didn=E2=80=99t it? > >>> > >>> It was only powerpc; sparc64 and mips were good as well. > >> > >> 'char' being signed vs. unsigned? > > > > Yeah, that occurred to me, but EOF should be out of range for any char > > type. I'd like ((char)getchar() =3D=3D EOF) to warn on all platforms. > > I think we just define EOF to be -1. Someone should check, and that the = warning message might be misleading. Yeah, stdio.h has: #define EOF (-1) If char is signed, that gets more exciting, due to the value-preserving promotion rule (after the char cast, it gets converted back to int for the comparison operation). Also, -1 is assumed to be EOF in external code, e.g., contrib/top/getopt.c. -Ben From owner-svn-src-all@freebsd.org Mon May 2 16:47:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6AF4B296E7; Mon, 2 May 2016 16:47:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7D1138C; Mon, 2 May 2016 16:47:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GlTAn061662; Mon, 2 May 2016 16:47:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GlSGY061648; Mon, 2 May 2016 16:47:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605021647.u42GlSGY061648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 16:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298931 - in head/sys/dev: ciss drm2/i915 drm2/radeon drm2/ttm hptiop hwpmc isci/scil pccbb wbwd wtap wtap/plugins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 16:47:30 -0000 Author: pfg Date: Mon May 2 16:47:28 2016 New Revision: 298931 URL: https://svnweb.freebsd.org/changeset/base/298931 Log: etc: minor spelling fixes. Mostly comments but also some user-visible strings. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/radeon/radeon_fb.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/dev/hptiop/hptiop.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/isci/scil/scic_phy.h head/sys/dev/isci/scil/scic_sds_phy.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/wbwd/wbwd.c head/sys/dev/wtap/if_wtap.c head/sys/dev/wtap/if_wtap_module.c head/sys/dev/wtap/plugins/visibility.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/ciss/ciss.c Mon May 2 16:47:28 2016 (r298931) @@ -464,7 +464,7 @@ ciss_attach(device_t dev) ciss_initq_notify(sc); /* - * Initalize device sysctls. + * Initialize device sysctls. */ ciss_init_sysctl(sc); @@ -619,7 +619,7 @@ ciss_init_pci(struct ciss_softc *sc) /* * XXX Big hammer, masks/unmasks all possible interrupts. This should * work on all hardware variants. Need to add code to handle the - * "controller crashed" interupt bit that this unmasks. + * "controller crashed" interrupt bit that this unmasks. */ sqmask = ~0; } @@ -4487,7 +4487,7 @@ ciss_name_ldrive_org(int org) case CISS_LDRIVE_RAIDADG: return("RAID ADG"); } - return("unkown"); + return("unknown"); } /************************************************************************ Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/drm2/i915/i915_gem.c Mon May 2 16:47:28 2016 (r298931) @@ -1600,7 +1600,7 @@ have_page: } DRM_UNLOCK(dev); if (*mres != NULL) { - KASSERT(*mres != page, ("loosing %p %p", *mres, page)); + KASSERT(*mres != page, ("losing %p %p", *mres, page)); vm_page_lock(*mres); vm_page_free(*mres); vm_page_unlock(*mres); @@ -3149,7 +3149,7 @@ static bool i915_gem_valid_gtt_space(str /* On non-LLC machines we have to be careful when putting differing * types of snoopable memory together to avoid the prefetcher - * crossing memory domains and dieing. + * crossing memory domains and dying. */ if (HAS_LLC(dev)) return true; Modified: head/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- head/sys/dev/drm2/i915/intel_dp.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/drm2/i915/intel_dp.c Mon May 2 16:47:28 2016 (r298931) @@ -1959,7 +1959,7 @@ intel_dp_complete_link_train(struct inte } if (channel_eq) - DRM_DEBUG_KMS("Channel EQ done. DP Training successfull\n"); + DRM_DEBUG_KMS("Channel EQ done. DP Training successful\n"); intel_dp_set_link_train(intel_dp, DP, DP_TRAINING_PATTERN_DISABLE); } Modified: head/sys/dev/drm2/radeon/radeon_fb.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_fb.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/drm2/radeon/radeon_fb.c Mon May 2 16:47:28 2016 (r298931) @@ -228,7 +228,7 @@ static int radeonfb_create(struct radeon ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); if (ret) { - DRM_ERROR("failed to initalise framebuffer %d\n", ret); + DRM_ERROR("failed to initialise framebuffer %d\n", ret); goto out_unref; } Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Mon May 2 16:47:28 2016 (r298931) @@ -260,7 +260,7 @@ reserve: m->valid = VM_PAGE_BITS_ALL; vm_page_xbusy(m); if (*mres != NULL) { - KASSERT(*mres != m, ("loosing %p %p", *mres, m)); + KASSERT(*mres != m, ("losing %p %p", *mres, m)); vm_page_lock(*mres); vm_page_free(*mres); vm_page_unlock(*mres); @@ -296,7 +296,7 @@ ttm_bo_vm_ctor(void *handle, vm_ooffset_ * acquired either in ttm_bo_mmap() or ttm_bo_vm_open(). It's * then released in ttm_bo_vm_close(). * - * Here, this function is called during mmap() intialization. + * Here, this function is called during mmap() initialization. * Thus, the reference acquired in ttm_bo_mmap_single() is * sufficient. */ Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/hptiop/hptiop.c Mon May 2 16:47:28 2016 (r298931) @@ -2408,7 +2408,7 @@ static void hptiop_post_req_itl(struct h iop_req32 = BUS_SPACE_RD4_ITL(inbound_queue); if (iop_req32 == IOPMU_QUEUE_EMPTY) { - device_printf(hba->pcidev, "invaild req offset\n"); + device_printf(hba->pcidev, "invalid req offset\n"); ccb->ccb_h.status = CAM_BUSY; bus_dmamap_unload(hba->io_dmat, srb->dma_map); hptiop_free_srb(hba, srb); Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon May 2 16:47:28 2016 (r298931) @@ -1123,7 +1123,7 @@ pmc_detach_one_process(struct proc *p, s pmclog_process_pmcdetach(pm, p->p_pid); /* - * If there are no PMCs targetting this process, we remove its + * If there are no PMCs targeting this process, we remove its * descriptor from the target hash table and unset the P_HWPMC * flag in the struct proc. */ @@ -1232,7 +1232,7 @@ pmc_process_csw_in(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d] wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d] weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1377,7 +1377,7 @@ pmc_process_csw_out(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1907,7 +1907,7 @@ pmc_hook_handler(struct thread *td, int /* * Log the exec event to all monitoring owners. Skip - * owners who have already recieved the event because + * owners who have already received the event because * they had system sampling PMCs active. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -1933,7 +1933,7 @@ pmc_hook_handler(struct thread *td, int /* * If the newly exec()'ed process has a different credential * than before, allow it to be the target of a PMC only if - * the PMC's owner has sufficient priviledge. + * the PMC's owner has sufficient privilege. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -4441,7 +4441,7 @@ pmc_process_exit(void *arg __unused, str * process, we would have context switched IN at some prior * point. However, with PREEMPTION, kernel mode context * switches may happen any time, so we want to disable a - * context switch OUT till we get any PMCs targetting this + * context switch OUT till we get any PMCs targeting this * process off the hardware. * * We also need to atomically remove this process' @@ -4544,7 +4544,7 @@ pmc_process_exit(void *arg __unused, str /* * Unlink this process from the PMCs that are - * targetting it. This will send a signal to + * targeting it. This will send a signal to * all PMC owner's whose PMCs are orphaned. * * Log PMC value at exit time if requested. Modified: head/sys/dev/isci/scil/scic_phy.h ============================================================================== --- head/sys/dev/isci/scil/scic_phy.h Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/isci/scil/scic_phy.h Mon May 2 16:47:28 2016 (r298931) @@ -308,7 +308,7 @@ SCI_STATUS scic_sas_phy_get_properties( /** * @brief This method will enable the user to retrieve information - * specific to a SATA phy, such as: the recieved signature + * specific to a SATA phy, such as: the received signature * FIS, if a port selector is present, etc. * * @param[in] phy this parameter specifies the phy for which to Modified: head/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_phy.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/isci/scil/scic_sds_phy.c Mon May 2 16:47:28 2016 (r298931) @@ -749,7 +749,7 @@ SCI_STATUS scic_sds_phy_initialize( this_phy, link_layer_registers )); - // Perfrom the initialization of the TL hardware + // Perform the initialization of the TL hardware scic_sds_phy_transport_layer_initialization(this_phy, transport_layer_registers); // Perofrm the initialization of the PE hardware @@ -1029,7 +1029,7 @@ SCI_STATUS scic_sds_phy_reset( } /** - * @brief This method will process the event code recieved. + * @brief This method will process the event code received. * * @param[in] this_phy * @param[in] event_code @@ -1052,7 +1052,7 @@ SCI_STATUS scic_sds_phy_event_handler( } /** - * @brief This method will process the frame index recieved. + * @brief This method will process the frame index received. * * @param[in] this_phy * @param[in] frame_index @@ -1754,7 +1754,7 @@ SCI_STATUS scic_sds_phy_default_frame_ha SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY, - "SCIC Phy 0x%08x recieved unexpected frame data %d while in state %d\n", + "SCIC Phy 0x%08x received unexpected frame data %d while in state %d\n", this_phy, frame_index, sci_base_state_machine_get_state(&this_phy->parent.state_machine) )); @@ -1866,7 +1866,7 @@ SCI_STATUS scic_sds_phy_stopped_state_st * This method takes the SCIC_SDS_PHY from a stopped state and destroys it. * - This function takes no action. * - * @todo Shouldnt this function transition the SCI_BASE_PHY::state_machine to + * @todo Shouldn't this function transition the SCI_BASE_PHY::state_machine to * the SCI_BASE_PHY_STATE_FINAL? * * @param[in] phy This is the SCI_BASE_PHY object which is cast into a @@ -1964,7 +1964,7 @@ SCI_STATUS scic_sds_phy_ready_state_rese * - decoded event is a link failure * - transition the SCIC_SDS_PHY back to the SCI_BASE_PHY_STATE_STARTING * state. - * - any other event recived will report a warning message + * - any other event received will report a warning message * * @param[in] phy This is the SCIC_SDS_PHY object which has received the * event. @@ -2020,7 +2020,7 @@ SCI_STATUS scic_sds_phy_ready_state_even SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x ready state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x ready state machine received unexpected event_code %x\n", this_phy, event_code )); result = SCI_FAILURE_INVALID_STATE; @@ -2066,7 +2066,7 @@ SCI_STATUS scic_sds_phy_resetting_state_ SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x resetting state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x resetting state machine received unexpected event_code %x\n", this_phy, event_code )); @@ -2691,7 +2691,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2772,7 +2772,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2834,7 +2834,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2879,7 +2879,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2935,7 +2935,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3003,7 +3003,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3090,7 +3090,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3147,7 +3147,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3246,7 +3246,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } @@ -3332,7 +3332,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/pccbb/pccbb_pci.c Mon May 2 16:47:28 2016 (r298931) @@ -340,7 +340,7 @@ cbb_pci_attach(device_t brdev) SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "memory", CTLFLAG_RD, &sc->subbus, 0, "Memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "premem", - CTLFLAG_RD, &sc->subbus, 0, "Prefetch memroy window open"); + CTLFLAG_RD, &sc->subbus, 0, "Prefetch memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io1", CTLFLAG_RD, &sc->subbus, 0, "io range 1 open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io2", @@ -448,7 +448,7 @@ cbb_chipinit(struct cbb_softc *sc) if (pci_read_config(sc->dev, PCIR_LATTIMER, 1) < 0x20) pci_write_config(sc->dev, PCIR_LATTIMER, 0x20, 1); - /* Enable DMA, memory access for this card and I/O acces for children */ + /* Enable DMA, memory access for this card and I/O access for children */ pci_enable_busmaster(sc->dev); pci_enable_io(sc->dev, SYS_RES_IOPORT); pci_enable_io(sc->dev, SYS_RES_MEMORY); Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/wbwd/wbwd.c Mon May 2 16:47:28 2016 (r298931) @@ -754,7 +754,7 @@ wb_attach(device_t dev) sc = device_get_softc(dev); KASSERT(sc->ext_cfg_enter_f != NULL && sc->ext_cfg_exit_f != NULL, - ("%s: successfull probe result but not setup correctly", __func__)); + ("%s: successful probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/wtap/if_wtap.c Mon May 2 16:47:28 2016 (r298931) @@ -131,7 +131,7 @@ wtap_node_ioctl(struct cdev *dev, u_long switch(cmd) { default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } return error; Modified: head/sys/dev/wtap/if_wtap_module.c ============================================================================== --- head/sys/dev/wtap/if_wtap_module.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/wtap/if_wtap_module.c Mon May 2 16:47:28 2016 (r298931) @@ -88,7 +88,7 @@ MALLOC_DEFINE(M_WTAP, "wtap", "wtap wireless simulator"); MALLOC_DEFINE(M_WTAP_PACKET, "wtap packet", "wtap wireless simulator packet"); MALLOC_DEFINE(M_WTAP_RXBUF, "wtap rxbuf", - "wtap wireless simulator recieve buffer"); + "wtap wireless simulator receive buffer"); MALLOC_DEFINE(M_WTAP_PLUGIN, "wtap plugin", "wtap wireless simulator plugin"); static struct wtap_hal *hal; @@ -122,7 +122,7 @@ wtap_ioctl(struct cdev *dev, u_long cmd, error = EINVAL; break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } Modified: head/sys/dev/wtap/plugins/visibility.c ============================================================================== --- head/sys/dev/wtap/plugins/visibility.c Mon May 2 16:16:08 2016 (r298930) +++ head/sys/dev/wtap/plugins/visibility.c Mon May 2 16:47:28 2016 (r298931) @@ -230,7 +230,7 @@ vis_ioctl(struct cdev *sdev, u_long cmd, #endif break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } From owner-svn-src-all@freebsd.org Mon May 2 17:44:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D1EB2AB91; Mon, 2 May 2016 17:44:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF7413E6; Mon, 2 May 2016 17:44:07 +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 u42Hi6Me080878; Mon, 2 May 2016 17:44:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42Hi3Dg080849; Mon, 2 May 2016 17:44:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605021744.u42Hi3Dg080849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 17:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298932 - in head/sys/dev/usb: . controller input misc net serial storage template wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 17:44:07 -0000 Author: pfg Date: Mon May 2 17:44:03 2016 New Revision: 298932 URL: https://svnweb.freebsd.org/changeset/base/298932 Log: dev/usb: minor spelling fixes in comments. No functional change. Reviewed by: hselasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/xhcireg.h head/sys/dev/usb/input/ums.c head/sys/dev/usb/input/wsp.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umcs.h head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/storage/rio500_usb.h head/sys/dev/usb/storage/umass.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_cdc.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdevs head/sys/dev/usb/usbdi.h head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/at91dci.c Mon May 2 17:44:03 2016 (r298932) @@ -1330,7 +1330,7 @@ at91dci_clear_stall_sub(struct at91dci_s /* * NOTE: One would assume that a FIFO reset would release the - * FIFO banks aswell, but it doesn't! We have to do this + * FIFO banks as well, but it doesn't! We have to do this * manually! */ Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/dwc_otg.c Mon May 2 17:44:03 2016 (r298932) @@ -3332,7 +3332,7 @@ dwc_otg_setup_standard_chain(struct usb_ * type in general, as a means to workaround * that. This trick should work for both FULL and LOW * speed USB traffic going through a TT. For non-TT - * traffic it works aswell. The reason for using + * traffic it works as well. The reason for using * CONTROL type instead of BULK is that some TTs might * reject LOW speed BULK traffic. */ Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/ehci.c Mon May 2 17:44:03 2016 (r298932) @@ -2995,7 +2995,7 @@ struct usb_device_descriptor ehci_devd = UDPROTO_HSHUBSTT, /* protocol */ 64, /* max packet */ {0}, {0}, {0x00, 0x01}, /* device id */ - 1, 2, 0, /* string indicies */ + 1, 2, 0, /* string indexes */ 1 /* # of configurations */ }; Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/ohci.c Mon May 2 17:44:03 2016 (r298932) @@ -2043,7 +2043,7 @@ struct usb_device_descriptor ohci_devd = UDPROTO_FSHUB, /* protocol */ 64, /* max packet */ {0}, {0}, {0x00, 0x01}, /* device id */ - 1, 2, 0, /* string indicies */ + 1, 2, 0, /* string indexes */ 1 /* # of configurations */ }; Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/uhci.c Mon May 2 17:44:03 2016 (r298932) @@ -2321,7 +2321,7 @@ struct usb_device_descriptor uhci_devd = UDPROTO_FSHUB, /* protocol */ 64, /* max packet */ {0}, {0}, {0x00, 0x01}, /* device id */ - 1, 2, 0, /* string indicies */ + 1, 2, 0, /* string indexes */ 1 /* # of configurations */ }; Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/controller/xhcireg.h Mon May 2 17:44:03 2016 (r298932) @@ -45,16 +45,16 @@ #define XHCI_HCIVERSION 0x02 /* RO Interface version number */ #define XHCI_HCIVERSION_0_9 0x0090 /* xHCI version 0.9 */ #define XHCI_HCIVERSION_1_0 0x0100 /* xHCI version 1.0 */ -#define XHCI_HCSPARAMS1 0x04 /* RO structual parameters 1 */ +#define XHCI_HCSPARAMS1 0x04 /* RO structural parameters 1 */ #define XHCI_HCS1_DEVSLOT_MAX(x)((x) & 0xFF) #define XHCI_HCS1_IRQ_MAX(x) (((x) >> 8) & 0x3FF) #define XHCI_HCS1_N_PORTS(x) (((x) >> 24) & 0xFF) -#define XHCI_HCSPARAMS2 0x08 /* RO structual parameters 2 */ +#define XHCI_HCSPARAMS2 0x08 /* RO structural parameters 2 */ #define XHCI_HCS2_IST(x) ((x) & 0xF) #define XHCI_HCS2_ERST_MAX(x) (((x) >> 4) & 0xF) #define XHCI_HCS2_SPR(x) (((x) >> 24) & 0x1) #define XHCI_HCS2_SPB_MAX(x) (((x) >> 27) & 0x7F) -#define XHCI_HCSPARAMS3 0x0C /* RO structual parameters 3 */ +#define XHCI_HCSPARAMS3 0x0C /* RO structural parameters 3 */ #define XHCI_HCS3_U1_DEL(x) ((x) & 0xFF) #define XHCI_HCS3_U2_DEL(x) (((x) >> 16) & 0xFFFF) #define XHCI_HCSPARAMS0 0x10 /* RO capability parameters */ Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/input/ums.c Mon May 2 17:44:03 2016 (r298932) @@ -572,7 +572,7 @@ ums_attach(device_t dev) * The Microsoft Wireless Notebook Optical Mouse seems to be in worse * shape than the Wireless Intellimouse 2.0, as its X, Y, wheel, and * all of its other button positions are all off. It also reports that - * it has two addional buttons and a tilt wheel. + * it has two additional buttons and a tilt wheel. */ if (usb_test_quirk(uaa, UQ_MS_BAD_CLASS)) { Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/input/wsp.c Mon May 2 17:44:03 2016 (r298932) @@ -1040,7 +1040,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (sc->o_ntouch != ntouch) dx = dy = 0; - /* Ignore unexpeted movment when typing */ + /* Ignore unexpeted movement when typing */ if (ntouch == 1 && sc->index[0]->tool_major > 1200) dx = dy = 0; Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/misc/udbp.c Mon May 2 17:44:03 2016 (r298932) @@ -744,7 +744,7 @@ ng_udbp_rcvdata(hook_p hook, item_p item /* * Do local shutdown processing.. - * We are a persistant device, we refuse to go away, and + * We are a persistent device, we refuse to go away, and * only remove our links and reset ourself. */ static int Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/net/if_cue.c Mon May 2 17:44:03 2016 (r298932) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); * RX filter uses a 512-bit multicast hash table, single perfect entry * for the station address, and promiscuous mode. Unlike the ADMtek * and KLSI chips, the CATC ASIC supports read and write combining - * mode where multiple packets can be transfered using a single bulk + * mode where multiple packets can be transferred using a single bulk * transaction, which helps performance a great deal. */ Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/net/if_rue.c Mon May 2 17:44:03 2016 (r298932) @@ -693,7 +693,7 @@ rue_bulk_read_callback(struct usb_xfer * usbd_copy_out(pc, actlen - 4, &status, sizeof(status)); actlen -= 4; - /* check recieve packet was valid or not */ + /* check receive packet was valid or not */ status = le16toh(status); if ((status & RUE_RXSTAT_VALID) == 0) { if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/net/if_urndis.c Mon May 2 17:44:03 2016 (r298932) @@ -709,7 +709,7 @@ urndis_ctrl_halt(struct urndis_softc *sc } /* - * NB: Querying a device has the requirment of using an input buffer the size + * NB: Querying a device has the requirement of using an input buffer the size * of the expected reply or larger, except for variably sized replies. */ static uint32_t Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/serial/ulpt.c Mon May 2 17:44:03 2016 (r298932) @@ -419,7 +419,7 @@ ulpt_open(struct usb_fifo *fifo, int ffl if (sc->sc_fflags == 0) { - /* reset USB paralell port */ + /* reset USB parallel port */ ulpt_reset(sc); } Modified: head/sys/dev/usb/serial/umcs.h ============================================================================== --- head/sys/dev/usb/serial/umcs.h Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/serial/umcs.h Mon May 2 17:44:03 2016 (r298932) @@ -107,28 +107,28 @@ * 4, R/W */ #define MCS7840_DEV_REG_BI_FIFO_STAT1 0x32 /* Bulk-In FIFO Stat for Port * 1, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BO_FIFO_STAT1 0x33 /* Bulk-out FIFO Stat for Port * 1, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BI_FIFO_STAT2 0x34 /* Bulk-In FIFO Stat for Port * 2, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BO_FIFO_STAT2 0x35 /* Bulk-out FIFO Stat for Port * 2, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BI_FIFO_STAT3 0x36 /* Bulk-In FIFO Stat for Port * 3, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BO_FIFO_STAT3 0x37 /* Bulk-out FIFO Stat for Port * 3, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BI_FIFO_STAT4 0x38 /* Bulk-In FIFO Stat for Port * 4, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_BO_FIFO_STAT4 0x39 /* Bulk-out FIFO Stat for Port * 4, contains number of - * availiable bytes, R/Only */ + * available bytes, R/Only */ #define MCS7840_DEV_REG_ZERO_PERIOD1 0x3a /* Period between zero out * frames for Port 1, R/W */ #define MCS7840_DEV_REG_ZERO_PERIOD2 0x3b /* Period between zero out @@ -139,28 +139,28 @@ * frames for Port 1, R/W */ #define MCS7840_DEV_REG_ZERO_ENABLE 0x3e /* Enable/disable of zero out * frames, R/W */ -#define MCS7840_DEV_REG_THR_VAL_LOW1 0x3f /* Low 8 bits of threshhold +#define MCS7840_DEV_REG_THR_VAL_LOW1 0x3f /* Low 8 bits of threshold * value for Bulk-Out for Port * 1, R/W */ -#define MCS7840_DEV_REG_THR_VAL_HIGH1 0x40 /* High 1 bit of threshhold +#define MCS7840_DEV_REG_THR_VAL_HIGH1 0x40 /* High 1 bit of threshold * value for Bulk-Out and * enable flag for Port 1, R/W */ -#define MCS7840_DEV_REG_THR_VAL_LOW2 0x41 /* Low 8 bits of threshhold +#define MCS7840_DEV_REG_THR_VAL_LOW2 0x41 /* Low 8 bits of threshold * value for Bulk-Out for Port * 2, R/W */ -#define MCS7840_DEV_REG_THR_VAL_HIGH2 0x42 /* High 1 bit of threshhold +#define MCS7840_DEV_REG_THR_VAL_HIGH2 0x42 /* High 1 bit of threshold * value for Bulk-Out and * enable flag for Port 2, R/W */ -#define MCS7840_DEV_REG_THR_VAL_LOW3 0x43 /* Low 8 bits of threshhold +#define MCS7840_DEV_REG_THR_VAL_LOW3 0x43 /* Low 8 bits of threshold * value for Bulk-Out for Port * 3, R/W */ -#define MCS7840_DEV_REG_THR_VAL_HIGH3 0x44 /* High 1 bit of threshhold +#define MCS7840_DEV_REG_THR_VAL_HIGH3 0x44 /* High 1 bit of threshold * value for Bulk-Out and * enable flag for Port 3, R/W */ -#define MCS7840_DEV_REG_THR_VAL_LOW4 0x45 /* Low 8 bits of threshhold +#define MCS7840_DEV_REG_THR_VAL_LOW4 0x45 /* Low 8 bits of threshold * value for Bulk-Out for Port * 4, R/W */ -#define MCS7840_DEV_REG_THR_VAL_HIGH4 0x46 /* High 1 bit of threshhold +#define MCS7840_DEV_REG_THR_VAL_HIGH4 0x46 /* High 1 bit of threshold * value for Bulk-Out and * enable flag for Port 4, R/W */ Modified: head/sys/dev/usb/serial/uvisor.c ============================================================================== --- head/sys/dev/usb/serial/uvisor.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/serial/uvisor.c Mon May 2 17:44:03 2016 (r298932) @@ -100,7 +100,7 @@ SYSCTL_INT(_hw_usb_uvisor, OID_AUTO, deb /* From the Linux driver */ /* * UVISOR_REQUEST_BYTES_AVAILABLE asks the visor for the number of bytes that - * are available to be transfered to the host for the specified endpoint. + * are available to be transferred to the host for the specified endpoint. * Currently this is not used, and always returns 0x0001 */ #define UVISOR_REQUEST_BYTES_AVAILABLE 0x01 Modified: head/sys/dev/usb/storage/rio500_usb.h ============================================================================== --- head/sys/dev/usb/storage/rio500_usb.h Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/storage/rio500_usb.h Mon May 2 17:44:03 2016 (r298932) @@ -5,7 +5,7 @@ Redistribution and use in source and binary forms, with or without modification, are permitted under any licence of your choise which - meets the open source licence definiton + meets the open source licence definition http://www.opensource.org/opd.html such as the GNU licence or the BSD licence. Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/storage/umass.c Mon May 2 17:44:03 2016 (r298932) @@ -2721,7 +2721,7 @@ umass_rbc_transform(struct umass_softc * cmd_len = 12; } sc->sc_transfer.cmd_len = cmd_len; - return (1); /* sucess */ + return (1); /* success */ /* All other commands are not legal in RBC */ default: Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/template/usb_template.c Mon May 2 17:44:03 2016 (r298932) @@ -522,8 +522,8 @@ usb_make_device_desc(struct usb_temp_set * usb_hw_ep_match * * Return values: - * 0: The endpoint profile does not match the criterias - * Else: The endpoint profile matches the criterias + * 0: The endpoint profile does not match the criteria + * Else: The endpoint profile matches the criteria *------------------------------------------------------------------------*/ static uint8_t usb_hw_ep_match(const struct usb_hw_ep_profile *pf, Modified: head/sys/dev/usb/usb_cdc.h ============================================================================== --- head/sys/dev/usb/usb_cdc.h Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_cdc.h Mon May 2 17:44:03 2016 (r298932) @@ -161,7 +161,7 @@ struct usb_cdc_notification { #define UCDC_NOTIFICATION_LENGTH 8 /* - * Bits set in the SERIAL STATE notifcation (first byte of data) + * Bits set in the SERIAL STATE notification (first byte of data) */ #define UCDC_N_SERIAL_OVERRUN 0x40 Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_dev.c Mon May 2 17:44:03 2016 (r298932) @@ -179,7 +179,7 @@ usb_loc_fill(struct usb_fs_privdata* pd, * * This function is used to atomically refer an USB device by its * device location. If this function returns success the USB device - * will not dissappear until the USB device is unreferenced. + * will not disappear until the USB device is unreferenced. * * Return values: * 0: Success, refcount incremented on the given USB device. Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_device.c Mon May 2 17:44:03 2016 (r298932) @@ -190,7 +190,7 @@ usbd_get_ep_by_addr(struct usb_device *u ea_val &= EA_MASK; /* - * Iterate accross all the USB endpoints searching for a match + * Iterate across all the USB endpoints searching for a match * based on the endpoint address: */ for (; ep != ep_end; ep++) { @@ -300,7 +300,7 @@ usbd_get_endpoint(struct usb_device *ude } /* - * Iterate accross all the USB endpoints searching for a match + * Iterate across all the USB endpoints searching for a match * based on the endpoint address. Note that we are searching * the endpoints from the beginning of the "udev->endpoints" array. */ Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_handle_request.c Mon May 2 17:44:03 2016 (r298932) @@ -313,7 +313,7 @@ tr_repeat: case UR_SET_INTERFACE: /* * We assume that the endpoints are the same - * accross the alternate settings. + * across the alternate settings. * * Reset the endpoints, because re-attaching * only a part of the device is not possible. Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_hid.c Mon May 2 17:44:03 2016 (r298932) @@ -576,7 +576,7 @@ hid_report_size(const void *buf, usb_siz for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) { if (h.kind == k) { - /* check for ID-byte presense */ + /* check for ID-byte presence */ if ((h.report_ID != 0) && !any_id) { if (id != NULL) *id = h.report_ID; Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_hub.c Mon May 2 17:44:03 2016 (r298932) @@ -1766,7 +1766,7 @@ done: * The USB Transaction Translator: * =============================== * - * When doing LOW- and FULL-speed USB transfers accross a HIGH-speed + * When doing LOW- and FULL-speed USB transfers across a HIGH-speed * USB HUB, bandwidth must be allocated for ISOCHRONOUS and INTERRUPT * USB transfers. To utilize bandwidth dynamically the "scatter and * gather" principle must be applied. This means that bandwidth must @@ -1838,7 +1838,7 @@ usb_intr_find_best_slot(usb_size_t *ptr, /*------------------------------------------------------------------------* * usb_hs_bandwidth_adjust * - * This function will update the bandwith usage for the microframe + * This function will update the bandwidth usage for the microframe * having index "slot" by "len" bytes. "len" can be negative. If the * "slot" argument is greater or equal to "USB_HS_MICRO_FRAMES_MAX" * the "slot" argument will be replaced by the slot having least used @@ -2310,7 +2310,7 @@ usb_needs_explore_all(void) return; } /* - * Explore all USB busses in parallell. + * Explore all USB busses in parallel. */ max = devclass_get_maxunit(dc); while (max >= 0) { Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usb_transfer.c Mon May 2 17:44:03 2016 (r298932) @@ -615,7 +615,7 @@ usbd_transfer_setup_sub(struct usb_setup /* * NOTE: we do not allow "max_packet_size" or "max_frame_size" * to be equal to zero when setting up USB transfers, hence - * this leads to alot of extra code in the USB kernel. + * this leads to a lot of extra code in the USB kernel. */ if ((xfer->max_frame_size == 0) || @@ -2448,7 +2448,7 @@ done: * * This function is called when the DMA delay has been exectuded, and * will make sure that the callback is called to complete the USB - * transfer. This code path is ususally only used when there is an USB + * transfer. This code path is usually only used when there is an USB * error like USB_ERR_CANCELLED. *------------------------------------------------------------------------*/ void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usbdevs Mon May 2 17:44:03 2016 (r298932) @@ -134,7 +134,7 @@ vendor MEGATRENDS 0x046b American Megatr vendor LOGITECH 0x046d Logitech vendor BTC 0x046e Behavior Tech. Computer vendor PHILIPS 0x0471 Philips -vendor SUN2 0x0472 Sun Microsystems (offical) +vendor SUN2 0x0472 Sun Microsystems (official) vendor SANYO 0x0474 Sanyo Electric vendor SEAGATE 0x0477 Seagate vendor CONNECTIX 0x0478 Connectix Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/usbdi.h Mon May 2 17:44:03 2016 (r298932) @@ -241,7 +241,7 @@ struct usb_config { /* * Use these macro when defining USB device ID arrays if you want to * have your driver module automatically loaded in host, device or - * both modes respectivly: + * both modes respectively: */ #if USB_HAVE_ID_SECTION #define STRUCT_USB_HOST_ID \ Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon May 2 16:47:28 2016 (r298931) +++ head/sys/dev/usb/wlan/if_run.c Mon May 2 17:44:03 2016 (r298932) @@ -1030,7 +1030,7 @@ run_vap_delete(struct ieee80211vap *vap) * There are numbers of functions need to be called in context thread. * Rather than creating taskqueue event for each of those functions, * here is all-for-one taskqueue callback function. This function - * gurantees deferred functions are executed in the same order they + * guarantees deferred functions are executed in the same order they * were enqueued. * '& RUN_CMDQ_MASQ' is to loop cmdq[]. */ @@ -3372,7 +3372,7 @@ run_tx(struct run_softc *sc, struct mbuf /* * Unlike PCI based devices, we don't get any interrupt from * USB devices, so we simulate FIFO-is-full interrupt here. - * Ralink recomends to drain FIFO stats every 100 ms, but 16 slots + * Ralink recommends to drain FIFO stats every 100 ms, but 16 slots * quickly get fulled. To prevent overflow, increment a counter on * every FIFO stat request, so we know how many slots are left. * We do this only in HOSTAP or multiple vap mode since FIFO stats @@ -4884,7 +4884,7 @@ run_update_beacon_cb(void *arg) /* * No need to call ieee80211_beacon_update(), run_update_beacon() - * is taking care of apropriate calls. + * is taking care of appropriate calls. */ if (rvp->beacon_mbuf == NULL) { rvp->beacon_mbuf = ieee80211_beacon_alloc(ni); From owner-svn-src-all@freebsd.org Mon May 2 18:00:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28935B2A01B; Mon, 2 May 2016 18:00:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC4881EEE; Mon, 2 May 2016 18:00:40 +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 u42I0eUW084262; Mon, 2 May 2016 18:00:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42I0cjK084243; Mon, 2 May 2016 18:00:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605021800.u42I0cjK084243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 2 May 2016 18:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 18:00:41 -0000 Author: jhb Date: Mon May 2 18:00:38 2016 New Revision: 298933 URL: https://svnweb.freebsd.org/changeset/base/298933 Log: Add a new bus method to fetch device-specific CPU sets. bus_get_cpus() returns a specified set of CPUs for a device. It accepts an enum for the second parameter that indicates the type of cpuset to request. Currently two valus are supported: - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to the device when DEVICE_NUMA is enabled) - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) For systems that do not support NUMA (or if it is not enabled in the kernel config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' by default. The idea is that INTR_CPUS should always return a valid set. Device drivers which want to use per-CPU interrupts should start using INTR_CPUS instead of simply assigning interrupts to all available CPUs. In the future we may wish to add tunables to control the policy of INTR_CPUS (e.g. should it be local-only or global, should it ignore SMT threads or not). The x86 nexus driver exposes the internal set of interrupt CPUs from the the x86 interrupt code via INTR_CPUS. The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and the global INTR_CPUS set from the nexus driver with the per-domain set from _PXM to generate a local INTR_CPUS set for child devices. Reviewed by: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5519 Added: head/share/man/man9/BUS_GET_CPUS.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/amd64/include/intr_machdep.h head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/acpica/acpi_pcibvar.h head/sys/dev/acpica/acpivar.h head/sys/dev/drm2/drm_dp_iic_helper.c head/sys/dev/drm2/i915/dvo.h head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h head/sys/x86/acpica/OsdEnvironment.c head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/nexus.c Added: head/share/man/man9/BUS_GET_CPUS.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_GET_CPUS.9 Mon May 2 18:00:38 2016 (r298933) @@ -0,0 +1,100 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 1, 2016 +.Dt BUS_GET_CPUS 9 +.Os +.Sh NAME +.Nm BUS_GET_CPUS , +.Nm bus_get_cpus +.Nd "request a set of device-specific CPUs" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft int +.Fo BUS_GET_CPUS +.Fa "device_t dev" "device_t child" "enum cpu_sets op" "size_t setsize" +.Fa "cpuset_t *cpuset" +.Fc +.Ft int +.Fo bus_get_cpus +.Fa "device_t dev" "enum cpu_sets op" "size_t setsize" "cpuset_t *cpuset" +.Fc +.Sh DESCRIPTION +The +.Fn BUS_GET_CPUS +method queries the parent bus device for a set of device-specific CPUs. +The +.Fa op +argument specifies which set of CPUs to retrieve. +If successful, +the requested set of CPUs are returned in +.Fa cpuset . +The +.Fa setsize +argument specifies the size in bytes of the set passed in +.Fa cpuset . +.Pp +.Fn BUS_GET_CPUS +supports querying different types of CPU sets via the the +.Fa op argument. +Not all set types are supported for every device. +If a set type is not supported, +.Fn BUS_GET_CPUS +fails with +.Er EINVAL . +These set types are supported: +.Bl -tag -width ".Dv LOCAL_CPUS" +.It Dv LOCAL_CPUS +The set of CPUs that are local to the device. +If a device is closer to a specific memory domain in a non-uniform memory +architecture system +.Pq NUMA , +this will return the set of CPUs in that memory domain. +.It Dv INTR_CPUS +The preferred set of CPUs that this device should use for device interrupts. +This set type must be supported by all bus drivers. +.El +.Pp +The +.Fn bus_get_cpus +function is a simple wrapper around +.Fn BUS_GET_CPUS . +.Sh RETURN VALUES +Zero is returned on success, otherwise an appropriate error is returned. +.Sh SEE ALSO +.Xr cpuset 2 , +.Xr BUS_BIND_INTR 9 , +.Xr device 9 +.Sh HISTORY +The +.Fn BUS_GET_CPUS +method and +.Fn bus_get_cpus +function first appeared in +.Fx 11.0 . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon May 2 17:44:03 2016 (r298932) +++ head/share/man/man9/Makefile Mon May 2 18:00:38 2016 (r298933) @@ -42,6 +42,7 @@ MAN= accept_filter.9 \ bus_generic_print_child.9 \ bus_generic_read_ivar.9 \ bus_generic_shutdown.9 \ + BUS_GET_CPUS.9 \ bus_get_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ @@ -502,6 +503,7 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 +MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9 MLINKS+=BUS_SETUP_INTR.9 bus_setup_intr.9 \ BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9 \ Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Mon May 2 17:44:03 2016 (r298932) +++ head/sys/amd64/include/intr_machdep.h Mon May 2 18:00:38 2016 (r298933) @@ -143,6 +143,9 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; +#ifdef SMP +extern cpuset_t intr_cpus; +#endif extern struct mtx icu_lock; extern int elcr_found; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi.c Mon May 2 18:00:38 2016 (r298933) @@ -211,6 +211,7 @@ static device_method_t acpi_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), + DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_domain, acpi_get_domain), /* ACPI bus */ @@ -1077,52 +1078,79 @@ acpi_hint_device_unit(device_t acdev, de } /* - * Fetch the VM domain for the given device 'dev'. - * - * Return 1 + domain if there's a domain, 0 if not found; - * -1 upon an error. + * Fetch the NUMA domain for a device by mapping the value returned by + * _PXM to a NUMA domain. If the device does not have a _PXM method, + * -2 is returned. If any other error occurs, -1 is returned. */ -int -acpi_parse_pxm(device_t dev, int *domain) +static int +acpi_parse_pxm(device_t dev) { #ifdef DEVICE_NUMA - ACPI_HANDLE h; - int d, pxm; + ACPI_HANDLE handle; + ACPI_STATUS status; + int pxm; - h = acpi_get_handle(dev); - if ((h != NULL) && - ACPI_SUCCESS(acpi_GetInteger(h, "_PXM", &pxm))) { - d = acpi_map_pxm_to_vm_domainid(pxm); - if (d < 0) - return (-1); - *domain = d; - return (1); - } + handle = acpi_get_handle(dev); + if (handle == NULL) + return (-2); + status = acpi_GetInteger(handle, "_PXM", &pxm); + if (ACPI_SUCCESS(status)) + return (acpi_map_pxm_to_vm_domainid(pxm)); + if (status == AE_NOT_FOUND) + return (-2); #endif + return (-1); +} - return (0); +int +acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + int d, error; + + d = acpi_parse_pxm(child); + if (d < 0) + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + + switch (op) { + case LOCAL_CPUS: + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = cpuset_domain[d]; + return (0); + case INTR_CPUS: + error = bus_generic_get_cpus(dev, child, op, setsize, cpuset); + if (error != 0) + return (error); + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + CPU_AND(cpuset, &cpuset_domain[d]); + return (0); + default: + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + } } /* - * Fetch the NUMA domain for the given device. + * Fetch the NUMA domain for the given device 'dev'. * * If a device has a _PXM method, map that to a NUMA domain. - * - * If none is found, then it'll call the parent method. - * If there's no domain, return ENOENT. + * Otherwise, pass the request up to the parent. + * If there's no matching domain or the domain cannot be + * determined, return ENOENT. */ int acpi_get_domain(device_t dev, device_t child, int *domain) { - int ret; + int d; - ret = acpi_parse_pxm(child, domain); - /* Error */ - if (ret == -1) - return (ENOENT); - /* Found */ - if (ret == 1) + d = acpi_parse_pxm(child); + if (d >= 0) { + *domain = d; return (0); + } + if (d == -1) + return (ENOENT); /* No _PXM node; go up a level */ return (bus_generic_get_domain(dev, child, domain)); Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi_pci.c Mon May 2 18:00:38 2016 (r298933) @@ -95,6 +95,7 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_child_deleted, acpi_pci_child_deleted), DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method), + DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), DEVMETHOD(bus_get_domain, acpi_get_domain), Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi_pcib.c Mon May 2 18:00:38 2016 (r298933) @@ -265,3 +265,11 @@ acpi_pcib_power_for_sleep(device_t pcib, acpi_device_pwr_for_sleep(acpi_dev, dev, pstate); return (0); } + +int +acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset) +{ + + return (bus_get_cpus(pcib, op, setsize, cpuset)); +} Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Mon May 2 18:00:38 2016 (r298933) @@ -130,6 +130,7 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_maxslots, pcib_maxslots), Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi_pcib_pci.c Mon May 2 18:00:38 2016 (r298933) @@ -78,6 +78,7 @@ static device_method_t acpi_pcib_pci_met /* Bus interface */ DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), + DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), Modified: head/sys/dev/acpica/acpi_pcibvar.h ============================================================================== --- head/sys/dev/acpica/acpi_pcibvar.h Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpi_pcibvar.h Mon May 2 18:00:38 2016 (r298933) @@ -36,6 +36,8 @@ void acpi_pci_link_add_reference(device_ int slot, int pin); int acpi_pci_link_route_interrupt(device_t dev, int index); void acpi_pcib_fetch_prt(device_t bus, ACPI_BUFFER *prt); +int acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset); int acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, ACPI_BUFFER *prtbuf); int acpi_pcib_power_for_sleep(device_t pcib, device_t dev, Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/acpica/acpivar.h Mon May 2 18:00:38 2016 (r298933) @@ -506,8 +506,9 @@ SYSCTL_DECL(_debug_acpi); * Returns the VM domain ID if found, or -1 if not found / invalid. */ int acpi_map_pxm_to_vm_domainid(int pxm); +int acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset); int acpi_get_domain(device_t dev, device_t child, int *domain); -int acpi_parse_pxm(device_t dev, int *domain); #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: head/sys/dev/drm2/drm_dp_iic_helper.c ============================================================================== --- head/sys/dev/drm2/drm_dp_iic_helper.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/drm2/drm_dp_iic_helper.c Mon May 2 18:00:38 2016 (r298933) @@ -23,7 +23,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/dev/drm2/i915/dvo.h ============================================================================== --- head/sys/dev/drm2/i915/dvo.h Mon May 2 17:44:03 2016 (r298932) +++ head/sys/dev/drm2/i915/dvo.h Mon May 2 18:00:38 2016 (r298933) @@ -26,7 +26,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Mon May 2 17:44:03 2016 (r298932) +++ head/sys/kern/bus_if.m Mon May 2 18:00:38 2016 (r298933) @@ -731,3 +731,21 @@ METHOD int get_domain { device_t _child; int *_domain; } DEFAULT bus_generic_get_domain; + +/** + * @brief Request a set of CPUs + * + * @param _dev the bus device + * @param _child the child device + * @param _op type of CPUs to request + * @param _setsize the size of the set passed in _cpuset + * @param _cpuset a pointer to a cpuset to receive the requested + * set of CPUs + */ +METHOD int get_cpus { + device_t _dev; + device_t _child; + enum cpu_sets _op; + size_t _setsize; + cpuset_t *_cpuset; +} DEFAULT bus_generic_get_cpus; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/kern/subr_bus.c Mon May 2 18:00:38 2016 (r298933) @@ -47,8 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -4111,6 +4113,23 @@ bus_generic_describe_intr(device_t dev, } /** + * @brief Helper function for implementing BUS_GET_CPUS(). + * + * This simple implementation of BUS_GET_CPUS() simply calls the + * BUS_GET_CPUS() method of the parent of @p dev. + */ +int +bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent != NULL) + return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_GET_DMA_TAG(). * * This simple implementation of BUS_GET_DMA_TAG() simply calls the @@ -4620,6 +4639,23 @@ bus_child_location_str(device_t child, c } /** + * @brief Wrapper function for BUS_GET_CPUS(). + * + * This function simply calls the BUS_GET_CPUS() method of the + * parent of @p dev. + */ +int +bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (EINVAL); + return (BUS_GET_CPUS(parent, dev, op, setsize, cpuset)); +} + +/** * @brief Wrapper function for BUS_GET_DMA_TAG(). * * This function simply calls the BUS_GET_DMA_TAG() method of the @@ -4711,6 +4747,23 @@ root_child_present(device_t dev, device_ return (-1); } +static int +root_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + + switch (op) { + case INTR_CPUS: + /* Default to returning the set of all CPUs. */ + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = all_cpus; + return (0); + default: + return (EINVAL); + } +} + static kobj_method_t root_methods[] = { /* Device interface */ KOBJMETHOD(device_shutdown, bus_generic_shutdown), @@ -4723,6 +4776,7 @@ static kobj_method_t root_methods[] = { KOBJMETHOD(bus_write_ivar, bus_generic_write_ivar), KOBJMETHOD(bus_setup_intr, root_setup_intr), KOBJMETHOD(bus_child_present, root_child_present), + KOBJMETHOD(bus_get_cpus, root_get_cpus), KOBJMETHOD_END }; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon May 2 17:44:03 2016 (r298932) +++ head/sys/sys/bus.h Mon May 2 18:00:38 2016 (r298933) @@ -32,6 +32,7 @@ #include #include #include +#include #include /** @@ -272,6 +273,16 @@ enum intr_polarity { INTR_POLARITY_LOW = 2 }; +/** + * CPU sets supported by bus_get_cpus(). Note that not all sets may be + * supported for a given device. If a request is not supported by a + * device (or its parents), then bus_get_cpus() will fail with EINVAL. + */ +enum cpu_sets { + LOCAL_CPUS = 0, + INTR_CPUS +}; + typedef int (*devop_t)(void); /** @@ -388,6 +399,8 @@ int bus_generic_deactivate_resource(devi int rid, struct resource *r); int bus_generic_detach(device_t dev); void bus_generic_driver_added(device_t dev, driver_t *driver); +int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset); bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child); bus_space_tag_t @@ -457,6 +470,8 @@ int bus_activate_resource(device_t dev, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); +int bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset); bus_dma_tag_t bus_get_dma_tag(device_t dev); bus_space_tag_t bus_get_bus_tag(device_t dev); int bus_get_domain(device_t dev, int *domain); Modified: head/sys/x86/acpica/OsdEnvironment.c ============================================================================== --- head/sys/x86/acpica/OsdEnvironment.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/x86/acpica/OsdEnvironment.c Mon May 2 18:00:38 2016 (r298933) @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/x86/x86/intr_machdep.c Mon May 2 18:00:38 2016 (r298933) @@ -490,7 +490,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs) * allocate CPUs round-robin. */ -static cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); +cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); static int current_cpu; /* Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Mon May 2 17:44:03 2016 (r298932) +++ head/sys/x86/x86/nexus.c Mon May 2 18:00:38 2016 (r298933) @@ -127,6 +127,8 @@ static int nexus_set_resource(device_t, static int nexus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *); static void nexus_delete_resource(device_t, device_t, int, int); +static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, + cpuset_t *); #ifdef DEV_APIC static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); @@ -163,6 +165,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), + DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* pcib interface */ #ifdef DEV_APIC @@ -619,6 +622,24 @@ nexus_delete_resource(device_t dev, devi resource_list_delete(rl, type, rid); } +static int +nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + + switch (op) { +#ifdef SMP + case INTR_CPUS: + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = intr_cpus; + return (0); +#endif + default: + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + } +} + /* Called from the MSI code to add new IRQs to the IRQ rman. */ void nexus_add_irq(u_long irq) From owner-svn-src-all@freebsd.org Mon May 2 18:23:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECDDDB2AD0A; Mon, 2 May 2016 18:23:49 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A53C412DE; Mon, 2 May 2016 18:23:49 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42INmvF092880; Mon, 2 May 2016 18:23:48 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42INmKr092879; Mon, 2 May 2016 18:23:48 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021823.u42INmKr092879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 18:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298934 - head/sys/dev/xen/control X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 18:23:50 -0000 Author: royger Date: Mon May 2 18:23:48 2016 New Revision: 298934 URL: https://svnweb.freebsd.org/changeset/base/298934 Log: xen/control: improve suspend/resume Implement several small improvements to the suspend/resume Xen sequence: - Call the power_suspend_early event before stopping all processes. - Stop all processes. This was done implicitly previously by putting all the CPUs in a known IPI handler. - Warm up the timecounter. - Re-initialize the time of day register. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Mon May 2 18:00:38 2016 (r298933) +++ head/sys/dev/xen/control/control.c Mon May 2 18:23:48 2016 (r298934) @@ -122,6 +122,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -197,6 +198,8 @@ xctrl_suspend() #endif int suspend_cancelled; + EVENTHANDLER_INVOKE(power_suspend_early); + stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); if (smp_started) { @@ -222,7 +225,6 @@ xctrl_suspend() printf("%s: device_suspend failed\n", __func__); return; } - mtx_unlock(&Giant); #ifdef SMP CPU_ZERO(&cpu_suspend_map); /* silence gcc */ @@ -273,16 +275,24 @@ xctrl_suspend() * FreeBSD really needs to add DEVICE_SUSPEND_CANCEL or * similar. */ - mtx_lock(&Giant); DEVICE_RESUME(root_bus); mtx_unlock(&Giant); + /* + * Warm up timecounter again and reset system clock. + */ + timecounter->tc_get_timecount(timecounter); + timecounter->tc_get_timecount(timecounter); + inittodr(time_second); + if (smp_started) { thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } + resume_all_proc(); + EVENTHANDLER_INVOKE(power_resume); if (bootverbose) From owner-svn-src-all@freebsd.org Mon May 2 18:45:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4749FB2A2D5; Mon, 2 May 2016 18:45:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::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 189091EFC; Mon, 2 May 2016 18:45:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id yl2so18286463pac.1; Mon, 02 May 2016 11:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NZweoUYbZPj/saJpaEyhmbLlgokxTYr+ZXhcfxtouY0=; b=Nf3hirFS/25tL3968rSwR/KRJKQSASedvRl6i/1Dlog1zgHWHW4GmyJYBZ0Mi9Lx8m hgtMj4+mmlDDIrDBwMr2XHj8jOWrjMvtErNrw17SsqQbH/42MvHeIrZyltS06Ribgad8 dGbwf8L0YJIflK3I70YxUlfNpIBRsA3ugMmjIGmxOOySaTU7Z4ohtolNetiAKF+reNaB FIToPyx9sEPBNpIPhFN/LWHlfCGNHHxFpEvzPezSrekTvsRqZldkEwQTte72H7hpd9ir x+Czwop0YWozMxZK84rC9Ja/Si7furNi+hOjz+nvpSkIQ10GIJRQfw40OFSbH8DBH9F5 z+0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NZweoUYbZPj/saJpaEyhmbLlgokxTYr+ZXhcfxtouY0=; b=RDlT6Kw4BSG7HFgr/hGaawVKzJGHH+va5tKWGfHMxihzYGVmZrDkbhMjT9bHsefau/ i2xsExkBFP/UVXnArk1kMPzzkwIsOpZCrEwVi0MCbqHGyrUAIdMK7RHW+AXg1z/JfA9r rJxqik7gjdpDTBrDgXl37jK4G5D08F2w5IsYAu9OIMj0hBQDRnUR7B2iUaG3Dm3CkQ2x q6Vavyh8AGwhLmPKQlKUkiG3gAfPCtYpBbLzQmdLMxacoajhr4bSr0/KsIVgWhffxfsa 23UhLmv0rPKYJCWZyNDUWV6UK0unL0Xg4c6Gruacl1nS/i9pgx0j4uwstZ283H28xbaT L+Qw== X-Gm-Message-State: AOPr4FU7LkkPmQozMRX72NOuVtMntcrwP3ur6vA9Z7hK8wse5hKUWo9iNDHR3EImifiFZw== X-Received: by 10.66.184.40 with SMTP id er8mr54629674pac.134.1462214744710; Mon, 02 May 2016 11:45:44 -0700 (PDT) Received: from [192.168.100.129] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id q26sm47168369pfi.57.2016.05.02.11.45.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2016 11:45:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605021800.u42I0cjK084243@repo.freebsd.org> Date: Mon, 2 May 2016 11:45:41 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4F040E00-AB92-4D32-99F5-9BCB02578DC0@gmail.com> References: <201605021800.u42I0cjK084243@repo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 18:45:45 -0000 > On May 2, 2016, at 11:00, John Baldwin wrote: >=20 > Author: jhb > Date: Mon May 2 18:00:38 2016 > New Revision: 298933 > URL: https://svnweb.freebsd.org/changeset/base/298933 >=20 > Log: > Add a new bus method to fetch device-specific CPU sets. >=20 > bus_get_cpus() returns a specified set of CPUs for a device. It = accepts > an enum for the second parameter that indicates the type of cpuset to > request. Currently two valus are supported: >=20 > - LOCAL_CPUS (on x86 this returns all the CPUs in the package = closest to > the device when DEVICE_NUMA is enabled) > - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each = core) >=20 > For systems that do not support NUMA (or if it is not enabled in the = kernel > config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to = 'all_cpus' > by default. The idea is that INTR_CPUS should always return a valid = set. >=20 > Device drivers which want to use per-CPU interrupts should start = using > INTR_CPUS instead of simply assigning interrupts to all available = CPUs. > In the future we may wish to add tunables to control the policy of > INTR_CPUS (e.g. should it be local-only or global, should it ignore > SMT threads or not). >=20 > The x86 nexus driver exposes the internal set of interrupt CPUs from = the > the x86 interrupt code via INTR_CPUS. >=20 > The ACPI bus driver and PCI bridge drivers use _PXM to return a = suitable > LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They = also and > the global INTR_CPUS set from the nexus driver with the per-domain = set from > _PXM to generate a local INTR_CPUS set for child devices. >=20 > Reviewed by: wblock (manpage) > Differential Revision: https://reviews.freebsd.org/D5519 >=20 > Added: > head/share/man/man9/BUS_GET_CPUS.9 (contents, props changed) > Modified: > head/share/man/man9/Makefile > head/sys/amd64/include/intr_machdep.h > head/sys/dev/acpica/acpi.c > head/sys/dev/acpica/acpi_pci.c > head/sys/dev/acpica/acpi_pcib.c > head/sys/dev/acpica/acpi_pcib_acpi.c > head/sys/dev/acpica/acpi_pcib_pci.c > head/sys/dev/acpica/acpi_pcibvar.h > head/sys/dev/acpica/acpivar.h > head/sys/dev/drm2/drm_dp_iic_helper.c > head/sys/dev/drm2/i915/dvo.h > head/sys/kern/bus_if.m > head/sys/kern/subr_bus.c > head/sys/sys/bus.h > head/sys/x86/acpica/OsdEnvironment.c > head/sys/x86/x86/intr_machdep.c > head/sys/x86/x86/nexus.c This broke the build with gcc: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1211/= From owner-svn-src-all@freebsd.org Mon May 2 18:46:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4D5B2A347; Mon, 2 May 2016 18:46:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::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 D31071087; Mon, 2 May 2016 18:46:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id yl2so18287396pac.1; Mon, 02 May 2016 11:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VklaM4WboOUkC1hkAbScdVVJgfDhxF2Djl9smkT6I+o=; b=q0/Jy82wRlKn9j+0LAdxpkYtOdfN3XFYBvx9iX7Xrm7ailgt5qfZ2p5jlceQBViEOM ON5Fu0YkV3omHmhTIUbijb9q0IM5abpiKEGUkVeq1Ql/8iezzJ6nyi3G+zjNN5Y2v9Cp +WHojOXn11a7ELWKJuEMiEdBQJ71Z2yolW4XEHIb2I25VsJVr2z/Qp1LNCZkPuMe/oZK wzXP4OhODxacLOUYlv2NFhnHW3N5ZCRQCtVGusxVgLbnCqZ7bIwpxmEOxnxBn7hzyjJ0 1408S/k09Ffnyb2biElKgxhkkmDHwubNljH0nUk4ndhDXPFpECPHxZkyJtrJ86dDIjMY 8OVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VklaM4WboOUkC1hkAbScdVVJgfDhxF2Djl9smkT6I+o=; b=HCev2rlztZefrvlK1CudKeEqtNmFXLXcBWzTjlylnqQGpuTC4VcwyiIUyLMTIO2Diu g8lqIehfXcoji0WXONQp+jLsM8UE+MhIcA/gb2pwjmdIalNen7ezaAUY6b8wgIS/cFW9 H8XYjVACMj4cZ22KoJmXZGLGDEoWflIOi10tZZA5L24yQkLtWPxDf610mlbMXYP5/kP5 7oc4rTLkh7QBeVlXTc7VXVUMvkTPMk/DPNYuDXTge1lfAhrotNkmFVOEie89dS2ZxMR3 n+SI3StWt2QZ8vzcyr3Vv1Naj2gNvPYNNe6d/pAaBKOS538r8NhCVbTDWwawU99TBJaB j/jg== X-Gm-Message-State: AOPr4FU44+BpJdaO7KgYHdlrorD6XBO69EJr/kSI/Md0cdbURhzLylSVJRR2M+kA7j02IA== X-Received: by 10.66.14.198 with SMTP id r6mr4916791pac.48.1462214793477; Mon, 02 May 2016 11:46:33 -0700 (PDT) Received: from [192.168.100.129] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id q26sm47168369pfi.57.2016.05.02.11.46.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2016 11:46:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298929 - head/sys/dev/xen/timer From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605021615.u42GFSeR052375@repo.freebsd.org> Date: Mon, 2 May 2016 11:46:31 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <337D6745-6821-4035-B1CB-F22C6A96E568@gmail.com> References: <201605021615.u42GFSeR052375@repo.freebsd.org> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 18:46:34 -0000 > On May 2, 2016, at 09:15, Roger Pau Monn=C3=A9 = wrote: >=20 > Author: royger > Date: Mon May 2 16:15:28 2016 > New Revision: 298929 > URL: https://svnweb.freebsd.org/changeset/base/298929 >=20 > Log: > xen/time: allow Dom0 to set the host time >=20 > Dom0 should be able to set the host time. This is implemented by = first > writing to the RTC (as would be done on bare metal), and then using = the > XENPF_settime64 hypercall in order to force Xen to update the = wallclock > shared page of all domains. >=20 > Sponsored by: Citrix Systems R&D >=20 > Modified: > head/sys/dev/xen/timer/timer.c >=20 > Modified: head/sys/dev/xen/timer/timer.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/xen/timer/timer.c Mon May 2 16:14:55 2016 = (r298928) > +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:15:28 2016 = (r298929) > @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include >=20 > #include > #include > @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); >=20 > #include >=20 > +#include > + > #include "clock_if.h" >=20 > static devclass_t xentimer_devclass; > @@ -211,11 +214,32 @@ xen_fetch_uptime(struct timespec *ts) > static int > xentimer_settime(device_t dev __unused, struct timespec *ts) > { > + struct xen_platform_op settime; > + int ret; > + > /* > * Don't return EINVAL here; just silently fail if the domain = isn't > * privileged enough to set the TOD. > */ > - return (0); > + if (!xen_initial_domain()) > + return (0); > + > + /* Set the native RTC. */ > + atrtc_set(ts); > + > + settime.cmd =3D XENPF_settime64; > + settime.u.settime64.mbz =3D 0; > + settime.u.settime64.secs =3D ts->tv_sec; > + settime.u.settime64.nsecs =3D ts->tv_nsec; > + settime.u.settime64.system_time =3D > + xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); > + > + ret =3D HYPERVISOR_platform_op(&settime); > + ret =3D ret !=3D 0 ? xen_translate_error(ret) : 0; > + if (ret !=3D 0 && bootverbose) > + device_printf(dev, "failed to set Xen PV clock: %d\n", = ret); > + > + return (ret); > } This broke the build on i386 with clang: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3028/= From owner-svn-src-all@freebsd.org Mon May 2 18:48:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F76B2A4E5; Mon, 2 May 2016 18:48:39 +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 147D41336; Mon, 2 May 2016 18:48:39 +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 u42ImcsK098996; Mon, 2 May 2016 18:48:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42ImbTi098991; Mon, 2 May 2016 18:48:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605021848.u42ImbTi098991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 18:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298935 - in head/sys/modules/bhnd: . bcma_bhndb bhndb nvram siba_bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 18:48:39 -0000 Author: adrian Date: Mon May 2 18:48:37 2016 New Revision: 298935 URL: https://svnweb.freebsd.org/changeset/base/298935 Log: [bhnd] add missing bus interface SRC bits, required after the last source import. Modified: head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/bcma_bhndb/Makefile head/sys/modules/bhnd/bhndb/Makefile head/sys/modules/bhnd/nvram/Makefile head/sys/modules/bhnd/siba_bhndb/Makefile Modified: head/sys/modules/bhnd/Makefile ============================================================================== --- head/sys/modules/bhnd/Makefile Mon May 2 18:23:48 2016 (r298934) +++ head/sys/modules/bhnd/Makefile Mon May 2 18:48:37 2016 (r298935) @@ -4,7 +4,7 @@ KMOD= bhnd SRCS= bhnd.c bhnd_subr.c \ - bhnd_bus_if.c bhnd_bus_if.h + bhnd_bus_if.c bhnd_bus_if.h bhnd_nvram_if.h SRCS+= device_if.h bus_if.h Modified: head/sys/modules/bhnd/bcma_bhndb/Makefile ============================================================================== --- head/sys/modules/bhnd/bcma_bhndb/Makefile Mon May 2 18:23:48 2016 (r298934) +++ head/sys/modules/bhnd/bcma_bhndb/Makefile Mon May 2 18:48:37 2016 (r298935) @@ -5,7 +5,7 @@ KMOD= bcma_bhndb SRCS= bcma_bhndb.c -SRCS+= bhnd_bus_if.h bhndb_if.h +SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h SRCS+= device_if.h bus_if.h .include Modified: head/sys/modules/bhnd/bhndb/Makefile ============================================================================== --- head/sys/modules/bhnd/bhndb/Makefile Mon May 2 18:23:48 2016 (r298934) +++ head/sys/modules/bhnd/bhndb/Makefile Mon May 2 18:48:37 2016 (r298935) @@ -5,7 +5,8 @@ KMOD= bhndb SRCS= bhndb.c bhndb_subr.c bhndb_hwdata.c \ bhndb_bus_if.c bhndb_bus_if.h \ - bhndb_if.c bhndb_if.h + bhndb_if.c bhndb_if.h \ + bhnd_bus_if.h SRCS+= device_if.h bus_if.h Modified: head/sys/modules/bhnd/nvram/Makefile ============================================================================== --- head/sys/modules/bhnd/nvram/Makefile Mon May 2 18:23:48 2016 (r298934) +++ head/sys/modules/bhnd/nvram/Makefile Mon May 2 18:48:37 2016 (r298935) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/bhnd/nvram KMOD= bhnd_nvram -SRCS= bhnd_nvram_if.c bhnd_nvram_if.h +SRCS= bhnd_nvram_if.c bhnd_nvram_if.h bhnd_bus_if.h SRCS+= device_if.h bus_if.h Modified: head/sys/modules/bhnd/siba_bhndb/Makefile ============================================================================== --- head/sys/modules/bhnd/siba_bhndb/Makefile Mon May 2 18:23:48 2016 (r298934) +++ head/sys/modules/bhnd/siba_bhndb/Makefile Mon May 2 18:48:37 2016 (r298935) @@ -5,7 +5,7 @@ KMOD= siba_bhndb SRCS= siba_bhndb.c -SRCS+= bhnd_bus_if.h bhndb_if.h +SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h SRCS+= device_if.h bus_if.h .include From owner-svn-src-all@freebsd.org Mon May 2 19:07:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A10B2AB62; Mon, 2 May 2016 19:07:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 248E71326; Mon, 2 May 2016 19:07:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42J7iQP005125; Mon, 2 May 2016 19:07:44 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42J7iC9005124; Mon, 2 May 2016 19:07:44 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605021907.u42J7iC9005124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 2 May 2016 19:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298936 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 19:07:45 -0000 Author: avos Date: Mon May 2 19:07:44 2016 New Revision: 298936 URL: https://svnweb.freebsd.org/changeset/base/298936 Log: iwm: fix parameters for iwm_add_channel_band() It accepts , not . Reported by: adrian Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon May 2 18:48:37 2016 (r298935) +++ head/sys/dev/iwm/if_iwm.c Mon May 2 19:07:44 2016 (r298936) @@ -1737,14 +1737,13 @@ iwm_init_channel_map(struct ieee80211com /* 14: 11b channel only. */ clrbit(bands, IEEE80211_MODE_11G); iwm_add_channel_band(sc, chans, maxchans, nchans, - IWM_NUM_2GHZ_CHANNELS - 1, 1, bands); + IWM_NUM_2GHZ_CHANNELS - 1, IWM_NUM_2GHZ_CHANNELS, bands); if (data->sku_cap_band_52GHz_enable) { memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11A); iwm_add_channel_band(sc, chans, maxchans, nchans, - IWM_NUM_2GHZ_CHANNELS, - nitems(iwm_nvm_channels) - IWM_NUM_2GHZ_CHANNELS, bands); + IWM_NUM_2GHZ_CHANNELS, nitems(iwm_nvm_channels), bands); } } From owner-svn-src-all@freebsd.org Mon May 2 19:15:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DD5B2AEA0; Mon, 2 May 2016 19:15:17 +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 827291CA0; Mon, 2 May 2016 19:15:17 +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 u42JFGkT008317; Mon, 2 May 2016 19:15:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42JFGhf008315; Mon, 2 May 2016 19:15:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605021915.u42JFGhf008315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 19:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298937 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 19:15:17 -0000 Author: adrian Date: Mon May 2 19:15:16 2016 New Revision: 298937 URL: https://svnweb.freebsd.org/changeset/base/298937 Log: [asmc] add support for more models and restore keyboard backlight after resume. This patch adds support for restoring backlight after resume and adds models Macbook3,1 MacbookAir5,1 MacbookAir5,2 It also incorporates fixes for bug #175260, bug #203610 and bug #203512 so those can be closed if this patch is applied. PR: kern/209156 PR: kern/175260 PR: kern/203610 PR: kern/203512 Submitted by: Johannes Lundberg Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon May 2 19:07:44 2016 (r298936) +++ head/sys/dev/asmc/asmc.c Mon May 2 19:15:16 2016 (r298937) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); static int asmc_probe(device_t dev); static int asmc_attach(device_t dev); static int asmc_detach(device_t dev); +static int asmc_resume(device_t dev); /* * SMC functions. @@ -137,10 +138,18 @@ static struct asmc_model *asmc_match(dev #define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \ asmc_mb_sysctl_sms_z +#define ASMC_SMS_FUNCS_DISABLED NULL,NULL,NULL + #define ASMC_FAN_FUNCS asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ asmc_mb_sysctl_fanminspeed, \ asmc_mb_sysctl_fanmaxspeed, \ asmc_mb_sysctl_fantargetspeed + +#define ASMC_FAN_FUNCS2 asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, NULL, \ + asmc_mb_sysctl_fanminspeed, \ + asmc_mb_sysctl_fanmaxspeed, \ + asmc_mb_sysctl_fantargetspeed + #define ASMC_LIGHT_FUNCS asmc_mbp_sysctl_light_left, \ asmc_mbp_sysctl_light_right, \ asmc_mbp_sysctl_light_control @@ -158,6 +167,12 @@ struct asmc_model asmc_models[] = { ASMC_MB_TEMPS, ASMC_MB_TEMPNAMES, ASMC_MB_TEMPDESCS }, + { + "MacBook3,1", "Apple SMC MacBook Core 2 Duo", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL, + ASMC_MB31_TEMPS, ASMC_MB31_TEMPNAMES, ASMC_MB31_TEMPDESCS + }, + { "MacBookPro1,1", "Apple SMC MacBook Pro Core Duo (15-inch)", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, @@ -260,12 +275,30 @@ struct asmc_model asmc_models[] = { ASMC_MBA3_TEMPS, ASMC_MBA3_TEMPNAMES, ASMC_MBA3_TEMPDESCS }, + { + "MacBookAir5,1", "Apple SMC MacBook Air 11-inch (Mid 2012)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS + }, + + { + "MacBookAir5,2", "Apple SMC MacBook Air 13-inch (Mid 2012)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS + }, + { NULL, NULL } }; #undef ASMC_SMS_FUNCS +#undef ASMC_SMS_FUNCS_DISABLED #undef ASMC_FAN_FUNCS +#undef ASMC_FAN_FUNCS2 #undef ASMC_LIGHT_FUNCS /* @@ -275,6 +308,7 @@ static device_method_t asmc_methods[] = DEVMETHOD(device_probe, asmc_probe), DEVMETHOD(device_attach, asmc_attach), DEVMETHOD(device_detach, asmc_detach), + DEVMETHOD(device_resume, asmc_resume), { 0, 0 } }; @@ -301,6 +335,8 @@ static char *asmc_ids[] = { "APP0001", N static devclass_t asmc_devclass; +static unsigned int light_control = 0; + DRIVER_MODULE(asmc, acpi, asmc_driver, asmc_devclass, NULL, NULL); MODULE_DEPEND(asmc, acpi, 1, 1, 1); @@ -581,6 +617,17 @@ asmc_detach(device_t dev) return (0); } +static int +asmc_resume(device_t dev) +{ + uint8_t buf[2]; + buf[0] = light_control; + buf[1] = 0x00; + asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); + return (0); +} + + #ifdef DEBUG void asmc_dumpall(device_t dev) { @@ -879,7 +926,7 @@ out: snprintf(buf, sizeof(buf), "key %d is: %s, type %s " "(len %d), data", number, key, type, maxlen); for (i = 0; i < maxlen; i++) { - snprintf(buf2, sizeof(buf), " %02x", v[i]); + snprintf(buf2, sizeof(buf2), " %02x", v[i]); strlcat(buf, buf2, sizeof(buf)); } strlcat(buf, " \n", sizeof(buf)); @@ -1324,17 +1371,16 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN device_t dev = (device_t) arg1; uint8_t buf[2]; int error; - static unsigned int level; int v; - v = level; + v = light_control; error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { if (v < 0 || v > 255) return (EINVAL); - level = v; - buf[0] = level; + light_control = v; + buf[0] = light_control; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Mon May 2 19:07:44 2016 (r298936) +++ head/sys/dev/asmc/asmcvar.h Mon May 2 19:15:16 2016 (r298937) @@ -144,7 +144,19 @@ struct asmc_softc { "Northbridge Point 2", "Heatsink 1", \ "Heatsink 2", "Memory Bank A", } -#define ASMC_MBP_TEMPS { "TB0T", "Th0H", "Th1H", "Tm0P", \ +#define ASMC_MB31_TEMPS { "TB0T", "TN0P", "Th0H", "Th1H", \ + "TM0P", NULL } + +#define ASMC_MB31_TEMPNAMES { "enclosure", "northbridge1", \ + "heatsink1", "heatsink2", \ + "memory", } + +#define ASMC_MB31_TEMPDESCS { "Enclosure Bottomside", \ + "Northbridge Point 1", \ + "Heatsink 1","Heatsink 2" \ + "Memory Bank A", } + +#define ASMC_MBP_TEMPS { "TB0T", "Th0H", "Th1H", "Tm0P", \ "TG0H", "TG0P", "TG0T", NULL } #define ASMC_MBP_TEMPNAMES { "enclosure", "heatsink1", \ @@ -337,3 +349,24 @@ struct asmc_softc { #define ASMC_MBA3_TEMPDESCS { "Enclosure Bottom", "TB1T", "TB2T", \ "TC0D", "TC0E", "TC0P" } + +#define ASMC_MBA5_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", \ + "TC0D", "TC0E", "TC0F", "TC0P", \ + "TC1C", "TC2C", "TCGC", "TCSA", \ + "TCXC", "THSP", "TM0P", "TPCD", \ + "Ta0P", "Th1H", "Tm0P", "Tm1P", \ + "Ts0P", "Ts0S", NULL } + +#define ASMC_MBA5_TEMPNAMES { "enclosure1", "enclosure2", "enclosure3", "TC0C", \ + "cpudiode", "cputemp1", "cputemp2", "cpuproximity", \ + "cpucore1", "cpucore2", "cpupeci", "pecisa", \ + "TCXC", "THSP", "memorybank", "pchdie", \ + "Ta0P", "heatpipe", "mainboardproximity1", "mainboardproximity2", \ + "palmrest", "memoryproximity" } + +#define ASMC_MBA5_TEMPDESCS { "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", "TC0C",\ + "CPU Diode", "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \ + "CPU Core 1", "CPU Core 2", "CPU Peci Core", "PECI SA", \ + "TCXC", "THSP", "Memory Bank A", "PCH Die", \ + "Ta0P", "Heatpipe", "Mainboard Proximity 1", "Mainboard Proximity 2", \ + "Palm Rest", "Memory Proximity" } From owner-svn-src-all@freebsd.org Mon May 2 19:32:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314DFB2A774; Mon, 2 May 2016 19:32:08 +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 DAD511B1F; Mon, 2 May 2016 19:32:07 +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 u42JW7tG012298; Mon, 2 May 2016 19:32:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42JW7KD012297; Mon, 2 May 2016 19:32:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605021932.u42JW7KD012297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 19:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298938 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 19:32:08 -0000 Author: pfg Date: Mon May 2 19:32:06 2016 New Revision: 298938 URL: https://svnweb.freebsd.org/changeset/base/298938 Log: Enhance the ddb examine (x) command. * Change x/a to work similar to gdb. The content of the memory is treated as an address, printed symbolically and the address is advanced. This way you can x/a and then just hit return a bunch of times to locate useful data on the stack. * Add x/p. The content of the memory is treated as an address and printed as hex. This is based on the similar commit from DragonFlyBSD without the cosmetic changes. Relnotes: yes Obtained from: DragonflyBSD (Matthew Dillon) Reference: 0624d20e86affcd708609cbf9014207537537a72 Modified: head/sys/ddb/db_examine.c Modified: head/sys/ddb/db_examine.c ============================================================================== --- head/sys/ddb/db_examine.c Mon May 2 19:15:16 2016 (r298937) +++ head/sys/ddb/db_examine.c Mon May 2 19:32:06 2016 (r298938) @@ -89,15 +89,6 @@ db_examine(db_addr_t addr, char *fmt, in case 'g': size = 8; break; - case 'a': /* address */ - size = sizeof(void *); - /* always forces a new line */ - if (db_print_position() != 0) - db_printf("\n"); - db_prev = addr; - db_printsym(addr, DB_STGY_ANY); - db_printf(":\t"); - break; default: if (db_print_position() == 0) { /* Print the address. */ @@ -108,6 +99,18 @@ db_examine(db_addr_t addr, char *fmt, in width = size * 4; switch (c) { + case 'a': /* address */ + size = sizeof(void *); + value = db_get_value(addr, size, TRUE); + addr += size; + db_printsym(value, DB_STGY_ANY); + break; + case 'p': + size = sizeof(void *); + value = db_get_value(addr, size, TRUE); + addr += size; + db_printf("%p", (void *)value); + break; case 'r': /* signed, current radix */ value = db_get_value(addr, size, true); addr += size; @@ -173,7 +176,7 @@ db_examine(db_addr_t addr, char *fmt, in default: break; } - if (db_print_position() != 0) + if (db_print_position() != 0 || c == 'a' || c == 'p') db_end_line(1); break; } From owner-svn-src-all@freebsd.org Mon May 2 19:56:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19922B2AF52; Mon, 2 May 2016 19:56:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C954419F7; Mon, 2 May 2016 19:56:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42Jupqi020324; Mon, 2 May 2016 19:56:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42JumKA020298; Mon, 2 May 2016 19:56:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605021956.u42JumKA020298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 19:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298939 - in head/sys/dev/ath: . ath_dfs/null ath_hal ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 19:56:52 -0000 Author: pfg Date: Mon May 2 19:56:48 2016 New Revision: 298939 URL: https://svnweb.freebsd.org/changeset/base/298939 Log: dev/ath: minor spelling fixes in comments. No functional change. Reviewed by: adrian Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c head/sys/dev/ath/ath_hal/ar5212/ar2316.c head/sys/dev/ath/ath_hal/ar5212/ar2317.c head/sys/dev/ath/ath_hal/ar5212/ar2413.c head/sys/dev/ath/ath_hal/ar5212/ar2425.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c head/sys/dev/ath/ath_hal/ar5212/ar5413.c head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_ioctl.c head/sys/dev/ath/if_ath_lna_div.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon May 2 19:56:48 2016 (r298939) @@ -181,7 +181,7 @@ ath_dfs_process_phy_err(struct ath_softc } /* - * Process the radar events and determine whether a DFS event has occured. + * Process the radar events and determine whether a DFS event has occurred. * * This is designed to run outside of the RX processing path. * The RX path will call ath_dfs_tasklet_needed() to see whether Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ah.c Mon May 2 19:56:48 2016 (r298939) @@ -362,7 +362,7 @@ ath_hal_computetxtime(struct ath_hal *ah kbps = rates->info[rateix].rateKbps; /* - * index can be invalid duting dynamic Turbo transitions. + * index can be invalid during dynamic Turbo transitions. * XXX */ if (kbps == 0) Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ah.h Mon May 2 19:56:48 2016 (r298939) @@ -414,7 +414,7 @@ typedef enum { /* Allow all mcast/bcast frames */ /* - * Magic RX filter flags that aren't targetting hardware bits + * Magic RX filter flags that aren't targeting hardware bits * but instead the HAL sets individual bits - eg PHYERR will result * in OFDM/CCK timing error frames being received. */ @@ -1224,7 +1224,7 @@ typedef struct { /* * slotted mode only. rx_clear and bt_ant decision * will be held the entire time that BT_ACTIVE is asserted, - * otherwise the decision is made before every slot boundry. + * otherwise the decision is made before every slot boundary. */ HAL_BOOL bt_hold_rxclear; } HAL_BT_COEX_CONFIG; Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Mon May 2 19:56:48 2016 (r298939) @@ -490,7 +490,7 @@ getchannels(struct ath_hal *ah, break; default: HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, - "%s: Unkonwn HAL mode 0x%x\n", __func__, cm->mode); + "%s: Unknown HAL mode 0x%x\n", __func__, cm->mode); continue; } if (isChanBitMaskZero(channelBM)) Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Mon May 2 19:56:48 2016 (r298939) @@ -913,7 +913,7 @@ getNoiseFloorThresh(struct ath_hal *ah, } /* - * Read the NF and check it against the noise floor threshhold + * Read the NF and check it against the noise floor threshold * * Returns: TRUE if the NF is good */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar2316.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar2316.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar2316.c Mon May 2 19:56:48 2016 (r298939) @@ -373,9 +373,9 @@ ar2316getGainBoundariesAndPdadcsForPower * change pwr_I_0 to signed 5-bits. */ int16_t Pmin_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on. */ + /* to accommodate -ve power levels later on. */ int16_t Pmax_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on */ + /* to accommodate -ve power levels later on */ uint16_t numVpd = 0; uint16_t Vpd_step; int16_t tmpVal ; Modified: head/sys/dev/ath/ath_hal/ar5212/ar2317.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar2317.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar2317.c Mon May 2 19:56:48 2016 (r298939) @@ -351,9 +351,9 @@ ar2317getGainBoundariesAndPdadcsForPower * change pwr_I_0 to signed 5-bits. */ int16_t Pmin_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on. */ + /* to accommodate -ve power levels later on. */ int16_t Pmax_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on */ + /* to accommodate -ve power levels later on */ uint16_t numVpd = 0; uint16_t Vpd_step; int16_t tmpVal ; Modified: head/sys/dev/ath/ath_hal/ar5212/ar2413.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar2413.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar2413.c Mon May 2 19:56:48 2016 (r298939) @@ -367,9 +367,9 @@ ar2413getGainBoundariesAndPdadcsForPower * change pwr_I_0 to signed 5-bits. */ int16_t Pmin_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on. */ + /* to accommodate -ve power levels later on. */ int16_t Pmax_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on */ + /* to accommodate -ve power levels later on */ uint16_t numVpd = 0; uint16_t Vpd_step; int16_t tmpVal ; Modified: head/sys/dev/ath/ath_hal/ar5212/ar2425.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar2425.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar2425.c Mon May 2 19:56:48 2016 (r298939) @@ -372,9 +372,9 @@ ar2425getGainBoundariesAndPdadcsForPower * change pwr_I_0 to signed 5-bits. */ static int16_t Pmin_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on. */ + /* to accommodate -ve power levels later on. */ static int16_t Pmax_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on */ + /* to accommodate -ve power levels later on */ uint16_t numVpd = 0; uint16_t Vpd_step; int16_t tmpVal ; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon May 2 19:56:48 2016 (r298939) @@ -885,7 +885,7 @@ ar5212FillCapabilityInfo(struct ath_hal pCap->halRfSilentSupport = AH_TRUE; } - /* NB: this is a guess, noone seems to know the answer */ + /* NB: this is a guess, no one seems to know the answer */ ahpriv->ah_rxornIsFatal = (AH_PRIVATE(ah)->ah_macVersion < AR_SREV_VERSION_VENICE); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Mon May 2 19:56:48 2016 (r298939) @@ -51,7 +51,7 @@ ar5212SetPowerModeAwake(struct ath_hal * * which when blindly written back with OS_REG_RMW_FIELD * enables the MIB interrupt for the sleep performance * counters. This can result in an interrupt storm when - * ANI is in operation as noone knows to turn off the MIB + * ANI is in operation as no one knows to turn off the MIB * interrupt cause. */ scr = OS_REG_READ(ah, AR_SCR); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Mon May 2 19:56:48 2016 (r298939) @@ -1385,7 +1385,7 @@ ar5212GetNfHistMid(const int16_t calData } /* - * Read the NF and check it against the noise floor threshhold + * Read the NF and check it against the noise floor threshold */ int16_t ar5212GetNf(struct ath_hal *ah, struct ieee80211_channel *chan) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5413.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5413.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5212/ar5413.c Mon May 2 19:56:48 2016 (r298939) @@ -411,9 +411,9 @@ ar5413getGainBoundariesAndPdadcsForPower * change pwr_I_0 to signed 5-bits. */ int16_t Pmin_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on. */ + /* to accommodate -ve power levels later on. */ int16_t Pmax_t2[MAX_NUM_PDGAINS_PER_CHANNEL]; - /* to accomodate -ve power levels later on */ + /* to accommodate -ve power levels later on */ uint16_t numVpd = 0; uint16_t Vpd_step; int16_t tmpVal ; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Mon May 2 19:56:48 2016 (r298939) @@ -95,7 +95,7 @@ ar5416BTCoexSetWeights(struct ath_hal *a struct ath_hal_5416 *ahp = AH5416(ah); if (AR_SREV_KIWI_10_OR_LATER(ah)) { - /* TODO: TX RX seperate is not enabled. */ + /* TODO: TX RX separate is not enabled. */ switch (stompType) { case HAL_BT_COEX_STOMP_ALL: ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Mon May 2 19:56:48 2016 (r298939) @@ -772,7 +772,7 @@ ar5416SanitizeNF(struct ath_hal *ah, int /* - * Read the NF and check it against the noise floor threshhold + * Read the NF and check it against the noise floor threshold * * Return 0 if the NF calibration hadn't finished, 0 if it was * invalid, or > 0 for a valid NF reading. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Mon May 2 19:56:48 2016 (r298939) @@ -119,7 +119,7 @@ ar5416ConfigureSpectralScan(struct ath_h } else { if (ss->ss_count != HAL_SPECTRAL_PARAM_NOVAL) { /* - * In Merlin, for continous scan, scan_count = 128. + * In Merlin, for continuous scan, scan_count = 128. * In case of Kiwi, this value should be 0 */ if (ss->ss_count == 128) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon May 2 19:56:48 2016 (r298939) @@ -807,7 +807,7 @@ ar5416ProcTxDesc(struct ath_hal *ah, } /* - * These fields are not used. Zero these to preserve compatability + * These fields are not used. Zero these to preserve compatibility * with existing drivers. */ ts->ts_virtcol = MS(ads->ds_ctl1, AR_VirtRetryCnt); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon May 2 19:56:48 2016 (r298939) @@ -277,10 +277,10 @@ #define AR_PCIE_PM_CTRL_ENA 0x00080000 #define AR_AHB_EXACT_WR_EN 0x00000000 /* write exact bytes */ -#define AR_AHB_BUF_WR_EN 0x00000001 /* buffer write upto cacheline*/ +#define AR_AHB_BUF_WR_EN 0x00000001 /* buffer write up to cacheline*/ #define AR_AHB_EXACT_RD_EN 0x00000000 /* read exact bytes */ -#define AR_AHB_CACHELINE_RD_EN 0x00000002 /* read upto end of cacheline */ -#define AR_AHB_PREFETCH_RD_EN 0x00000004 /* prefetch upto page boundary*/ +#define AR_AHB_CACHELINE_RD_EN 0x00000002 /* read up to end of cacheline */ +#define AR_AHB_PREFETCH_RD_EN 0x00000004 /* prefetch up to page boundary*/ #define AR_AHB_PAGE_SIZE_1K 0x00000000 /* set page-size as 1k */ #define AR_AHB_PAGE_SIZE_2K 0x00000008 /* set page-size as 2k */ #define AR_AHB_PAGE_SIZE_4K 0x00000010 /* set page-size as 4k */ @@ -518,7 +518,7 @@ #define AR_PCU_FORCE_QUIET_COLL 0x00040000 /* kill xmit for channel change */ #define AR_PCU_BT_ANT_PREVENT_RX 0x00100000 #define AR_PCU_BT_ANT_PREVENT_RX_S 20 -#define AR_PCU_TBTT_PROTECT 0x00200000 /* no xmit upto tbtt+20 uS */ +#define AR_PCU_TBTT_PROTECT 0x00200000 /* no xmit up to tbtt+20 uS */ #define AR_PCU_CLEAR_VMF 0x01000000 /* clear vmf mode (fast cc)*/ #define AR_PCU_CLEAR_BA_VALID 0x04000000 /* clear ba state */ #define AR_PCU_SEL_EVM 0x08000000 /* select EVM data or PLCP header */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Mon May 2 19:56:48 2016 (r298939) @@ -328,7 +328,7 @@ ar9280SetPowerCalTable(struct ath_hal *a * uses this to calculate the PDADC delta during * calibration ; 0 here effectively stops the * temperature compensation calibration from - * occuring. + * occurring. */ AH5416(ah)->initPDADC = 0; } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath.c Mon May 2 19:56:48 2016 (r298939) @@ -2698,7 +2698,7 @@ ath_txrx_start(struct ath_softc *sc) } /* - * Grab the reset lock, and wait around until noone else + * Grab the reset lock, and wait around until no one else * is trying to do anything with it. * * This is totally horrible but we can't hold this lock for @@ -2782,7 +2782,7 @@ ath_reset(struct ath_softc *sc, ATH_RESE ATH_PCU_UNLOCK_ASSERT(sc); ATH_UNLOCK_ASSERT(sc); - /* Try to (stop any further TX/RX from occuring */ + /* Try to (stop any further TX/RX from occurring */ taskqueue_block(sc->sc_tq); /* @@ -2826,7 +2826,7 @@ ath_reset(struct ath_softc *sc, ATH_RESE /* * Should now wait for pending TX/RX to complete - * and block future ones from occuring. This needs to be + * and block future ones from occurring. This needs to be * done before the TX queue is drained. */ ath_draintxq(sc, reset_type); /* stop xmit side */ @@ -3676,7 +3676,7 @@ ath_bstuck_proc(void *arg, int pending) sc->sc_stats.ast_bstuck++; /* * This assumes that there's no simultaneous channel mode change - * occuring. + * occurring. */ ath_reset(sc, ATH_RESET_NOLOSS); } @@ -4737,7 +4737,7 @@ ath_tx_freebuf(struct ath_softc *sc, str /* * Make sure that we only sync/unload if there's an mbuf. * If not (eg we cloned a buffer), the unload will have already - * occured. + * occurred. */ if (bf->bf_m != NULL) { bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, @@ -5076,7 +5076,7 @@ ath_chan_set(struct ath_softc *sc, struc ATH_PCU_UNLOCK_ASSERT(sc); ATH_UNLOCK_ASSERT(sc); - /* (Try to) stop TX/RX from occuring */ + /* (Try to) stop TX/RX from occurring */ taskqueue_block(sc->sc_tq); ATH_PCU_LOCK(sc); @@ -5857,7 +5857,7 @@ ath_newassoc(struct ieee80211_node *ni, * If we're reassociating, make sure that any paused queues * get unpaused. * - * Now, we may hvae frames in the hardware queue for this node. + * Now, we may have frames in the hardware queue for this node. * So if we are reassociating and there are frames in the queue, * we need to go through the cleanup path to ensure that they're * marked as non-aggregate. @@ -6068,7 +6068,7 @@ ath_setcurmode(struct ath_softc *sc, enu sc->sc_currates = rt; sc->sc_curmode = mode; /* - * All protection frames are transmited at 2Mb/s for + * All protection frames are transmitted at 2Mb/s for * 11g, otherwise at 1Mb/s. */ if (mode == IEEE80211_MODE_11G) Modified: head/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- head/sys/dev/ath/if_ath_ioctl.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath_ioctl.c Mon May 2 19:56:48 2016 (r298939) @@ -163,7 +163,7 @@ bad: * Diagnostic interface to the HAL. This is used by various * tools to do things like retrieve register contents for * debugging. The mechanism is intentionally opaque so that - * it can change frequently w/o concern for compatiblity. + * it can change frequently w/o concern for compatibility. */ static int ath_ioctl_diag(struct ath_softc *sc, struct ath_diag *ad) Modified: head/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- head/sys/dev/ath/if_ath_lna_div.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath_lna_div.c Mon May 2 19:56:48 2016 (r298939) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* Linux compability macros */ +/* Linux compatibility macros */ /* * XXX these don't handle rounding, underflow, overflow, wrapping! */ Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath_pci.c Mon May 2 19:56:48 2016 (r298939) @@ -82,7 +82,7 @@ struct ath_pci_softc { /* * XXX eventually this should be some system level definition - * so modules will hvae probe/attach information like USB. + * so modules will have probe/attach information like USB. * But for now.. */ struct pci_device_id { Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath_rx.c Mon May 2 19:56:48 2016 (r298939) @@ -802,7 +802,7 @@ rx_accept: * This code should be removed once the actual * root cause of the issue has been identified. * For example, it may be that the rs_antenna - * field is only valid for the lsat frame of + * field is only valid for the last frame of * an aggregate and it just happens that it is * "mostly" right. (This is a general statement - * the majority of the statistics are only valid Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_ath_tx.c Mon May 2 19:56:48 2016 (r298939) @@ -3125,7 +3125,7 @@ ath_tx_swq(struct ath_softc *sc, struct * If we're not doing A-MPDU, be prepared to direct dispatch * up to both limits if possible. This particular corner * case may end up with packet starvation between aggregate - * traffic and non-aggregate traffic: we wnat to ensure + * traffic and non-aggregate traffic: we want to ensure * that non-aggregate stations get a few frames queued to the * hardware before the aggregate station(s) get their chance. * @@ -3949,7 +3949,7 @@ ath_tx_tid_reset(struct ath_softc *sc, s * XXX TODO: it may just be enough to walk the HWQs and mark * frames for that node as non-aggregate; or mark the ath_node * with something that indicates that aggregation is no longer - * occuring. Then we can just toss the BAW complaints and + * occurring. Then we can just toss the BAW complaints and * do a complete hard reset of state here - no pause, no * complete counter, etc. */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon May 2 19:32:06 2016 (r298938) +++ head/sys/dev/ath/if_athvar.h Mon May 2 19:56:48 2016 (r298939) @@ -126,7 +126,7 @@ struct ath_tid { TAILQ_HEAD(,ath_buf) tid_q; /* pending buffers */ struct ath_node *an; /* pointer to parent */ int tid; /* tid */ - int ac; /* which AC gets this trafic */ + int ac; /* which AC gets this traffic */ int hwq_depth; /* how many buffers are on HW */ u_int axq_depth; /* SW queue depth */ From owner-svn-src-all@freebsd.org Mon May 2 20:16:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A07B2A3E9; Mon, 2 May 2016 20:16:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B7A1683; Mon, 2 May 2016 20:16:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42KGUXm026701; Mon, 2 May 2016 20:16:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42KGTcC026691; Mon, 2 May 2016 20:16:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605022016.u42KGTcC026691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 20:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298940 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 20:16:31 -0000 Author: pfg Date: Mon May 2 20:16:29 2016 New Revision: 298940 URL: https://svnweb.freebsd.org/changeset/base/298940 Log: sys/vm: minor spelling fixes in comments. No functional change. Modified: head/sys/vm/swap_pager.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_glue.c head/sys/vm/vm_map.c head/sys/vm/vm_object.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/swap_pager.c Mon May 2 20:16:29 2016 (r298940) @@ -965,7 +965,7 @@ swap_pager_copy(vm_object_t srcobject, v /* * Free left over swap blocks in source. * - * We have to revert the type to OBJT_DEFAULT so we do not accidently + * We have to revert the type to OBJT_DEFAULT so we do not accidentally * double-remove the object from the swap queues. */ if (destroysource) { @@ -2623,7 +2623,7 @@ swapongeom_ev(void *arg, int flags) cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; g_attach(cp, pp); /* - * XXX: Everytime you think you can improve the margin for + * XXX: Every time you think you can improve the margin for * footshooting, somebody depends on the ability to do so: * savecore(8) wants to write to our swapdev so we cannot * set an exclusive count :-( Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/uma_core.c Mon May 2 20:16:29 2016 (r298940) @@ -31,7 +31,7 @@ * * This allocator is intended to replace the multitude of similar object caches * in the standard FreeBSD kernel. The intent is to be flexible as well as - * effecient. A primary design goal is to return unused memory to the rest of + * efficient. A primary design goal is to return unused memory to the rest of * the system. This will make the system as a whole more flexible due to the * ability to move memory to subsystems which most need it instead of leaving * pools of reserved memory unused. @@ -531,7 +531,7 @@ zone_timeout(uma_zone_t zone) * hash A new hash structure with the old hash size in uh_hashsize * * Returns: - * 1 on sucess and 0 on failure. + * 1 on success and 0 on failure. */ static int hash_alloc(struct uma_hash *hash) @@ -2257,7 +2257,7 @@ zalloc_start: /* * Now lets just fill a bucket and put it on the free list. If that - * works we'll restart the allocation from the begining and it + * works we'll restart the allocation from the beginning and it * will use the just filled bucket. */ bucket = zone_alloc_bucket(zone, udata, flags); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/uma_int.h Mon May 2 20:16:29 2016 (r298940) @@ -415,7 +415,7 @@ vsetslab(vm_offset_t va, uma_slab_t slab /* * The following two functions may be defined by architecture specific code - * if they can provide more effecient allocation functions. This is useful + * if they can provide more efficient allocation functions. This is useful * for using direct mapped addresses. */ void *uma_small_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vm_glue.c Mon May 2 20:16:29 2016 (r298940) @@ -149,7 +149,7 @@ kernacc(addr, len, rw) * the associated vm_map_entry range. It does not determine whether the * contents of the memory is actually readable or writable. vmapbuf(), * vm_fault_quick(), or copyin()/copout()/su*()/fu*() functions should be - * used in conjuction with this call. + * used in conjunction with this call. */ int useracc(addr, len, rw) @@ -665,7 +665,7 @@ vm_forkproc(td, p2, td2, vm2, flags) } /* - * Called after process has been wait(2)'ed apon and is being reaped. + * Called after process has been wait(2)'ed upon and is being reaped. * The idea is to reclaim resources that we could not reclaim while * the process was still executing. */ Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vm_map.c Mon May 2 20:16:29 2016 (r298940) @@ -3519,7 +3519,7 @@ vm_map_stack_locked(vm_map_t map, vm_off return (KERN_NO_SPACE); /* - * If we can't accomodate max_ssize in the current mapping, no go. + * If we can't accommodate max_ssize in the current mapping, no go. * However, we need to be aware that subsequent user mappings might * map into the space we have reserved for stack, and currently this * space is not protected. Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vm_object.c Mon May 2 20:16:29 2016 (r298940) @@ -2111,7 +2111,7 @@ vm_object_coalesce(vm_object_t prev_obje /* * If prev_object was charged, then this mapping, - * althought not charged now, may become writable + * although not charged now, may become writable * later. Non-NULL cred in the object would prevent * swap reservation during enabling of the write * access, so reserve swap now. Failed reservation Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vm_page.h Mon May 2 20:16:29 2016 (r298940) @@ -141,7 +141,7 @@ struct vm_page { vm_object_t object; /* which object am I in (O,P) */ vm_pindex_t pindex; /* offset into object (O,P) */ vm_paddr_t phys_addr; /* physical address of page */ - struct md_page md; /* machine dependant stuff */ + struct md_page md; /* machine dependent stuff */ u_int wire_count; /* wired down maps refs (P) */ volatile u_int busy_lock; /* busy owners lock */ uint16_t hold_count; /* page hold count (P) */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vm_pageout.c Mon May 2 20:16:29 2016 (r298940) @@ -447,7 +447,7 @@ more: ++pageout_count; ++ib; /* - * alignment boundry, stop here and switch directions. Do + * alignment boundary, stop here and switch directions. Do * not clear ib. */ if ((pindex - (ib - 1)) % vm_pageout_page_count == 0) @@ -477,7 +477,7 @@ more: /* * If we exhausted our forward scan, continue with the reverse scan - * when possible, even past a page boundry. This catches boundry + * when possible, even past a page boundary. This catches boundary * conditions. */ if (ib && pageout_count < vm_pageout_page_count) Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon May 2 19:56:48 2016 (r298939) +++ head/sys/vm/vnode_pager.c Mon May 2 20:16:29 2016 (r298940) @@ -819,7 +819,7 @@ vnode_pager_generic_getpages(struct vnod /* * A sparse file can be encountered only for a single page request, - * which may not be preceeded by call to vm_pager_haspage(). + * which may not be preceded by call to vm_pager_haspage(). */ if (bp->b_blkno == -1) { KASSERT(count == 1, @@ -1139,7 +1139,7 @@ vnode_pager_putpages(vm_object_t object, * own vnodes if they fail to implement VOP_PUTPAGES. * * This is typically called indirectly via the pageout daemon and - * clustering has already typically occured, so in general we ask the + * clustering has already typically occurred, so in general we ask the * underlying filesystem to write the data out asynchronously rather * then delayed. */ @@ -1182,7 +1182,7 @@ vnode_pager_generic_putpages(struct vnod /* * If the page-aligned write is larger then the actual file we - * have to invalidate pages occuring beyond the file EOF. However, + * have to invalidate pages occurring beyond the file EOF. However, * there is an edge case where a file may not be page-aligned where * the last page is partially invalid. In this case the filesystem * may not properly clear the dirty bits for the entire page (which From owner-svn-src-all@freebsd.org Mon May 2 20:46:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EED3B2ACE4; Mon, 2 May 2016 20:46:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6041117F2; Mon, 2 May 2016 20:46:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42Kk5ev035969; Mon, 2 May 2016 20:46:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42Kk5nd035968; Mon, 2 May 2016 20:46:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605022046.u42Kk5nd035968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 2 May 2016 20:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298941 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 20:46:06 -0000 Author: avos Date: Mon May 2 20:46:05 2016 New Revision: 298941 URL: https://svnweb.freebsd.org/changeset/base/298941 Log: net80211: fix MAC address change via SIOCSIFLLADDR ioctl. Recheck MAC address on SIOCSIFFLAGS; as a result, 'ifconfig wlan0 ether ' can be used after interface startup. PR: 208933 Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Mon May 2 20:16:29 2016 (r298940) +++ head/sys/net80211/ieee80211_ioctl.c Mon May 2 20:46:05 2016 (r298941) @@ -3382,8 +3382,18 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon } IEEE80211_UNLOCK(ic); /* Wait for parent ioctl handler if it was queued */ - if (wait) + if (wait) { ieee80211_waitfor_parent(ic); + + /* + * Check if the MAC address was changed + * via SIOCSIFLLADDR ioctl. + */ + if ((ifp->if_flags & IFF_UP) == 0 && + !IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp))) + IEEE80211_ADDR_COPY(vap->iv_myaddr, + IF_LLADDR(ifp)); + } break; case SIOCADDMULTI: case SIOCDELMULTI: From owner-svn-src-all@freebsd.org Mon May 2 20:53:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A90B2AEFA; Mon, 2 May 2016 20:53:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 3B8EA1CB3; Mon, 2 May 2016 20:53:03 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id E2309B96C; Mon, 2 May 2016 16:53:01 -0400 (EDT) From: John Baldwin To: "Ngie Cooper (yaneurabeya)" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 Date: Mon, 02 May 2016 13:52:53 -0700 Message-ID: <2097917.RNSsKXUJ7U@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <4F040E00-AB92-4D32-99F5-9BCB02578DC0@gmail.com> References: <201605021800.u42I0cjK084243@repo.freebsd.org> <4F040E00-AB92-4D32-99F5-9BCB02578DC0@gmail.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.2.7 (bigwig.baldwin.cx); Mon, 02 May 2016 16:53:02 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 20:53:03 -0000 On Monday, May 02, 2016 11:45:41 AM Ngie Cooper wrote: > > > On May 2, 2016, at 11:00, John Baldwin wrote: > > > > Author: jhb > > Date: Mon May 2 18:00:38 2016 > > New Revision: 298933 > > URL: https://svnweb.freebsd.org/changeset/base/298933 > > > > Log: > > Add a new bus method to fetch device-specific CPU sets. > > > > bus_get_cpus() returns a specified set of CPUs for a device. It accepts > > an enum for the second parameter that indicates the type of cpuset to > > request. Currently two valus are supported: > > > > - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to > > the device when DEVICE_NUMA is enabled) > > - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) > > > > For systems that do not support NUMA (or if it is not enabled in the kernel > > config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' > > by default. The idea is that INTR_CPUS should always return a valid set. > > > > Device drivers which want to use per-CPU interrupts should start using > > INTR_CPUS instead of simply assigning interrupts to all available CPUs. > > In the future we may wish to add tunables to control the policy of > > INTR_CPUS (e.g. should it be local-only or global, should it ignore > > SMT threads or not). > > > > The x86 nexus driver exposes the internal set of interrupt CPUs from the > > the x86 interrupt code via INTR_CPUS. > > > > The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable > > LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and > > the global INTR_CPUS set from the nexus driver with the per-domain set from > > _PXM to generate a local INTR_CPUS set for child devices. > > > > Reviewed by: wblock (manpage) > > Differential Revision: https://reviews.freebsd.org/D5519 > > > > Added: > > head/share/man/man9/BUS_GET_CPUS.9 (contents, props changed) > > Modified: > > head/share/man/man9/Makefile > > head/sys/amd64/include/intr_machdep.h > > head/sys/dev/acpica/acpi.c > > head/sys/dev/acpica/acpi_pci.c > > head/sys/dev/acpica/acpi_pcib.c > > head/sys/dev/acpica/acpi_pcib_acpi.c > > head/sys/dev/acpica/acpi_pcib_pci.c > > head/sys/dev/acpica/acpi_pcibvar.h > > head/sys/dev/acpica/acpivar.h > > head/sys/dev/drm2/drm_dp_iic_helper.c > > head/sys/dev/drm2/i915/dvo.h > > head/sys/kern/bus_if.m > > head/sys/kern/subr_bus.c > > head/sys/sys/bus.h > > head/sys/x86/acpica/OsdEnvironment.c > > head/sys/x86/x86/intr_machdep.c > > head/sys/x86/x86/nexus.c > > This broke the build with gcc: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1211/ I saw. What is odd though is that my tinderbox builds all passed. This might be due to the recent howmany() changes since _bitset.h only needed before but now needs (which is borderline to being pointless for a _foo.h header). -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 2 20:56:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C4CB2AF95; Mon, 2 May 2016 20:56:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 264841E56; Mon, 2 May 2016 20:56:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42KuDQB038933; Mon, 2 May 2016 20:56:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42KuCOV038921; Mon, 2 May 2016 20:56:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605022056.u42KuCOV038921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 May 2016 20:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298942 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 20:56:14 -0000 Author: pfg Date: Mon May 2 20:56:11 2016 New Revision: 298942 URL: https://svnweb.freebsd.org/changeset/base/298942 Log: netinet/sctp*: minor spelling fixes in comments. No functional change. Reviewed by: tuexen Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_lock_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_bsd_addr.c Mon May 2 20:56:11 2016 (r298942) @@ -298,7 +298,7 @@ sctp_addr_change(struct ifaddr *ifa, int } /* * BSD only has one VRF, if this changes we will need to hook in the - * right things here to get the id to pass to the address managment + * right things here to get the id to pass to the address management * routine. */ if (SCTP_BASE_VAR(first_time) == 0) { Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_cc_functions.c Mon May 2 20:56:11 2016 (r298942) @@ -242,7 +242,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } /* Defines for instantaneous bw decisions */ -#define SCTP_INST_LOOSING 1 /* Loosing to other flows */ +#define SCTP_INST_LOOSING 1 /* Losing to other flows */ #define SCTP_INST_NEUTRAL 2 /* Neutral, no indication */ #define SCTP_INST_GAINING 3 /* Gaining, step down possible */ @@ -563,7 +563,7 @@ cc_bw_increase(struct sctp_tcb *stcb, st return (0); } -/* RTCC Algoritm to limit growth of cwnd, return +/* RTCC Algorithm to limit growth of cwnd, return * true if you want to NOT allow cwnd growth */ static int @@ -1110,7 +1110,7 @@ sctp_cwnd_update_after_ecn_echo_common(s } else { /* * Further tuning down required over the drastic - * orginal cut + * original cut */ net->ssthresh -= (net->mtu * num_pkt_lost); net->cwnd -= (net->mtu * num_pkt_lost); @@ -1290,7 +1290,7 @@ sctp_cwnd_update_after_sack(struct sctp_ struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) { - /* Passing a zero argument in last disables the rtcc algoritm */ + /* Passing a zero argument in last disables the rtcc algorithm */ sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 0); } @@ -1298,13 +1298,13 @@ static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) { - /* Passing a zero argument in last disables the rtcc algoritm */ + /* Passing a zero argument in last disables the rtcc algorithm */ sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 0); } /* Here starts the RTCCVAR type CC invented by RRS which * is a slight mod to RFC2581. We reuse a common routine or - * two since these algoritms are so close and need to + * two since these algorithms are so close and need to * remain the same. */ static void @@ -1510,7 +1510,7 @@ sctp_cwnd_update_rtcc_after_sack(struct struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) { - /* Passing a one argument at the last enables the rtcc algoritm */ + /* Passing a one argument at the last enables the rtcc algorithm */ sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); } Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_constants.h Mon May 2 20:56:11 2016 (r298942) @@ -275,7 +275,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_MULTIPLE_ASCONFS 0 /* - * Theshold for rwnd updates, we have to read (sb_hiwat >> + * Threshold for rwnd updates, we have to read (sb_hiwat >> * SCTP_RWND_HIWAT_SHIFT) before we will look to see if we need to send a * window update sack. When we look, we compare the last rwnd we sent vs the * current rwnd. It too must be greater than this value. Using 3 divdes the @@ -513,7 +513,7 @@ __FBSDID("$FreeBSD$"); /* Maximum the mapping array will grow to (TSN mapping array) */ #define SCTP_MAPPING_ARRAY 512 -/* size of the inital malloc on the mapping array */ +/* size of the initial malloc on the mapping array */ #define SCTP_INITIAL_MAPPING_ARRAY 16 /* how much we grow the mapping array each call */ #define SCTP_MAPPING_ARRAY_INCR 32 @@ -638,7 +638,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEF_PMTU_RAISE_SEC 600 /* 10 min between raise attempts */ -/* How many streams I request initally by default */ +/* How many streams I request initially by default */ #define SCTP_OSTREAM_INITIAL 10 #define SCTP_ISTREAM_INITIAL 2048 @@ -921,7 +921,7 @@ __FBSDID("$FreeBSD$"); * element. Each entry will take 2 4 byte ints (and of course the overhead * of the next pointer as well). Using 15 as an example will yield * ((8 * * 15) + 8) or 128 bytes of overhead for each timewait block that gets - * initialized. Increasing it to 31 would yeild 256 bytes per block. + * initialized. Increasing it to 31 would yield 256 bytes per block. */ #define SCTP_NUMBER_IN_VTAG_BLOCK 15 /* Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_indata.c Mon May 2 20:56:11 2016 (r298942) @@ -481,7 +481,7 @@ sctp_queue_data_to_stream(struct sctp_tc * FIX-ME maybe? What happens when the ssn wraps? If we are getting * all the data in one stream this could happen quite rapidly. One * could use the TSN to keep track of things, but this scheme breaks - * down in the other type of stream useage that could occur. Send a + * down in the other type of stream usage that could occur. Send a * single msg to stream 0, send 4Billion messages to stream 1, now * send a message to stream 0. You have a situation where the TSN * has wrapped but not in the stream. Is this worth worrying about @@ -1343,7 +1343,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * For IDATA we always check since we know * that the first fragment is 0. For old * DATA we have to receive the first before - * we knwo the first FSN (which is the TSN). + * we know the first FSN (which is the TSN). */ if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { /* @@ -1372,7 +1372,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * For IDATA we always check since we know * that the first fragment is 0. For old * DATA we have to receive the first before - * we knwo the first FSN (which is the TSN). + * we know the first FSN (which is the TSN). */ if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { @@ -2227,7 +2227,7 @@ sctp_slide_mapping_arrays(struct sctp_tc * 1) Did we move the cum-ack point? * * When you first glance at this you might think that all entries that - * make up the postion of the cum-ack would be in the nr-mapping + * make up the position of the cum-ack would be in the nr-mapping * array only.. i.e. things up to the cum-ack are always * deliverable. Thats true with one exception, when its a fragmented * message we may not deliver the data until some threshold (or all @@ -2534,7 +2534,7 @@ sctp_process_data(struct mbuf **mm, int /* copy the length and free up the old */ SCTP_BUF_LEN(m) = SCTP_BUF_LEN((*mm)); sctp_m_freem(*mm); - /* sucess, back copy */ + /* success, back copy */ *mm = m; } else { /* We are in trouble in the mbuf world .. yikes */ @@ -3651,7 +3651,7 @@ static int sctp_fs_audit(struct sctp_association *asoc) { struct sctp_tmit_chunk *chk; - int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; + int inflight = 0, resend = 0, between = 0, acked = 0, above = 0; int ret; #ifndef INVARIANTS @@ -4694,7 +4694,7 @@ sctp_handle_sack(struct mbuf *m, int off } if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { #ifdef INVARIANTS - panic("Warning flight size is postive and should be 0"); + panic("Warning flight size is positive and should be 0"); #else SCTP_PRINTF("Warning flight size incorrect should be 0 is %d\n", asoc->total_flight); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_input.c Mon May 2 20:56:11 2016 (r298942) @@ -616,7 +616,7 @@ sctp_handle_heartbeat_ack(struct sctp_he if (f_net != r_net) { /* * first one on the list is NOT the primary - * sctp_cmpaddr() is much more efficent if + * sctp_cmpaddr() is much more efficient if * the primary is the first on the list, * make it so. */ @@ -1082,7 +1082,7 @@ sctp_handle_shutdown_ack(struct sctp_shu /* * Skip past the param header and then we will find the chunk that caused the - * problem. There are two possiblities ASCONF or FWD-TSN other than that and + * problem. There are two possibilities ASCONF or FWD-TSN other than that and * our peer must be broken. */ static void @@ -1256,7 +1256,7 @@ sctp_handle_error(struct sctp_chunkhdr * * (or IPv4 for that matter) it does not matter. If * they don't support that type of address, they can * NOT possibly get that packet type... i.e. with no - * IPv6 you can't recieve a IPv6 packet. so we can + * IPv6 you can't receive a IPv6 packet. so we can * safely ignore this one. If we ever added support * for HOSTNAME Addresses, then we would need to do * something here. @@ -4470,7 +4470,7 @@ sctp_handle_packet_dropped(struct sctp_p (stcb->asoc.sat_t3_loss_recovery == 0) && (stcb->asoc.sat_network)) { /* - * This is debateable but for sat networks it makes sense + * This is debatable but for sat networks it makes sense * Note if a T3 timer has went off, we will prohibit any * changes to cwnd until we exit the t3 loss recovery. */ Modified: head/sys/netinet/sctp_lock_bsd.h ============================================================================== --- head/sys/netinet/sctp_lock_bsd.h Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_lock_bsd.h Mon May 2 20:56:11 2016 (r298942) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); * Most other locks (INP and INFO) attempt to localize the locking i.e. we try * to contain the lock and unlock within the function that needs to lock it. * This sometimes mean we do extra locks and unlocks and lose a bit of - * efficency, but if the performance statements about non-recursive locks are + * efficiency, but if the performance statements about non-recursive locks are * true this should not be a problem. One issue that arises with this only * lock when needed is that if an implicit association setup is done we have * a problem. If at the time I lookup an association I have NULL in the tcb Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_output.c Mon May 2 20:56:11 2016 (r298942) @@ -3071,7 +3071,7 @@ bound_all_plan_b: ifn, num_preferred); if (num_preferred == 0) { /* None on this interface. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "No prefered -- skipping to next\n"); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "No preferred -- skipping to next\n"); continue; } SCTPDBG(SCTP_DEBUG_OUTPUT2, @@ -3156,7 +3156,7 @@ again_with_private_addresses_allowed: * It is restricted for some reason.. * probably not yet added. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Its resticted\n"); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Its restricted\n"); sifa = NULL; continue; } @@ -5390,7 +5390,7 @@ sctp_are_there_new_addresses(struct sctp } } if (fnd == 0) { - /* New address added! no need to look futher. */ + /* New address added! no need to look further. */ return (1); } } @@ -5631,7 +5631,7 @@ do_a_abort: stc.peerport = sh->src_port; /* - * If we wanted to honor cookie life extentions, we would add to + * If we wanted to honor cookie life extensions, we would add to * stc.cookie_life. For now we should NOT honor any extension */ stc.site_scope = stc.local_scope = stc.loopback_scope = 0; @@ -6206,7 +6206,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, return; } } /* if chunk was present */ - } /* if of sufficent priority */ + } /* if of sufficient priority */ } /* if chunk has enabled */ } /* tailqforeach */ @@ -6564,7 +6564,7 @@ error_out: } } /* - * save off the end and update the end-chain postion + * save off the end and update the end-chain position */ m = appendchain; while (m) { @@ -6576,7 +6576,7 @@ error_out: } return (outchain); } else { - /* save off the end and update the end-chain postion */ + /* save off the end and update the end-chain position */ m = appendchain; while (m) { if (SCTP_BUF_NEXT(m) == NULL) { @@ -6810,7 +6810,7 @@ sctp_sendall_completes(void *ptr, uint32 /* * Do a notify here? Kacheong suggests that the notify be done at * the send time.. so you would push up a notification if any send - * failed. Don't know if this is feasable since the only failures we + * failed. Don't know if this is feasible since the only failures we * have is "memory" related and if you cannot get an mbuf to send * the data you surely can't get an mbuf to send up to notify the * user you can't send the data :-> @@ -7468,7 +7468,7 @@ dont_do_it: chk->copy_by_ref = 0; } /* - * get last_mbuf and counts of mb useage This is ugly but hopefully + * get last_mbuf and counts of mb usage This is ugly but hopefully * its only one mbuf. */ if (chk->last_mbuf == NULL) { @@ -9537,7 +9537,7 @@ sctp_chunk_retransmission(struct sctp_in cnt_thru = 0; /* do we have control chunks to retransmit? */ if (m != NULL) { - /* Start a timer no matter if we suceed or fail */ + /* Start a timer no matter if we succeed or fail */ if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) { sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, chk->whoTo); } else if (chk->rec.chunk_id.id == SCTP_ASCONF) @@ -9802,7 +9802,7 @@ one_chunk_around: /* Is there something to send for this destination? */ if (m) { /* - * No matter if we fail/or suceed we should start a + * No matter if we fail/or succeed we should start a * timer. A failure is like a lost IP packet :-) */ if (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_pcb.c Mon May 2 20:56:11 2016 (r298942) @@ -330,7 +330,7 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, goto out; } if (sctp_ifap->ifn_p == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unuseable\n"); + SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unusable\n"); goto out; } if (if_name) { @@ -374,7 +374,7 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s goto out; } if (sctp_ifap->ifn_p == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unuseable\n"); + SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unusable\n"); goto out; } if (if_name) { @@ -5772,7 +5772,7 @@ sctp_pcb_init() { /* * SCTP initialization for the PCB structures should be called by - * the sctp_init() funciton. + * the sctp_init() function. */ int i; struct timeval tv; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_pcb.h Mon May 2 20:56:11 2016 (r298942) @@ -107,7 +107,7 @@ struct sctp_ifa { * that we MUST lock appropriate locks. This * is for V6. */ union sctp_sockstore address; - uint32_t refcount; /* number of folks refering to this */ + uint32_t refcount; /* number of folks referring to this */ uint32_t flags; uint32_t localifa_flags; uint32_t vrf_id; /* vrf_id of this addr (for deleting) */ @@ -360,7 +360,7 @@ struct sctp_pcbtsn_rlog { struct sctp_inpcb { /*- * put an inpcb in front of it all, kind of a waste but we need to - * for compatability with all the other stuff. + * for compatibility with all the other stuff. */ union { struct inpcb inp; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_structs.h Mon May 2 20:56:11 2016 (r298942) @@ -971,7 +971,7 @@ struct sctp_association { uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; /* - * For the pd-api we should re-write this a bit more efficent. We + * For the pd-api we should re-write this a bit more efficient. We * could have multiple sctp_queued_to_read's that we are building at * once. Now we only do this when we get ready to deliver to the * socket buffer. Note that we depend on the fact that the struct is Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctp_timer.c Mon May 2 20:56:11 2016 (r298942) @@ -1076,7 +1076,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp return (1); } /* - * cleared theshold management now lets backoff the address & select + * cleared threshold management now lets backoff the address & select * an alternate */ stcb->asoc.dropped_special_cnt = 0; @@ -1122,7 +1122,7 @@ sctp_strreset_timer(struct sctp_inpcb *i return (1); } /* - * cleared theshold management now lets backoff the address & select + * cleared threshold management now lets backoff the address & select * an alternate */ sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0, 0); @@ -1282,7 +1282,7 @@ sctp_shutdown_timer(struct sctp_inpcb *i { struct sctp_nets *alt; - /* first threshold managment */ + /* first threshold management */ if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { /* Assoc is over */ return (1); @@ -1305,7 +1305,7 @@ sctp_shutdownack_timer(struct sctp_inpcb { struct sctp_nets *alt; - /* first threshold managment */ + /* first threshold management */ if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { /* Assoc is over */ return (1); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 2 20:46:05 2016 (r298941) +++ head/sys/netinet/sctputil.c Mon May 2 20:56:11 2016 (r298942) @@ -1616,7 +1616,7 @@ sctp_timeout_handler(void *t) return; } } - /* record in stopped what t-o occured */ + /* record in stopped what t-o occurred */ tmr->stopped_from = type; /* mark as being serviced now */ From owner-svn-src-all@freebsd.org Mon May 2 21:01:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A256B2A0AF; Mon, 2 May 2016 21:01:10 +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 0C1F411AC; Mon, 2 May 2016 21:01:09 +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 u42L19SS039784; Mon, 2 May 2016 21:01:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42L181w039771; Mon, 2 May 2016 21:01:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605022101.u42L181w039771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 21:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298943 - in head/sys/dev/bhnd: . bcma cores/chipc cores/pci siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:01:10 -0000 Author: adrian Date: Mon May 2 21:01:08 2016 New Revision: 298943 URL: https://svnweb.freebsd.org/changeset/base/298943 Log: [bhnd] add module dependencies. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6179 Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/siba/siba_bhndb.c Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Mon May 2 20:56:11 2016 (r298942) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Mon May 2 21:01:08 2016 (r298943) @@ -180,4 +180,5 @@ DRIVER_MODULE(bcma_bhndb, bhndb, bcma_bh MODULE_VERSION(bcma_bhndb, 1); MODULE_DEPEND(bcma_bhndb, bcma, 1, 1, 1); +MODULE_DEPEND(bcma_bhndb, bhnd, 1, 1, 1); MODULE_DEPEND(bcma_bhndb, bhndb, 1, 1, 1); Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Mon May 2 20:56:11 2016 (r298942) +++ head/sys/dev/bhnd/bhnd_subr.c Mon May 2 21:01:08 2016 (r298943) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -889,4 +890,4 @@ bhnd_bus_generic_deactivate_resource(dev child, type, rid, r)); return (EINVAL); -}; \ No newline at end of file +}; Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Mon May 2 20:56:11 2016 (r298942) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Mon May 2 21:01:08 2016 (r298943) @@ -306,4 +306,5 @@ static device_method_t chipc_methods[] = DEFINE_CLASS_0(bhnd_chipc, chipc_driver, chipc_methods, sizeof(struct chipc_softc)); DRIVER_MODULE(bhnd_chipc, bhnd, chipc_driver, bhnd_chipc_devclass, 0, 0); +MODULE_DEPEND(bhnd_chipc, bhnd, 1, 1, 1); MODULE_VERSION(bhnd_chipc, 1); Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci.c Mon May 2 20:56:11 2016 (r298942) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci.c Mon May 2 21:01:08 2016 (r298943) @@ -546,3 +546,4 @@ DEFINE_CLASS_0(bhnd_pci, bhnd_pci_driver MODULE_VERSION(bhnd_pci, 1); MODULE_DEPEND(bhnd_pci, pci, 1, 1, 1); +MODULE_DEPEND(bhnd_pci, bhnd, 1, 1, 1); Modified: head/sys/dev/bhnd/siba/siba_bhndb.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_bhndb.c Mon May 2 20:56:11 2016 (r298942) +++ head/sys/dev/bhnd/siba/siba_bhndb.c Mon May 2 21:01:08 2016 (r298943) @@ -179,4 +179,5 @@ DRIVER_MODULE(siba_bhndb, bhndb, siba_bh MODULE_VERSION(siba_bhndb, 1); MODULE_DEPEND(siba_bhndb, siba, 1, 1, 1); -MODULE_DEPEND(siba_bhndb, bhndb, 1, 1, 1); \ No newline at end of file +MODULE_DEPEND(siba_bhndb, bhnd, 1, 1, 1); +MODULE_DEPEND(siba_bhndb, bhndb, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon May 2 21:03:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97CCBB2A21E for ; Mon, 2 May 2016 21:03:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE8E165B for ; Mon, 2 May 2016 21:03:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462222989; bh=WaY1A3MPOeS/ruE02+bdDllYni5I2GQlGt9jPr5u1Ks=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=mCVZVBSX8wHyumhUt9hw7gdCmmZ0lMBEryVD/NXouV43wkrlYHfuGHk85u8rX7Zvnsrz/0z9aRxXsrCTmxamNj9JkfN34+hxCBrGgD9tPd6mNEYSNlnPYuvIOUsA3BLmbAgBDwsWZKYqJLJcsEZcNjwa+iIaXvPeZ2er69bY98nOz2LR2YIqakQPuFjEYol7uWgVXbJTsISUbw72Ud+mTtPL7i4g3g+tKmhQ+2t+/2RI2WrP7kA/8pxaEBhV81F3nIRGyTwcG2ONHocph7Y/fSY8mazxm+sXREmzSYDXrVG7h1DazaYrwKRmmPbSfySNqebFHaZvtRWvSviIkMRR/A== Received: from [98.139.170.180] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:03:09 -0000 Received: from [68.142.230.65] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:03:08 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:03:08 -0000 X-Yahoo-Newman-Id: 956903.29917.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ONTnvkIVM1ngbQaYOBriU8CD60FYk8BfBVtFUl8ICDAz7.X PCstj1LYIvR8X95Phky.gxfkccubvh0AOt9ue_3.QyXPeLtco_8g6eDXV8Ux JYxWQVD.2bkva39WGBvqEbCnUoN5MTtVDcyu0.LB8Xy6S7eoucLwcvylRN2X imHIphGoyPjkg3WxqyIjcMhZV5zNC_VSaQCPMKNEi_lWFkj4tVnSmudqe7H0 L26dMzguAQ5qvPbMhOYD.elp_rHSl_K..BgsX0sHrUCyMSxR6IpspeEqfkY7 .SbkeNVxQCG6IStLx1Pnfm9KzRohktXraJrxguwyVK_giJSxPAX0obJKVzpQ ElGGe2tMCVGwmw0iVpgvOM_h9vL71HrCeABbMH5obVLX4GcyPQpaCS80wzxf 2n_RJPTyAE0zvSgnXsgWztAuznZuN.wdMnXLl8zdJn2Y5M2wtdk7JNT8ms2_ hz3bDuCPajIdYA2yY4eZTvYTtCbSCe3OJmffbshgMPVbff0RsK4TUnGQDzSn EZjlsYeEgcXvJ3ZWkCuLHzRPLBL_9ay25 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 To: John Baldwin , "Ngie Cooper (yaneurabeya)" References: <201605021800.u42I0cjK084243@repo.freebsd.org> <4F040E00-AB92-4D32-99F5-9BCB02578DC0@gmail.com> <2097917.RNSsKXUJ7U@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Mon, 2 May 2016 16:03:13 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <2097917.RNSsKXUJ7U@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:03:11 -0000 On 05/02/16 15:52, John Baldwin wrote: > On Monday, May 02, 2016 11:45:41 AM Ngie Cooper wrote: >> >>> On May 2, 2016, at 11:00, John Baldwin wrote: >>> >>> Author: jhb >>> Date: Mon May 2 18:00:38 2016 >>> New Revision: 298933 >>> URL: https://svnweb.freebsd.org/changeset/base/298933 >>> >>> Log: >>> Add a new bus method to fetch device-specific CPU sets. >>> >>> bus_get_cpus() returns a specified set of CPUs for a device. It accepts >>> an enum for the second parameter that indicates the type of cpuset to >>> request. Currently two valus are supported: >>> >>> - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to >>> the device when DEVICE_NUMA is enabled) >>> - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) >>> >>> For systems that do not support NUMA (or if it is not enabled in the kernel >>> config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' >>> by default. The idea is that INTR_CPUS should always return a valid set. >>> >>> Device drivers which want to use per-CPU interrupts should start using >>> INTR_CPUS instead of simply assigning interrupts to all available CPUs. >>> In the future we may wish to add tunables to control the policy of >>> INTR_CPUS (e.g. should it be local-only or global, should it ignore >>> SMT threads or not). >>> >>> The x86 nexus driver exposes the internal set of interrupt CPUs from the >>> the x86 interrupt code via INTR_CPUS. >>> >>> The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable >>> LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and >>> the global INTR_CPUS set from the nexus driver with the per-domain set from >>> _PXM to generate a local INTR_CPUS set for child devices. >>> >>> Reviewed by: wblock (manpage) >>> Differential Revision: https://reviews.freebsd.org/D5519 >>> >>> Added: >>> head/share/man/man9/BUS_GET_CPUS.9 (contents, props changed) >>> Modified: >>> head/share/man/man9/Makefile >>> head/sys/amd64/include/intr_machdep.h >>> head/sys/dev/acpica/acpi.c >>> head/sys/dev/acpica/acpi_pci.c >>> head/sys/dev/acpica/acpi_pcib.c >>> head/sys/dev/acpica/acpi_pcib_acpi.c >>> head/sys/dev/acpica/acpi_pcib_pci.c >>> head/sys/dev/acpica/acpi_pcibvar.h >>> head/sys/dev/acpica/acpivar.h >>> head/sys/dev/drm2/drm_dp_iic_helper.c >>> head/sys/dev/drm2/i915/dvo.h >>> head/sys/kern/bus_if.m >>> head/sys/kern/subr_bus.c >>> head/sys/sys/bus.h >>> head/sys/x86/acpica/OsdEnvironment.c >>> head/sys/x86/x86/intr_machdep.c >>> head/sys/x86/x86/nexus.c >> >> This broke the build with gcc: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1211/ > > I saw. What is odd though is that my tinderbox builds all passed. This might > be due to the recent howmany() changes since _bitset.h only needed > before but now needs (which is borderline to being pointless for > a _foo.h header). > TBH, I thought so too, but I avoided applying such changes to headers, and I haven't touched _bitset.h, Pedro. From owner-svn-src-all@freebsd.org Mon May 2 21:06:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6ACB2A2F0; Mon, 2 May 2016 21:06:03 +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 2735118F1; Mon, 2 May 2016 21:06:03 +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 u42L62wJ042062; Mon, 2 May 2016 21:06:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42L62Ym042059; Mon, 2 May 2016 21:06:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605022106.u42L62Ym042059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 21:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298944 - in head/sys: conf dev/bwn modules/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:06:03 -0000 Author: adrian Date: Mon May 2 21:06:02 2016 New Revision: 298944 URL: https://svnweb.freebsd.org/changeset/base/298944 Log: [bwn] break out the LP PHY code into a separate file. This (and eventually migrating the other PHY code out) is in preparation for adding the 11n PHY. No, the 11ac PHY (for the BCM4260 softmac part) isn't yet open source, so we can't grow that. Yet. This trims ~3,700 lines of code from if_bwn.c, bringing it down to a slightly less crazy sounding 10,446 lines of code. Added: head/sys/dev/bwn/if_bwn_misc.h (contents, props changed) head/sys/dev/bwn/if_bwn_phy_lp.c (contents, props changed) head/sys/dev/bwn/if_bwn_phy_lp.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bwn/if_bwn.c head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 2 21:01:08 2016 (r298943) +++ head/sys/conf/files Mon May 2 21:06:02 2016 (r298944) @@ -1132,6 +1132,8 @@ dev/bwi/if_bwi_pci.c optional bwi pci # XXX Work around clang warning, until maintainer approves fix. dev/bwn/if_bwn.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 2 21:01:08 2016 (r298943) +++ head/sys/dev/bwn/if_bwn.c Mon May 2 21:06:02 2016 (r298944) @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); @@ -204,8 +207,6 @@ static void bwn_core_start(struct bwn_ma static void bwn_core_exit(struct bwn_mac *); static void bwn_bt_disable(struct bwn_mac *); static int bwn_chip_init(struct bwn_mac *); -static uint64_t bwn_hf_read(struct bwn_mac *); -static void bwn_hf_write(struct bwn_mac *, uint64_t); static void bwn_set_txretry(struct bwn_mac *, int, int); static void bwn_rate_init(struct bwn_mac *); static void bwn_set_phytxctl(struct bwn_mac *); @@ -350,8 +351,6 @@ static void bwn_ofdmtab_write_4(struct b static void bwn_gtab_write(struct bwn_mac *, uint16_t, uint16_t, uint16_t); static void bwn_ram_write(struct bwn_mac *, uint16_t, uint32_t); -static void bwn_mac_suspend(struct bwn_mac *); -static void bwn_mac_enable(struct bwn_mac *); static void bwn_psctl(struct bwn_mac *, uint32_t); static int16_t bwn_nrssi_read(struct bwn_mac *, uint16_t); static void bwn_nrssi_offset(struct bwn_mac *); @@ -452,84 +451,6 @@ static void bwn_led_blink_end(void *); static void bwn_rfswitch(void *); static void bwn_rf_turnon(struct bwn_mac *); static void bwn_rf_turnoff(struct bwn_mac *); -static void bwn_phy_lp_init_pre(struct bwn_mac *); -static int bwn_phy_lp_init(struct bwn_mac *); -static uint16_t bwn_phy_lp_read(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_write(struct bwn_mac *, uint16_t, uint16_t); -static void bwn_phy_lp_maskset(struct bwn_mac *, uint16_t, uint16_t, - uint16_t); -static uint16_t bwn_phy_lp_rf_read(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_rf_write(struct bwn_mac *, uint16_t, uint16_t); -static void bwn_phy_lp_rf_onoff(struct bwn_mac *, int); -static int bwn_phy_lp_switch_channel(struct bwn_mac *, uint32_t); -static uint32_t bwn_phy_lp_get_default_chan(struct bwn_mac *); -static void bwn_phy_lp_set_antenna(struct bwn_mac *, int); -static void bwn_phy_lp_task_60s(struct bwn_mac *); -static void bwn_phy_lp_readsprom(struct bwn_mac *); -static void bwn_phy_lp_bbinit(struct bwn_mac *); -static void bwn_phy_lp_txpctl_init(struct bwn_mac *); -static void bwn_phy_lp_calib(struct bwn_mac *); -static void bwn_phy_lp_switch_analog(struct bwn_mac *, int); -static int bwn_phy_lp_b2062_switch_channel(struct bwn_mac *, uint8_t); -static int bwn_phy_lp_b2063_switch_channel(struct bwn_mac *, uint8_t); -static void bwn_phy_lp_set_anafilter(struct bwn_mac *, uint8_t); -static void bwn_phy_lp_set_gaintbl(struct bwn_mac *, uint32_t); -static void bwn_phy_lp_digflt_save(struct bwn_mac *); -static void bwn_phy_lp_get_txpctlmode(struct bwn_mac *); -static void bwn_phy_lp_set_txpctlmode(struct bwn_mac *, uint8_t); -static void bwn_phy_lp_bugfix(struct bwn_mac *); -static void bwn_phy_lp_digflt_restore(struct bwn_mac *); -static void bwn_phy_lp_tblinit(struct bwn_mac *); -static void bwn_phy_lp_bbinit_r2(struct bwn_mac *); -static void bwn_phy_lp_bbinit_r01(struct bwn_mac *); -static void bwn_phy_lp_b2062_init(struct bwn_mac *); -static void bwn_phy_lp_b2063_init(struct bwn_mac *); -static void bwn_phy_lp_rxcal_r2(struct bwn_mac *); -static void bwn_phy_lp_rccal_r12(struct bwn_mac *); -static void bwn_phy_lp_set_rccap(struct bwn_mac *); -static uint32_t bwn_phy_lp_roundup(uint32_t, uint32_t, uint8_t); -static void bwn_phy_lp_b2062_reset_pllbias(struct bwn_mac *); -static void bwn_phy_lp_b2062_vco_calib(struct bwn_mac *); -static void bwn_tab_write_multi(struct bwn_mac *, uint32_t, int, - const void *); -static void bwn_tab_read_multi(struct bwn_mac *, uint32_t, int, void *); -static struct bwn_txgain - bwn_phy_lp_get_txgain(struct bwn_mac *); -static uint8_t bwn_phy_lp_get_bbmult(struct bwn_mac *); -static void bwn_phy_lp_set_txgain(struct bwn_mac *, struct bwn_txgain *); -static void bwn_phy_lp_set_bbmult(struct bwn_mac *, uint8_t); -static void bwn_phy_lp_set_trsw_over(struct bwn_mac *, uint8_t, uint8_t); -static void bwn_phy_lp_set_rxgain(struct bwn_mac *, uint32_t); -static void bwn_phy_lp_set_deaf(struct bwn_mac *, uint8_t); -static int bwn_phy_lp_calc_rx_iq_comp(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_clear_deaf(struct bwn_mac *, uint8_t); -static void bwn_phy_lp_tblinit_r01(struct bwn_mac *); -static void bwn_phy_lp_tblinit_r2(struct bwn_mac *); -static void bwn_phy_lp_tblinit_txgain(struct bwn_mac *); -static void bwn_tab_write(struct bwn_mac *, uint32_t, uint32_t); -static void bwn_phy_lp_b2062_tblinit(struct bwn_mac *); -static void bwn_phy_lp_b2063_tblinit(struct bwn_mac *); -static int bwn_phy_lp_loopback(struct bwn_mac *); -static void bwn_phy_lp_set_rxgain_idx(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_ddfs_turnon(struct bwn_mac *, int, int, int, int, - int); -static uint8_t bwn_phy_lp_rx_iq_est(struct bwn_mac *, uint16_t, uint8_t, - struct bwn_phy_lp_iq_est *); -static void bwn_phy_lp_ddfs_turnoff(struct bwn_mac *); -static uint32_t bwn_tab_read(struct bwn_mac *, uint32_t); -static void bwn_phy_lp_set_txgain_dac(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_set_txgain_pa(struct bwn_mac *, uint16_t); -static void bwn_phy_lp_set_txgain_override(struct bwn_mac *); -static uint16_t bwn_phy_lp_get_pa_gain(struct bwn_mac *); -static uint8_t bwn_nbits(int32_t); -static void bwn_phy_lp_gaintbl_write_multi(struct bwn_mac *, int, int, - struct bwn_txgain_entry *); -static void bwn_phy_lp_gaintbl_write(struct bwn_mac *, int, - struct bwn_txgain_entry); -static void bwn_phy_lp_gaintbl_write_r2(struct bwn_mac *, int, - struct bwn_txgain_entry); -static void bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int, - struct bwn_txgain_entry); static void bwn_sysctl_node(struct bwn_softc *); static struct resource_spec bwn_res_spec_legacy[] = { @@ -612,231 +533,6 @@ static const struct bwn_channelinfo bwn_ .nchannels = 110 }; -static const uint8_t bwn_b2063_chantable_data[33][12] = { - { 0x6f, 0x3c, 0x3c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, - { 0x6f, 0x2c, 0x2c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, - { 0x6f, 0x1c, 0x1c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, - { 0x6e, 0x1c, 0x1c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, - { 0x6e, 0xc, 0xc, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, - { 0x6a, 0xc, 0xc, 0, 0x2, 0x5, 0xd, 0xd, 0x77, 0x80, 0x20, 0 }, - { 0x6a, 0xc, 0xc, 0, 0x1, 0x5, 0xd, 0xc, 0x77, 0x80, 0x20, 0 }, - { 0x6a, 0xc, 0xc, 0, 0x1, 0x4, 0xc, 0xc, 0x77, 0x80, 0x20, 0 }, - { 0x69, 0xc, 0xc, 0, 0x1, 0x4, 0xc, 0xc, 0x77, 0x70, 0x20, 0 }, - { 0x69, 0xc, 0xc, 0, 0x1, 0x4, 0xb, 0xc, 0x77, 0x70, 0x20, 0 }, - { 0x69, 0xc, 0xc, 0, 0, 0x4, 0xb, 0xb, 0x77, 0x60, 0x20, 0 }, - { 0x69, 0xc, 0xc, 0, 0, 0x3, 0xa, 0xb, 0x77, 0x60, 0x20, 0 }, - { 0x69, 0xc, 0xc, 0, 0, 0x3, 0xa, 0xa, 0x77, 0x60, 0x20, 0 }, - { 0x68, 0xc, 0xc, 0, 0, 0x2, 0x9, 0x9, 0x77, 0x60, 0x20, 0 }, - { 0x68, 0xc, 0xc, 0, 0, 0x1, 0x8, 0x8, 0x77, 0x50, 0x10, 0 }, - { 0x67, 0xc, 0xc, 0, 0, 0, 0x8, 0x8, 0x77, 0x50, 0x10, 0 }, - { 0x64, 0xc, 0xc, 0, 0, 0, 0x2, 0x1, 0x77, 0x20, 0, 0 }, - { 0x64, 0xc, 0xc, 0, 0, 0, 0x1, 0x1, 0x77, 0x20, 0, 0 }, - { 0x63, 0xc, 0xc, 0, 0, 0, 0x1, 0, 0x77, 0x10, 0, 0 }, - { 0x63, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0x10, 0, 0 }, - { 0x62, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0x10, 0, 0 }, - { 0x62, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, - { 0x61, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, - { 0x60, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, - { 0x6e, 0xc, 0xc, 0, 0x9, 0xe, 0xf, 0xf, 0x77, 0xc0, 0x50, 0 }, - { 0x6e, 0xc, 0xc, 0, 0x9, 0xd, 0xf, 0xf, 0x77, 0xb0, 0x50, 0 }, - { 0x6e, 0xc, 0xc, 0, 0x8, 0xc, 0xf, 0xf, 0x77, 0xb0, 0x50, 0 }, - { 0x6d, 0xc, 0xc, 0, 0x8, 0xc, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, - { 0x6d, 0xc, 0xc, 0, 0x8, 0xb, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, - { 0x6d, 0xc, 0xc, 0, 0x8, 0xa, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, - { 0x6c, 0xc, 0xc, 0, 0x7, 0x9, 0xf, 0xf, 0x77, 0x90, 0x40, 0 }, - { 0x6c, 0xc, 0xc, 0, 0x6, 0x8, 0xf, 0xf, 0x77, 0x90, 0x40, 0 }, - { 0x6c, 0xc, 0xc, 0, 0x5, 0x8, 0xf, 0xf, 0x77, 0x90, 0x40, 0 } -}; - -static const struct bwn_b206x_chan bwn_b2063_chantable[] = { - { 1, 2412, bwn_b2063_chantable_data[0] }, - { 2, 2417, bwn_b2063_chantable_data[0] }, - { 3, 2422, bwn_b2063_chantable_data[0] }, - { 4, 2427, bwn_b2063_chantable_data[1] }, - { 5, 2432, bwn_b2063_chantable_data[1] }, - { 6, 2437, bwn_b2063_chantable_data[1] }, - { 7, 2442, bwn_b2063_chantable_data[1] }, - { 8, 2447, bwn_b2063_chantable_data[1] }, - { 9, 2452, bwn_b2063_chantable_data[2] }, - { 10, 2457, bwn_b2063_chantable_data[2] }, - { 11, 2462, bwn_b2063_chantable_data[3] }, - { 12, 2467, bwn_b2063_chantable_data[3] }, - { 13, 2472, bwn_b2063_chantable_data[3] }, - { 14, 2484, bwn_b2063_chantable_data[4] }, - { 34, 5170, bwn_b2063_chantable_data[5] }, - { 36, 5180, bwn_b2063_chantable_data[6] }, - { 38, 5190, bwn_b2063_chantable_data[7] }, - { 40, 5200, bwn_b2063_chantable_data[8] }, - { 42, 5210, bwn_b2063_chantable_data[9] }, - { 44, 5220, bwn_b2063_chantable_data[10] }, - { 46, 5230, bwn_b2063_chantable_data[11] }, - { 48, 5240, bwn_b2063_chantable_data[12] }, - { 52, 5260, bwn_b2063_chantable_data[13] }, - { 56, 5280, bwn_b2063_chantable_data[14] }, - { 60, 5300, bwn_b2063_chantable_data[14] }, - { 64, 5320, bwn_b2063_chantable_data[15] }, - { 100, 5500, bwn_b2063_chantable_data[16] }, - { 104, 5520, bwn_b2063_chantable_data[17] }, - { 108, 5540, bwn_b2063_chantable_data[18] }, - { 112, 5560, bwn_b2063_chantable_data[19] }, - { 116, 5580, bwn_b2063_chantable_data[20] }, - { 120, 5600, bwn_b2063_chantable_data[21] }, - { 124, 5620, bwn_b2063_chantable_data[21] }, - { 128, 5640, bwn_b2063_chantable_data[22] }, - { 132, 5660, bwn_b2063_chantable_data[22] }, - { 136, 5680, bwn_b2063_chantable_data[22] }, - { 140, 5700, bwn_b2063_chantable_data[23] }, - { 149, 5745, bwn_b2063_chantable_data[23] }, - { 153, 5765, bwn_b2063_chantable_data[23] }, - { 157, 5785, bwn_b2063_chantable_data[23] }, - { 161, 5805, bwn_b2063_chantable_data[23] }, - { 165, 5825, bwn_b2063_chantable_data[23] }, - { 184, 4920, bwn_b2063_chantable_data[24] }, - { 188, 4940, bwn_b2063_chantable_data[25] }, - { 192, 4960, bwn_b2063_chantable_data[26] }, - { 196, 4980, bwn_b2063_chantable_data[27] }, - { 200, 5000, bwn_b2063_chantable_data[28] }, - { 204, 5020, bwn_b2063_chantable_data[29] }, - { 208, 5040, bwn_b2063_chantable_data[30] }, - { 212, 5060, bwn_b2063_chantable_data[31] }, - { 216, 5080, bwn_b2063_chantable_data[32] } -}; - -static const uint8_t bwn_b2062_chantable_data[22][12] = { - { 0xff, 0xff, 0xb5, 0x1b, 0x24, 0x32, 0x32, 0x88, 0x88, 0, 0, 0 }, - { 0, 0x22, 0x20, 0x84, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0x11, 0x10, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0x11, 0x20, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0x11, 0x10, 0x84, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0x11, 0, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x63, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x62, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x30, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x20, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0x10, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, - { 0, 0, 0, 0, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, - { 0x55, 0x77, 0x90, 0xf7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x44, 0x77, 0x80, 0xe7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x44, 0x66, 0x80, 0xe7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x33, 0x66, 0x70, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x22, 0x55, 0x60, 0xd7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x22, 0x55, 0x60, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x22, 0x44, 0x50, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, - { 0x11, 0x44, 0x50, 0xa5, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, - { 0, 0x44, 0x40, 0xb6, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 } -}; - -static const struct bwn_b206x_chan bwn_b2062_chantable[] = { - { 1, 2412, bwn_b2062_chantable_data[0] }, - { 2, 2417, bwn_b2062_chantable_data[0] }, - { 3, 2422, bwn_b2062_chantable_data[0] }, - { 4, 2427, bwn_b2062_chantable_data[0] }, - { 5, 2432, bwn_b2062_chantable_data[0] }, - { 6, 2437, bwn_b2062_chantable_data[0] }, - { 7, 2442, bwn_b2062_chantable_data[0] }, - { 8, 2447, bwn_b2062_chantable_data[0] }, - { 9, 2452, bwn_b2062_chantable_data[0] }, - { 10, 2457, bwn_b2062_chantable_data[0] }, - { 11, 2462, bwn_b2062_chantable_data[0] }, - { 12, 2467, bwn_b2062_chantable_data[0] }, - { 13, 2472, bwn_b2062_chantable_data[0] }, - { 14, 2484, bwn_b2062_chantable_data[0] }, - { 34, 5170, bwn_b2062_chantable_data[1] }, - { 38, 5190, bwn_b2062_chantable_data[2] }, - { 42, 5210, bwn_b2062_chantable_data[2] }, - { 46, 5230, bwn_b2062_chantable_data[3] }, - { 36, 5180, bwn_b2062_chantable_data[4] }, - { 40, 5200, bwn_b2062_chantable_data[5] }, - { 44, 5220, bwn_b2062_chantable_data[6] }, - { 48, 5240, bwn_b2062_chantable_data[3] }, - { 52, 5260, bwn_b2062_chantable_data[3] }, - { 56, 5280, bwn_b2062_chantable_data[3] }, - { 60, 5300, bwn_b2062_chantable_data[7] }, - { 64, 5320, bwn_b2062_chantable_data[8] }, - { 100, 5500, bwn_b2062_chantable_data[9] }, - { 104, 5520, bwn_b2062_chantable_data[10] }, - { 108, 5540, bwn_b2062_chantable_data[10] }, - { 112, 5560, bwn_b2062_chantable_data[10] }, - { 116, 5580, bwn_b2062_chantable_data[11] }, - { 120, 5600, bwn_b2062_chantable_data[12] }, - { 124, 5620, bwn_b2062_chantable_data[12] }, - { 128, 5640, bwn_b2062_chantable_data[12] }, - { 132, 5660, bwn_b2062_chantable_data[12] }, - { 136, 5680, bwn_b2062_chantable_data[12] }, - { 140, 5700, bwn_b2062_chantable_data[12] }, - { 149, 5745, bwn_b2062_chantable_data[12] }, - { 153, 5765, bwn_b2062_chantable_data[12] }, - { 157, 5785, bwn_b2062_chantable_data[12] }, - { 161, 5805, bwn_b2062_chantable_data[12] }, - { 165, 5825, bwn_b2062_chantable_data[12] }, - { 184, 4920, bwn_b2062_chantable_data[13] }, - { 188, 4940, bwn_b2062_chantable_data[14] }, - { 192, 4960, bwn_b2062_chantable_data[15] }, - { 196, 4980, bwn_b2062_chantable_data[16] }, - { 200, 5000, bwn_b2062_chantable_data[17] }, - { 204, 5020, bwn_b2062_chantable_data[18] }, - { 208, 5040, bwn_b2062_chantable_data[19] }, - { 212, 5060, bwn_b2062_chantable_data[20] }, - { 216, 5080, bwn_b2062_chantable_data[21] } -}; - -/* for LP PHY */ -static const struct bwn_rxcompco bwn_rxcompco_5354[] = { - { 1, -66, 15 }, { 2, -66, 15 }, { 3, -66, 15 }, { 4, -66, 15 }, - { 5, -66, 15 }, { 6, -66, 15 }, { 7, -66, 14 }, { 8, -66, 14 }, - { 9, -66, 14 }, { 10, -66, 14 }, { 11, -66, 14 }, { 12, -66, 13 }, - { 13, -66, 13 }, { 14, -66, 13 }, -}; - -/* for LP PHY */ -static const struct bwn_rxcompco bwn_rxcompco_r12[] = { - { 1, -64, 13 }, { 2, -64, 13 }, { 3, -64, 13 }, { 4, -64, 13 }, - { 5, -64, 12 }, { 6, -64, 12 }, { 7, -64, 12 }, { 8, -64, 12 }, - { 9, -64, 12 }, { 10, -64, 11 }, { 11, -64, 11 }, { 12, -64, 11 }, - { 13, -64, 11 }, { 14, -64, 10 }, { 34, -62, 24 }, { 38, -62, 24 }, - { 42, -62, 24 }, { 46, -62, 23 }, { 36, -62, 24 }, { 40, -62, 24 }, - { 44, -62, 23 }, { 48, -62, 23 }, { 52, -62, 23 }, { 56, -62, 22 }, - { 60, -62, 22 }, { 64, -62, 22 }, { 100, -62, 16 }, { 104, -62, 16 }, - { 108, -62, 15 }, { 112, -62, 14 }, { 116, -62, 14 }, { 120, -62, 13 }, - { 124, -62, 12 }, { 128, -62, 12 }, { 132, -62, 12 }, { 136, -62, 11 }, - { 140, -62, 10 }, { 149, -61, 9 }, { 153, -61, 9 }, { 157, -61, 9 }, - { 161, -61, 8 }, { 165, -61, 8 }, { 184, -62, 25 }, { 188, -62, 25 }, - { 192, -62, 25 }, { 196, -62, 25 }, { 200, -62, 25 }, { 204, -62, 25 }, - { 208, -62, 25 }, { 212, -62, 25 }, { 216, -62, 26 }, -}; - -static const struct bwn_rxcompco bwn_rxcompco_r2 = { 0, -64, 0 }; - -static const uint8_t bwn_tab_sigsq_tbl[] = { - 0xde, 0xdc, 0xda, 0xd8, 0xd6, 0xd4, 0xd2, 0xcf, 0xcd, - 0xca, 0xc7, 0xc4, 0xc1, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0x00, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xc1, 0xc4, 0xc7, 0xca, 0xcd, - 0xcf, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, -}; - -static const uint8_t bwn_tab_pllfrac_tbl[] = { - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -}; - -static const uint16_t bwn_tabl_iqlocal_tbl[] = { - 0x0200, 0x0300, 0x0400, 0x0600, 0x0800, 0x0b00, 0x1000, 0x1001, 0x1002, - 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1707, 0x2007, 0x2d07, 0x4007, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0200, 0x0300, 0x0400, 0x0600, - 0x0800, 0x0b00, 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, - 0x1007, 0x1707, 0x2007, 0x2d07, 0x4007, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -}; - static const uint16_t bwn_tab_noise_g1[] = BWN_TAB_NOISE_G1; static const uint16_t bwn_tab_noise_g2[] = BWN_TAB_NOISE_G2; static const uint16_t bwn_tab_noisescale_g1[] = BWN_TAB_NOISESCALE_G1; @@ -3273,7 +2969,7 @@ bwn_chip_init(struct bwn_mac *mac) } /* read hostflags */ -static uint64_t +uint64_t bwn_hf_read(struct bwn_mac *mac) { uint64_t ret; @@ -3286,7 +2982,7 @@ bwn_hf_read(struct bwn_mac *mac) return (ret); } -static void +void bwn_hf_write(struct bwn_mac *mac, uint64_t value) { @@ -6528,7 +6224,7 @@ bwn_lo_g_init(struct bwn_mac *mac) bwn_phy_g_dc_lookup_init(mac, 1); } -static void +void bwn_mac_suspend(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; @@ -6562,7 +6258,7 @@ out: mac->mac_suspended++; } -static void +void bwn_mac_enable(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; @@ -10699,3343 +10395,6 @@ bwn_rfswitch(void *arg) } static void -bwn_phy_lp_init_pre(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_lp *plp = &phy->phy_lp; - - plp->plp_antenna = BWN_ANT_DEFAULT; -} - -static int -bwn_phy_lp_init(struct bwn_mac *mac) -{ - static const struct bwn_stxtable tables[] = { - { 2, 6, 0x3d, 3, 0x01 }, { 1, 12, 0x4c, 1, 0x01 }, - { 1, 8, 0x50, 0, 0x7f }, { 0, 8, 0x44, 0, 0xff }, - { 1, 0, 0x4a, 0, 0xff }, { 0, 4, 0x4d, 0, 0xff }, - { 1, 4, 0x4e, 0, 0xff }, { 0, 12, 0x4f, 0, 0x0f }, - { 1, 0, 0x4f, 4, 0x0f }, { 3, 0, 0x49, 0, 0x0f }, - { 4, 3, 0x46, 4, 0x07 }, { 3, 15, 0x46, 0, 0x01 }, - { 4, 0, 0x46, 1, 0x07 }, { 3, 8, 0x48, 4, 0x07 }, - { 3, 11, 0x48, 0, 0x0f }, { 3, 4, 0x49, 4, 0x0f }, - { 2, 15, 0x45, 0, 0x01 }, { 5, 13, 0x52, 4, 0x07 }, - { 6, 0, 0x52, 7, 0x01 }, { 5, 3, 0x41, 5, 0x07 }, - { 5, 6, 0x41, 0, 0x0f }, { 5, 10, 0x42, 5, 0x07 }, - { 4, 15, 0x42, 0, 0x01 }, { 5, 0, 0x42, 1, 0x07 }, - { 4, 11, 0x43, 4, 0x0f }, { 4, 7, 0x43, 0, 0x0f }, - { 4, 6, 0x45, 1, 0x01 }, { 2, 7, 0x40, 4, 0x0f }, - { 2, 11, 0x40, 0, 0x0f } - }; - struct bwn_phy_lp *plp = &mac->mac_phy.phy_lp; - struct bwn_softc *sc = mac->mac_sc; - const struct bwn_stxtable *st; - struct ieee80211com *ic = &sc->sc_ic; - int i, error; - uint16_t tmp; - - bwn_phy_lp_readsprom(mac); /* XXX bad place */ - bwn_phy_lp_bbinit(mac); - - /* initialize RF */ - BWN_PHY_SET(mac, BWN_PHY_4WIRECTL, 0x2); - DELAY(1); - BWN_PHY_MASK(mac, BWN_PHY_4WIRECTL, 0xfffd); - DELAY(1); - - if (mac->mac_phy.rf_ver == 0x2062) - bwn_phy_lp_b2062_init(mac); - else { - bwn_phy_lp_b2063_init(mac); - - /* synchronize stx table. */ - for (i = 0; i < N(tables); i++) { - st = &tables[i]; - tmp = BWN_RF_READ(mac, st->st_rfaddr); - tmp >>= st->st_rfshift; - tmp <<= st->st_physhift; - BWN_PHY_SETMASK(mac, - BWN_PHY_OFDM(0xf2 + st->st_phyoffset), - ~(st->st_mask << st->st_physhift), tmp); - } - - BWN_PHY_WRITE(mac, BWN_PHY_OFDM(0xf0), 0x5f80); - BWN_PHY_WRITE(mac, BWN_PHY_OFDM(0xf1), 0); - } - - /* calibrate RC */ - if (mac->mac_phy.rev >= 2) - bwn_phy_lp_rxcal_r2(mac); - else if (!plp->plp_rccap) { - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) - bwn_phy_lp_rccal_r12(mac); - } else - bwn_phy_lp_set_rccap(mac); - - error = bwn_phy_lp_switch_channel(mac, 7); - if (error) - device_printf(sc->sc_dev, - "failed to change channel 7 (%d)\n", error); - bwn_phy_lp_txpctl_init(mac); - bwn_phy_lp_calib(mac); - return (0); -} - -static uint16_t -bwn_phy_lp_read(struct bwn_mac *mac, uint16_t reg) -{ - - BWN_WRITE_2(mac, BWN_PHYCTL, reg); - return (BWN_READ_2(mac, BWN_PHYDATA)); -} - -static void -bwn_phy_lp_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) -{ - - BWN_WRITE_2(mac, BWN_PHYCTL, reg); - BWN_WRITE_2(mac, BWN_PHYDATA, value); -} - -static void -bwn_phy_lp_maskset(struct bwn_mac *mac, uint16_t reg, uint16_t mask, - uint16_t set) -{ - - BWN_WRITE_2(mac, BWN_PHYCTL, reg); - BWN_WRITE_2(mac, BWN_PHYDATA, - (BWN_READ_2(mac, BWN_PHYDATA) & mask) | set); -} - -static uint16_t -bwn_phy_lp_rf_read(struct bwn_mac *mac, uint16_t reg) -{ - - KASSERT(reg != 1, ("unaccessible register %d", reg)); - if (mac->mac_phy.rev < 2 && reg != 0x4001) - reg |= 0x100; - if (mac->mac_phy.rev >= 2) - reg |= 0x200; - BWN_WRITE_2(mac, BWN_RFCTL, reg); - return BWN_READ_2(mac, BWN_RFDATALO); -} - -static void -bwn_phy_lp_rf_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) -{ - - KASSERT(reg != 1, ("unaccessible register %d", reg)); - BWN_WRITE_2(mac, BWN_RFCTL, reg); - BWN_WRITE_2(mac, BWN_RFDATALO, value); -} - -static void -bwn_phy_lp_rf_onoff(struct bwn_mac *mac, int on) -{ - - if (on) { - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xe0ff); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2, - (mac->mac_phy.rev >= 2) ? 0xf7f7 : 0xffe7); - return; - } - - if (mac->mac_phy.rev >= 2) { - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_VAL_0, 0x83ff); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_0, 0x1f00); - BWN_PHY_MASK(mac, BWN_PHY_AFE_DDFS, 0x80ff); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2_VAL, 0xdfff); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_2, 0x0808); - return; - } - - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_VAL_0, 0xe0ff); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_0, 0x1f00); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2_VAL, 0xfcff); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_2, 0x0018); -} - -static int -bwn_phy_lp_switch_channel(struct bwn_mac *mac, uint32_t chan) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_lp *plp = &phy->phy_lp; - int error; - - if (phy->rf_ver == 0x2063) { - error = bwn_phy_lp_b2063_switch_channel(mac, chan); - if (error) - return (error); - } else { - error = bwn_phy_lp_b2062_switch_channel(mac, chan); - if (error) - return (error); - bwn_phy_lp_set_anafilter(mac, chan); - bwn_phy_lp_set_gaintbl(mac, ieee80211_ieee2mhz(chan, 0)); - } - - plp->plp_chan = chan; - BWN_WRITE_2(mac, BWN_CHANNEL, chan); - return (0); -} - -static uint32_t -bwn_phy_lp_get_default_chan(struct bwn_mac *mac) -{ - struct bwn_softc *sc = mac->mac_sc; - struct ieee80211com *ic = &sc->sc_ic; - - return (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan) ? 1 : 36); -} - -static void -bwn_phy_lp_set_antenna(struct bwn_mac *mac, int antenna) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_lp *plp = &phy->phy_lp; - - if (phy->rev >= 2 || antenna > BWN_ANTAUTO1) - return; - - bwn_hf_write(mac, bwn_hf_read(mac) & ~BWN_HF_UCODE_ANTDIV_HELPER); - BWN_PHY_SETMASK(mac, BWN_PHY_CRSGAIN_CTL, 0xfffd, antenna & 0x2); - BWN_PHY_SETMASK(mac, BWN_PHY_CRSGAIN_CTL, 0xfffe, antenna & 0x1); - bwn_hf_write(mac, bwn_hf_read(mac) | BWN_HF_UCODE_ANTDIV_HELPER); - plp->plp_antenna = antenna; -} - -static void -bwn_phy_lp_task_60s(struct bwn_mac *mac) -{ - - bwn_phy_lp_calib(mac); -} - -static void -bwn_phy_lp_readsprom(struct bwn_mac *mac) -{ - struct bwn_phy_lp *plp = &mac->mac_phy.phy_lp; - struct bwn_softc *sc = mac->mac_sc; - struct ieee80211com *ic = &sc->sc_ic; - - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) { - plp->plp_txisoband_m = siba_sprom_get_tri2g(sc->sc_dev); - plp->plp_bxarch = siba_sprom_get_bxa2g(sc->sc_dev); - plp->plp_rxpwroffset = siba_sprom_get_rxpo2g(sc->sc_dev); - plp->plp_rssivf = siba_sprom_get_rssismf2g(sc->sc_dev); - plp->plp_rssivc = siba_sprom_get_rssismc2g(sc->sc_dev); - plp->plp_rssigs = siba_sprom_get_rssisav2g(sc->sc_dev); - return; - } - - plp->plp_txisoband_l = siba_sprom_get_tri5gl(sc->sc_dev); - plp->plp_txisoband_m = siba_sprom_get_tri5g(sc->sc_dev); - plp->plp_txisoband_h = siba_sprom_get_tri5gh(sc->sc_dev); - plp->plp_bxarch = siba_sprom_get_bxa5g(sc->sc_dev); - plp->plp_rxpwroffset = siba_sprom_get_rxpo5g(sc->sc_dev); - plp->plp_rssivf = siba_sprom_get_rssismf5g(sc->sc_dev); - plp->plp_rssivc = siba_sprom_get_rssismc5g(sc->sc_dev); - plp->plp_rssigs = siba_sprom_get_rssisav5g(sc->sc_dev); -} - -static void -bwn_phy_lp_bbinit(struct bwn_mac *mac) -{ - - bwn_phy_lp_tblinit(mac); - if (mac->mac_phy.rev >= 2) - bwn_phy_lp_bbinit_r2(mac); - else - bwn_phy_lp_bbinit_r01(mac); -} - -static void -bwn_phy_lp_txpctl_init(struct bwn_mac *mac) -{ - struct bwn_txgain gain_2ghz = { 4, 12, 12, 0 }; - struct bwn_txgain gain_5ghz = { 7, 15, 14, 0 }; - struct bwn_softc *sc = mac->mac_sc; - struct ieee80211com *ic = &sc->sc_ic; - - bwn_phy_lp_set_txgain(mac, - IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan) ? &gain_2ghz : &gain_5ghz); - bwn_phy_lp_set_bbmult(mac, 150); -} - -static void -bwn_phy_lp_calib(struct bwn_mac *mac) -{ - struct bwn_phy_lp *plp = &mac->mac_phy.phy_lp; - struct bwn_softc *sc = mac->mac_sc; - struct ieee80211com *ic = &sc->sc_ic; - const struct bwn_rxcompco *rc = NULL; - struct bwn_txgain ogain; - int i, omode, oafeovr, orf, obbmult; - uint8_t mode, fc = 0; - - if (plp->plp_chanfullcal != plp->plp_chan) { - plp->plp_chanfullcal = plp->plp_chan; - fc = 1; - } - - bwn_mac_suspend(mac); - - /* BlueTooth Coexistance Override */ - BWN_WRITE_2(mac, BWN_BTCOEX_CTL, 0x3); - BWN_WRITE_2(mac, BWN_BTCOEX_TXCTL, 0xff); - - if (mac->mac_phy.rev >= 2) - bwn_phy_lp_digflt_save(mac); - bwn_phy_lp_get_txpctlmode(mac); - mode = plp->plp_txpctlmode; - bwn_phy_lp_set_txpctlmode(mac, BWN_PHYLP_TXPCTL_OFF); - if (mac->mac_phy.rev == 0 && mode != BWN_PHYLP_TXPCTL_OFF) - bwn_phy_lp_bugfix(mac); - if (mac->mac_phy.rev >= 2 && fc == 1) { - bwn_phy_lp_get_txpctlmode(mac); - omode = plp->plp_txpctlmode; - oafeovr = BWN_PHY_READ(mac, BWN_PHY_AFE_CTL_OVR) & 0x40; - if (oafeovr) - ogain = bwn_phy_lp_get_txgain(mac); - orf = BWN_PHY_READ(mac, BWN_PHY_RF_PWR_OVERRIDE) & 0xff; - obbmult = bwn_phy_lp_get_bbmult(mac); - bwn_phy_lp_set_txpctlmode(mac, BWN_PHYLP_TXPCTL_OFF); - if (oafeovr) - bwn_phy_lp_set_txgain(mac, &ogain); - bwn_phy_lp_set_bbmult(mac, obbmult); - bwn_phy_lp_set_txpctlmode(mac, omode); - BWN_PHY_SETMASK(mac, BWN_PHY_RF_PWR_OVERRIDE, 0xff00, orf); - } - bwn_phy_lp_set_txpctlmode(mac, mode); - if (mac->mac_phy.rev >= 2) - bwn_phy_lp_digflt_restore(mac); - - /* do RX IQ Calculation; assumes that noise is true. */ - if (siba_get_chipid(sc->sc_dev) == 0x5354) { - for (i = 0; i < N(bwn_rxcompco_5354); i++) { - if (bwn_rxcompco_5354[i].rc_chan == plp->plp_chan) - rc = &bwn_rxcompco_5354[i]; - } - } else if (mac->mac_phy.rev >= 2) - rc = &bwn_rxcompco_r2; - else { - for (i = 0; i < N(bwn_rxcompco_r12); i++) { - if (bwn_rxcompco_r12[i].rc_chan == plp->plp_chan) - rc = &bwn_rxcompco_r12[i]; - } - } - if (rc == NULL) - goto fail; - - BWN_PHY_SETMASK(mac, BWN_PHY_RX_COMP_COEFF_S, 0xff00, rc->rc_c1); - BWN_PHY_SETMASK(mac, BWN_PHY_RX_COMP_COEFF_S, 0x00ff, rc->rc_c0 << 8); - - bwn_phy_lp_set_trsw_over(mac, 1 /* TX */, 0 /* RX */); - - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) { - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_0, 0x8); - BWN_PHY_SETMASK(mac, BWN_PHY_RF_OVERRIDE_VAL_0, 0xfff7, 0); - } else { - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_0, 0x20); - BWN_PHY_SETMASK(mac, BWN_PHY_RF_OVERRIDE_VAL_0, 0xffdf, 0); - } - - bwn_phy_lp_set_rxgain(mac, 0x2d5d); - BWN_PHY_MASK(mac, BWN_PHY_AFE_CTL_OVR, 0xfffe); - BWN_PHY_MASK(mac, BWN_PHY_AFE_CTL_OVRVAL, 0xfffe); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_0, 0x800); - BWN_PHY_SET(mac, BWN_PHY_RF_OVERRIDE_VAL_0, 0x800); - bwn_phy_lp_set_deaf(mac, 0); - /* XXX no checking return value? */ - (void)bwn_phy_lp_calc_rx_iq_comp(mac, 0xfff0); - bwn_phy_lp_clear_deaf(mac, 0); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xfffc); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xfff7); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xffdf); - - /* disable RX GAIN override. */ - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xfffe); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xffef); - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_0, 0xffbf); - if (mac->mac_phy.rev >= 2) { - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2, 0xfeff); - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) { - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2, 0xfbff); - BWN_PHY_MASK(mac, BWN_PHY_OFDM(0xe5), 0xfff7); - } - } else { - BWN_PHY_MASK(mac, BWN_PHY_RF_OVERRIDE_2, 0xfdff); - } - - BWN_PHY_MASK(mac, BWN_PHY_AFE_CTL_OVR, 0xfffe); - BWN_PHY_MASK(mac, BWN_PHY_AFE_CTL_OVRVAL, 0xf7ff); -fail: - bwn_mac_enable(mac); -} - -static void -bwn_phy_lp_switch_analog(struct bwn_mac *mac, int on) -{ - - if (on) { - BWN_PHY_MASK(mac, BWN_PHY_AFE_CTL_OVR, 0xfff8); - return; - } - - BWN_PHY_SET(mac, BWN_PHY_AFE_CTL_OVRVAL, 0x0007); - BWN_PHY_SET(mac, BWN_PHY_AFE_CTL_OVR, 0x0007); -} - -static int -bwn_phy_lp_b2063_switch_channel(struct bwn_mac *mac, uint8_t chan) -{ - static const struct bwn_b206x_chan *bc = NULL; - struct bwn_softc *sc = mac->mac_sc; - uint32_t count, freqref, freqvco, freqxtal, val[3], timeout, timeoutref, - tmp[6]; - uint16_t old, scale, tmp16; - int i, div; - - for (i = 0; i < N(bwn_b2063_chantable); i++) { - if (bwn_b2063_chantable[i].bc_chan == chan) { - bc = &bwn_b2063_chantable[i]; - break; - } - } - if (bc == NULL) - return (EINVAL); - - BWN_RF_WRITE(mac, BWN_B2063_LOGEN_VCOBUF1, bc->bc_data[0]); - BWN_RF_WRITE(mac, BWN_B2063_LOGEN_MIXER2, bc->bc_data[1]); - BWN_RF_WRITE(mac, BWN_B2063_LOGEN_BUF2, bc->bc_data[2]); - BWN_RF_WRITE(mac, BWN_B2063_LOGEN_RCCR1, bc->bc_data[3]); - BWN_RF_WRITE(mac, BWN_B2063_A_RX_1ST3, bc->bc_data[4]); - BWN_RF_WRITE(mac, BWN_B2063_A_RX_2ND1, bc->bc_data[5]); - BWN_RF_WRITE(mac, BWN_B2063_A_RX_2ND4, bc->bc_data[6]); - BWN_RF_WRITE(mac, BWN_B2063_A_RX_2ND7, bc->bc_data[7]); - BWN_RF_WRITE(mac, BWN_B2063_A_RX_PS6, bc->bc_data[8]); - BWN_RF_WRITE(mac, BWN_B2063_TX_RF_CTL2, bc->bc_data[9]); - BWN_RF_WRITE(mac, BWN_B2063_TX_RF_CTL5, bc->bc_data[10]); - BWN_RF_WRITE(mac, BWN_B2063_PA_CTL11, bc->bc_data[11]); - - old = BWN_RF_READ(mac, BWN_B2063_COM15); - BWN_RF_SET(mac, BWN_B2063_COM15, 0x1e); - - freqxtal = siba_get_cc_pmufreq(sc->sc_dev) * 1000; - freqvco = bc->bc_freq << ((bc->bc_freq > 4000) ? 1 : 2); - freqref = freqxtal * 3; - div = (freqxtal <= 26000000 ? 1 : 2); - timeout = ((((8 * freqxtal) / (div * 5000000)) + 1) >> 1) - 1; - timeoutref = ((((8 * freqxtal) / (div * (timeout + 1))) + - 999999) / 1000000) + 1; - - BWN_RF_WRITE(mac, BWN_B2063_JTAG_VCO_CALIB3, 0x2); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_VCO_CALIB6, - 0xfff8, timeout >> 2); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_VCO_CALIB7, - 0xff9f,timeout << 5); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_VCO_CALIB5, timeoutref); - - val[0] = bwn_phy_lp_roundup(freqxtal, 1000000, 16); - val[1] = bwn_phy_lp_roundup(freqxtal, 1000000 * div, 16); - val[2] = bwn_phy_lp_roundup(freqvco, 3, 16); - - count = (bwn_phy_lp_roundup(val[2], val[1] + 16, 16) * (timeout + 1) * - (timeoutref + 1)) - 1; - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_VCO_CALIB7, - 0xf0, count >> 8); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_VCO_CALIB8, count & 0xff); - - tmp[0] = ((val[2] * 62500) / freqref) << 4; - tmp[1] = ((val[2] * 62500) % freqref) << 4; - while (tmp[1] >= freqref) { - tmp[0]++; - tmp[1] -= freqref; - } - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_SG1, 0xffe0, tmp[0] >> 4); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_SG2, 0xfe0f, tmp[0] << 4); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_SG2, 0xfff0, tmp[0] >> 16); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_SG3, (tmp[1] >> 8) & 0xff); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_SG4, tmp[1] & 0xff); - - BWN_RF_WRITE(mac, BWN_B2063_JTAG_LF1, 0xb9); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_LF2, 0x88); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_LF3, 0x28); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_LF4, 0x63); - - tmp[2] = ((41 * (val[2] - 3000)) /1200) + 27; - tmp[3] = bwn_phy_lp_roundup(132000 * tmp[0], 8451, 16); - - if (howmany(tmp[3], tmp[2]) > 60) { - scale = 1; - tmp[4] = ((tmp[3] + tmp[2]) / (tmp[2] << 1)) - 8; - } else { - scale = 0; - tmp[4] = ((tmp[3] + (tmp[2] >> 1)) / tmp[2]) - 8; - } - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_CP2, 0xffc0, tmp[4]); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_CP2, 0xffbf, scale << 6); - - tmp[5] = bwn_phy_lp_roundup(100 * val[0], val[2], 16) * (tmp[4] * 8) * - (scale + 1); - if (tmp[5] > 150) - tmp[5] = 0; - - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_CP3, 0xffe0, tmp[5]); - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_CP3, 0xffdf, scale << 5); - - BWN_RF_SETMASK(mac, BWN_B2063_JTAG_XTAL_12, 0xfffb, 0x4); - if (freqxtal > 26000000) - BWN_RF_SET(mac, BWN_B2063_JTAG_XTAL_12, 0x2); - else - BWN_RF_MASK(mac, BWN_B2063_JTAG_XTAL_12, 0xfd); - - if (val[0] == 45) - BWN_RF_SET(mac, BWN_B2063_JTAG_VCO1, 0x2); - else - BWN_RF_MASK(mac, BWN_B2063_JTAG_VCO1, 0xfd); - - BWN_RF_SET(mac, BWN_B2063_PLL_SP2, 0x3); - DELAY(1); - BWN_RF_MASK(mac, BWN_B2063_PLL_SP2, 0xfffc); - - /* VCO Calibration */ - BWN_RF_MASK(mac, BWN_B2063_PLL_SP1, ~0x40); - tmp16 = BWN_RF_READ(mac, BWN_B2063_JTAG_CALNRST) & 0xf8; - BWN_RF_WRITE(mac, BWN_B2063_JTAG_CALNRST, tmp16); - DELAY(1); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_CALNRST, tmp16 | 0x4); - DELAY(1); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_CALNRST, tmp16 | 0x6); - DELAY(1); - BWN_RF_WRITE(mac, BWN_B2063_JTAG_CALNRST, tmp16 | 0x7); - DELAY(300); - BWN_RF_SET(mac, BWN_B2063_PLL_SP1, 0x40); - - BWN_RF_WRITE(mac, BWN_B2063_COM15, old); - return (0); -} - -static int -bwn_phy_lp_b2062_switch_channel(struct bwn_mac *mac, uint8_t chan) -{ - struct bwn_softc *sc = mac->mac_sc; - struct bwn_phy_lp *plp = &mac->mac_phy.phy_lp; - const struct bwn_b206x_chan *bc = NULL; - uint32_t freqxtal = siba_get_cc_pmufreq(sc->sc_dev) * 1000; - uint32_t tmp[9]; - int i; - - for (i = 0; i < N(bwn_b2062_chantable); i++) { - if (bwn_b2062_chantable[i].bc_chan == chan) { - bc = &bwn_b2062_chantable[i]; - break; - } - } - - if (bc == NULL) - return (EINVAL); - - BWN_RF_SET(mac, BWN_B2062_S_RFPLLCTL14, 0x04); - BWN_RF_WRITE(mac, BWN_B2062_N_LGENATUNE0, bc->bc_data[0]); - BWN_RF_WRITE(mac, BWN_B2062_N_LGENATUNE2, bc->bc_data[1]); - BWN_RF_WRITE(mac, BWN_B2062_N_LGENATUNE3, bc->bc_data[2]); - BWN_RF_WRITE(mac, BWN_B2062_N_TX_TUNE, bc->bc_data[3]); - BWN_RF_WRITE(mac, BWN_B2062_S_LGENG_CTL1, bc->bc_data[4]); - BWN_RF_WRITE(mac, BWN_B2062_N_LGENACTL5, bc->bc_data[5]); - BWN_RF_WRITE(mac, BWN_B2062_N_LGENACTL6, bc->bc_data[6]); - BWN_RF_WRITE(mac, BWN_B2062_N_TX_PGA, bc->bc_data[7]); - BWN_RF_WRITE(mac, BWN_B2062_N_TX_PAD, bc->bc_data[8]); - - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL33, 0xcc); - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL34, 0x07); - bwn_phy_lp_b2062_reset_pllbias(mac); - tmp[0] = freqxtal / 1000; - tmp[1] = plp->plp_div * 1000; - tmp[2] = tmp[1] * ieee80211_ieee2mhz(chan, 0); - if (ieee80211_ieee2mhz(chan, 0) < 4000) - tmp[2] *= 2; - tmp[3] = 48 * tmp[0]; - tmp[5] = tmp[2] / tmp[3]; - tmp[6] = tmp[2] % tmp[3]; - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL26, tmp[5]); - tmp[4] = tmp[6] * 0x100; - tmp[5] = tmp[4] / tmp[3]; - tmp[6] = tmp[4] % tmp[3]; - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL27, tmp[5]); - tmp[4] = tmp[6] * 0x100; - tmp[5] = tmp[4] / tmp[3]; - tmp[6] = tmp[4] % tmp[3]; - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL28, tmp[5]); - tmp[4] = tmp[6] * 0x100; - tmp[5] = tmp[4] / tmp[3]; - tmp[6] = tmp[4] % tmp[3]; - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL29, - tmp[5] + ((2 * tmp[6]) / tmp[3])); - tmp[7] = BWN_RF_READ(mac, BWN_B2062_S_RFPLLCTL19); - tmp[8] = ((2 * tmp[2] * (tmp[7] + 1)) + (3 * tmp[0])) / (6 * tmp[0]); - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL23, (tmp[8] >> 8) + 16); - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL24, tmp[8] & 0xff); - - bwn_phy_lp_b2062_vco_calib(mac); - if (BWN_RF_READ(mac, BWN_B2062_S_RFPLLCTL3) & 0x10) { - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL33, 0xfc); - BWN_RF_WRITE(mac, BWN_B2062_S_RFPLLCTL34, 0); - bwn_phy_lp_b2062_reset_pllbias(mac); - bwn_phy_lp_b2062_vco_calib(mac); - if (BWN_RF_READ(mac, BWN_B2062_S_RFPLLCTL3) & 0x10) { - BWN_RF_MASK(mac, BWN_B2062_S_RFPLLCTL14, ~0x04); - return (EIO); - } - } - BWN_RF_MASK(mac, BWN_B2062_S_RFPLLCTL14, ~0x04); - return (0); -} - -static void -bwn_phy_lp_set_anafilter(struct bwn_mac *mac, uint8_t channel) -{ - struct bwn_phy_lp *plp = &mac->mac_phy.phy_lp; - uint16_t tmp = (channel == 14); - - if (mac->mac_phy.rev < 2) { - BWN_PHY_SETMASK(mac, BWN_PHY_LP_PHY_CTL, 0xfcff, tmp << 9); - if ((mac->mac_phy.rev == 1) && (plp->plp_rccap)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 2 21:23:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F16F4B2A84B; Mon, 2 May 2016 21:23:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BED7A144E; Mon, 2 May 2016 21:23:06 +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 u42LN51q048334; Mon, 2 May 2016 21:23:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42LN5sF048333; Mon, 2 May 2016 21:23:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605022123.u42LN5sF048333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 May 2016 21:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298945 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:23:07 -0000 Author: tuexen Date: Mon May 2 21:23:05 2016 New Revision: 298945 URL: https://svnweb.freebsd.org/changeset/base/298945 Log: Undo a spell fix introduced in r298942, which breaks compilation. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon May 2 21:06:02 2016 (r298944) +++ head/sys/netinet/sctp_indata.c Mon May 2 21:23:05 2016 (r298945) @@ -3651,7 +3651,7 @@ static int sctp_fs_audit(struct sctp_association *asoc) { struct sctp_tmit_chunk *chk; - int inflight = 0, resend = 0, between = 0, acked = 0, above = 0; + int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; int ret; #ifndef INVARIANTS From owner-svn-src-all@freebsd.org Mon May 2 21:32:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35A43B2ABB6 for ; Mon, 2 May 2016 21:32:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3E8B1BFA for ; Mon, 2 May 2016 21:32:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462224741; bh=+XwOAVq/q16qjd6k0B1RSx2Z8ewqEEpI+SWM8xMTh8g=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=D1uarHAZIoPNxnf77EVJ4vYDuNlsgJ0i/P9pe1q3x7q9PapK3y1un7FTnMmSeUlN1IrJOa6T+zUG26BcOicBqVhnBLaw8tc8n5lug+EdbFcDkI3fOh5Fhy8x9qi2F8l+X5d0tBOBf4tbNdYW5fo/ZpPYhQhok7niFAtJY7+rN5i7LYJMJHH5qZglExie00pXJ54pLWzZdNkFP+koChrmafK0FHZdYn0jxoFOX9MkQ4WJyDZkSIKTwUz5CVnSFO59tPHK7ZSsGK2jEzg7zJ37C70IykOsQBczGUmEv5QtOr5V3siokKZidu4f/JdRXU5yktJwvTiXAQ19g7h5tzpDOQ== Received: from [98.139.170.182] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:32:21 -0000 Received: from [68.142.230.75] by tm25.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:32:21 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 02 May 2016 21:32:21 -0000 X-Yahoo-Newman-Id: 496912.39499.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FTW6fjoVM1nd6DBNXvPwqfc9FoKYaRMvjH9FVsrwWK1mtyK Ve_SU8GxYTT6VO8_V0hmigqSGYcDnSbLSF04i9TeiOLZGH5gomZ53J2W_8GU cVC0emiXIlUQx2fj.k01itUPMNTxFe4ya_XPtLfTHye2ZzpsMEzF0bG4nOcH 3v_RR.ietL1yq179ZgYFN2Ra6rZTQ2Qb5PNY3fU_Ww9ky9JgIJhu5j2i311u yHDvwWeT28nM_Gm1jPLMf.4hCcwFrPLB8ZsV4t1PcQZFBg0tzbLWR6ld6wbc 8DXv2iP4fX.oKJ1qKIjkWAqTVGAis.3.FLXIHN6sM8lthWXWr_zCf_5Ogq3O Zgy4vc8MCB5NhForKG0nS9L9wWJvMCADgkX4HiWcSeCrqgfTc0vfnnoEIlTG HqC_nREhLLEtZFYr.qRhKOs.daLhgYMN4556.FzRfDrUYEPwqeFMxowlrZVg NiUTYdspqdKSLDBvUWAHPfDPpd3EJ9dhfxGgT0cv56f_R4f8QwidRru.2Cp9 xO1_XI0Hd4_UeQnDYXqwx34RIzFNocZ6s X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298945 - head/sys/netinet To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605022123.u42LN5sF048333@repo.freebsd.org> From: Pedro Giffuni Message-ID: <5727C769.9090109@FreeBSD.org> Date: Mon, 2 May 2016 16:32:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201605022123.u42LN5sF048333@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:32:23 -0000 On 02/05/2016 16:23, Michael Tuexen wrote: > Author: tuexen > Date: Mon May 2 21:23:05 2016 > New Revision: 298945 > URL: https://svnweb.freebsd.org/changeset/base/298945 > > Log: > Undo a spell fix introduced in r298942, which breaks compilation. > > Modified: > head/sys/netinet/sctp_indata.c > > Modified: head/sys/netinet/sctp_indata.c > ============================================================================== > --- head/sys/netinet/sctp_indata.c Mon May 2 21:06:02 2016 (r298944) > +++ head/sys/netinet/sctp_indata.c Mon May 2 21:23:05 2016 (r298945) > @@ -3651,7 +3651,7 @@ static int > sctp_fs_audit(struct sctp_association *asoc) > { > struct sctp_tmit_chunk *chk; > - int inflight = 0, resend = 0, between = 0, acked = 0, above = 0; > + int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; > int ret; > > #ifndef INVARIANTS > Oops, sorry! Pointyhat here ... I'll take a break for today. Thanks! Pedro. From owner-svn-src-all@freebsd.org Mon May 2 21:40:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA309B2AF4F; Mon, 2 May 2016 21:40:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9717D107C; Mon, 2 May 2016 21:40:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42LeYxB051508; Mon, 2 May 2016 21:40:34 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42LeYFK051507; Mon, 2 May 2016 21:40:34 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605022140.u42LeYFK051507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 2 May 2016 21:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298946 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 21:40:35 -0000 Author: avos Date: Mon May 2 21:40:34 2016 New Revision: 298946 URL: https://svnweb.freebsd.org/changeset/base/298946 Log: bsdinstall: fix static address assignment for protected wireless networks. Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword) from ifconfig parameters. PR: 169199 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:23:05 2016 (r298945) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:40:34 2016 (r298946) @@ -84,7 +84,7 @@ retval=$? if [ "$BSDINSTALL_CONFIGCURRENT" ]; then . $BSDINSTALL_TMPETC/._rc.conf.net - ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed "s|$2||"` if [ "$defaultrouter" ]; then route delete -inet default route add -inet default $defaultrouter From owner-svn-src-all@freebsd.org Mon May 2 22:30:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF04CB2B95F; Mon, 2 May 2016 22:30:47 +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 667161BED; Mon, 2 May 2016 22:30:47 +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 u42MUkWe066428; Mon, 2 May 2016 22:30:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42MUk5p066425; Mon, 2 May 2016 22:30:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605022230.u42MUk5p066425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 22:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298947 - head/sys/dev/bhnd/cores/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 22:30:47 -0000 Author: adrian Date: Mon May 2 22:30:46 2016 New Revision: 298947 URL: https://svnweb.freebsd.org/changeset/base/298947 Log: [bhnd] fix more module dependencies. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6180 Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pci/bhnd_pcib.c Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci.c Mon May 2 21:40:34 2016 (r298946) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci.c Mon May 2 22:30:46 2016 (r298947) @@ -543,7 +543,6 @@ static device_method_t bhnd_pci_methods[ }; DEFINE_CLASS_0(bhnd_pci, bhnd_pci_driver, bhnd_pci_methods, sizeof(struct bhnd_pci_softc)); - -MODULE_VERSION(bhnd_pci, 1); -MODULE_DEPEND(bhnd_pci, pci, 1, 1, 1); MODULE_DEPEND(bhnd_pci, bhnd, 1, 1, 1); +MODULE_DEPEND(bhnd_pci, pci, 1, 1, 1); +MODULE_VERSION(bhnd_pci, 1); Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Mon May 2 21:40:34 2016 (r298946) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Mon May 2 22:30:46 2016 (r298947) @@ -449,4 +449,5 @@ DEFINE_CLASS_1(bhnd_pci_hostb, bhnd_pci_ DRIVER_MODULE(bhnd_hostb, bhnd, bhnd_pci_hostb_driver, bhnd_hostb_devclass, 0, 0); MODULE_VERSION(bhnd_pci_hostb, 1); +MODULE_DEPEND(bhnd_pci_hostb, bhnd, 1, 1, 1); MODULE_DEPEND(bhnd_pci_hostb, bhnd_pci, 1, 1, 1); Modified: head/sys/dev/bhnd/cores/pci/bhnd_pcib.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pcib.c Mon May 2 21:40:34 2016 (r298946) +++ head/sys/dev/bhnd/cores/pci/bhnd_pcib.c Mon May 2 22:30:46 2016 (r298947) @@ -90,5 +90,6 @@ DEFINE_CLASS_1(bhnd_pcib, bhnd_pcib_driv DRIVER_MODULE(bhnd_pcib, bhnd, bhnd_pcib_driver, bhnd_hostb_devclass, 0, 0); MODULE_VERSION(bhnd_pcib, 1); +MODULE_DEPEND(bhnd_pcib, bhnd, 1, 1, 1); +MODULE_DEPEND(bhnd_pcib, bhnd_pci, 1, 1, 1); MODULE_DEPEND(bhnd_pcib, pci, 1, 1, 1); -MODULE_DEPEND(bhnd_pcib, bhnd_pci_mdio, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon May 2 22:58:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E37B6B2BF04; Mon, 2 May 2016 22:58:12 +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 AD4CD1AD9; Mon, 2 May 2016 22:58:12 +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 u42MwBji075272; Mon, 2 May 2016 22:58:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42MwB4q075269; Mon, 2 May 2016 22:58:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605022258.u42MwB4q075269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 2 May 2016 22:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298948 - in head/sys: conf dev/bwn modules/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 02 May 2016 22:58:13 -0000 Author: adrian Date: Mon May 2 22:58:11 2016 New Revision: 298948 URL: https://svnweb.freebsd.org/changeset/base/298948 Log: [bwn] break out the 'g' phy code into a separate source file. * Break out the 'g' phy code; * Break out the debugging bits into a separate source file, since some debugging prints are done in the phy code; * Make some more chip methods in if_bwn.c public. This brings the size of if_bwn.c down to 6,805 lines which is now approaching managable. Added: head/sys/dev/bwn/if_bwn_debug.h (contents, props changed) head/sys/dev/bwn/if_bwn_phy_g.c (contents, props changed) head/sys/dev/bwn/if_bwn_phy_g.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_misc.h head/sys/dev/bwn/if_bwn_phy_lp.c head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 2 22:30:46 2016 (r298947) +++ head/sys/conf/files Mon May 2 22:58:11 2016 (r298948) @@ -1132,6 +1132,8 @@ dev/bwi/if_bwi_pci.c optional bwi pci # XXX Work around clang warning, until maintainer approves fix. dev/bwn/if_bwn.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/cardbus/cardbus.c optional cardbus Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 2 22:30:46 2016 (r298947) +++ head/sys/dev/bwn/if_bwn.c Mon May 2 22:58:11 2016 (r298948) @@ -75,7 +75,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, @@ -89,33 +91,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, bwn, C static int bwn_debug = 0; SYSCTL_INT(_hw_bwn, OID_AUTO, debug, CTLFLAG_RWTUN, &bwn_debug, 0, "Broadcom debugging printfs"); -enum { - BWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ - BWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ - BWN_DEBUG_STATE = 0x00000004, /* 802.11 state transitions */ - BWN_DEBUG_TXPOW = 0x00000008, /* tx power processing */ - BWN_DEBUG_RESET = 0x00000010, /* reset processing */ - BWN_DEBUG_OPS = 0x00000020, /* bwn_ops processing */ - BWN_DEBUG_BEACON = 0x00000040, /* beacon handling */ - BWN_DEBUG_WATCHDOG = 0x00000080, /* watchdog timeout */ - BWN_DEBUG_INTR = 0x00000100, /* ISR */ - BWN_DEBUG_CALIBRATE = 0x00000200, /* periodic calibration */ - BWN_DEBUG_NODE = 0x00000400, /* node management */ - BWN_DEBUG_LED = 0x00000800, /* led management */ - BWN_DEBUG_CMD = 0x00001000, /* cmd submission */ - BWN_DEBUG_LO = 0x00002000, /* LO */ - BWN_DEBUG_FW = 0x00004000, /* firmware */ - BWN_DEBUG_WME = 0x00008000, /* WME */ - BWN_DEBUG_RF = 0x00010000, /* RF */ - BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ - BWN_DEBUG_ANY = 0xffffffff -}; -#define DPRINTF(sc, m, fmt, ...) do { \ - if (sc->sc_debug & (m)) \ - printf(fmt, __VA_ARGS__); \ -} while (0) -#else -#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) #endif static int bwn_bfp = 0; /* use "Bad Frames Preemption" */ @@ -145,40 +120,9 @@ static void bwn_parent(struct ieee80211c static void bwn_start(struct bwn_softc *); static int bwn_transmit(struct ieee80211com *, struct mbuf *); static int bwn_attach_core(struct bwn_mac *); -static void bwn_reset_core(struct bwn_mac *, uint32_t); static int bwn_phy_getinfo(struct bwn_mac *, int); static int bwn_chiptest(struct bwn_mac *); static int bwn_setup_channels(struct bwn_mac *, int, int); -static int bwn_phy_g_attach(struct bwn_mac *); -static void bwn_phy_g_detach(struct bwn_mac *); -static void bwn_phy_g_init_pre(struct bwn_mac *); -static int bwn_phy_g_prepare_hw(struct bwn_mac *); -static int bwn_phy_g_init(struct bwn_mac *); -static void bwn_phy_g_exit(struct bwn_mac *); -static uint16_t bwn_phy_g_read(struct bwn_mac *, uint16_t); -static void bwn_phy_g_write(struct bwn_mac *, uint16_t, - uint16_t); -static uint16_t bwn_phy_g_rf_read(struct bwn_mac *, uint16_t); -static void bwn_phy_g_rf_write(struct bwn_mac *, uint16_t, - uint16_t); -static int bwn_phy_g_hwpctl(struct bwn_mac *); -static void bwn_phy_g_rf_onoff(struct bwn_mac *, int); -static int bwn_phy_g_switch_channel(struct bwn_mac *, uint32_t); -static uint32_t bwn_phy_g_get_default_chan(struct bwn_mac *); -static void bwn_phy_g_set_antenna(struct bwn_mac *, int); -static int bwn_phy_g_im(struct bwn_mac *, int); -static int bwn_phy_g_recalc_txpwr(struct bwn_mac *, int); -static void bwn_phy_g_set_txpwr(struct bwn_mac *); -static void bwn_phy_g_task_15s(struct bwn_mac *); -static void bwn_phy_g_task_60s(struct bwn_mac *); -static uint16_t bwn_phy_g_txctl(struct bwn_mac *); -static void bwn_phy_switch_analog(struct bwn_mac *, int); -static uint16_t bwn_shm_read_2(struct bwn_mac *, uint16_t, uint16_t); -static void bwn_shm_write_2(struct bwn_mac *, uint16_t, uint16_t, - uint16_t); -static uint32_t bwn_shm_read_4(struct bwn_mac *, uint16_t, uint16_t); -static void bwn_shm_write_4(struct bwn_mac *, uint16_t, uint16_t, - uint32_t); static void bwn_shm_ctlword(struct bwn_mac *, uint16_t, uint16_t); static void bwn_addchannels(struct ieee80211_channel [], int, int *, @@ -321,47 +265,6 @@ static struct bwn_dma_ring *bwn_dma_ring static struct bwn_dma_ring *bwn_dma_parse_cookie(struct bwn_mac *, const struct bwn_txstatus *, uint16_t, int *); static void bwn_dma_free(struct bwn_mac *); -static void bwn_phy_g_init_sub(struct bwn_mac *); -static uint8_t bwn_has_hwpctl(struct bwn_mac *); -static void bwn_phy_init_b5(struct bwn_mac *); -static void bwn_phy_init_b6(struct bwn_mac *); -static void bwn_phy_init_a(struct bwn_mac *); -static void bwn_loopback_calcgain(struct bwn_mac *); -static uint16_t bwn_rf_init_bcm2050(struct bwn_mac *); -static void bwn_lo_g_init(struct bwn_mac *); -static void bwn_lo_g_adjust(struct bwn_mac *); -static void bwn_lo_get_powervector(struct bwn_mac *); -static struct bwn_lo_calib *bwn_lo_calibset(struct bwn_mac *, - const struct bwn_bbatt *, const struct bwn_rfatt *); -static void bwn_lo_write(struct bwn_mac *, struct bwn_loctl *); -static void bwn_phy_hwpctl_init(struct bwn_mac *); -static void bwn_phy_g_switch_chan(struct bwn_mac *, int, uint8_t); -static void bwn_phy_g_set_txpwr_sub(struct bwn_mac *, - const struct bwn_bbatt *, const struct bwn_rfatt *, - uint8_t); -static void bwn_phy_g_set_bbatt(struct bwn_mac *, uint16_t); -static uint16_t bwn_rf_2050_rfoverval(struct bwn_mac *, uint16_t, uint32_t); -static void bwn_spu_workaround(struct bwn_mac *, uint8_t); -static void bwn_wa_init(struct bwn_mac *); -static void bwn_ofdmtab_write_2(struct bwn_mac *, uint16_t, uint16_t, - uint16_t); -static void bwn_dummy_transmission(struct bwn_mac *, int, int); -static void bwn_ofdmtab_write_4(struct bwn_mac *, uint16_t, uint16_t, - uint32_t); -static void bwn_gtab_write(struct bwn_mac *, uint16_t, uint16_t, - uint16_t); -static void bwn_ram_write(struct bwn_mac *, uint16_t, uint32_t); -static void bwn_psctl(struct bwn_mac *, uint32_t); -static int16_t bwn_nrssi_read(struct bwn_mac *, uint16_t); -static void bwn_nrssi_offset(struct bwn_mac *); -static void bwn_nrssi_threshold(struct bwn_mac *); -static void bwn_nrssi_slope_11g(struct bwn_mac *); -static void bwn_set_all_gains(struct bwn_mac *, int16_t, int16_t, - int16_t); -static void bwn_set_original_gains(struct bwn_mac *); -static void bwn_hwpctl_early_init(struct bwn_mac *); -static void bwn_hwpctl_init_gphy(struct bwn_mac *); -static uint16_t bwn_phy_g_chan2freq(uint8_t); static int bwn_fw_gets(struct bwn_mac *, enum bwn_fwtype); static int bwn_fw_get(struct bwn_mac *, enum bwn_fwtype, const char *, struct bwn_fwfile *); @@ -370,7 +273,6 @@ static void bwn_do_release_fw(struct bwn static uint16_t bwn_fwcaps_read(struct bwn_mac *); static int bwn_fwinitvals_write(struct bwn_mac *, const struct bwn_fwinitvals *, size_t, size_t); -static int bwn_switch_channel(struct bwn_mac *, int); static uint16_t bwn_ant2phy(int); static void bwn_mac_write_bssid(struct bwn_mac *); static void bwn_mac_setfilter(struct bwn_mac *, uint16_t, @@ -418,12 +320,6 @@ static void bwn_plcp_genhdr(struct bwn_p const uint8_t); static uint8_t bwn_antenna_sanitize(struct bwn_mac *, uint8_t); static uint8_t bwn_get_fbrate(uint8_t); -static int bwn_phy_shm_tssi_read(struct bwn_mac *, uint16_t); -static void bwn_phy_g_setatt(struct bwn_mac *, int *, int *); -static void bwn_phy_lock(struct bwn_mac *); -static void bwn_phy_unlock(struct bwn_mac *); -static void bwn_rf_lock(struct bwn_mac *); -static void bwn_rf_unlock(struct bwn_mac *); static void bwn_txpwr(void *, int); static void bwn_tasks(void *); static void bwn_task_15s(struct bwn_mac *); @@ -436,7 +332,6 @@ static void bwn_rx_radiotap(struct bwn_m const struct bwn_rxhdr4 *, struct bwn_plcp6 *, int, int, int); static void bwn_tsf_read(struct bwn_mac *, uint64_t *); -static void bwn_phy_g_dc_lookup_init(struct bwn_mac *, uint8_t); static void bwn_set_slot_time(struct bwn_mac *, uint16_t); static void bwn_watchdog(void *); static void bwn_dma_stop(struct bwn_mac *); @@ -533,13 +428,6 @@ static const struct bwn_channelinfo bwn_ .nchannels = 110 }; -static const uint16_t bwn_tab_noise_g1[] = BWN_TAB_NOISE_G1; -static const uint16_t bwn_tab_noise_g2[] = BWN_TAB_NOISE_G2; -static const uint16_t bwn_tab_noisescale_g1[] = BWN_TAB_NOISESCALE_G1; -static const uint16_t bwn_tab_noisescale_g2[] = BWN_TAB_NOISESCALE_G2; -static const uint16_t bwn_tab_noisescale_g3[] = BWN_TAB_NOISESCALE_G3; -const uint8_t bwn_bitrev_table[256] = BWN_BITREV_TABLE; - #define VENDOR_LED_ACT(vendor) \ { \ .vid = PCI_VENDOR_##vendor, \ @@ -1361,7 +1249,7 @@ fail: return (error); } -static void +void bwn_reset_core(struct bwn_mac *mac, uint32_t flags) { struct bwn_softc *sc = mac->mac_sc; @@ -1531,7 +1419,7 @@ bwn_setup_channels(struct bwn_mac *mac, return (ic->ic_nchans == 0 ? ENXIO : 0); } -static uint32_t +uint32_t bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset) { uint32_t ret; @@ -1557,7 +1445,7 @@ out: return (ret); } -static uint16_t +uint16_t bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset) { uint16_t ret; @@ -1593,7 +1481,7 @@ bwn_shm_ctlword(struct bwn_mac *mac, uin BWN_WRITE_4(mac, BWN_SHM_CONTROL, control); } -static void +void bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset, uint32_t value) { @@ -1616,7 +1504,7 @@ bwn_shm_write_4(struct bwn_mac *mac, uin BWN_WRITE_4(mac, BWN_SHM_DATA, value); } -static void +void bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset, uint16_t value) { @@ -1698,683 +1586,6 @@ bwn_addchannels(struct ieee80211_channel } static int -bwn_phy_g_attach(struct bwn_mac *mac) -{ - struct bwn_softc *sc = mac->mac_sc; - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - unsigned int i; - int16_t pab0, pab1, pab2; - static int8_t bwn_phy_g_tssi2dbm_table[] = BWN_PHY_G_TSSI2DBM_TABLE; - int8_t bg; - - bg = (int8_t)siba_sprom_get_tssi_bg(sc->sc_dev); - pab0 = (int16_t)siba_sprom_get_pa0b0(sc->sc_dev); - pab1 = (int16_t)siba_sprom_get_pa0b1(sc->sc_dev); - pab2 = (int16_t)siba_sprom_get_pa0b2(sc->sc_dev); - - if ((siba_get_chipid(sc->sc_dev) == 0x4301) && (phy->rf_ver != 0x2050)) - device_printf(sc->sc_dev, "not supported anymore\n"); - - pg->pg_flags = 0; - if (pab0 == 0 || pab1 == 0 || pab2 == 0 || pab0 == -1 || pab1 == -1 || - pab2 == -1) { - pg->pg_idletssi = 52; - pg->pg_tssi2dbm = bwn_phy_g_tssi2dbm_table; - return (0); - } - - pg->pg_idletssi = (bg == 0 || bg == -1) ? 62 : bg; - pg->pg_tssi2dbm = (uint8_t *)malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO); - if (pg->pg_tssi2dbm == NULL) { - device_printf(sc->sc_dev, "failed to allocate buffer\n"); - return (ENOMEM); - } - for (i = 0; i < 64; i++) { - int32_t m1, m2, f, q, delta; - int8_t j = 0; - - m1 = BWN_TSSI2DBM(16 * pab0 + i * pab1, 32); - m2 = MAX(BWN_TSSI2DBM(32768 + i * pab2, 256), 1); - f = 256; - - do { - if (j > 15) { - device_printf(sc->sc_dev, - "failed to generate tssi2dBm\n"); - free(pg->pg_tssi2dbm, M_DEVBUF); - return (ENOMEM); - } - q = BWN_TSSI2DBM(f * 4096 - BWN_TSSI2DBM(m2 * f, 16) * - f, 2048); - delta = abs(q - f); - f = q; - j++; - } while (delta >= 2); - - pg->pg_tssi2dbm[i] = MIN(MAX(BWN_TSSI2DBM(m1 * f, 8192), -127), - 128); - } - - pg->pg_flags |= BWN_PHY_G_FLAG_TSSITABLE_ALLOC; - return (0); -} - -static void -bwn_phy_g_detach(struct bwn_mac *mac) -{ - struct bwn_phy_g *pg = &mac->mac_phy.phy_g; - - if (pg->pg_flags & BWN_PHY_G_FLAG_TSSITABLE_ALLOC) { - free(pg->pg_tssi2dbm, M_DEVBUF); - pg->pg_tssi2dbm = NULL; - } - pg->pg_flags = 0; -} - -static void -bwn_phy_g_init_pre(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - void *tssi2dbm; - int idletssi; - unsigned int i; - - tssi2dbm = pg->pg_tssi2dbm; - idletssi = pg->pg_idletssi; - - memset(pg, 0, sizeof(*pg)); - - pg->pg_tssi2dbm = tssi2dbm; - pg->pg_idletssi = idletssi; - - memset(pg->pg_minlowsig, 0xff, sizeof(pg->pg_minlowsig)); - - for (i = 0; i < N(pg->pg_nrssi); i++) - pg->pg_nrssi[i] = -1000; - for (i = 0; i < N(pg->pg_nrssi_lt); i++) - pg->pg_nrssi_lt[i] = i; - pg->pg_lofcal = 0xffff; - pg->pg_initval = 0xffff; - pg->pg_immode = BWN_IMMODE_NONE; - pg->pg_ofdmtab_dir = BWN_OFDMTAB_DIR_UNKNOWN; - pg->pg_avgtssi = 0xff; - - pg->pg_loctl.tx_bias = 0xff; - TAILQ_INIT(&pg->pg_loctl.calib_list); -} - -static int -bwn_phy_g_prepare_hw(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - struct bwn_softc *sc = mac->mac_sc; - struct bwn_txpwr_loctl *lo = &pg->pg_loctl; - static const struct bwn_rfatt rfatt0[] = { - { 3, 0 }, { 1, 0 }, { 5, 0 }, { 7, 0 }, { 9, 0 }, { 2, 0 }, - { 0, 0 }, { 4, 0 }, { 6, 0 }, { 8, 0 }, { 1, 1 }, { 2, 1 }, - { 3, 1 }, { 4, 1 } - }; - static const struct bwn_rfatt rfatt1[] = { - { 2, 1 }, { 4, 1 }, { 6, 1 }, { 8, 1 }, { 10, 1 }, { 12, 1 }, - { 14, 1 } - }; - static const struct bwn_rfatt rfatt2[] = { - { 0, 1 }, { 2, 1 }, { 4, 1 }, { 6, 1 }, { 8, 1 }, { 9, 1 }, - { 9, 1 } - }; - static const struct bwn_bbatt bbatt_0[] = { - { 0 }, { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 } - }; - - KASSERT(phy->type == BWN_PHYTYPE_G, ("%s fail", __func__)); - - if (phy->rf_ver == 0x2050 && phy->rf_rev < 6) - pg->pg_bbatt.att = 0; - else - pg->pg_bbatt.att = 2; - - /* prepare Radio Attenuation */ - pg->pg_rfatt.padmix = 0; - - if (siba_get_pci_subvendor(sc->sc_dev) == SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == SIBA_BOARD_BCM4309G) { - if (siba_get_pci_revid(sc->sc_dev) < 0x43) { - pg->pg_rfatt.att = 2; - goto done; - } else if (siba_get_pci_revid(sc->sc_dev) < 0x51) { - pg->pg_rfatt.att = 3; - goto done; - } - } - - if (phy->type == BWN_PHYTYPE_A) { - pg->pg_rfatt.att = 0x60; - goto done; - } - - switch (phy->rf_ver) { - case 0x2050: - switch (phy->rf_rev) { - case 0: - pg->pg_rfatt.att = 5; - goto done; - case 1: - if (phy->type == BWN_PHYTYPE_G) { - if (siba_get_pci_subvendor(sc->sc_dev) == - SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == - SIBA_BOARD_BCM4309G && - siba_get_pci_revid(sc->sc_dev) >= 30) - pg->pg_rfatt.att = 3; - else if (siba_get_pci_subvendor(sc->sc_dev) == - SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == - SIBA_BOARD_BU4306) - pg->pg_rfatt.att = 3; - else - pg->pg_rfatt.att = 1; - } else { - if (siba_get_pci_subvendor(sc->sc_dev) == - SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == - SIBA_BOARD_BCM4309G && - siba_get_pci_revid(sc->sc_dev) >= 30) - pg->pg_rfatt.att = 7; - else - pg->pg_rfatt.att = 6; - } - goto done; - case 2: - if (phy->type == BWN_PHYTYPE_G) { - if (siba_get_pci_subvendor(sc->sc_dev) == - SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == - SIBA_BOARD_BCM4309G && - siba_get_pci_revid(sc->sc_dev) >= 30) - pg->pg_rfatt.att = 3; - else if (siba_get_pci_subvendor(sc->sc_dev) == - SIBA_BOARDVENDOR_BCM && - siba_get_pci_subdevice(sc->sc_dev) == - SIBA_BOARD_BU4306) - pg->pg_rfatt.att = 5; - else if (siba_get_chipid(sc->sc_dev) == 0x4320) - pg->pg_rfatt.att = 4; - else - pg->pg_rfatt.att = 3; - } else - pg->pg_rfatt.att = 6; - goto done; - case 3: - pg->pg_rfatt.att = 5; - goto done; - case 4: - case 5: - pg->pg_rfatt.att = 1; - goto done; - case 6: - case 7: - pg->pg_rfatt.att = 5; - goto done; - case 8: - pg->pg_rfatt.att = 0xa; - pg->pg_rfatt.padmix = 1; - goto done; - case 9: - default: - pg->pg_rfatt.att = 5; - goto done; - } - break; - case 0x2053: - switch (phy->rf_rev) { - case 1: - pg->pg_rfatt.att = 6; - goto done; - } - break; - } - pg->pg_rfatt.att = 5; -done: - pg->pg_txctl = (bwn_phy_g_txctl(mac) << 4); - - if (!bwn_has_hwpctl(mac)) { - lo->rfatt.array = rfatt0; - lo->rfatt.len = N(rfatt0); - lo->rfatt.min = 0; - lo->rfatt.max = 9; - goto genbbatt; - } - if (phy->rf_ver == 0x2050 && phy->rf_rev == 8) { - lo->rfatt.array = rfatt1; - lo->rfatt.len = N(rfatt1); - lo->rfatt.min = 0; - lo->rfatt.max = 14; - goto genbbatt; - } - lo->rfatt.array = rfatt2; - lo->rfatt.len = N(rfatt2); - lo->rfatt.min = 0; - lo->rfatt.max = 9; -genbbatt: - lo->bbatt.array = bbatt_0; - lo->bbatt.len = N(bbatt_0); - lo->bbatt.min = 0; - lo->bbatt.max = 8; - - BWN_READ_4(mac, BWN_MACCTL); - if (phy->rev == 1) { - phy->gmode = 0; - bwn_reset_core(mac, 0); - bwn_phy_g_init_sub(mac); - phy->gmode = 1; - bwn_reset_core(mac, BWN_TGSLOW_SUPPORT_G); - } - return (0); -} - -static uint16_t -bwn_phy_g_txctl(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - - if (phy->rf_ver != 0x2050) - return (0); - if (phy->rf_rev == 1) - return (BWN_TXCTL_PA2DB | BWN_TXCTL_TXMIX); - if (phy->rf_rev < 6) - return (BWN_TXCTL_PA2DB); - if (phy->rf_rev == 8) - return (BWN_TXCTL_TXMIX); - return (0); -} - -static int -bwn_phy_g_init(struct bwn_mac *mac) -{ - - bwn_phy_g_init_sub(mac); - return (0); -} - -static void -bwn_phy_g_exit(struct bwn_mac *mac) -{ - struct bwn_txpwr_loctl *lo = &mac->mac_phy.phy_g.pg_loctl; - struct bwn_lo_calib *cal, *tmp; - - if (lo == NULL) - return; - TAILQ_FOREACH_SAFE(cal, &lo->calib_list, list, tmp) { - TAILQ_REMOVE(&lo->calib_list, cal, list); - free(cal, M_DEVBUF); - } -} - -static uint16_t -bwn_phy_g_read(struct bwn_mac *mac, uint16_t reg) -{ - - BWN_WRITE_2(mac, BWN_PHYCTL, reg); - return (BWN_READ_2(mac, BWN_PHYDATA)); -} - -static void -bwn_phy_g_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) -{ - - BWN_WRITE_2(mac, BWN_PHYCTL, reg); - BWN_WRITE_2(mac, BWN_PHYDATA, value); -} - -static uint16_t -bwn_phy_g_rf_read(struct bwn_mac *mac, uint16_t reg) -{ - - KASSERT(reg != 1, ("%s:%d: fail", __func__, __LINE__)); - BWN_WRITE_2(mac, BWN_RFCTL, reg | 0x80); - return (BWN_READ_2(mac, BWN_RFDATALO)); -} - -static void -bwn_phy_g_rf_write(struct bwn_mac *mac, uint16_t reg, uint16_t value) -{ - - KASSERT(reg != 1, ("%s:%d: fail", __func__, __LINE__)); - BWN_WRITE_2(mac, BWN_RFCTL, reg); - BWN_WRITE_2(mac, BWN_RFDATALO, value); -} - -static int -bwn_phy_g_hwpctl(struct bwn_mac *mac) -{ - - return (mac->mac_phy.rev >= 6); -} - -static void -bwn_phy_g_rf_onoff(struct bwn_mac *mac, int on) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - unsigned int channel; - uint16_t rfover, rfoverval; - - if (on) { - if (phy->rf_on) - return; - - BWN_PHY_WRITE(mac, 0x15, 0x8000); - BWN_PHY_WRITE(mac, 0x15, 0xcc00); - BWN_PHY_WRITE(mac, 0x15, (phy->gmode ? 0xc0 : 0x0)); - if (pg->pg_flags & BWN_PHY_G_FLAG_RADIOCTX_VALID) { - BWN_PHY_WRITE(mac, BWN_PHY_RFOVER, - pg->pg_radioctx_over); - BWN_PHY_WRITE(mac, BWN_PHY_RFOVERVAL, - pg->pg_radioctx_overval); - pg->pg_flags &= ~BWN_PHY_G_FLAG_RADIOCTX_VALID; - } - channel = phy->chan; - bwn_phy_g_switch_chan(mac, 6, 1); - bwn_phy_g_switch_chan(mac, channel, 0); - return; - } - - rfover = BWN_PHY_READ(mac, BWN_PHY_RFOVER); - rfoverval = BWN_PHY_READ(mac, BWN_PHY_RFOVERVAL); - pg->pg_radioctx_over = rfover; - pg->pg_radioctx_overval = rfoverval; - pg->pg_flags |= BWN_PHY_G_FLAG_RADIOCTX_VALID; - BWN_PHY_WRITE(mac, BWN_PHY_RFOVER, rfover | 0x008c); - BWN_PHY_WRITE(mac, BWN_PHY_RFOVERVAL, rfoverval & 0xff73); -} - -static int -bwn_phy_g_switch_channel(struct bwn_mac *mac, uint32_t newchan) -{ - - if ((newchan < 1) || (newchan > 14)) - return (EINVAL); - bwn_phy_g_switch_chan(mac, newchan, 0); - - return (0); -} - -static uint32_t -bwn_phy_g_get_default_chan(struct bwn_mac *mac) -{ - - return (1); -} - -static void -bwn_phy_g_set_antenna(struct bwn_mac *mac, int antenna) -{ - struct bwn_phy *phy = &mac->mac_phy; - uint64_t hf; - int autodiv = 0; - uint16_t tmp; - - if (antenna == BWN_ANTAUTO0 || antenna == BWN_ANTAUTO1) - autodiv = 1; - - hf = bwn_hf_read(mac) & ~BWN_HF_UCODE_ANTDIV_HELPER; - bwn_hf_write(mac, hf); - - BWN_PHY_WRITE(mac, BWN_PHY_BBANDCFG, - (BWN_PHY_READ(mac, BWN_PHY_BBANDCFG) & ~BWN_PHY_BBANDCFG_RXANT) | - ((autodiv ? BWN_ANTAUTO1 : antenna) - << BWN_PHY_BBANDCFG_RXANT_SHIFT)); - - if (autodiv) { - tmp = BWN_PHY_READ(mac, BWN_PHY_ANTDWELL); - if (antenna == BWN_ANTAUTO1) - tmp &= ~BWN_PHY_ANTDWELL_AUTODIV1; - else - tmp |= BWN_PHY_ANTDWELL_AUTODIV1; - BWN_PHY_WRITE(mac, BWN_PHY_ANTDWELL, tmp); - } - tmp = BWN_PHY_READ(mac, BWN_PHY_ANTWRSETT); - if (autodiv) - tmp |= BWN_PHY_ANTWRSETT_ARXDIV; - else - tmp &= ~BWN_PHY_ANTWRSETT_ARXDIV; - BWN_PHY_WRITE(mac, BWN_PHY_ANTWRSETT, tmp); - if (phy->rev >= 2) { - BWN_PHY_WRITE(mac, BWN_PHY_OFDM61, - BWN_PHY_READ(mac, BWN_PHY_OFDM61) | BWN_PHY_OFDM61_10); - BWN_PHY_WRITE(mac, BWN_PHY_DIVSRCHGAINBACK, - (BWN_PHY_READ(mac, BWN_PHY_DIVSRCHGAINBACK) & 0xff00) | - 0x15); - if (phy->rev == 2) - BWN_PHY_WRITE(mac, BWN_PHY_ADIVRELATED, 8); - else - BWN_PHY_WRITE(mac, BWN_PHY_ADIVRELATED, - (BWN_PHY_READ(mac, BWN_PHY_ADIVRELATED) & 0xff00) | - 8); - } - if (phy->rev >= 6) - BWN_PHY_WRITE(mac, BWN_PHY_OFDM9B, 0xdc); - - hf |= BWN_HF_UCODE_ANTDIV_HELPER; - bwn_hf_write(mac, hf); -} - -static int -bwn_phy_g_im(struct bwn_mac *mac, int mode) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - - KASSERT(phy->type == BWN_PHYTYPE_G, ("%s: fail", __func__)); - KASSERT(mode == BWN_IMMODE_NONE, ("%s: fail", __func__)); - - if (phy->rev == 0 || !phy->gmode) - return (ENODEV); - - pg->pg_aci_wlan_automatic = 0; - return (0); -} - -static int -bwn_phy_g_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - struct bwn_softc *sc = mac->mac_sc; - unsigned int tssi; - int cck, ofdm; - int power; - int rfatt, bbatt; - unsigned int max; - - KASSERT(phy->type == BWN_PHYTYPE_G, ("%s: fail", __func__)); - - cck = bwn_phy_shm_tssi_read(mac, BWN_SHARED_TSSI_CCK); - ofdm = bwn_phy_shm_tssi_read(mac, BWN_SHARED_TSSI_OFDM_G); - if (cck < 0 && ofdm < 0) { - if (ignore_tssi == 0) - return (BWN_TXPWR_RES_DONE); - cck = 0; - ofdm = 0; - } - tssi = (cck < 0) ? ofdm : ((ofdm < 0) ? cck : (cck + ofdm) / 2); - if (pg->pg_avgtssi != 0xff) - tssi = (tssi + pg->pg_avgtssi) / 2; - pg->pg_avgtssi = tssi; - KASSERT(tssi < BWN_TSSI_MAX, ("%s:%d: fail", __func__, __LINE__)); - - max = siba_sprom_get_maxpwr_bg(sc->sc_dev); - if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL) - max -= 3; - if (max >= 120) { - device_printf(sc->sc_dev, "invalid max TX-power value\n"); - max = 80; - siba_sprom_set_maxpwr_bg(sc->sc_dev, max); - } - - power = MIN(MAX((phy->txpower < 0) ? 0 : (phy->txpower << 2), 0), max) - - (pg->pg_tssi2dbm[MIN(MAX(pg->pg_idletssi - pg->pg_curtssi + - tssi, 0x00), 0x3f)]); - if (power == 0) - return (BWN_TXPWR_RES_DONE); - - rfatt = -((power + 7) / 8); - bbatt = (-(power / 2)) - (4 * rfatt); - if ((rfatt == 0) && (bbatt == 0)) - return (BWN_TXPWR_RES_DONE); - pg->pg_bbatt_delta = bbatt; - pg->pg_rfatt_delta = rfatt; - return (BWN_TXPWR_RES_NEED_ADJUST); -} - -static void -bwn_phy_g_set_txpwr(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - struct bwn_softc *sc = mac->mac_sc; - int rfatt, bbatt; - uint8_t txctl; - - bwn_mac_suspend(mac); - - BWN_ASSERT_LOCKED(sc); - - bbatt = pg->pg_bbatt.att; - bbatt += pg->pg_bbatt_delta; - rfatt = pg->pg_rfatt.att; - rfatt += pg->pg_rfatt_delta; - - bwn_phy_g_setatt(mac, &bbatt, &rfatt); - txctl = pg->pg_txctl; - if ((phy->rf_ver == 0x2050) && (phy->rf_rev == 2)) { - if (rfatt <= 1) { - if (txctl == 0) { - txctl = BWN_TXCTL_PA2DB | BWN_TXCTL_TXMIX; - rfatt += 2; - bbatt += 2; - } else if (siba_sprom_get_bf_lo(sc->sc_dev) & - BWN_BFL_PACTRL) { - bbatt += 4 * (rfatt - 2); - rfatt = 2; - } - } else if (rfatt > 4 && txctl) { - txctl = 0; - if (bbatt < 3) { - rfatt -= 3; - bbatt += 2; - } else { - rfatt -= 2; - bbatt -= 2; - } - } - } - pg->pg_txctl = txctl; - bwn_phy_g_setatt(mac, &bbatt, &rfatt); - pg->pg_rfatt.att = rfatt; - pg->pg_bbatt.att = bbatt; - - DPRINTF(sc, BWN_DEBUG_TXPOW, "%s: adjust TX power\n", __func__); - - bwn_phy_lock(mac); - bwn_rf_lock(mac); - bwn_phy_g_set_txpwr_sub(mac, &pg->pg_bbatt, &pg->pg_rfatt, - pg->pg_txctl); - bwn_rf_unlock(mac); - bwn_phy_unlock(mac); - - bwn_mac_enable(mac); -} - -static void -bwn_phy_g_task_15s(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - struct bwn_softc *sc = mac->mac_sc; - struct bwn_txpwr_loctl *lo = &pg->pg_loctl; - unsigned long expire, now; - struct bwn_lo_calib *cal, *tmp; - uint8_t expired = 0; - - bwn_mac_suspend(mac); - - if (lo == NULL) - goto fail; - - BWN_GETTIME(now); - if (bwn_has_hwpctl(mac)) { - expire = now - BWN_LO_PWRVEC_EXPIRE; - if (ieee80211_time_before(lo->pwr_vec_read_time, expire)) { - bwn_lo_get_powervector(mac); - bwn_phy_g_dc_lookup_init(mac, 0); - } - goto fail; - } - - expire = now - BWN_LO_CALIB_EXPIRE; - TAILQ_FOREACH_SAFE(cal, &lo->calib_list, list, tmp) { - if (!ieee80211_time_before(cal->calib_time, expire)) - continue; - if (BWN_BBATTCMP(&cal->bbatt, &pg->pg_bbatt) && - BWN_RFATTCMP(&cal->rfatt, &pg->pg_rfatt)) { - KASSERT(!expired, ("%s:%d: fail", __func__, __LINE__)); - expired = 1; - } - - DPRINTF(sc, BWN_DEBUG_LO, "expired BB %u RF %u %u I %d Q %d\n", - cal->bbatt.att, cal->rfatt.att, cal->rfatt.padmix, - cal->ctl.i, cal->ctl.q); - - TAILQ_REMOVE(&lo->calib_list, cal, list); - free(cal, M_DEVBUF); - } - if (expired || TAILQ_EMPTY(&lo->calib_list)) { - cal = bwn_lo_calibset(mac, &pg->pg_bbatt, - &pg->pg_rfatt); - if (cal == NULL) { - device_printf(sc->sc_dev, - "failed to recalibrate LO\n"); - goto fail; - } - TAILQ_INSERT_TAIL(&lo->calib_list, cal, list); - bwn_lo_write(mac, &cal->ctl); - } - -fail: - bwn_mac_enable(mac); -} - -static void -bwn_phy_g_task_60s(struct bwn_mac *mac) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_softc *sc = mac->mac_sc; - uint8_t old = phy->chan; - - if (!(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_RSSI)) - return; - - bwn_mac_suspend(mac); - bwn_nrssi_slope_11g(mac); - if ((phy->rf_ver == 0x2050) && (phy->rf_rev == 8)) { - bwn_switch_channel(mac, (old >= 8) ? 1 : 13); - bwn_switch_channel(mac, old); - } - bwn_mac_enable(mac); -} - -static void -bwn_phy_switch_analog(struct bwn_mac *mac, int on) -{ - - BWN_WRITE_2(mac, BWN_PHY0, on ? 0 : 0xf4); -} - -static int bwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_bpf_params *params) { @@ -4302,2836 +3513,108 @@ bwn_dma_ring_addr(void *arg, bus_dma_seg } } -static void -bwn_phy_g_init_sub(struct bwn_mac *mac) +void +bwn_ram_write(struct bwn_mac *mac, uint16_t offset, uint32_t val) { - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_phy_g *pg = &phy->phy_g; - struct bwn_softc *sc = mac->mac_sc; - uint16_t i, tmp; - - if (phy->rev == 1) - bwn_phy_init_b5(mac); - else - bwn_phy_init_b6(mac); - - if (phy->rev >= 2 || phy->gmode) - bwn_phy_init_a(mac); - - if (phy->rev >= 2) { - BWN_PHY_WRITE(mac, BWN_PHY_ANALOGOVER, 0); - BWN_PHY_WRITE(mac, BWN_PHY_ANALOGOVERVAL, 0); - } - if (phy->rev == 2) { - BWN_PHY_WRITE(mac, BWN_PHY_RFOVER, 0); - BWN_PHY_WRITE(mac, BWN_PHY_PGACTL, 0xc0); - } - if (phy->rev > 5) { - BWN_PHY_WRITE(mac, BWN_PHY_RFOVER, 0x400); - BWN_PHY_WRITE(mac, BWN_PHY_PGACTL, 0xc0); - } - if (phy->gmode || phy->rev >= 2) { - tmp = BWN_PHY_READ(mac, BWN_PHY_VERSION_OFDM); - tmp &= BWN_PHYVER_VERSION; - if (tmp == 3 || tmp == 5) { - BWN_PHY_WRITE(mac, BWN_PHY_OFDM(0xc2), 0x1816); - BWN_PHY_WRITE(mac, BWN_PHY_OFDM(0xc3), 0x8006); - } - if (tmp == 5) { - BWN_PHY_SETMASK(mac, BWN_PHY_OFDM(0xcc), 0x00ff, - 0x1f00); - } - } - if ((phy->rev <= 2 && phy->gmode) || phy->rev >= 2) - BWN_PHY_WRITE(mac, BWN_PHY_OFDM(0x7e), 0x78); - if (phy->rf_rev == 8) { - BWN_PHY_SET(mac, BWN_PHY_EXTG(0x01), 0x80); - BWN_PHY_SET(mac, BWN_PHY_OFDM(0x3e), 0x4); - } - if (BWN_HAS_LOOPBACK(phy)) - bwn_loopback_calcgain(mac); - - if (phy->rf_rev != 8) { - if (pg->pg_initval == 0xffff) - pg->pg_initval = bwn_rf_init_bcm2050(mac); - else - BWN_RF_WRITE(mac, 0x0078, pg->pg_initval); - } - bwn_lo_g_init(mac); - if (BWN_HAS_TXMAG(phy)) { - BWN_RF_WRITE(mac, 0x52, - (BWN_RF_READ(mac, 0x52) & 0xff00) - | pg->pg_loctl.tx_bias | - pg->pg_loctl.tx_magn); - } else { - BWN_RF_SETMASK(mac, 0x52, 0xfff0, pg->pg_loctl.tx_bias); - } - if (phy->rev >= 6) { - BWN_PHY_SETMASK(mac, BWN_PHY_CCK(0x36), 0x0fff, - (pg->pg_loctl.tx_bias << 12)); - } - if (siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_PACTRL) - BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x8075); - else - BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2e), 0x807f); - if (phy->rev < 2) - BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2f), 0x101); - else - BWN_PHY_WRITE(mac, BWN_PHY_CCK(0x2f), 0x202); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 00:09:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C0EB2B1B6; Tue, 3 May 2016 00:09:14 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E2551435; Tue, 3 May 2016 00:09:14 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4309DlX097647; Tue, 3 May 2016 00:09:13 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4309Dea097646; Tue, 3 May 2016 00:09:13 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201605030009.u4309Dea097646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 3 May 2016 00:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298949 - head/sys/boot/i386/zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 00:09:14 -0000 Author: peter Date: Tue May 3 00:09:13 2016 New Revision: 298949 URL: https://svnweb.freebsd.org/changeset/base/298949 Log: Change a rounding operation that had missing braces into a roundup2() macro. Adjust the buffer clipping code to work as expected. This prevented a number of machines in the FreeBSD.org cluster from booting due to "ZFS: i/o error - all block copies unavailable" after an unclean shutdown. Modified: head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Mon May 2 22:58:11 2016 (r298948) +++ head/sys/boot/i386/zfsboot/zfsboot.c Tue May 3 00:09:13 2016 (r298949) @@ -224,21 +224,18 @@ vdev_read(vdev_t *vdev, void *priv, off_ while (bytes > 0) { nb = bytes / DEV_BSIZE; - if (nb > READ_BUF_SIZE / DEV_BSIZE) - nb = READ_BUF_SIZE / DEV_BSIZE; /* * Ensure that the read size plus the leading offset does not * exceed the size of the read buffer. */ - if (nb * DEV_BSIZE + diff > READ_BUF_SIZE) - nb -= diff / DEV_BSIZE; + if (nb > (READ_BUF_SIZE - diff) / DEV_BSIZE) + nb = (READ_BUF_SIZE - diff) / DEV_BSIZE; /* * Round the number of blocks to read up to the nearest multiple * of DEV_GELIBOOT_BSIZE. */ - alignnb = nb + (diff / DEV_BSIZE) + - (DEV_GELIBOOT_BSIZE / DEV_BSIZE - 1) & ~ - (unsigned int)(DEV_GELIBOOT_BSIZE / DEV_BSIZE - 1); + alignnb = roundup2(nb * DEV_BSIZE + diff, DEV_GELIBOOT_BSIZE) + / DEV_BSIZE; if (drvread(dsk, dmadat->rdbuf, alignlba, alignnb)) return -1; From owner-svn-src-all@freebsd.org Tue May 3 00:35:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF69B2B910; Tue, 3 May 2016 00:35:12 +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 AC86816A8; Tue, 3 May 2016 00:35:12 +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 u430ZBgT006798; Tue, 3 May 2016 00:35:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u430ZBkH006797; Tue, 3 May 2016 00:35:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605030035.u430ZBkH006797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 May 2016 00:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298950 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 00:35:13 -0000 Author: jhb Date: Tue May 3 00:35:11 2016 New Revision: 298950 URL: https://svnweb.freebsd.org/changeset/base/298950 Log: Fix an off by one error when remapping MSI-X vectors. pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value. MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue May 3 00:09:13 2016 (r298949) +++ head/sys/dev/pci/pci.c Tue May 3 00:35:11 2016 (r298950) @@ -1855,7 +1855,7 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < count; i++) { if (vectors[i] == 0) continue; - irq = msix->msix_vectors[vectors[i]].mv_irq; + irq = msix->msix_vectors[vectors[i] - 1].mv_irq; resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } @@ -1869,7 +1869,7 @@ pci_remap_msix_method(device_t dev, devi printf("---"); else printf("%d", - msix->msix_vectors[vectors[i]].mv_irq); + msix->msix_vectors[vectors[i] - 1].mv_irq); } printf("\n"); } From owner-svn-src-all@freebsd.org Tue May 3 01:17:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51E0FB2B20F; Tue, 3 May 2016 01:17:43 +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 10A4512C3; Tue, 3 May 2016 01:17:42 +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 u431Hgd9020024; Tue, 3 May 2016 01:17:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u431Hep4020007; Tue, 3 May 2016 01:17:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605030117.u431Hep4020007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 May 2016 01:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298951 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 01:17:43 -0000 Author: jhb Date: Tue May 3 01:17:40 2016 New Revision: 298951 URL: https://svnweb.freebsd.org/changeset/base/298951 Log: Revert bus_get_cpus() for now. I really thought I had run this through the tinderbox before committing, but many places need -> for now. Deleted: head/share/man/man9/BUS_GET_CPUS.9 Modified: head/share/man/man9/Makefile head/sys/amd64/include/intr_machdep.h head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/acpica/acpi_pcibvar.h head/sys/dev/acpica/acpivar.h head/sys/dev/drm2/drm_dp_iic_helper.c head/sys/dev/drm2/i915/dvo.h head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h head/sys/x86/acpica/OsdEnvironment.c head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/nexus.c Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue May 3 00:35:11 2016 (r298950) +++ head/share/man/man9/Makefile Tue May 3 01:17:40 2016 (r298951) @@ -42,7 +42,6 @@ MAN= accept_filter.9 \ bus_generic_print_child.9 \ bus_generic_read_ivar.9 \ bus_generic_shutdown.9 \ - BUS_GET_CPUS.9 \ bus_get_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ @@ -503,7 +502,6 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 -MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9 MLINKS+=BUS_SETUP_INTR.9 bus_setup_intr.9 \ BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9 \ Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Tue May 3 00:35:11 2016 (r298950) +++ head/sys/amd64/include/intr_machdep.h Tue May 3 01:17:40 2016 (r298951) @@ -143,9 +143,6 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; -#ifdef SMP -extern cpuset_t intr_cpus; -#endif extern struct mtx icu_lock; extern int elcr_found; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi.c Tue May 3 01:17:40 2016 (r298951) @@ -211,7 +211,6 @@ static device_method_t acpi_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), - DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_domain, acpi_get_domain), /* ACPI bus */ @@ -1078,79 +1077,52 @@ acpi_hint_device_unit(device_t acdev, de } /* - * Fetch the NUMA domain for a device by mapping the value returned by - * _PXM to a NUMA domain. If the device does not have a _PXM method, - * -2 is returned. If any other error occurs, -1 is returned. + * Fetch the VM domain for the given device 'dev'. + * + * Return 1 + domain if there's a domain, 0 if not found; + * -1 upon an error. */ -static int -acpi_parse_pxm(device_t dev) +int +acpi_parse_pxm(device_t dev, int *domain) { #ifdef DEVICE_NUMA - ACPI_HANDLE handle; - ACPI_STATUS status; - int pxm; + ACPI_HANDLE h; + int d, pxm; - handle = acpi_get_handle(dev); - if (handle == NULL) - return (-2); - status = acpi_GetInteger(handle, "_PXM", &pxm); - if (ACPI_SUCCESS(status)) - return (acpi_map_pxm_to_vm_domainid(pxm)); - if (status == AE_NOT_FOUND) - return (-2); + h = acpi_get_handle(dev); + if ((h != NULL) && + ACPI_SUCCESS(acpi_GetInteger(h, "_PXM", &pxm))) { + d = acpi_map_pxm_to_vm_domainid(pxm); + if (d < 0) + return (-1); + *domain = d; + return (1); + } #endif - return (-1); -} - -int -acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, - cpuset_t *cpuset) -{ - int d, error; - d = acpi_parse_pxm(child); - if (d < 0) - return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); - - switch (op) { - case LOCAL_CPUS: - if (setsize != sizeof(cpuset_t)) - return (EINVAL); - *cpuset = cpuset_domain[d]; - return (0); - case INTR_CPUS: - error = bus_generic_get_cpus(dev, child, op, setsize, cpuset); - if (error != 0) - return (error); - if (setsize != sizeof(cpuset_t)) - return (EINVAL); - CPU_AND(cpuset, &cpuset_domain[d]); - return (0); - default: - return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); - } + return (0); } /* - * Fetch the NUMA domain for the given device 'dev'. + * Fetch the NUMA domain for the given device. * * If a device has a _PXM method, map that to a NUMA domain. - * Otherwise, pass the request up to the parent. - * If there's no matching domain or the domain cannot be - * determined, return ENOENT. + * + * If none is found, then it'll call the parent method. + * If there's no domain, return ENOENT. */ int acpi_get_domain(device_t dev, device_t child, int *domain) { - int d; + int ret; - d = acpi_parse_pxm(child); - if (d >= 0) { - *domain = d; - return (0); - } - if (d == -1) + ret = acpi_parse_pxm(child, domain); + /* Error */ + if (ret == -1) return (ENOENT); + /* Found */ + if (ret == 1) + return (0); /* No _PXM node; go up a level */ return (bus_generic_get_domain(dev, child, domain)); Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi_pci.c Tue May 3 01:17:40 2016 (r298951) @@ -95,7 +95,6 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_child_deleted, acpi_pci_child_deleted), DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method), - DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), DEVMETHOD(bus_get_domain, acpi_get_domain), Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi_pcib.c Tue May 3 01:17:40 2016 (r298951) @@ -265,11 +265,3 @@ acpi_pcib_power_for_sleep(device_t pcib, acpi_device_pwr_for_sleep(acpi_dev, dev, pstate); return (0); } - -int -acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset) -{ - - return (bus_get_cpus(pcib, op, setsize, cpuset)); -} Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Tue May 3 01:17:40 2016 (r298951) @@ -130,7 +130,6 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_maxslots, pcib_maxslots), Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi_pcib_pci.c Tue May 3 01:17:40 2016 (r298951) @@ -78,7 +78,6 @@ static device_method_t acpi_pcib_pci_met /* Bus interface */ DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), - DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), Modified: head/sys/dev/acpica/acpi_pcibvar.h ============================================================================== --- head/sys/dev/acpica/acpi_pcibvar.h Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpi_pcibvar.h Tue May 3 01:17:40 2016 (r298951) @@ -36,8 +36,6 @@ void acpi_pci_link_add_reference(device_ int slot, int pin); int acpi_pci_link_route_interrupt(device_t dev, int index); void acpi_pcib_fetch_prt(device_t bus, ACPI_BUFFER *prt); -int acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset); int acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, ACPI_BUFFER *prtbuf); int acpi_pcib_power_for_sleep(device_t pcib, device_t dev, Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/acpica/acpivar.h Tue May 3 01:17:40 2016 (r298951) @@ -506,9 +506,8 @@ SYSCTL_DECL(_debug_acpi); * Returns the VM domain ID if found, or -1 if not found / invalid. */ int acpi_map_pxm_to_vm_domainid(int pxm); -int acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset); int acpi_get_domain(device_t dev, device_t child, int *domain); +int acpi_parse_pxm(device_t dev, int *domain); #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: head/sys/dev/drm2/drm_dp_iic_helper.c ============================================================================== --- head/sys/dev/drm2/drm_dp_iic_helper.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/drm2/drm_dp_iic_helper.c Tue May 3 01:17:40 2016 (r298951) @@ -23,7 +23,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/dev/drm2/i915/dvo.h ============================================================================== --- head/sys/dev/drm2/i915/dvo.h Tue May 3 00:35:11 2016 (r298950) +++ head/sys/dev/drm2/i915/dvo.h Tue May 3 01:17:40 2016 (r298951) @@ -26,7 +26,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue May 3 00:35:11 2016 (r298950) +++ head/sys/kern/bus_if.m Tue May 3 01:17:40 2016 (r298951) @@ -731,21 +731,3 @@ METHOD int get_domain { device_t _child; int *_domain; } DEFAULT bus_generic_get_domain; - -/** - * @brief Request a set of CPUs - * - * @param _dev the bus device - * @param _child the child device - * @param _op type of CPUs to request - * @param _setsize the size of the set passed in _cpuset - * @param _cpuset a pointer to a cpuset to receive the requested - * set of CPUs - */ -METHOD int get_cpus { - device_t _dev; - device_t _child; - enum cpu_sets _op; - size_t _setsize; - cpuset_t *_cpuset; -} DEFAULT bus_generic_get_cpus; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/kern/subr_bus.c Tue May 3 01:17:40 2016 (r298951) @@ -47,10 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include #include @@ -4113,23 +4111,6 @@ bus_generic_describe_intr(device_t dev, } /** - * @brief Helper function for implementing BUS_GET_CPUS(). - * - * This simple implementation of BUS_GET_CPUS() simply calls the - * BUS_GET_CPUS() method of the parent of @p dev. - */ -int -bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset) -{ - - /* Propagate up the bus hierarchy until someone handles it. */ - if (dev->parent != NULL) - return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset)); - return (EINVAL); -} - -/** * @brief Helper function for implementing BUS_GET_DMA_TAG(). * * This simple implementation of BUS_GET_DMA_TAG() simply calls the @@ -4639,23 +4620,6 @@ bus_child_location_str(device_t child, c } /** - * @brief Wrapper function for BUS_GET_CPUS(). - * - * This function simply calls the BUS_GET_CPUS() method of the - * parent of @p dev. - */ -int -bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) -{ - device_t parent; - - parent = device_get_parent(dev); - if (parent == NULL) - return (EINVAL); - return (BUS_GET_CPUS(parent, dev, op, setsize, cpuset)); -} - -/** * @brief Wrapper function for BUS_GET_DMA_TAG(). * * This function simply calls the BUS_GET_DMA_TAG() method of the @@ -4747,23 +4711,6 @@ root_child_present(device_t dev, device_ return (-1); } -static int -root_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, - cpuset_t *cpuset) -{ - - switch (op) { - case INTR_CPUS: - /* Default to returning the set of all CPUs. */ - if (setsize != sizeof(cpuset_t)) - return (EINVAL); - *cpuset = all_cpus; - return (0); - default: - return (EINVAL); - } -} - static kobj_method_t root_methods[] = { /* Device interface */ KOBJMETHOD(device_shutdown, bus_generic_shutdown), @@ -4776,7 +4723,6 @@ static kobj_method_t root_methods[] = { KOBJMETHOD(bus_write_ivar, bus_generic_write_ivar), KOBJMETHOD(bus_setup_intr, root_setup_intr), KOBJMETHOD(bus_child_present, root_child_present), - KOBJMETHOD(bus_get_cpus, root_get_cpus), KOBJMETHOD_END }; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue May 3 00:35:11 2016 (r298950) +++ head/sys/sys/bus.h Tue May 3 01:17:40 2016 (r298951) @@ -32,7 +32,6 @@ #include #include #include -#include #include /** @@ -273,16 +272,6 @@ enum intr_polarity { INTR_POLARITY_LOW = 2 }; -/** - * CPU sets supported by bus_get_cpus(). Note that not all sets may be - * supported for a given device. If a request is not supported by a - * device (or its parents), then bus_get_cpus() will fail with EINVAL. - */ -enum cpu_sets { - LOCAL_CPUS = 0, - INTR_CPUS -}; - typedef int (*devop_t)(void); /** @@ -399,8 +388,6 @@ int bus_generic_deactivate_resource(devi int rid, struct resource *r); int bus_generic_detach(device_t dev); void bus_generic_driver_added(device_t dev, driver_t *driver); -int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset); bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child); bus_space_tag_t @@ -470,8 +457,6 @@ int bus_activate_resource(device_t dev, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); -int bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, - cpuset_t *cpuset); bus_dma_tag_t bus_get_dma_tag(device_t dev); bus_space_tag_t bus_get_bus_tag(device_t dev); int bus_get_domain(device_t dev, int *domain); Modified: head/sys/x86/acpica/OsdEnvironment.c ============================================================================== --- head/sys/x86/acpica/OsdEnvironment.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/x86/acpica/OsdEnvironment.c Tue May 3 01:17:40 2016 (r298951) @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/x86/x86/intr_machdep.c Tue May 3 01:17:40 2016 (r298951) @@ -490,7 +490,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs) * allocate CPUs round-robin. */ -cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); +static cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); static int current_cpu; /* Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue May 3 00:35:11 2016 (r298950) +++ head/sys/x86/x86/nexus.c Tue May 3 01:17:40 2016 (r298951) @@ -127,8 +127,6 @@ static int nexus_set_resource(device_t, static int nexus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *); static void nexus_delete_resource(device_t, device_t, int, int); -static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, - cpuset_t *); #ifdef DEV_APIC static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); @@ -165,7 +163,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), - DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* pcib interface */ #ifdef DEV_APIC @@ -622,24 +619,6 @@ nexus_delete_resource(device_t dev, devi resource_list_delete(rl, type, rid); } -static int -nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, - cpuset_t *cpuset) -{ - - switch (op) { -#ifdef SMP - case INTR_CPUS: - if (setsize != sizeof(cpuset_t)) - return (EINVAL); - *cpuset = intr_cpus; - return (0); -#endif - default: - return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); - } -} - /* Called from the MSI code to add new IRQs to the IRQ rman. */ void nexus_add_irq(u_long irq) From owner-svn-src-all@freebsd.org Tue May 3 01:29:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19851B2B427; Tue, 3 May 2016 01:29:38 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x243.google.com (mail-vk0-x243.google.com [IPv6:2607:f8b0:400c:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C987F19D8; Tue, 3 May 2016 01:29:37 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x243.google.com with SMTP id o133so490208vka.0; Mon, 02 May 2016 18:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=jDyOFYj7kI9zn1/2pnMXCv/hBxZZlBPvv2N31cHZHY8=; b=a3rr4GZAIjNZu3OVrjqPBgTIQslRi2BNDF1+y1LJXt2xnvds7y/JU6+wA8S9cfJ156 nOrVXLWINazIVtGU9WPFbYT1mAcfXuw43Q7KST1qm6RqaoHXxAFpn/e39w5ca5aE9KBx 3ZReA6rJtHp0RXQwBIUw2FTdpOG5vwzKyY3vSiKda5B9UKGhK0U0xqRr61h3Vv/DuIzB NmRg/yAhlDFSoJa70xoQ86dHFbFOB1UwIC+Kwl84raoElomcNO2ua2rU2l3VNtkgzT31 A20rgje9AG+Pcf/e0FXghIDl7FgSff6iun6DGTQEXLnZaYB5hbKCu31kj+OpfJqyXqHs O8Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=jDyOFYj7kI9zn1/2pnMXCv/hBxZZlBPvv2N31cHZHY8=; b=lS6UWRyAzYAbPqlYtABAlSMmXNbkRvj2X8EWpQU6rt8tn6EGdhQk/+FgVSDk7TGXc2 0xK9ed6+7e4eM1arIc3Tu8AN5IY1Q8R3zOmBJ0fl4P54aNlnspR19p5TEbuLcXEswaYW 1P0hXSxw5pr7TrLBsEi39kZ8xBKromCnOKFSxOfZUMBwM3Hblr2Ma2o9avK5+D1anndM iC22umDx45PA4fBkeKMS8M8/7JZ1R/nL0sPECD9tnD8oHi3wOl6opPKOgS+uOPPwPSSf UIvaL6xy4IqSyOS32c1pwopBlx+X1yLmutCh+fFbNtJkttWh+fMfB0gCnXQ9GQ7dqGgN h++g== X-Gm-Message-State: AOPr4FVhbBxnAxCFfeH3VJQ/aCXWlqJjpHEVI4tQoWbmkXjP38NvdCDumo7j6dtxkCnMaLN32xERkCgK3bnr0w== MIME-Version: 1.0 X-Received: by 10.176.3.176 with SMTP id 45mr22018857uau.60.1462238976851; Mon, 02 May 2016 18:29:36 -0700 (PDT) Sender: sepherosa@gmail.com Received: by 10.176.65.99 with HTTP; Mon, 2 May 2016 18:29:36 -0700 (PDT) In-Reply-To: <20160429155536.GD18595@strugglingcoder.info> References: <201604290723.u3T7N8Ph070162@repo.freebsd.org> <20160429155536.GD18595@strugglingcoder.info> Date: Tue, 3 May 2016 09:29:36 +0800 X-Google-Sender-Auth: a_b6f6xPV-TP-DpL6LP1r8KU7Fc Message-ID: Subject: Re: svn commit: r298769 - head/sys/netinet From: Sepherosa Ziehau To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 01:29:38 -0000 On Fri, Apr 29, 2016 at 11:55 PM, hiren panchasara wrote: > On 04/29/16 at 07:23P, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Fri Apr 29 07:23:08 2016 >> New Revision: 298769 >> URL: https://svnweb.freebsd.org/changeset/base/298769 >> >> Log: >> tcp/syncache: Set flowid and hash type properly for SYN|ACK >> >> So the underlying drivers can use it to select the sending queue >> properly for SYN|ACK instead of rolling their own hash. >> >> Sponsored by: Microsoft OSTC >> Differential Revision: https://reviews.freebsd.org/D6120 >> >> Modified: >> head/sys/netinet/tcp_syncache.c > > Would it be possible to MFC this? I _think_ we can :) Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Tue May 3 03:24:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA1CB2BB03; Tue, 3 May 2016 03:24:29 +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 03C6C1DEC; Tue, 3 May 2016 03:24:28 +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 u433OSig060810; Tue, 3 May 2016 03:24:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u433OSMW060807; Tue, 3 May 2016 03:24:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605030324.u433OSMW060807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 3 May 2016 03:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298952 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 03:24:29 -0000 Author: adrian Date: Tue May 3 03:24:27 2016 New Revision: 298952 URL: https://svnweb.freebsd.org/changeset/base/298952 Log: [bwn] migrate bwn_dummy_transmission() back to main, as it'll be used by other PHYs. The Linux b43 driver uses this in other PHYs besides the g PHY. Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_misc.h head/sys/dev/bwn/if_bwn_phy_g.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 3 01:17:40 2016 (r298951) +++ head/sys/dev/bwn/if_bwn.c Tue May 3 03:24:27 2016 (r298952) @@ -3514,6 +3514,72 @@ bwn_dma_ring_addr(void *arg, bus_dma_seg } void +bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon) +{ + struct bwn_phy *phy = &mac->mac_phy; + struct bwn_softc *sc = mac->mac_sc; + unsigned int i, max_loop; + uint16_t value; + uint32_t buffer[5] = { + 0x00000000, 0x00d40000, 0x00000000, 0x01000000, 0x00000000 + }; + + if (ofdm) { + max_loop = 0x1e; + buffer[0] = 0x000201cc; + } else { + max_loop = 0xfa; + buffer[0] = 0x000b846e; + } + + BWN_ASSERT_LOCKED(mac->mac_sc); + + for (i = 0; i < 5; i++) + bwn_ram_write(mac, i * 4, buffer[i]); + + BWN_WRITE_2(mac, 0x0568, 0x0000); + BWN_WRITE_2(mac, 0x07c0, + (siba_get_revid(sc->sc_dev) < 11) ? 0x0000 : 0x0100); + value = ((phy->type == BWN_PHYTYPE_A) ? 0x41 : 0x40); + BWN_WRITE_2(mac, 0x050c, value); + if (phy->type == BWN_PHYTYPE_LP) + BWN_WRITE_2(mac, 0x0514, 0x1a02); + BWN_WRITE_2(mac, 0x0508, 0x0000); + BWN_WRITE_2(mac, 0x050a, 0x0000); + BWN_WRITE_2(mac, 0x054c, 0x0000); + BWN_WRITE_2(mac, 0x056a, 0x0014); + BWN_WRITE_2(mac, 0x0568, 0x0826); + BWN_WRITE_2(mac, 0x0500, 0x0000); + if (phy->type == BWN_PHYTYPE_LP) + BWN_WRITE_2(mac, 0x0502, 0x0050); + else + BWN_WRITE_2(mac, 0x0502, 0x0030); + + if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) + BWN_RF_WRITE(mac, 0x0051, 0x0017); + for (i = 0x00; i < max_loop; i++) { + value = BWN_READ_2(mac, 0x050e); + if (value & 0x0080) + break; + DELAY(10); + } + for (i = 0x00; i < 0x0a; i++) { + value = BWN_READ_2(mac, 0x050e); + if (value & 0x0400) + break; + DELAY(10); + } + for (i = 0x00; i < 0x19; i++) { + value = BWN_READ_2(mac, 0x0690); + if (!(value & 0x0100)) + break; + DELAY(10); + } + if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) + BWN_RF_WRITE(mac, 0x0051, 0x0037); +} + +void bwn_ram_write(struct bwn_mac *mac, uint16_t offset, uint32_t val) { uint32_t macctl; Modified: head/sys/dev/bwn/if_bwn_misc.h ============================================================================== --- head/sys/dev/bwn/if_bwn_misc.h Tue May 3 01:17:40 2016 (r298951) +++ head/sys/dev/bwn/if_bwn_misc.h Tue May 3 03:24:27 2016 (r298952) @@ -43,6 +43,8 @@ struct bwn_mac; extern uint64_t bwn_hf_read(struct bwn_mac *); extern void bwn_hf_write(struct bwn_mac *, uint64_t); +extern void bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon); + extern void bwn_ram_write(struct bwn_mac *, uint16_t, uint32_t); extern void bwn_mac_suspend(struct bwn_mac *); Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Tue May 3 01:17:40 2016 (r298951) +++ head/sys/dev/bwn/if_bwn_phy_g.c Tue May 3 03:24:27 2016 (r298952) @@ -103,7 +103,6 @@ static void bwn_spu_workaround(struct bw static void bwn_wa_init(struct bwn_mac *); static void bwn_ofdmtab_write_2(struct bwn_mac *, uint16_t, uint16_t, uint16_t); -static void bwn_dummy_transmission(struct bwn_mac *, int, int); static void bwn_ofdmtab_write_4(struct bwn_mac *, uint16_t, uint16_t, uint32_t); static void bwn_gtab_write(struct bwn_mac *, uint16_t, uint16_t, @@ -1893,72 +1892,6 @@ bwn_gtab_write(struct bwn_mac *mac, uint } static void -bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon) -{ - struct bwn_phy *phy = &mac->mac_phy; - struct bwn_softc *sc = mac->mac_sc; - unsigned int i, max_loop; - uint16_t value; - uint32_t buffer[5] = { - 0x00000000, 0x00d40000, 0x00000000, 0x01000000, 0x00000000 - }; - - if (ofdm) { - max_loop = 0x1e; - buffer[0] = 0x000201cc; - } else { - max_loop = 0xfa; - buffer[0] = 0x000b846e; - } - - BWN_ASSERT_LOCKED(mac->mac_sc); - - for (i = 0; i < 5; i++) - bwn_ram_write(mac, i * 4, buffer[i]); - - BWN_WRITE_2(mac, 0x0568, 0x0000); - BWN_WRITE_2(mac, 0x07c0, - (siba_get_revid(sc->sc_dev) < 11) ? 0x0000 : 0x0100); - value = ((phy->type == BWN_PHYTYPE_A) ? 0x41 : 0x40); - BWN_WRITE_2(mac, 0x050c, value); - if (phy->type == BWN_PHYTYPE_LP) - BWN_WRITE_2(mac, 0x0514, 0x1a02); - BWN_WRITE_2(mac, 0x0508, 0x0000); - BWN_WRITE_2(mac, 0x050a, 0x0000); - BWN_WRITE_2(mac, 0x054c, 0x0000); - BWN_WRITE_2(mac, 0x056a, 0x0014); - BWN_WRITE_2(mac, 0x0568, 0x0826); - BWN_WRITE_2(mac, 0x0500, 0x0000); - if (phy->type == BWN_PHYTYPE_LP) - BWN_WRITE_2(mac, 0x0502, 0x0050); - else - BWN_WRITE_2(mac, 0x0502, 0x0030); - - if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) - BWN_RF_WRITE(mac, 0x0051, 0x0017); - for (i = 0x00; i < max_loop; i++) { - value = BWN_READ_2(mac, 0x050e); - if (value & 0x0080) - break; - DELAY(10); - } - for (i = 0x00; i < 0x0a; i++) { - value = BWN_READ_2(mac, 0x050e); - if (value & 0x0400) - break; - DELAY(10); - } - for (i = 0x00; i < 0x19; i++) { - value = BWN_READ_2(mac, 0x0690); - if (!(value & 0x0100)) - break; - DELAY(10); - } - if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) - BWN_RF_WRITE(mac, 0x0051, 0x0037); -} - -static void bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl) { uint16_t value; From owner-svn-src-all@freebsd.org Tue May 3 03:27:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C6AB2BBCD; Tue, 3 May 2016 03:27:13 +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 DDF331FF7; Tue, 3 May 2016 03:27:12 +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 u433RCGX060940; Tue, 3 May 2016 03:27:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u433RC3H060939; Tue, 3 May 2016 03:27:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605030327.u433RC3H060939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 3 May 2016 03:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298953 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 03:27:13 -0000 Author: adrian Date: Tue May 3 03:27:11 2016 New Revision: 298953 URL: https://svnweb.freebsd.org/changeset/base/298953 Log: [bwn] add PHY types for later PHYs. Obtained from: Linux b43 Modified: head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Tue May 3 03:24:27 2016 (r298952) +++ head/sys/dev/bwn/if_bwnreg.h Tue May 3 03:27:11 2016 (r298953) @@ -67,6 +67,12 @@ #define BWN_PHYTYPE_G 0x02 #define BWN_PHYTYPE_N 0x04 #define BWN_PHYTYPE_LP 0x05 +#define BWN_PHYTYPE_SSLPN 0x06 +#define BWN_PHYTYPE_HT 0x07 +#define BWN_PHYTYPE_LCN 0x08 +#define BWN_PHYTYPE_LCNXN 0x09 +#define BWN_PHYTYPE_LCN40 0x0a +#define BWN_PHYTYPE_AC 0x0b #define BWN_DMA0_REASON 0x20 #define BWN_DMA0_INTR_MASK 0x24 From owner-svn-src-all@freebsd.org Tue May 3 03:31:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC5CBB2BCB3; Tue, 3 May 2016 03:31:17 +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 9D98C134F; Tue, 3 May 2016 03:31:17 +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 u433VGYP061747; Tue, 3 May 2016 03:31:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u433VGqP061746; Tue, 3 May 2016 03:31:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605030331.u433VGqP061746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 3 May 2016 03:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298954 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 03:31:17 -0000 Author: adrian Date: Tue May 3 03:31:16 2016 New Revision: 298954 URL: https://svnweb.freebsd.org/changeset/base/298954 Log: [bwn] update bwn_dummy_transmission(). This is based on the b43 code. It'll be used by the upcoming 11n phy. Obtained from: Linux b43 (concept) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 3 03:27:11 2016 (r298953) +++ head/sys/dev/bwn/if_bwn.c Tue May 3 03:31:16 2016 (r298954) @@ -3540,9 +3540,12 @@ bwn_dummy_transmission(struct bwn_mac *m BWN_WRITE_2(mac, 0x0568, 0x0000); BWN_WRITE_2(mac, 0x07c0, (siba_get_revid(sc->sc_dev) < 11) ? 0x0000 : 0x0100); - value = ((phy->type == BWN_PHYTYPE_A) ? 0x41 : 0x40); + + value = (ofdm ? 0x41 : 0x40); BWN_WRITE_2(mac, 0x050c, value); - if (phy->type == BWN_PHYTYPE_LP) + + if (phy->type == BWN_PHYTYPE_N || phy->type == BWN_PHYTYPE_LP || + phy->type == BWN_PHYTYPE_LCN) BWN_WRITE_2(mac, 0x0514, 0x1a02); BWN_WRITE_2(mac, 0x0508, 0x0000); BWN_WRITE_2(mac, 0x050a, 0x0000); @@ -3550,10 +3553,24 @@ bwn_dummy_transmission(struct bwn_mac *m BWN_WRITE_2(mac, 0x056a, 0x0014); BWN_WRITE_2(mac, 0x0568, 0x0826); BWN_WRITE_2(mac, 0x0500, 0x0000); - if (phy->type == BWN_PHYTYPE_LP) + + /* XXX TODO: n phy pa override? */ + + switch (phy->type) { + case BWN_PHYTYPE_N: + case BWN_PHYTYPE_LCN: + BWN_WRITE_2(mac, 0x0502, 0x00d0); + break; + case BWN_PHYTYPE_LP: BWN_WRITE_2(mac, 0x0502, 0x0050); - else + break; + default: BWN_WRITE_2(mac, 0x0502, 0x0030); + break; + } + + /* flush */ + BWN_READ_2(mac, 0x0502); if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) BWN_RF_WRITE(mac, 0x0051, 0x0017); From owner-svn-src-all@freebsd.org Tue May 3 03:41:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9735B2BFDE; Tue, 3 May 2016 03:41:32 +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 88C891BAE; Tue, 3 May 2016 03:41:32 +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 u433fVBb066714; Tue, 3 May 2016 03:41:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u433fQLh066657; Tue, 3 May 2016 03:41:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605030341.u433fQLh066657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 03:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298955 - in head/sys/dev: aac aacraid acpi_support acpica advansys aha ahb ahci alpm altera/atse amr an asmc ata ata/chipsets atkbdc bce bhnd bhnd/bhndb bhnd/siba bktr buslogic bwi bxe... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 03:41:33 -0000 Author: pfg Date: Tue May 3 03:41:25 2016 New Revision: 298955 URL: https://svnweb.freebsd.org/changeset/base/298955 Log: sys/dev: minor spelling fixes. Most affect comments, very few have user-visible effects. Modified: head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aac_debug.c head/sys/dev/aac/aac_disk.c head/sys/dev/aac/aacreg.h head/sys/dev/aacraid/aacraid_cam.c head/sys/dev/aacraid/aacraid_debug.c head/sys/dev/aacraid/aacraid_reg.h head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpiio.h head/sys/dev/advansys/advansys.c head/sys/dev/advansys/advlib.c head/sys/dev/advansys/advlib.h head/sys/dev/advansys/adwlib.h head/sys/dev/aha/aha.c head/sys/dev/ahb/ahb.c head/sys/dev/ahb/ahbreg.h head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/alpm/alpm.c head/sys/dev/altera/atse/if_atse.c head/sys/dev/amr/amr.c head/sys/dev/an/if_an.c head/sys/dev/an/if_anreg.h head/sys/dev/asmc/asmc.c head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-sata.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/atkbdc/psm.c head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h head/sys/dev/bhnd/bcmsrom_fmt.h head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_hwdata.c head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bktr/CHANGELOG.TXT head/sys/dev/bktr/bktr_audio.c head/sys/dev/bktr/bktr_card.c head/sys/dev/bktr/bktr_core.c head/sys/dev/bktr/bktr_os.c head/sys/dev/bktr/bktr_os.h head/sys/dev/bktr/msp34xx.c head/sys/dev/buslogic/bt.c head/sys/dev/buslogic/bt_eisa.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_sp.h head/sys/dev/cardbus/cardbus_cis.c head/sys/dev/ce/ceddk.c head/sys/dev/ce/if_ce.c head/sys/dev/cesa/cesa.c head/sys/dev/ciss/cissvar.h head/sys/dev/cmx/cmx.c head/sys/dev/cmx/cmx_pccard.c head/sys/dev/cp/if_cp.c head/sys/dev/cs/if_cs.c head/sys/dev/cx/csigma.c head/sys/dev/cx/if_cx.c head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_hal.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_wr.h head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_mp_ring.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/de/dc21040reg.h head/sys/dev/de/if_de.c head/sys/dev/de/if_devar.h head/sys/dev/dpt/dpt.h head/sys/dev/dpt/dpt_scsi.c head/sys/dev/drm/drm.h head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_vm.c head/sys/dev/drm/i915_drv.h head/sys/dev/drm/mach64_state.c head/sys/dev/drm/mga_dma.c head/sys/dev/drm/mga_drm.h head/sys/dev/drm/radeon_cp.c head/sys/dev/drm/radeon_drm.h head/sys/dev/drm/radeon_drv.h head/sys/dev/drm/radeon_state.c head/sys/dev/drm/savage_bci.c head/sys/dev/drm/savage_drm.h head/sys/dev/drm2/drm_vm.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/radeon/atombios.h head/sys/dev/drm2/radeon/evergreen.c head/sys/dev/drm2/radeon/radeon_device.c head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_gart.c head/sys/dev/drm2/radeon/radeon_gem.c head/sys/dev/drm2/radeon/radeon_kms.c head/sys/dev/drm2/radeon/radeon_legacy_crtc.c head/sys/dev/drm2/ttm/ttm_page_alloc_dma.c head/sys/dev/ed/if_edreg.h head/sys/dev/esp/esp_pci.c head/sys/dev/esp/ncr53c9xvar.h head/sys/dev/et/if_et.c head/sys/dev/et/if_etreg.h head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/fatm/if_fatm.c head/sys/dev/fatm/if_fatmreg.h head/sys/dev/fatm/if_fatmvar.h head/sys/dev/fb/machfb.c head/sys/dev/fb/splash.c head/sys/dev/fb/vga.c head/sys/dev/fdc/fdc.c head/sys/dev/fdt/fdt_static_dtb.S head/sys/dev/fe/if_fe_isa.c head/sys/dev/fe/mb86960.h head/sys/dev/firewire/firewire.c head/sys/dev/firewire/fwdev.c head/sys/dev/firewire/fwohci.c head/sys/dev/firewire/if_fwip.c head/sys/dev/firewire/sbp_targ.c head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/rcvbundl.h head/sys/dev/hatm/if_hatm.c head/sys/dev/hatm/if_hatm_rx.c head/sys/dev/hatm/if_hatm_tx.c head/sys/dev/hifn/hifn7751var.h head/sys/dev/hptmv/array.h head/sys/dev/hptmv/command.h head/sys/dev/hptmv/entry.c head/sys/dev/hptmv/hptintf.h head/sys/dev/hptmv/mvOs.h head/sys/dev/hptnr/hptintf.h head/sys/dev/hptrr/hptintf.h head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/pmc_events.h head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/ic/cd180.h head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h head/sys/dev/ida/idareg.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iicbus/ds133x.c head/sys/dev/iicbus/if_ic.c head/sys/dev/iicbus/iiconf.h head/sys/dev/iicbus/twsi/twsi.c head/sys/dev/iir/iir.c head/sys/dev/intpm/intpm.c head/sys/dev/ips/ips.c head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_timer.c head/sys/dev/isci/scil/intel_sas.h head/sys/dev/isci/scil/sati_callbacks.h head/sys/dev/isci/scil/sati_design.h head/sys/dev/isci/scil/sati_device.h head/sys/dev/isci/scil/sati_log_sense.c head/sys/dev/isci/scil/sati_move.c head/sys/dev/isci/scil/sati_translator_sequence.h head/sys/dev/isci/scil/sati_util.c head/sys/dev/isci/scil/sci_base_phy.h head/sys/dev/isci/scil/sci_fast_list.h head/sys/dev/isci/scil/sci_simple_list.h head/sys/dev/isci/scil/scic_config_parameters.h head/sys/dev/isci/scil/scic_controller.h head/sys/dev/isci/scil/scic_sds_controller.c head/sys/dev/isci/scil/scic_sds_controller.h head/sys/dev/isci/scil/scic_sds_phy_registers.h head/sys/dev/isci/scil/scic_sds_port.c head/sys/dev/isci/scil/scic_sds_port.h head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c head/sys/dev/isci/scil/scic_sds_remote_device.c head/sys/dev/isci/scil/scic_sds_remote_node_context.c head/sys/dev/isci/scil/scic_sds_remote_node_table.c head/sys/dev/isci/scil/scic_sds_request.c head/sys/dev/isci/scil/scic_sds_smp_request.c head/sys/dev/isci/scil/scic_sds_ssp_request.c head/sys/dev/isci/scil/scic_sds_stp_packet_request.c head/sys/dev/isci/scil/scic_sds_stp_remote_device.c head/sys/dev/isci/scil/scic_sds_stp_request.c head/sys/dev/isci/scil/scic_sds_stp_request.h head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.c head/sys/dev/isci/scil/scic_task_request.h head/sys/dev/isci/scil/scic_user_callback.h head/sys/dev/isci/scil/scif_config_parameters.h head/sys/dev/isci/scil/scif_domain.h head/sys/dev/isci/scil/scif_io_request.h head/sys/dev/isci/scil/scif_sas_design.h head/sys/dev/isci/scil/scif_sas_domain.c head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c head/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c head/sys/dev/isci/scil/scif_sas_stp_remote_device.c head/sys/dev/isci/scil/scif_sas_stp_task_request.c head/sys/dev/isci/scil/scif_user_callback.h head/sys/dev/isci/scil/scu_registers.h head/sys/dev/isci/scil/scu_task_context.h head/sys/dev/iscsi_initiator/isc_cam.c head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/iscsi_initiator/iscsi.c head/sys/dev/isp/DriverManual.txt head/sys/dev/isp/isp.c head/sys/dev/isp/ispvar.h head/sys/dev/iwi/if_iwireg.h head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h head/sys/dev/iwn/if_iwn.c head/sys/dev/ixgb/ixgb_ee.c head/sys/dev/ixgb/ixgb_hw.c head/sys/dev/jme/if_jmereg.h head/sys/dev/jme/if_jmevar.h head/sys/dev/kbd/kbd.c head/sys/dev/lge/if_lge.c head/sys/dev/lmc/if_lmc.c head/sys/dev/lmc/if_lmc.h head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_tbolt.c head/sys/dev/mge/if_mgevar.h head/sys/dev/mlx/mlx_disk.c head/sys/dev/mly/mly.c head/sys/dev/mly/mlyreg.h head/sys/dev/mmc/mmcreg.h head/sys/dev/mn/if_mn.c head/sys/dev/mpr/mpi/mpi2_history.txt head/sys/dev/mpr/mpi/mpi2_init.h head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_mapping.h head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mps/mpi/mpi2_history.txt head/sys/dev/mps/mpi/mpi2_init.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_config.c head/sys/dev/mps/mps_mapping.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mpt/mpilib/mpi_cnfg.h head/sys/dev/mpt/mpilib/mpi_log_fc.h head/sys/dev/mpt/mpilib/mpi_log_sas.h head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h head/sys/dev/mvs/mvs.c head/sys/dev/mvs/mvs.h head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/if_mwlvar.h head/sys/dev/nand/nfc_fsl.c head/sys/dev/ncr/ncr.c head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_offloadings.c head/sys/dev/nge/if_nge.c head/sys/dev/nsp/nsp.c head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/patm/if_patmvar.h head/sys/dev/pccbb/pccbb.c head/sys/dev/pcf/pcf_isa.c head/sys/dev/pci/hostb_pci.c head/sys/dev/pci/pci.c head/sys/dev/pdq/pdq.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/qlxgb/qla_def.h head/sys/dev/qlxgb/qla_hw.c head/sys/dev/qlxgb/qla_isr.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxge/qls_def.h head/sys/dev/qlxge/qls_hw.c head/sys/dev/qlxge/qls_isr.c head/sys/dev/ral/rt2560.c head/sys/dev/rc/rc.c head/sys/dev/rl/if_rlreg.h head/sys/dev/sbni/if_sbni.c head/sys/dev/sf/if_sf.c head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_regs_mcdi.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_vpd.c head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/si/si.c head/sys/dev/si/si.h head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h head/sys/dev/sio/sio.c head/sys/dev/sk/if_sk.c head/sys/dev/sk/yukonreg.h head/sys/dev/sn/if_sn.c head/sys/dev/sn/if_snreg.h head/sys/dev/snc/dp83932.c head/sys/dev/snc/dp83932var.h head/sys/dev/sym/sym_hipd.c head/sys/dev/syscons/syscons.c head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h head/sys/dev/tl/if_tl.c head/sys/dev/tpm/tpm.c head/sys/dev/tpm/tpm_acpi.c head/sys/dev/trm/trm.c head/sys/dev/trm/trm.h head/sys/dev/tsec/if_tsec.h head/sys/dev/twe/twe.c head/sys/dev/twe/twevar.h head/sys/dev/tws/tws_cam.c head/sys/dev/tws/tws_hdm.c head/sys/dev/tx/if_tx.c head/sys/dev/tx/if_txreg.h head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_dev_lpc.c head/sys/dev/uart/uart_dev_ns8250.c head/sys/dev/virtio/console/virtio_console.c head/sys/dev/vx/if_vx.c head/sys/dev/vx/if_vx_eisa.c head/sys/dev/vxge/include/vxge-queue.h head/sys/dev/vxge/include/vxgehal-ll.h head/sys/dev/vxge/include/vxgehal-mgmt.h head/sys/dev/vxge/include/vxgehal-mgmtaux.h head/sys/dev/vxge/include/vxgehal-stats.h head/sys/dev/vxge/vxgehal/vxge-queue.c head/sys/dev/vxge/vxgehal/vxgehal-device.c head/sys/dev/vxge/vxgehal/vxgehal-fifo.c head/sys/dev/vxge/vxgehal/vxgehal-mgmt.c head/sys/dev/vxge/vxgehal/vxgehal-mgmtaux.c head/sys/dev/vxge/vxgehal/vxgehal-regs.h head/sys/dev/vxge/vxgehal/vxgehal-virtualpath.c head/sys/dev/wi/if_wavelan_ieee.h head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wireg.h head/sys/dev/wl/if_wl.c head/sys/dev/xe/if_xereg.h head/sys/dev/xen/balloon/balloon.c head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h head/sys/dev/xen/control/control.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netback/netback_unit_tests.c head/sys/dev/xen/xenstore/xenstore.c head/sys/dev/xen/xenstore/xenstore_dev.c head/sys/dev/xl/if_xl.c Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aac/aac_cam.c Tue May 3 03:41:25 2016 (r298955) @@ -555,7 +555,7 @@ aac_cam_fix_inquiry(struct aac_softc *sc /* * Some aac(4) adapters will always report that a direct * access device is offline in response to a INQUIRY - * command that does not retreive vital product data. + * command that does not retrieve vital product data. * Force the qualifier to connected so that upper layers * correctly recognize that a disk is present. */ @@ -590,7 +590,7 @@ aac_cam_complete(struct aac_command *cm) } else { /* * The SRB error codes just happen to match the CAM error - * codes. How convienient! + * codes. How convenient! */ ccb->ccb_h.status = srbr->srb_status; Modified: head/sys/dev/aac/aac_debug.c ============================================================================== --- head/sys/dev/aac/aac_debug.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aac/aac_debug.c Tue May 3 03:41:25 2016 (r298955) @@ -351,7 +351,7 @@ aac_print_aif(struct aac_softc *sc, stru device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", aif->data.EN.data.ECLE.eventType); break; - case AifEnDiskSetEvent: /* A disk set event occured. */ + case AifEnDiskSetEvent: /* A disk set event occurred. */ device_printf(sc->aac_dev, "(DiskSetEvent) event %d " "diskset %jd creator %jd\n", aif->data.EN.data.EDS.eventType, Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aac/aac_disk.c Tue May 3 03:41:25 2016 (r298955) @@ -88,7 +88,7 @@ DRIVER_MODULE(aacd, aac, aac_disk_driver * Handle open from generic layer. * * This is called by the diskslice code on first open in order to get the - * basic device geometry paramters. + * basic device geometry parameters. */ static int aac_disk_open(struct disk *dp) Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aac/aacreg.h Tue May 3 03:41:25 2016 (r298955) @@ -886,7 +886,7 @@ typedef enum { AifEnSMARTEvent, /* SMART Event */ AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ - AifEnDiskSetEvent, /* A disk set event occured. */ + AifEnDiskSetEvent, /* A disk set event occurred. */ AifEnContainerScsiEvent, /* a container event with no. and scsi id */ AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */ AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */ Modified: head/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- head/sys/dev/aacraid/aacraid_cam.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aacraid/aacraid_cam.c Tue May 3 03:41:25 2016 (r298955) @@ -1181,7 +1181,7 @@ aac_cam_complete(struct aac_command *cm) } else { /* * The SRB error codes just happen to match the CAM error - * codes. How convienient! + * codes. How convenient! */ ccb->ccb_h.status = srbr->srb_status; Modified: head/sys/dev/aacraid/aacraid_debug.c ============================================================================== --- head/sys/dev/aacraid/aacraid_debug.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aacraid/aacraid_debug.c Tue May 3 03:41:25 2016 (r298955) @@ -265,7 +265,7 @@ aacraid_print_aif(struct aac_softc *sc, device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", aif->data.EN.data.ECLE.eventType); break; - case AifEnDiskSetEvent: /* A disk set event occured. */ + case AifEnDiskSetEvent: /* A disk set event occurred. */ device_printf(sc->aac_dev, "(DiskSetEvent) event %d " "diskset %jd creator %jd\n", aif->data.EN.data.EDS.eventType, Modified: head/sys/dev/aacraid/aacraid_reg.h ============================================================================== --- head/sys/dev/aacraid/aacraid_reg.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aacraid/aacraid_reg.h Tue May 3 03:41:25 2016 (r298955) @@ -875,7 +875,7 @@ typedef enum { AifEnSMARTEvent, /* SMART Event */ AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ - AifEnDiskSetEvent, /* A disk set event occured. */ + AifEnDiskSetEvent, /* A disk set event occurred. */ AifEnContainerScsiEvent, /* a container event with no. and scsi id */ AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */ AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */ Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/acpi_support/acpi_ibm.c Tue May 3 03:41:25 2016 (r298955) @@ -839,7 +839,7 @@ acpi_ibm_sysctl_init(struct acpi_ibm_sof case ACPI_IBM_METHOD_BRIGHTNESS: case ACPI_IBM_METHOD_VOLUME: case ACPI_IBM_METHOD_MUTE: - /* EC is required here, which was aready checked before */ + /* EC is required here, which was already checked before */ return (TRUE); case ACPI_IBM_METHOD_THINKLIGHT: Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/acpica/acpi.c Tue May 3 03:41:25 2016 (r298955) @@ -1965,7 +1965,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN * Since we scan from \, be sure to skip system scope objects. * \_SB_ and \_TZ_ are defined in ACPICA as devices to work around * BIOS bugs. For example, \_SB_ is to allow \_SB_._INI to be run - * during the intialization and \_TZ_ is to support Notify() on it. + * during the initialization and \_TZ_ is to support Notify() on it. */ if (strcmp(handle_str, "\\_SB_") == 0 || strcmp(handle_str, "\\_TZ_") == 0) Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/acpica/acpi_cpu.c Tue May 3 03:41:25 2016 (r298955) @@ -641,7 +641,7 @@ acpi_cpu_shutdown(device_t dev) disable_idle(device_get_softc(dev)); /* - * CPU devices are not truely detached and remain referenced, + * CPU devices are not truly detached and remain referenced, * so their resources are not freed. */ Modified: head/sys/dev/acpica/acpiio.h ============================================================================== --- head/sys/dev/acpica/acpiio.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/acpica/acpiio.h Tue May 3 03:41:25 2016 (r298955) @@ -64,7 +64,7 @@ struct acpi_bif { char model[ACPI_CMBAT_MAXSTRLEN]; /* model identifier */ char serial[ACPI_CMBAT_MAXSTRLEN]; /* Serial number */ char type[ACPI_CMBAT_MAXSTRLEN]; /* Type */ - char oeminfo[ACPI_CMBAT_MAXSTRLEN]; /* OEM infomation */ + char oeminfo[ACPI_CMBAT_MAXSTRLEN]; /* OEM information */ }; struct acpi_bst { Modified: head/sys/dev/advansys/advansys.c ============================================================================== --- head/sys/dev/advansys/advansys.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/advansys/advansys.c Tue May 3 03:41:25 2016 (r298955) @@ -633,7 +633,7 @@ adv_timeout(void *arg) * means that the driver attempts to clear only one error * condition at a time. In general, timeouts that occur * close together are related anyway, so there is no benefit - * in attempting to handle errors in parrallel. Timeouts will + * in attempting to handle errors in parallel. Timeouts will * be reinstated when the recovery process ends. */ adv_set_state(adv, ADV_IN_TIMEOUT); @@ -1123,7 +1123,7 @@ adv_done(struct adv_softc *adv, union cc * from this initiator are in effect, but this * ignores multi-initiator setups and there is * evidence that the firmware gets its per-device - * transaction counts screwed up occassionally. + * transaction counts screwed up occasionally. */ ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; if ((ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) != 0 Modified: head/sys/dev/advansys/advlib.c ============================================================================== --- head/sys/dev/advansys/advlib.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/advansys/advlib.c Tue May 3 03:41:25 2016 (r298955) @@ -2060,7 +2060,7 @@ adv_reset_bus(struct adv_softc *adv, int /*offset*/0, ADV_TRANS_CUR); ADV_OUTW(adv, ADV_REG_PROG_COUNTER, ADV_MCODE_START_ADDR); - /* Tell the XPT layer that a bus reset occured */ + /* Tell the XPT layer that a bus reset occurred */ if (adv->path != NULL) xpt_async(AC_BUS_RESET, adv->path, NULL); Modified: head/sys/dev/advansys/advlib.h ============================================================================== --- head/sys/dev/advansys/advlib.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/advansys/advlib.h Tue May 3 03:41:25 2016 (r298955) @@ -228,7 +228,7 @@ struct adv_ccb_info { #define ADV_CSW_SCSI_RESET_LATCH 0x0002 #define ADV_CSW_INT_PENDING 0x0001 /* - * XXX I don't understand the relevence of the naming + * XXX I don't understand the relevance of the naming * convention change here. What does CIW stand for? * Perhaps this is to differentiate read and write * values? @@ -590,7 +590,7 @@ struct adv_scsiq_1 { u_int8_t target_lun; /* LUN - taken from our xs */ u_int32_t data_addr; /* - * physical addres of first + * physical address of first * (possibly only) segment * to transfer. */ @@ -793,7 +793,7 @@ u_int16_t adv_read_lram_16(struct adv_so void adv_write_lram_16(struct adv_softc *adv, u_int16_t addr, u_int16_t value); -/* Intialization */ +/* Initialization */ int adv_find_signature(struct resource *res); void adv_lib_init(struct adv_softc *adv); Modified: head/sys/dev/advansys/adwlib.h ============================================================================== --- head/sys/dev/advansys/adwlib.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/advansys/adwlib.h Tue May 3 03:41:25 2016 (r298955) @@ -563,7 +563,7 @@ typedef enum { ADW_FENONE = 0x0000, ADW_ULTRA = 0x0001, /* Supports 20MHz Transfers */ ADW_ULTRA2 = 0x0002, /* Supports 40MHz Transfers */ - ADW_DT = 0x0004, /* Supports Double Transistion REQ/ACK*/ + ADW_DT = 0x0004, /* Supports Double Transition REQ/ACK */ ADW_WIDE = 0x0008, /* Wide Channel */ ADW_ASC3550_FE = ADW_ULTRA, ADW_ASC38C0800_FE = ADW_ULTRA2, @@ -801,7 +801,7 @@ carrierbtov(struct adw_softc *adw, u_int return (carrierbotov(adw, baddr - adw->carrier_busbase)); } -/* Intialization */ +/* Initialization */ int adw_find_signature(struct adw_softc *adw); void adw_reset_chip(struct adw_softc *adw); int adw_reset_bus(struct adw_softc *adw); Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/aha/aha.c Tue May 3 03:41:25 2016 (r298955) @@ -301,7 +301,7 @@ aha_probe(struct aha_softc* aha) * This really should be replaced with the esetup command, since * that appears to be more reliable. This becomes more and more * true over time as we discover more cards that don't read the - * geometry register consistantly. + * geometry register consistently. */ if (aha->boardid <= 0x42) { /* Wait 10ms before reading */ @@ -1161,7 +1161,7 @@ ahadone(struct aha_softc *aha, struct ah struct ccb_hdr *ccb_h; cam_status error; - /* Notify all clients that a BDR occured */ + /* Notify all clients that a BDR occurred */ error = xpt_create_path(&path, /*periph*/NULL, cam_sim_path(aha->sim), accb->hccb.target, CAM_LUN_WILDCARD); @@ -1204,7 +1204,7 @@ ahadone(struct aha_softc *aha, struct ah break; case AMBI_ABORT: case AMBI_ERROR: - /* An error occured */ + /* An error occurred */ if (accb->hccb.opcode < INITIATOR_CCB_WRESID) csio->resid = 0; else @@ -1747,7 +1747,7 @@ ahatimeout(void *arg) * means that the driver attempts to clear only one error * condition at a time. In general, timeouts that occur * close together are related anyway, so there is no benefit - * in attempting to handle errors in parrallel. Timeouts will + * in attempting to handle errors in parallel. Timeouts will * be reinstated when the recovery process ends. */ if ((accb->flags & ACCB_DEVICE_RESET) == 0) { Modified: head/sys/dev/ahb/ahb.c ============================================================================== --- head/sys/dev/ahb/ahb.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ahb/ahb.c Tue May 3 03:41:25 2016 (r298955) @@ -885,7 +885,7 @@ ahbintr_locked(struct ahb_softc *ahb) xpt_async(AC_BUS_RESET, ahb->path, NULL); break; } - printf("Unsupported initiator selection AEN occured\n"); + printf("Unsupported initiator selection AEN occurred\n"); break; case INTSTAT_IMMED_OK: case INTSTAT_IMMED_ERR: @@ -1235,7 +1235,7 @@ ahbtimeout(void *arg) * means that the driver attempts to clear only one error * condition at a time. In general, timeouts that occur * close together are related anyway, so there is no benefit - * in attempting to handle errors in parrallel. Timeouts will + * in attempting to handle errors in parallel. Timeouts will * be reinstated when the recovery process ends. */ if ((ecb->state & ECB_DEVICE_RESET) == 0) { Modified: head/sys/dev/ahb/ahbreg.h ============================================================================== --- head/sys/dev/ahb/ahbreg.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ahb/ahbreg.h Tue May 3 03:41:25 2016 (r298955) @@ -64,7 +64,7 @@ #define RSTBUS 0x10 #define BUSDEF 0x0C4 -#define B0uS 0x00 /* give up bus immediatly */ +#define B0uS 0x00 /* give up bus immediately */ #define B4uS 0x01 /* delay 4uSec. */ #define B8uS 0x02 /* delay 8uSec. */ Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ahci/ahci.c Tue May 3 03:41:25 2016 (r298955) @@ -1303,7 +1303,7 @@ ahci_ch_intr_main(struct ahci_channel *c err = 0; port = -1; } - /* Complete all successfull commands. */ + /* Complete all successful commands. */ ok = ch->rslots & ~cstatus; for (i = 0; i < ch->numslots; i++) { if ((ok >> i) & 1) Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ahci/ahci.h Tue May 3 03:41:25 2016 (r298955) @@ -444,7 +444,7 @@ struct ahci_channel { int numtslotspd[16];/* Number of tagged slots per dev */ int numhslots; /* Number of held slots */ int recoverycmd; /* Our READ LOG active */ - int fatalerr; /* Fatal error happend */ + int fatalerr; /* Fatal error happened */ int resetting; /* Hard-reset in progress. */ int resetpolldiv; /* Hard-reset poll divider. */ int listening; /* SUD bit is cleared. */ @@ -465,7 +465,7 @@ struct ahci_enclosure { device_t dev; /* Device handle */ struct resource *r_memc; /* Control register */ struct resource *r_memt; /* Transmit buffer */ - struct resource *r_memr; /* Recieve buffer */ + struct resource *r_memr; /* Receive buffer */ struct cam_sim *sim; struct cam_path *path; struct mtx mtx; /* state lock */ Modified: head/sys/dev/alpm/alpm.c ============================================================================== --- head/sys/dev/alpm/alpm.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/alpm/alpm.c Tue May 3 03:41:25 2016 (r298955) @@ -202,7 +202,7 @@ alpm_attach(device_t dev) printf(" 55K"); break; default: - printf("unkown"); + printf("unknown"); break; } printf("\n"); Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/altera/atse/if_atse.c Tue May 3 03:41:25 2016 (r298955) @@ -146,7 +146,7 @@ a_onchip_fifo_mem_core_read(struct resou return (val4); } -/* The FIFO does an endian convertion, so we must not do it as well. */ +/* The FIFO does an endian conversion, so we must not do it as well. */ /* XXX-BZ in fact we should do a htobe32 so le would be fine as well? */ #define ATSE_TX_DATA_WRITE(sc, val4) \ bus_write_4((sc)->atse_tx_mem_res, A_ONCHIP_FIFO_MEM_CORE_DATA, val4) @@ -169,8 +169,8 @@ a_onchip_fifo_mem_core_read(struct resou A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_FILL_LEVEL, \ "RX_FILL", __func__, __LINE__) -/* The FIFO does an endian convertion, so we must not do it as well. */ -/* XXX-BZ in fact we shoudl do a htobe32 so le would be fine as well? */ +/* The FIFO does an endian conversion, so we must not do it as well. */ +/* XXX-BZ in fact we should do a htobe32 so le would be fine as well? */ #define ATSE_RX_DATA_READ(sc) \ bus_read_4((sc)->atse_rx_mem_res, A_ONCHIP_FIFO_MEM_CORE_DATA) #define ATSE_RX_META_READ(sc) \ Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/amr/amr.c Tue May 3 03:41:25 2016 (r298955) @@ -525,7 +525,7 @@ shutdown_out: /* * Bug-for-bug compatibility with Linux! * Some apps will send commands with inlen and outlen set to 0, - * even though they expect data to be transfered to them from the + * even though they expect data to be transferred to them from the * card. Linux accidentally allows this by allocating a 4KB * buffer for the transfer anyways, but it then throws it away * without copying it back to the app. @@ -1784,7 +1784,7 @@ amr_start(struct amr_command *ac) /* Now we have a slot, we can map the command (unmapped in amr_complete). */ if ((error = amr_mapcmd(ac)) == ENOMEM) { /* - * Memroy resources are short, so free the slot and let this be tried + * Memory resources are short, so free the slot and let this be tried * later. */ amr_freeslot(ac); Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/an/if_an.c Tue May 3 03:41:25 2016 (r298955) @@ -426,7 +426,7 @@ int an_alloc_memory(device_t dev, int ri } /* - * Allocate a auxilary memory resource with the given resource id. + * Allocate a auxiliary memory resource with the given resource id. */ int an_alloc_aux_memory(device_t dev, int rid, int size) { Modified: head/sys/dev/an/if_anreg.h ============================================================================== --- head/sys/dev/an/if_anreg.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/an/if_anreg.h Tue May 3 03:41:25 2016 (r298955) @@ -276,7 +276,7 @@ struct an_reply { #define AN_EV_ALLOC 0x0008 /* async alloc/reclaim completed */ #define AN_EV_TX_CPY 0x0400 #define AN_EV_TX_EXC 0x0004 /* async xmit completed with failure */ -#define AN_EV_TX 0x0002 /* async xmit completed succesfully */ +#define AN_EV_TX 0x0002 /* async xmit completed successfully */ #define AN_EV_RX 0x0001 /* async rx completed */ #define AN_INTRS(x) \ Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/asmc/asmc.c Tue May 3 03:41:25 2016 (r298955) @@ -650,7 +650,7 @@ asmc_init(device_t dev) goto nosms; /* - * We are ready to recieve interrupts from the SMS. + * We are ready to receive interrupts from the SMS. */ buf[0] = 0x01; ASMC_DPRINTF(("intok key\n")); Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ata/ata-all.c Tue May 3 03:41:25 2016 (r298955) @@ -426,7 +426,7 @@ ata_default_registers(device_t dev) void ata_udelay(int interval) { - /* for now just use DELAY, the timer/sleep subsytems are not there yet */ + /* for now just use DELAY, the timer/sleep subsystems are not there yet */ if (1 || interval < (1000000/hz) || ata_delayed_attach) DELAY(interval); else Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ata/ata-sata.c Tue May 3 03:41:25 2016 (r298955) @@ -297,7 +297,7 @@ ata_pm_identify(device_t dev) /* get PM revision data */ if (ch->hw.pm_read(dev, ATA_PM, 1, &pm_revision)) { - device_printf(dev, "error getting PM revison data\n"); + device_printf(dev, "error getting PM revision data\n"); return; } Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/ata/chipsets/ata-ite.c Tue May 3 03:41:25 2016 (r298955) @@ -103,7 +103,7 @@ ata_ite_chipinit(device_t dev) pci_write_config(dev, 0x56, 0x31, 1); ctlr->setmode = ata_ite_821x_setmode; - /* No timing restrictions initally. */ + /* No timing restrictions initially. */ ctlr->chipset_data = NULL; } ctlr->ch_attach = ata_ite_ch_attach; Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/atkbdc/psm.c Tue May 3 03:41:25 2016 (r298955) @@ -1807,7 +1807,7 @@ psmread(struct cdev *dev, struct uio *ui if ((sc->state & PSM_VALID) == 0) return (EIO); - /* block until mouse activity occured */ + /* block until mouse activity occurred */ s = spltty(); while (sc->queue.count <= 0) { if (dev != sc->bdev) { @@ -3008,7 +3008,7 @@ proc_synaptics(struct psm_softc *sc, pac if (synaction->queue_len < synaction->window_min) goto SYNAPTICS_END; - /* Is a scrolling action occuring? */ + /* Is a scrolling action occurring? */ if (!synaction->in_taphold && !synaction->in_vscroll) { /* * A scrolling action must not conflict with a tap @@ -3518,7 +3518,7 @@ psmsoftintr(void *arg) case MOUSE_MODEL_NETSCROLL: /* - * three addtional bytes encode buttons and + * three additional bytes encode buttons and * wheel events */ ms.button |= (pb->ipacket[3] & MOUSE_PS2_BUTTON3DOWN) ? Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bce/if_bce.c Tue May 3 03:41:25 2016 (r298955) @@ -2361,7 +2361,7 @@ bce_nvram_erase_page(struct bce_softc *s BCE_NVM_COMMAND_DOIT; /* - * Clear the DONE bit separately, set the NVRAM adress to erase, + * Clear the DONE bit separately, set the NVRAM address to erase, * and issue the erase command. */ REG_WR(sc, BCE_NVM_COMMAND, BCE_NVM_COMMAND_DONE); @@ -7957,7 +7957,7 @@ bce_intr(void *xsc) goto bce_intr_exit; } - /* Ack the interrupt and stop others from occuring. */ + /* Ack the interrupt and stop others from occurring. */ REG_WR(sc, BCE_PCICFG_INT_ACK_CMD, BCE_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | BCE_PCICFG_INT_ACK_CMD_MASK_INT); Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bce/if_bcereg.h Tue May 3 03:41:25 2016 (r298955) @@ -6089,7 +6089,7 @@ struct l2_fhdr { /****************************************************************************/ /* The following definitions refer to pre-defined locations in processor */ /* memory space which allows the driver to enable particular functionality */ -/* within the firmware or read specfic information about the running */ +/* within the firmware or read specific information about the running */ /* firmware. */ /****************************************************************************/ @@ -6174,7 +6174,7 @@ struct l2_fhdr { #define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE) /* - * To accomodate jumbo frames, the page chain should + * To accommodate jumbo frames, the page chain should * be 4 times larger than the receive chain. */ #define DEFAULT_PG_PAGES (DEFAULT_RX_PAGES * 4) Modified: head/sys/dev/bhnd/bcmsrom_fmt.h ============================================================================== --- head/sys/dev/bhnd/bcmsrom_fmt.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/bcmsrom_fmt.h Tue May 3 03:41:25 2016 (r298955) @@ -311,7 +311,7 @@ /* SISO PA parameters are in the path0 spaces */ #define SROM8_SISO 96 -/* Legacy names for SISO PA paramters */ +/* Legacy names for SISO PA parameters */ #define SROM8_W0_ITTMAXP (SROM8_SISO + SROM8_2G_ITT_MAXP) #define SROM8_W0_PAB0 (SROM8_SISO + SROM8_2G_PA) #define SROM8_W0_PAB1 (SROM8_SISO + SROM8_2G_PA + 1) Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/bhnd.h Tue May 3 03:41:25 2016 (r298955) @@ -449,7 +449,7 @@ bhnd_alloc_resource_any(device_t dev, in * BHND_BUS_ALLOC_RESOURCE. * * @retval 0 success - * @retval non-zero an error occured while activating the resource. + * @retval non-zero an error occurred while activating the resource. */ static inline int bhnd_activate_resource(device_t dev, int type, int rid, @@ -469,7 +469,7 @@ bhnd_activate_resource(device_t dev, int * BHND_BUS_ALLOC_RESOURCE. * * @retval 0 success - * @retval non-zero an error occured while activating the resource. + * @retval non-zero an error occurred while activating the resource. */ static inline int bhnd_deactivate_resource(device_t dev, int type, int rid, @@ -489,7 +489,7 @@ bhnd_deactivate_resource(device_t dev, i * BHND_ALLOC_RESOURCE. * * @retval 0 success - * @retval non-zero an error occured while activating the resource. + * @retval non-zero an error occurred while activating the resource. */ static inline int bhnd_release_resource(device_t dev, int type, int rid, Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/bhnd_ids.h Tue May 3 03:41:25 2016 (r298955) @@ -421,14 +421,14 @@ #define BHND_PKGID_BCM4314PCIE (8 | 2) /* 4314 QFN PCI (ARM-less) package id */ #define BHND_PKGID_BCM4314SDIO_ARM (8 | 3) /* 4314 QFN SDIO (ARM-less) package id */ #define BHND_PKGID_BCM4314SDIO_FPBGA (8 | 4) /* 4314 FpBGA SDIO package id */ -#define BHND_PKGID_BCM4314DEV (8 | 6) /* 4314 Developement package id */ +#define BHND_PKGID_BCM4314DEV (8 | 6) /* 4314 Development package id */ #define BHND_PKGID_BCM4707 1 /* 4707 package id */ #define BHND_PKGID_BCM4708 2 /* 4708 package id */ #define BHND_PKGID_BCM4709 0 /* 4709 package id */ #define BHND_PKGID_BCM4335_WLCSP (0x0) /* WLCSP Module/Mobile SDIO/HSIC. */ -#define BHND_PKGID_BCM4335_FCBGA (0x1) /* FCBGA PC/Embeded/Media PCIE/SDIO */ +#define BHND_PKGID_BCM4335_FCBGA (0x1) /* FCBGA PC/Embedded/Media PCIE/SDIO */ #define BHND_PKGID_BCM4335_WLBGA (0x2) /* WLBGA COB/Mobile SDIO/HSIC. */ #define BHND_PKGID_BCM4335_FCBGAD (0x3) /* FCBGA Debug Debug/Dev All if's. */ #define BHND_PKGID_PKG_MASK_BCM4335 (0x3) @@ -645,8 +645,8 @@ #define BHND_BFL3_RCAL_WAR 0x00000008 /* acphy, rcal war active on this board (4335a0) */ #define BHND_BFL3_TXGAINTBLID 0x00000070 /* acphy, txgain table id */ #define BHND_BFL3_TXGAINTBLID_SHIFT 0x4 /* acphy, txgain table id shift bit */ -#define BHND_BFL3_TSSI_DIV_WAR 0x00000080 /* acphy, Seperate paparam for 20/40/80 */ -#define BHND_BFL3_TSSI_DIV_WAR_SHIFT 0x7 /* acphy, Seperate paparam for 20/40/80 shift bit */ +#define BHND_BFL3_TSSI_DIV_WAR 0x00000080 /* acphy, Separate paparam for 20/40/80 */ +#define BHND_BFL3_TSSI_DIV_WAR_SHIFT 0x7 /* acphy, Separate paparam for 20/40/80 shift bit */ #define BHND_BFL3_FEMTBL_FROM_NVRAM 0x00000100 /* acphy, femctrl table is read from nvram */ #define BHND_BFL3_FEMTBL_FROM_NVRAM_SHIFT 0x8 /* acphy, femctrl table is read from nvram */ #define BHND_BFL3_AGC_CFG_2G 0x00000200 /* acphy, gain control configuration for 2G */ Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue May 3 03:41:25 2016 (r298955) @@ -1515,7 +1515,7 @@ bhndb_get_resource_list(device_t dev, de * Default bhndb(4) implementation of BHND_BUS_ACTIVATE_RESOURCE(). * * For BHNDB_ADDRSPACE_NATIVE children, all resources may be assumed to - * be actived by the bridge. + * be activated by the bridge. * * For BHNDB_ADDRSPACE_BRIDGED children, attempts to activate a static register * window, a dynamic register window, or configures @p r as an indirect Modified: head/sys/dev/bhnd/bhndb/bhndb_hwdata.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_hwdata.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/bhndb/bhndb_hwdata.c Tue May 3 03:41:25 2016 (r298955) @@ -130,7 +130,7 @@ const struct bhndb_hw_priority bhndb_bcm /* * Default Core Behavior * - * All other cores are assumed to require effecient runtime access to + * All other cores are assumed to require efficient runtime access to * the default device port, and if supported by the bus, an agent port. */ BHNDB_CLASS_PRIO(INVALID, -1, DEFAULT, @@ -183,7 +183,7 @@ const struct bhndb_hw_priority bhndb_sib /* * Default Core Behavior * - * All other cores are assumed to require effecient runtime access to + * All other cores are assumed to require efficient runtime access to * the device port. */ BHNDB_CLASS_PRIO(INVALID, -1, DEFAULT, Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/siba/siba.c Tue May 3 03:41:25 2016 (r298955) @@ -420,7 +420,7 @@ siba_register_addrspaces(device_t dev, s /* Region numbers must be assigned in order, but our siba address * space IDs may be sparsely allocated; thus, we track - * the region index seperately. */ + * the region index separately. */ region_num = 0; /* Register the device address space entries */ Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bhnd/siba/siba_subr.c Tue May 3 03:41:25 2016 (r298955) @@ -337,7 +337,7 @@ siba_admatch_offset(uint8_t addrspace) * @param[out] size The parsed size. * * @retval 0 success - * @retval non-zero a parse error occured. + * @retval non-zero a parse error occurred. */ int siba_parse_admatch(uint32_t am, uint32_t *addr, uint32_t *size) Modified: head/sys/dev/bktr/CHANGELOG.TXT ============================================================================== --- head/sys/dev/bktr/CHANGELOG.TXT Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/CHANGELOG.TXT Tue May 3 03:41:25 2016 (r298955) @@ -356,7 +356,7 @@ BSDI code removed. Will be restored later. 1.70 12 July 1999 Roger Hardiman - Reorganise OS device dependant parts (based on a port to + Reorganise OS device dependent parts (based on a port to linux by Brad Parker). Make the driver compile on FreeBSD 2.2.x systems again. Change number of VBI lines from 16 to 12 for NTSC formats. @@ -368,7 +368,7 @@ Matt Brown added MSP3430G DBX initialisation. 1.71 30 Aug 1999 Roger Hardiman - Small cleanup of OS dependant code. Remove NPCI usage. + Small cleanup of OS dependent code. Remove NPCI usage. Fix bug in AVerMedia detection. Update VBI support for the AleVT Teletext package. Parts from Juha Nurmela's driver Modified: head/sys/dev/bktr/bktr_audio.c ============================================================================== --- head/sys/dev/bktr/bktr_audio.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/bktr_audio.c Tue May 3 03:41:25 2016 (r298955) @@ -132,7 +132,7 @@ set_audio( bktr_ptr_t bktr, int cmd ) else #endif /* AUDIOMUX_DISCOVER */ - /* check for existance of audio MUXes */ + /* check for existence of audio MUXes */ if ( !bktr->card.audiomuxs[ 4 ] ) return( -1 ); @@ -308,7 +308,7 @@ init_BTSC( bktr_ptr_t bktr ) /* * setup the dbx chip - * XXX FIXME: alot of work to be done here, this merely unmutes it. + * XXX FIXME: a lot of work to be done here, this merely unmutes it. */ int set_BTSC( bktr_ptr_t bktr, int control ) @@ -471,7 +471,7 @@ void msp_read_id( bktr_ptr_t bktr ){ * For the MSP3430G, we use fast autodetect mode * For the MSP3410/3415 there are two schemes for this * a) Fast autodetection - the chip is put into autodetect mode, and the function - * returns immediatly. This works in most cases and is the Default Mode. + * returns immediately. This works in most cases and is the Default Mode. * b) Slow mode. The function sets the MSP3410/3415 chip, then waits for feedback from * the chip and re-programs it if needed. */ @@ -561,7 +561,7 @@ void msp_autodetect( bktr_ptr_t bktr ) { msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0020);/* Loudspeaker set stereo*/ /* set spatial effect strength to 50% enlargement - set spatial effect mode b, stereo basewidth enlargment only + set spatial effect mode b, stereo basewidth enlargement only */ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x3f28); } else if (stereo > 0x8000) { /* bilingual mode */ @@ -573,7 +573,7 @@ void msp_autodetect( bktr_ptr_t bktr ) { msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0030);/* Loudspeaker */ /* set spatial effect strength to 50% enlargement - set spatial effect mode a, stereo basewidth enlargment + set spatial effect mode a, stereo basewidth enlargement and pseudo stereo effect with automatic high-pass filter */ msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x3f08); Modified: head/sys/dev/bktr/bktr_card.c ============================================================================== --- head/sys/dev/bktr/bktr_card.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/bktr_card.c Tue May 3 03:41:25 2016 (r298955) @@ -1217,7 +1217,7 @@ checkTuner: } /* end switch(card) */ - /* At this point, a goto checkDBX has not occured */ + /* At this point, a goto checkDBX has not occurred */ /* We have not been able to select a Tuner */ /* Some cards make use of the tuner address to */ /* identify the make/model of tuner */ Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/bktr_core.c Tue May 3 03:41:25 2016 (r298955) @@ -256,7 +256,7 @@ typedef u_char bool_t; */ #define MAX_VBI_LINES 16 /* Maximum for all vidoe formats */ -#define VBI_LINE_SIZE 2048 /* Store upto 2048 bytes per line */ +#define VBI_LINE_SIZE 2048 /* Store up to 2048 bytes per line */ #define VBI_BUFFER_ITEMS 20 /* Number of frames we buffer */ #define VBI_DATA_SIZE (VBI_LINE_SIZE * MAX_VBI_LINES * 2) #define VBI_BUFFER_SIZE (VBI_DATA_SIZE * VBI_BUFFER_ITEMS) @@ -626,7 +626,7 @@ bktr_store_address(unit, BKTR_MEM_BUF, init_audio_devices( bktr ); #ifdef BKTR_NEW_MSP34XX_DRIVER - /* setup the kenrel thread */ + /* setup the kernel thread */ err = msp_attach( bktr ); if ( err != 0 ) /* error doing kernel thread stuff, disable msp3400c */ bktr->card.msp3400c = 0; @@ -1786,7 +1786,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, && bktr->video.addr == 0) { /*****************************/ -/* *** OS Dependant code *** */ +/* *** OS Dependent code *** */ /*****************************/ #if defined(__NetBSD__) || defined(__OpenBSD__) bus_dmamap_t dmamap; @@ -2369,7 +2369,7 @@ common_ioctl( bktr_ptr_t bktr, ioctl_cmd /* Tuner is MUX0, RCA is MUX1, S-Video is MUX2 */ /* On the Hauppauge bt878 boards, */ /* Tuner is MUX0, RCA is MUX3 */ - /* Unfortunatly Meteor driver codes DEV_RCA as DEV_0, so we */ + /* Unfortunately Meteor driver codes DEV_RCA as DEV_0, so we */ /* stick with this system in our Meteor Emulation */ switch(*(unsigned long *)arg & METEOR_DEV_MASK) { Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/bktr_os.c Tue May 3 03:41:25 2016 (r298955) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); * chipset. * Copyright Roger Hardiman and Amancio Hasty. * - * bktr_os : This has all the Operating System dependant code, + * bktr_os : This has all the Operating System dependent code, * probe/attach and open/close/ioctl/read/mmap * memory allocation * PCI bus interfacing @@ -395,12 +395,12 @@ bktr_attach( device_t dev ) fun = fun | 1; /* Enable writes to the sub-system vendor ID */ #if defined( BKTR_430_FX_MODE ) - if (bootverbose) printf("Using 430 FX chipset compatibilty mode\n"); + if (bootverbose) printf("Using 430 FX chipset compatibility mode\n"); fun = fun | 2; /* Enable Intel 430 FX compatibility mode */ #endif #if defined( BKTR_SIS_VIA_MODE ) - if (bootverbose) printf("Using SiS/VIA chipset compatibilty mode\n"); + if (bootverbose) printf("Using SiS/VIA chipset compatibility mode\n"); fun = fun | 4; /* Enable SiS/VIA compatibility mode (useful for OPTi chipset motherboards too */ #endif Modified: head/sys/dev/bktr/bktr_os.h ============================================================================== --- head/sys/dev/bktr/bktr_os.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/bktr_os.h Tue May 3 03:41:25 2016 (r298955) @@ -6,7 +6,7 @@ * chipset. * Copyright Roger Hardiman and Amancio Hasty. * - * bktr_os : This has all the Operating System dependant code. + * bktr_os : This has all the Operating System dependent code. * */ Modified: head/sys/dev/bktr/msp34xx.c ============================================================================== --- head/sys/dev/bktr/msp34xx.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bktr/msp34xx.c Tue May 3 03:41:25 2016 (r298955) @@ -39,7 +39,7 @@ * * FM-Mono * should work. The stereo modes are backward compatible to FM-mono, - * therefore FM-Mono should be allways available. + * therefore FM-Mono should be always available. * * FM-Stereo (B/G, used in germany) * should work, with autodetect @@ -226,7 +226,7 @@ static struct MSP_INIT_DATA_DEM { MSP_CARRIER(10.7), MSP_CARRIER(10.7), 0x00d0, 0x0480, 0x0020, 0x3000 }, - /* Terrestial FM-mono + FM-stereo */ + /* Terrestrial FM-mono + FM-stereo */ { { 3, 18, 27, 48, 66, 72 }, { 3, 18, 27, 48, 66, 72 }, MSP_CARRIER(5.5), MSP_CARRIER(5.5), 0x00d0, 0x0480, 0x0030, 0x3000}, Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/buslogic/bt.c Tue May 3 03:41:25 2016 (r298955) @@ -1578,7 +1578,7 @@ btdone(struct bt_softc *bt, struct bt_cc struct ccb_hdr *ccb_h; cam_status error; - /* Notify all clients that a BDR occured */ + /* Notify all clients that a BDR occurred */ error = xpt_create_path(&path, /*periph*/NULL, cam_sim_path(bt->sim), bccb->hccb.target_id, @@ -1624,12 +1624,12 @@ btdone(struct bt_softc *bt, struct bt_cc case BMBI_ABORT: case BMBI_ERROR: if (bootverbose) { - printf("bt: ccb %p - error %x occured. " + printf("bt: ccb %p - error %x occurred. " "btstat = %x, sdstat = %x\n", (void *)bccb, comp_code, bccb->hccb.btstat, bccb->hccb.sdstat); } - /* An error occured */ + /* An error occurred */ switch(bccb->hccb.btstat) { case BTSTAT_DATARUN_ERROR: if (bccb->hccb.data_len == 0) { @@ -2317,7 +2317,7 @@ bttimeout(void *arg) * means that the driver attempts to clear only one error * condition at a time. In general, timeouts that occur * close together are related anyway, so there is no benefit - * in attempting to handle errors in parrallel. Timeouts will + * in attempting to handle errors in parallel. Timeouts will * be reinstated when the recovery process ends. */ if ((bccb->flags & BCCB_DEVICE_RESET) == 0) { Modified: head/sys/dev/buslogic/bt_eisa.c ============================================================================== --- head/sys/dev/buslogic/bt_eisa.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/buslogic/bt_eisa.c Tue May 3 03:41:25 2016 (r298955) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define EISA_IRQ_TYPE 0x08D #define LEVEL 0x40 -/* Definitions for the AMI Series 48 controler */ +/* Definitions for the AMI Series 48 controller */ #define AMI_EISA_IOSIZE 0x500 /* Two separate ranges?? */ #define AMI_EISA_SLOT_OFFSET 0x800 #define AMI_EISA_IOCONF 0x000 Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bwi/if_bwi.c Tue May 3 03:41:25 2016 (r298955) @@ -3747,7 +3747,7 @@ bwi_rx_radiotap(struct bwi_softc *sc, st if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_WEP; - sc->sc_rx_th.wr_tsf = hdr->rxh_tsf; /* No endian convertion */ + sc->sc_rx_th.wr_tsf = hdr->rxh_tsf; /* No endian conversion */ sc->sc_rx_th.wr_rate = rate; sc->sc_rx_th.wr_antsignal = rssi; sc->sc_rx_th.wr_antnoise = noise; Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bxe/bxe.c Tue May 3 03:41:25 2016 (r298955) @@ -2221,7 +2221,7 @@ storm_memset_eq_prod(struct bxe_softc *s /* * Post a slowpath command. * - * A slowpath command is used to propogate a configuration change through + * A slowpath command is used to propagate a configuration change through * the controller in a controlled manner, allowing each STORM processor and * other H/W blocks to phase in the change. The commands sent on the * slowpath are referred to as ramrods. Depending on the ramrod used the @@ -4248,7 +4248,7 @@ bxe_nic_unload(struct bxe_softc *sc, /* * Nothing to do during unload if previous bxe_nic_load() - * did not completed succesfully - all resourses are released. + * did not completed successfully - all resourses are released. */ if ((sc->state == BXE_STATE_CLOSED) || (sc->state == BXE_STATE_ERROR)) { @@ -4762,7 +4762,7 @@ bxe_dump_mbuf(struct bxe_softc *sc, * Checks to ensure the 13 bd sliding window is >= MSS for TSO. * Check that (13 total bds - 3 bds) = 10 bd window >= MSS. * The window: 3 bds are = 1 for headers BD + 2 for parse BD and last BD - * The headers comes in a seperate bd in FreeBSD so 13-3=10. + * The headers comes in a separate bd in FreeBSD so 13-3=10. * Returns: 0 if OK to send, 1 if packet needs further defragmentation */ static int @@ -7990,7 +7990,7 @@ bxe_attn_int_deasserted2(struct bxe_soft mask1 = REG_RD(sc, PXP2_REG_PXP2_INT_MASK_1); val0 = REG_RD(sc, PXP2_REG_PXP2_INT_STS_0); /* - * If the olny PXP2_EOP_ERROR_BIT is set in + * If the only PXP2_EOP_ERROR_BIT is set in * STS0 and STS1 - clear it * * probably we lose additional attentions between @@ -10627,7 +10627,7 @@ bxe_set_234_gates(struct bxe_softc *sc, (!close) ? (val | HC_CONFIG_0_REG_BLOCK_DISABLE_0) : (val & ~(uint32_t)HC_CONFIG_0_REG_BLOCK_DISABLE_0)); } else { - /* Prevent incomming interrupts in IGU */ + /* Prevent incoming interrupts in IGU */ val = REG_RD(sc, IGU_REG_BLOCK_CONFIGURATION); REG_WR(sc, IGU_REG_BLOCK_CONFIGURATION, Modified: head/sys/dev/bxe/bxe_elink.c ============================================================================== --- head/sys/dev/bxe/bxe_elink.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bxe/bxe_elink.c Tue May 3 03:41:25 2016 (r298955) @@ -1294,7 +1294,7 @@ static void elink_ets_e3b0_set_credit_up * Will return the NIG ETS registers to init values.Except * credit_upper_bound. * That isn't used in this configuration (No WFQ is enabled) and will be -* configured acording to spec +* configured according to spec. *. ******************************************************************************/ static void elink_ets_e3b0_nig_disabled(const struct elink_params *params, @@ -1411,7 +1411,7 @@ static void elink_ets_e3b0_set_credit_up * Will return the PBF ETS registers to init values.Except * credit_upper_bound. * That isn't used in this configuration (No WFQ is enabled) and will be -* configured acording to spec +* configured according to spec. *. ******************************************************************************/ static void elink_ets_e3b0_pbf_disabled(const struct elink_params *params) @@ -1469,7 +1469,7 @@ static void elink_ets_e3b0_pbf_disabled( } /****************************************************************************** * Description: -* E3B0 disable will return basicly the values to init values. +* E3B0 disable will return basically the values to init values. *. ******************************************************************************/ static elink_status_t elink_ets_e3b0_disabled(const struct elink_params *params, @@ -1492,7 +1492,7 @@ static elink_status_t elink_ets_e3b0_dis /****************************************************************************** * Description: -* Disable will return basicly the values to init values. +* Disable will return basically the values to init values. * ******************************************************************************/ elink_status_t elink_ets_disabled(struct elink_params *params, @@ -3762,7 +3762,7 @@ static elink_status_t elink_eee_initial_ { vars->eee_status |= ((uint32_t) mode) << SHMEM_EEE_SUPPORTED_SHIFT; - /* Propogate params' bits --> vars (for migration exposure) */ + /* Propagate params' bits --> vars (for migration exposure) */ if (params->eee_mode & ELINK_EEE_MODE_ENABLE_LPI) vars->eee_status |= SHMEM_EEE_LPI_REQUESTED_BIT; else @@ -14632,7 +14632,7 @@ static void elink_check_over_curr(struct vars->phy_flags &= ~PHY_OVER_CURRENT_FLAG; } -/* Returns 0 if no change occured since last check; 1 otherwise. */ +/* Returns 0 if no change occurred since last check; 1 otherwise. */ static uint8_t elink_analyze_link_error(struct elink_params *params, struct elink_vars *vars, uint32_t status, uint32_t phy_flag, uint32_t link_flag, uint8_t notify) Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bxe/bxe_stats.c Tue May 3 03:41:25 2016 (r298955) @@ -1670,7 +1670,7 @@ bxe_stats_init(struct bxe_softc *sc) bxe_port_stats_base_init(sc); } - /* mark the end of statistics initializiation */ + /* mark the end of statistics initialization */ sc->stats_init = FALSE; } Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bxe/bxe_stats.h Tue May 3 03:41:25 2016 (r298955) @@ -264,7 +264,7 @@ struct bxe_eth_stats { uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; - /* num. of times tx queue full occured */ + /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; }; @@ -370,7 +370,7 @@ struct bxe_eth_q_stats { uint32_t mbuf_alloc_sge; uint32_t mbuf_alloc_tpa; - /* num. of times tx queue full occured */ + /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; }; Modified: head/sys/dev/bxe/ecore_hsi.h ============================================================================== --- head/sys/dev/bxe/ecore_hsi.h Tue May 3 03:31:16 2016 (r298954) +++ head/sys/dev/bxe/ecore_hsi.h Tue May 3 03:41:25 2016 (r298955) @@ -8188,7 +8188,7 @@ union fcoe_kcqe_params struct fcoe_kcqe { uint32_t fcoe_conn_id /* Drivers connection ID (only 16 bits are used) */; - uint32_t completion_status /* 0=command completed succesfuly, 1=command failed */; + uint32_t completion_status /* 0=command completed successfully, 1=command failed */; uint32_t fcoe_conn_context_id /* Context ID of the FCoE connection */; union fcoe_kcqe_params params /* command-specific parameters */; uint16_t qe_self_seq /* Self identifying sequence number */; @@ -9464,7 +9464,7 @@ union iscsi_kcqe_params struct iscsi_kcqe { uint32_t iscsi_conn_id /* Drivers connection ID (only 16 bits are used) */; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 06:12:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45886B2BABA; Tue, 3 May 2016 06:12:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8A516FA; Tue, 3 May 2016 06:12:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id DB4391A37B6; Tue, 3 May 2016 15:52:56 +1000 (AEST) Date: Tue, 3 May 2016 15:52:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: John Baldwin , "Ngie Cooper (yaneurabeya)" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 In-Reply-To: Message-ID: <20160503152502.A939@besplex.bde.org> References: <201605021800.u42I0cjK084243@repo.freebsd.org> <4F040E00-AB92-4D32-99F5-9BCB02578DC0@gmail.com> <2097917.RNSsKXUJ7U@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=gkHm1csUnXyMWDEhC90A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 06:12:38 -0000 On Mon, 2 May 2016, Pedro Giffuni wrote: > > On 05/02/16 15:52, John Baldwin wrote: >> On Monday, May 02, 2016 11:45:41 AM Ngie Cooper wrote: >>> >>>> On May 2, 2016, at 11:00, John Baldwin wrote: >>>> >>>> Author: jhb >>>> [... excessive quoting trimmed] >>>> New Revision: 298933 >>>> URL: https://svnweb.freebsd.org/changeset/base/298933 >>>> >>>> Log: >>>> Add a new bus method to fetch device-specific CPU sets. >>>> [... excessive quoting trimmed] >>>> kernel >>> >>> This broke the build with gcc: >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1211/ >> >> I saw. What is odd though is that my tinderbox builds all passed. This >> might >> be due to the recent howmany() changes since _bitset.h only needed >> >> before but now needs (which is borderline to being pointless >> for >> a _foo.h header). > > TBH, I thought so too, but I avoided applying such changes to headers, > and I haven't touched _bitset.h, _foo.h headers cannot use howmany() due to namespace pollution. _bitset.h was already broken, unless it is supposed to be kernel-only -- it uses howmany(). It is kernel-only according to its documention -- bitset is only documented in kernel manpages (in a single unreadable one than is linked ad nauseum). It is otherwise fairly clean. It defines the symbols BITSET_DEFINE, BITSET_T_INITIALIZER, and BITSET_SET in the application namespace This is not completely clean for a _foo.h header. All other BITSET* macros are already in bitset.h I think only BITSET_DEFINE should be in _bitset.h (for use declarations in other headers). select.h avoids this problem by defining its own howmany() macro. This seems to be correct except for the bogus ifdef around the private macro. This ifdef is a little more than a style bug (verboseness) -- it breaks detection of other definitions that might be different. Lexical differences wouldn't matter, but it is easier to never have them. Old versions of select polluted . The select macros just used howmany(). howmany() was in too. Bruce From owner-svn-src-all@freebsd.org Tue May 3 07:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25200B2B6F3; Tue, 3 May 2016 07:03:54 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 08E871E4F; Tue, 3 May 2016 07:03:53 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id ECFAA174DA; Tue, 3 May 2016 00:03:46 -0700 (PDT) Date: Tue, 3 May 2016 00:03:46 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298769 - head/sys/netinet Message-ID: <20160503070346.GA79033@strugglingcoder.info> References: <201604290723.u3T7N8Ph070162@repo.freebsd.org> <20160429155536.GD18595@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:03:54 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05/03/16 at 09:29P, Sepherosa Ziehau wrote: > On Fri, Apr 29, 2016 at 11:55 PM, hiren panchasara > wrote: > > On 04/29/16 at 07:23P, Sepherosa Ziehau wrote: > >> Author: sephe > >> Date: Fri Apr 29 07:23:08 2016 > >> New Revision: 298769 > >> URL: https://svnweb.freebsd.org/changeset/base/298769 > >> > >> Log: > >> tcp/syncache: Set flowid and hash type properly for SYN|ACK > >> > >> So the underlying drivers can use it to select the sending queue > >> properly for SYN|ACK instead of rolling their own hash. > >> > >> Sponsored by: Microsoft OSTC > >> Differential Revision: https://reviews.freebsd.org/D6120 > >> > >> Modified: > >> head/sys/netinet/tcp_syncache.c > > > > Would it be possible to MFC this? >=20 > I _think_ we can :) That'd be nice. Thank you! Cheers, Hiren --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXKE1PXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lp1QH/2nYVVzH6/DWYdGy90/Kecs/ KtopKb1LZDhuTEDlaVLw0OFYE+ms4TcF4/+fsiNd+olIcPF5BEH290/fn8WaJatD v13SMwuDxsdQwkdkchiBLZ5wzUazsJfSVsKAtvE/LuaHGtrKRmicwQv6/XSOVP/L kMVCN03EtwR/T/5wc/icRYAqBEZdOeA0h1+D7xTk18NCZ+7Fd2lHm4Qy9ILuaCDD 0ifHxwq9mcjP0jZ86CfzYLKJprn/MfYfosM1y/RWpWmQw0sGk6hS1yFcXV7zGHcG 40CPsb1MzXCzHxbitfx2NMa3i0+xL4AyHXNVi6XCzqxa9xloJY0YpNtNXWc3OT8= =x2V4 -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- From owner-svn-src-all@freebsd.org Tue May 3 07:17:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 236D3B2BA73; Tue, 3 May 2016 07:17:15 +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 D77F31371; Tue, 3 May 2016 07:17:14 +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 u437HE4i029198; Tue, 3 May 2016 07:17:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437HDtc029195; Tue, 3 May 2016 07:17:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605030717.u437HDtc029195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 3 May 2016 07:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298956 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:17:15 -0000 Author: sephe Date: Tue May 3 07:17:13 2016 New Revision: 298956 URL: https://svnweb.freebsd.org/changeset/base/298956 Log: kern: Add phashinit_flags(), which allows malloc(M_NOWAIT) It will be used for the upcoming LRO hash table initialization. And probably will be useful in other cases, when M_WAITOK can't be used. Reviewed by: jhb, kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6138 Modified: head/share/man/man9/hashinit.9 head/sys/kern/subr_hash.c head/sys/sys/systm.h Modified: head/share/man/man9/hashinit.9 ============================================================================== --- head/share/man/man9/hashinit.9 Tue May 3 03:41:25 2016 (r298955) +++ head/share/man/man9/hashinit.9 Tue May 3 07:17:13 2016 (r298956) @@ -25,11 +25,11 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd April 29, 2016 .Dt HASHINIT 9 .Os .Sh NAME -.Nm hashinit , hashinit_flags , hashdestroy , phashinit +.Nm hashinit , hashinit_flags , hashdestroy , phashinit , phashinit_flags .Nd manage kernel hash tables .Sh SYNOPSIS .In sys/malloc.h @@ -45,12 +45,14 @@ .Fn hashdestroy "void *hashtbl" "struct malloc_type *type" "u_long hashmask" .Ft "void *" .Fn phashinit "int nelements" "struct malloc_type *type" "u_long *nentries" +.Fn phashinit_flags "int nelements" "struct malloc_type *type" "u_long *nentries" "int flags" .Sh DESCRIPTION The .Fn hashinit , -.Fn hashinit_flags -and +.Fn hashinit_flags , .Fn phashinit +and +.Fn phashinit_flags functions allocate space for hash tables of size given by the argument .Fa nelements . .Pp @@ -71,6 +73,12 @@ function operates like but also accepts an additional argument .Fa flags which control various options during allocation. +.Fn phashinit_flags +function operates like +.Fn phashinit +but also accepts an additional argument +.Fa flags +which control various options during allocation. Allocated hash tables are contiguous arrays of .Xr LIST_HEAD 3 entries, allocated using @@ -100,13 +108,19 @@ must be used with one of the following v .It Dv HASH_NOWAIT Any malloc performed by the .Fn hashinit_flags +and +.Fn phashinit_flags function will not be allowed to wait, and therefore may fail. .It Dv HASH_WAITOK Any malloc performed by .Fn hashinit_flags +and +.Fn phashinit_flags function is allowed to wait for memory. This is also the behavior of -.Fn hashinit . +.Fn hashinit +and +.Fn phashinit . .El .Sh IMPLEMENTATION NOTES The largest prime hash value chosen by Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Tue May 3 03:41:25 2016 (r298955) +++ head/sys/kern/subr_hash.c Tue May 3 07:17:13 2016 (r298956) @@ -104,16 +104,21 @@ static const int primes[] = { 1, 13, 31, #define NPRIMES nitems(primes) /* - * General routine to allocate a prime number sized hash table. + * General routine to allocate a prime number sized hash table with control of + * memory flags. */ void * -phashinit(int elements, struct malloc_type *type, u_long *nentries) +phashinit_flags(int elements, struct malloc_type *type, u_long *nentries, int flags) { long hashsize; LIST_HEAD(generic, generic) *hashtbl; - int i; + int i, m_flags; KASSERT(elements > 0, ("%s: bad elements", __func__)); + /* Exactly one of HASH_WAITOK and HASH_NOWAIT must be set. */ + KASSERT((flags & HASH_WAITOK) ^ (flags & HASH_NOWAIT), + ("Bad flags (0x%x) passed to phashinit_flags", flags)); + for (i = 1, hashsize = primes[1]; hashsize <= elements;) { i++; if (i == NPRIMES) @@ -121,9 +126,25 @@ phashinit(int elements, struct malloc_ty hashsize = primes[i]; } hashsize = primes[i - 1]; - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK); + + m_flags = (flags & HASH_NOWAIT) ? M_NOWAIT : M_WAITOK; + hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, m_flags); + if (hashtbl == NULL) + return (NULL); + for (i = 0; i < hashsize; i++) LIST_INIT(&hashtbl[i]); *nentries = hashsize; return (hashtbl); } + +/* + * Allocate and initialize a prime number sized hash table with default flag: + * may sleep. + */ +void * +phashinit(int elements, struct malloc_type *type, u_long *nentries) +{ + + return (phashinit_flags(elements, type, nentries, HASH_WAITOK)); +} Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue May 3 03:41:25 2016 (r298955) +++ head/sys/sys/systm.h Tue May 3 07:17:13 2016 (r298956) @@ -189,6 +189,8 @@ void *hashinit_flags(int count, struct m #define HASH_WAITOK 0x00000002 void *phashinit(int count, struct malloc_type *type, u_long *nentries); +void *phashinit_flags(int count, struct malloc_type *type, u_long *nentries, + int flags); void g_waitidle(void); void panic(const char *, ...) __dead2 __printflike(1, 2); From owner-svn-src-all@freebsd.org Tue May 3 07:48:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25DEFB2B6B7; Tue, 3 May 2016 07:48:51 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9BBF169F; Tue, 3 May 2016 07:48:50 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id iv1so6325789pac.2; Tue, 03 May 2016 00:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NGWq9gGJxM2OfGEcR6gQp0l2RLQrjLZh1cbDm8O/7Bk=; b=MmGH07XQTpQb8PQRO2rraNhF5z0ZMtnCdVD3Yzv+nmBOb+rDPL0Vc45rFX4AyK2u4M wyF2XL7Jr0VLus9lmnKjaYi/uQuvDhj8ESTU6CWjeZ5mwYUgWghjKynaj/fPUKdf2BaR ZjRx4WN9DTj0ba5Pl+42JZrOFVBMxII3UGq8Y7XAQFWKuLRrnUzffPrILtK6UZQuvqFI UYL5R4xEQyL7zEFUqQFz7tY/FvOXoTC/JoKKc1Yl5Jg/qW7dQHTiJmyecyVbQey+m6tX n8R4XUVwZkFzAyVMh4X8TSMP6mJnb1ICmx+oviulOwqtiRcgTHHBE4aK2CVC2G8Ir+jk E4ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=NGWq9gGJxM2OfGEcR6gQp0l2RLQrjLZh1cbDm8O/7Bk=; b=Q8NeKLHTtT9kP8WvVoGy+vJS/RUIYydK38e4aZn9PwHTf0pNjPSqp4Z7sE3/0YrGu4 lTO8WrFS8A11zUbQLO9afGlVenGqtCxkuoaQUi0Fc6uwW1nfPEku/TVfsDdh0oW6aIe+ ZGwlFBF6pI1EGQnzrp6DiSdTRsG6aTNF9zB+UF8Lrn4p/QzF/65LXkrKOzOBaZcWzfGj D8Ynh8BKeSM8hthxzbhIQiJ9vxL43h5gROaiwA8/y/RLYufHZiX7EMcnjDWhdH217Uzi HmWg6bQuSu0W1eAKzqtsIUbvof8ZLsjVJybFdvm+OyxhYxNj/+s24dh++IXdF98lT8F3 GwPw== X-Gm-Message-State: AOPr4FUZ/REGEOGh6cO0MDwGxYQBUMWGfeVLHHcwDRD0yAhI3NmKBSStbTJXHDGLSmUciQ== X-Received: by 10.66.149.194 with SMTP id uc2mr1429559pab.116.1462261730614; Tue, 03 May 2016 00:48:50 -0700 (PDT) Received: from ox ([2601:641:c000:e00:e90b:a312:e3a:9f25]) by smtp.gmail.com with ESMTPSA id o80sm3340373pfa.37.2016.05.03.00.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 00:48:49 -0700 (PDT) Sender: Navdeep Parhar Date: Tue, 3 May 2016 00:48:40 -0700 From: Navdeep Parhar To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298955 - in head/sys/dev: aac aacraid acpi_support acpica advansys aha ahb ahci alpm altera/atse amr an asmc ata ata/chipsets atkbdc bce bhnd bhnd/bhndb bhnd/siba bktr buslogic bwi bxe... Message-ID: <20160503074710.GA14852@ox> Mail-Followup-To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605030341.u433fQLh066657@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605030341.u433fQLh066657@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:48:51 -0000 On Tue, May 03, 2016 at 03:41:26AM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue May 3 03:41:25 2016 > New Revision: 298955 > URL: https://svnweb.freebsd.org/changeset/base/298955 > > Log: > sys/dev: minor spelling fixes. > > Most affect comments, very few have user-visible effects. > > Modified: > ... > head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt > ... > head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt > head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt > ... These 3 files have a checksum (see the checksum = line in the [fini] section) that covers all of the contents of the file, including comments. You can't modify these files without updating the checksum. Please fix properly or revert. Regards, Navdeep From owner-svn-src-all@freebsd.org Tue May 3 07:48:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D72EB2B6C7; Tue, 3 May 2016 07:48:53 +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 4CFC516A3; Tue, 3 May 2016 07:48:53 +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 u437mqki038335; Tue, 3 May 2016 07:48:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437mqlm038331; Tue, 3 May 2016 07:48:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030748.u437mqlm038331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:48: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: r298957 - in stable/10: share/man/man4 sys/amd64/conf sys/dev/wbwd sys/i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:48:53 -0000 Author: mav Date: Tue May 3 07:48:52 2016 New Revision: 298957 URL: https://svnweb.freebsd.org/changeset/base/298957 Log: MFC r297243: Polish wbwd(4) driver and add more supported chips. Modified: stable/10/share/man/man4/wbwd.4 stable/10/sys/amd64/conf/GENERIC.hints stable/10/sys/dev/wbwd/wbwd.c stable/10/sys/i386/conf/GENERIC.hints Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/wbwd.4 ============================================================================== --- stable/10/share/man/man4/wbwd.4 Tue May 3 07:17:13 2016 (r298956) +++ stable/10/share/man/man4/wbwd.4 Tue May 3 07:48:52 2016 (r298957) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2012 +.Dd March 24, 2016 .Dt WBWD 4 .Os .Sh NAME .Nm wbwd -.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Nd device driver for Winbond/Nuvoton Super I/O chips watchdog timer .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: @@ -50,18 +50,51 @@ The driver provides .Xr watchdog 4 support for the watchdog interrupt timer present on at least the following -Winbond Super I/O chips: -.Pp +Super I/O chips: .Bl -bullet -compact .It -83627HF/F/HG/G Rev. G +Winbond 83627HF/F/HG/G +.It +Winbond 83627S +.It +Winbond 83697HF +.It +Winbond 83697UG +.It +Winbond 83637HF +.It +Winbond 83627THF +.It +Winbond 83687THF +.It +Winbond 83627EHF +.It +Winbond 83627DHG .It -83627HF/F/HG/G Rev. J +Winbond 83627UHG .It -83627HF/F/HG/G Rev. UD-A +Winbond 83667HG .It -83627DHG IC ver. 5 +Winbond 83627DHG-P +.It +Winbond 83667HG-B +.It +Nuvoton NCT6775 +.It +Nuvoton NCT6776 +.It +Nuvoton NCT6102 +.It +Nuvoton NCT6779 +.It +Nuvoton NCT6791 +.It +Nuvoton NCT6792 .El +.Pp +Driver may be forced to attach to unknown chips by adding to +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" .Sh SYSCTL VARIABLES The .Nm Modified: stable/10/sys/amd64/conf/GENERIC.hints ============================================================================== --- stable/10/sys/amd64/conf/GENERIC.hints Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/amd64/conf/GENERIC.hints Tue May 3 07:48:52 2016 (r298957) @@ -30,6 +30,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:48:52 2016 (r298957) @@ -91,8 +91,11 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF7_FORCE 0x20 /* 1: force timeout (self-clear) */ #define WB_LDN8_CRF7_TS 0x10 /* 0: counting, 1: fired */ #define WB_LDN8_CRF7_IRQS 0x0f /* irq source for watchdog, 2 == SMI */ -#define WB_LDN8_CRF7_CLEAR_MASK \ - (WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_KEYB|WB_LDN8_CRF7_TS|WB_LDN8_CRF7_IRQS) + +enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf, + w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, + w83627dhg_p, w83667hg_b, nct6775, nct6776, nct6779, nct6791, + nct6792, nct6102 }; struct wb_softc { device_t dev; @@ -103,6 +106,10 @@ struct wb_softc { eventhandler_tag ev_tag; int (*ext_cfg_enter_f)(struct wb_softc *, u_short); void (*ext_cfg_exit_f)(struct wb_softc *, u_short); + enum chips chip; + uint8_t ctl_reg; + uint8_t time_reg; + uint8_t csr_reg; int debug_verbose; /* @@ -144,46 +151,104 @@ struct winbond_superio_cfg { }; struct winbond_vendor_device_id { - uint16_t vendor_id; uint8_t device_id; - uint8_t device_rev; + enum chips chip; const char * descr; } wb_devs[] = { { - .vendor_id = 0x5ca3, .device_id = 0x52, - .device_rev = 0x17, - .descr = "Winbond 83627HF/F/HG/G Rev. G", + .chip = w83627hf, + .descr = "Winbond 83627HF/F/HG/G", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x3a, - .descr = "Winbond 83627HF/F/HG/G Rev. J", + .device_id = 0x59, + .chip = w83627s, + .descr = "Winbond 83627S", }, { - .vendor_id = 0x5ca3, - .device_id = 0x52, - .device_rev = 0x41, - .descr = "Winbond 83627HF/F/HG/G Rev. UD-A", + .device_id = 0x60, + .chip = w83697hf, + .descr = "Winbond 83697HF", + }, + { + .device_id = 0x68, + .chip = w83697ug, + .descr = "Winbond 83697UG", + }, + { + .device_id = 0x70, + .chip = w83637hf, + .descr = "Winbond 83637HF", + }, + { + .device_id = 0x82, + .chip = w83627thf, + .descr = "Winbond 83627THF", + }, + { + .device_id = 0x85, + .chip = w83687thf, + .descr = "Winbond 83687THF", + }, + { + .device_id = 0x88, + .chip = w83627ehf, + .descr = "Winbond 83627EHF", }, { - .vendor_id = 0x5ca3, .device_id = 0xa0, - .device_rev = 0x25, - .descr = "Winbond 83627DHG IC ver. 5", + .chip = w83627dhg, + .descr = "Winbond 83627DHG", + }, + { + .device_id = 0xa2, + .chip = w83627uhg, + .descr = "Winbond 83627UHG", + }, + { + .device_id = 0xa5, + .chip = w83667hg, + .descr = "Winbond 83667HG", }, { - .vendor_id = 0x5ca3, .device_id = 0xb0, - .device_rev = 0x73, - .descr = "Winbond 83627DHG-P", + .chip = w83627dhg_p, + .descr = "Winbond 83627DHG-P", + }, + { + .device_id = 0xb3, + .chip = w83667hg_b, + .descr = "Winbond 83667HG-B", + }, + { + .device_id = 0xb4, + .chip = nct6775, + .descr = "Nuvoton NCT6775", }, { - .vendor_id = 0x5ca3, .device_id = 0xc3, - .device_rev = 0x33, - .descr = "Nuvoton WPCM450RA0BX", + .chip = nct6776, + .descr = "Nuvoton NCT6776", + }, + { + .device_id = 0xc4, + .chip = nct6102, + .descr = "Nuvoton NCT6102", + }, + { + .device_id = 0xc5, + .chip = nct6779, + .descr = "Nuvoton NCT6779", + }, + { + .device_id = 0xc8, + .chip = nct6791, + .descr = "Nuvoton NCT6791", + }, + { + .device_id = 0xc9, + .chip = nct6792, + .descr = "Nuvoton NCT6792", }, }; @@ -231,6 +296,22 @@ read_efdr_1(struct wb_softc *sc, u_short return (inb(baseport + 1)); } +static void +write_reg(struct wb_softc *sc, uint8_t reg, uint8_t value) +{ + + write_efir_1(sc, 0, reg); + write_efdr_1(sc, 0, value); +} + +static uint8_t +read_reg(struct wb_softc *sc, uint8_t reg) +{ + + write_efir_1(sc, 0, reg); + return (read_efdr_1(sc, 0)); +} + /* * Return the watchdog related registers as we last read them. This will * usually not give the current timeout or state on whether the watchdog @@ -248,9 +329,9 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&sb, NULL, 64, req); sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); - sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); - sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); - sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->ctl_reg, sc->reg_1); + sbuf_printf(&sb, "CR%02X 0x%02x ", sc->time_reg, sc->reg_timeout); + sbuf_printf(&sb, "CR%02X 0x%02x", sc->csr_reg, sc->reg_2); error = sbuf_finish(&sb); sbuf_delete(&sb); @@ -269,23 +350,17 @@ sysctl_wb_debug_current(SYSCTL_HANDLER_A sc = arg1; - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); + + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + (*sc->ext_cfg_exit_f)(sc, 0); return (sysctl_wb_debug(oidp, arg1, arg2, req)); } @@ -326,10 +401,6 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ } #endif - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); @@ -343,16 +414,14 @@ sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ #endif /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Force watchdog to fire. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); sc->reg_2 |= WB_LDN8_CRF7_FORCE; + write_reg(sc, sc->csr_reg, sc->reg_2); - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); return (0); } @@ -414,30 +483,36 @@ static int wb_set_watchdog(struct wb_softc *sc, unsigned int timeout) { + if (timeout != 0) { + /* + * In case an override is set, let it override. It may lead + * to strange results as we do not check the input of the sysctl. + */ + if (sc->timeout_override > 0) + timeout = sc->timeout_override; + + /* Make sure we support the requested timeout. */ + if (timeout > 255 * 60) + return (EINVAL); + } + if (sc->debug_verbose) wb_print_state(sc, "Before watchdog counter (re)load"); - /* - * Enter extended function mode in case someone else has been - * poking on the registers. We will not leave it though. - */ if ((*sc->ext_cfg_enter_f)(sc, 0) != 0) return (ENXIO); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); /* Disable and validate or arm/reset watchdog. */ if (timeout == 0) { /* Disable watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, 0x00); + write_reg(sc, sc->time_reg, 0x00); + sc->reg_timeout = read_reg(sc, sc->time_reg); + (*sc->ext_cfg_exit_f)(sc, 0); /* Re-check. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - if (sc->reg_timeout != 0x00) { device_printf(sc->dev, "Failed to disable watchdog: " "0x%02x.\n", sc->reg_timeout); @@ -445,20 +520,8 @@ wb_set_watchdog(struct wb_softc *sc, uns } } else { - /* - * In case an override is set, let it override. It may lead - * to strange results as we do not check the input of the sysctl. - */ - if (sc->timeout_override > 0) - timeout = sc->timeout_override; - - /* Make sure we support the requested timeout. */ - if (timeout > 255 * 60) - return (EINVAL); - /* Read current scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); if (timeout > 255) { /* Set scaling factor to 60s. */ @@ -473,21 +536,18 @@ wb_set_watchdog(struct wb_softc *sc, uns } /* In case we fired before we need to clear to fire again. */ - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_2 = read_reg(sc, sc->csr_reg); if (sc->reg_2 & WB_LDN8_CRF7_TS) { sc->reg_2 &= ~WB_LDN8_CRF7_TS; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + write_reg(sc, sc->csr_reg, sc->reg_2); } /* Write back scaling factor. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + write_reg(sc, sc->ctl_reg, sc->reg_1); /* Set timer and arm/reset the watchdog. */ - write_efir_1(sc, 0, WB_LDN8_CRF6); - write_efdr_1(sc, 0, sc->reg_timeout); + write_reg(sc, sc->time_reg, sc->reg_timeout); + (*sc->ext_cfg_exit_f)(sc, 0); } if (sc->debug_verbose) @@ -556,6 +616,7 @@ wb_probe_enable(device_t dev, int probe) struct wb_softc *sc; int error, found, i, j; uint8_t dev_id, dev_rev, cr26; + char buf[128]; if (dev == NULL) sc = NULL; @@ -566,6 +627,7 @@ wb_probe_enable(device_t dev, int probe) } error = ENXIO; + found = 0; for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { if (sc != NULL) { @@ -578,7 +640,6 @@ wb_probe_enable(device_t dev, int probe) sc->bsh = rman_get_bushandle(sc->portres); } - found = 0; error = (*probe_addrs[i].ext_cfg_enter_f)(sc, probe_addrs[i].efer); if (error != 0) goto cleanup; @@ -591,6 +652,9 @@ wb_probe_enable(device_t dev, int probe) write_efir_1(sc, probe_addrs[i].efer, WB_CR26); cr26 = read_efdr_1(sc, probe_addrs[i].efer); + if (dev_id == 0xff && dev_rev == 0xff) + goto cleanup; + /* HEFRAS of 0 means EFER at 0x2e, 1 means EFER at 0x4e. */ if (((cr26 & 0x40) == 0x00 && probe_addrs[i].efer != 0x2e) || ((cr26 & 0x40) == 0x40 && probe_addrs[i].efer != 0x4e)) { @@ -602,36 +666,30 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } - if (dev_id == 0xff && dev_rev == 0xff) - goto cleanup; - for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { - if (wb_devs[j].device_id == dev_id && - wb_devs[j].device_rev == dev_rev) { - if (probe && dev != NULL) - device_set_desc(dev, wb_devs[j].descr); - found++; + if (wb_devs[j].device_id == dev_id) { + found = 1; break; } } - if (!found) { - if (probe && dev != NULL) { - device_set_desc(dev, "Unknown Winbond/Nuvoton model"); - device_printf(dev, "DevID 0x%02x DevRev 0x%02x, " - "please report this.\n", dev_id, dev_rev); - } - found++; + if (probe && dev != NULL) { + snprintf(buf, sizeof(buf), + "%s (0x%02x/0x%02x) Watchdog Timer", + found ? wb_devs[j].descr : + "Unknown Winbond/Nuvoton", dev_id, dev_rev); + device_set_desc_copy(dev, buf); + } + + /* If this is hinted attach, try to guess the model. */ + if (dev != NULL && !found) { + found = 1; + j = 0; } - if (probe && found && bootverbose && dev != NULL) - device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" - " CR26 0x%02x (probing)\n", device_get_desc(dev), - probe_addrs[i].efer, dev_id, dev_rev, cr26); cleanup: if (probe || !found) { (*probe_addrs[i].ext_cfg_exit_f)(sc, probe_addrs[i].efer); - if (sc != NULL) (void) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); @@ -646,9 +704,21 @@ cleanup: if (sc != NULL) { sc->ext_cfg_enter_f = probe_addrs[i].ext_cfg_enter_f; sc->ext_cfg_exit_f = probe_addrs[i].ext_cfg_exit_f; + sc->chip = wb_devs[j].chip; + sc->ctl_reg = 0xf5; + sc->time_reg = 0xf6; + sc->csr_reg = 0xf7; + if (sc->chip == w83697hf || + sc->chip == w83697ug) { + sc->ctl_reg = 0xf3; + sc->time_reg = 0xf4; + } else if (sc->chip == nct6102) { + sc->ctl_reg = 0xf0; + sc->time_reg = 0xf1; + sc->csr_reg = 0xf2; + } } - error = BUS_PROBE_DEFAULT; - break; + return (BUS_PROBE_SPECIFIC); } else error = ENXIO; } @@ -659,15 +729,10 @@ cleanup: static void wb_identify(driver_t *driver, device_t parent) { - device_t dev; - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) { - if (wb_probe_enable(dev, 1) != BUS_PROBE_DEFAULT) { - if (bootverbose) - device_printf(dev, "can not find compatible Winbond chip.\n"); - } else - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); - return; + if (device_find_child(parent, driver->name, 0) == NULL) { + if (wb_probe_enable(NULL, 1) <= 0) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } } @@ -690,6 +755,7 @@ wb_attach(device_t dev) struct sysctl_oid *soid; unsigned long timeout; int error; + uint8_t t; error = wb_probe_enable(dev, 0); if (error > 0) @@ -700,37 +766,95 @@ wb_attach(device_t dev) ("%s: successfull probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ - write_efir_1(sc, 0, WB_LDN_REG); - write_efdr_1(sc, 0, WB_LDN_REG_LDN8); + write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); - /* Make sure LDN8 is enabled (Do we need to? Also affects GPIO). */ - write_efir_1(sc, 0, WB_LDN8_CR30); - write_efdr_1(sc, 0, WB_LDN8_CR30_ACTIVE); + /* Make sure WDT is enabled. */ + write_reg(sc, WB_LDN8_CR30, + read_reg(sc, WB_LDN8_CR30) | WB_LDN8_CR30_ACTIVE); + + switch (sc->chip) { + case w83627hf: + case w83627s: + t = read_reg(sc, 0x2B) & ~0x10; + write_reg(sc, 0x2B, t); /* set GPIO24 to WDT0 */ + break; + case w83697hf: + /* Set pin 119 to WDTO# mode (= CR29, WDT0) */ + t = read_reg(sc, 0x29) & ~0x60; + t |= 0x20; + write_reg(sc, 0x29, t); + break; + case w83697ug: + /* Set pin 118 to WDTO# mode */ + t = read_reg(sc, 0x2b) & ~0x04; + write_reg(sc, 0x2b, t); + break; + case w83627thf: + t = (read_reg(sc, 0x2B) & ~0x08) | 0x04; + write_reg(sc, 0x2B, t); /* set GPIO3 to WDT0 */ + break; + case w83627dhg: + case w83627dhg_p: + t = read_reg(sc, 0x2D) & ~0x01; /* PIN77 -> WDT0# */ + write_reg(sc, 0x2D, t); /* set GPIO5 to WDT0 */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + case w83637hf: + break; + case w83687thf: + t = read_reg(sc, 0x2C) & ~0x80; /* PIN47 -> WDT0# */ + write_reg(sc, 0x2C, t); + break; + case w83627ehf: + case w83627uhg: + case w83667hg: + case w83667hg_b: + case nct6775: + case nct6776: + case nct6779: + case nct6791: + case nct6792: + case nct6102: + /* + * These chips have a fixed WDTO# output pin (W83627UHG), + * or support more than one WDTO# output pin. + * Don't touch its configuration, and hope the BIOS + * does the right thing. + */ + t = read_reg(sc, sc->ctl_reg); + t |= 0x02; /* enable the WDTO# output low pulse + * to the KBRST# pin */ + write_reg(sc, sc->ctl_reg, t); + break; + default: + break; + } /* Read the current watchdog configuration. */ - write_efir_1(sc, 0, WB_LDN8_CRF5); - sc->reg_1 = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF6); - sc->reg_timeout = read_efdr_1(sc, 0); - write_efir_1(sc, 0, WB_LDN8_CRF7); - sc->reg_2 = read_efdr_1(sc, 0); + sc->reg_1 = read_reg(sc, sc->ctl_reg); + sc->reg_timeout = read_reg(sc, sc->time_reg); + sc->reg_2 = read_reg(sc, sc->csr_reg); /* Print current state if bootverbose or watchdog already enabled. */ if (bootverbose || (sc->reg_timeout > 0x00)) wb_print_state(sc, "Before watchdog attach"); + sc->reg_1 &= ~WB_LDN8_CRF5_KEYB_P20; + sc->reg_1 |= WB_LDN8_CRF5_KBRST; + write_reg(sc, sc->ctl_reg, sc->reg_1); + /* - * Clear a previous watchdog timeout event (if (still) set). - * Disable all all interrupt reset sources (defaults). + * Clear a previous watchdog timeout event (if still set). + * Disable timer reset on mouse interrupts. Leave reset on keyboard, + * since one of my boards is getting stuck in reboot without it. */ - sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); - sc->reg_1 |= WB_LDN8_CRF5_KBRST; - write_efir_1(sc, 0, WB_LDN8_CRF5); - write_efdr_1(sc, 0, sc->reg_1); + sc->reg_2 &= ~(WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_TS); + write_reg(sc, sc->csr_reg, sc->reg_2); - sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; - write_efir_1(sc, 0, WB_LDN8_CRF7); - write_efdr_1(sc, 0, sc->reg_2); + (*sc->ext_cfg_exit_f)(sc, 0); /* Read global timeout override tunable, Add per device sysctls. */ if (TUNABLE_ULONG_FETCH("hw.wbwd.timeout_override", &timeout)) { Modified: stable/10/sys/i386/conf/GENERIC.hints ============================================================================== --- stable/10/sys/i386/conf/GENERIC.hints Tue May 3 07:17:13 2016 (r298956) +++ stable/10/sys/i386/conf/GENERIC.hints Tue May 3 07:48:52 2016 (r298957) @@ -38,6 +38,5 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" -hint.wbwd.0.at="isa" hint.acpi_throttle.0.disabled="1" hint.p4tcc.0.disabled="1" From owner-svn-src-all@freebsd.org Tue May 3 07:49:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9992B2B78E; Tue, 3 May 2016 07:49:41 +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 86CD519D8; Tue, 3 May 2016 07:49:41 +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 u437nelV038416; Tue, 3 May 2016 07:49:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437neAd038415; Tue, 3 May 2016 07:49:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030749.u437neAd038415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298958 - stable/10/sys/dev/wbwd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:49:41 -0000 Author: mav Date: Tue May 3 07:49:40 2016 New Revision: 298958 URL: https://svnweb.freebsd.org/changeset/base/298958 Log: MFC r297963: Remove watchdog timer stop check. There are bunch of reports that this check fails at least on Nuvoton NCT6776 chips. I don't see why this check needed there, and Linux does not have it either. So far this check only made watchdogd unstopable. Modified: stable/10/sys/dev/wbwd/wbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:48:52 2016 (r298957) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 3 07:49:40 2016 (r298958) @@ -505,19 +505,10 @@ wb_set_watchdog(struct wb_softc *sc, uns /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); - /* Disable and validate or arm/reset watchdog. */ if (timeout == 0) { /* Disable watchdog. */ - write_reg(sc, sc->time_reg, 0x00); - sc->reg_timeout = read_reg(sc, sc->time_reg); - (*sc->ext_cfg_exit_f)(sc, 0); - - /* Re-check. */ - if (sc->reg_timeout != 0x00) { - device_printf(sc->dev, "Failed to disable watchdog: " - "0x%02x.\n", sc->reg_timeout); - return (EIO); - } + sc->reg_timeout = 0; + write_reg(sc, sc->time_reg, sc->reg_timeout); } else { /* Read current scaling factor. */ @@ -547,12 +538,12 @@ wb_set_watchdog(struct wb_softc *sc, uns /* Set timer and arm/reset the watchdog. */ write_reg(sc, sc->time_reg, sc->reg_timeout); - (*sc->ext_cfg_exit_f)(sc, 0); } + (*sc->ext_cfg_exit_f)(sc, 0); + if (sc->debug_verbose) wb_print_state(sc, "After watchdog counter (re)load"); - return (0); } From owner-svn-src-all@freebsd.org Tue May 3 07:50:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A69B2B8CF; Tue, 3 May 2016 07:50:59 +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 AF7811BA2; Tue, 3 May 2016 07:50:59 +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 u437owG4039161; Tue, 3 May 2016 07:50:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437owti039160; Tue, 3 May 2016 07:50:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030750.u437owti039160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:50: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: r298959 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:51:00 -0000 Author: mav Date: Tue May 3 07:50:58 2016 New Revision: 298959 URL: https://svnweb.freebsd.org/changeset/base/298959 Log: MFC r297921: Add hint.ahci.X.quirks tunable for some odd cases. Modified: stable/10/sys/dev/ahci/ahci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Tue May 3 07:49:40 2016 (r298958) +++ stable/10/sys/dev/ahci/ahci_pci.c Tue May 3 07:50:58 2016 (r298959) @@ -395,6 +395,8 @@ ahci_pci_attach(device_t dev) pci_get_subvendor(dev) == 0x1043 && pci_get_subdevice(dev) == 0x81e4) ctlr->quirks |= AHCI_Q_SATA1_UNIT0; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "quirks", &ctlr->quirks); ctlr->vendorid = pci_get_vendor(dev); ctlr->deviceid = pci_get_device(dev); ctlr->subvendorid = pci_get_subvendor(dev); From owner-svn-src-all@freebsd.org Tue May 3 07:52:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A5A1B2B937; Tue, 3 May 2016 07:52:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1B4F1EBD; Tue, 3 May 2016 07:52:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u437q7x8041235; Tue, 3 May 2016 07:52:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437q7Uf041233; Tue, 3 May 2016 07:52:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030752.u437q7Uf041233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:52: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: r298960 - stable/10/sys/dev/xen/blkfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:52:08 -0000 Author: mav Date: Tue May 3 07:52:06 2016 New Revision: 298960 URL: https://svnweb.freebsd.org/changeset/base/298960 Log: MFC r297522: Pass through some new block device features. Modified: stable/10/sys/dev/xen/blkfront/blkfront.c stable/10/sys/dev/xen/blkfront/block.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Tue May 3 07:50:58 2016 (r298959) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Tue May 3 07:52:06 2016 (r298960) @@ -849,6 +849,20 @@ xbd_feature_string(struct xbd_softc *sc, feature_cnt++; } + if ((sc->xbd_flags & XBDF_DISCARD) != 0) { + if (feature_cnt != 0) + sbuf_printf(&sb, ", "); + sbuf_printf(&sb, "discard"); + feature_cnt++; + } + + if ((sc->xbd_flags & XBDF_PERSISTENT) != 0) { + if (feature_cnt != 0) + sbuf_printf(&sb, ", "); + sbuf_printf(&sb, "persistent_grants"); + feature_cnt++; + } + (void) sbuf_finish(&sb); return (sbuf_len(&sb)); } @@ -979,7 +993,8 @@ xbd_vdevice_to_unit(uint32_t vdevice, in int xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors, - int vdevice, uint16_t vdisk_info, unsigned long sector_size) + int vdevice, uint16_t vdisk_info, unsigned long sector_size, + unsigned long phys_sector_size) { char features[80]; int unit, error = 0; @@ -1007,6 +1022,8 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_name = name; sc->xbd_disk->d_drv1 = sc; sc->xbd_disk->d_sectorsize = sector_size; + sc->xbd_disk->d_stripesize = phys_sector_size; + sc->xbd_disk->d_stripeoffset = 0; sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; @@ -1200,7 +1217,7 @@ static void xbd_connect(struct xbd_softc *sc) { device_t dev = sc->xbd_dev; - unsigned long sectors, sector_size; + unsigned long sectors, sector_size, phys_sector_size; unsigned int binfo; int err, feature_barrier, feature_flush; int i, j; @@ -1223,6 +1240,11 @@ xbd_connect(struct xbd_softc *sc) return; } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), + "physical-sector-size", "%lu", &phys_sector_size, + NULL); + if (err || phys_sector_size <= sector_size) + phys_sector_size = 0; + err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), "feature-barrier", "%lu", &feature_barrier, NULL); if (err == 0 && feature_barrier != 0) @@ -1324,7 +1346,7 @@ xbd_connect(struct xbd_softc *sc) bus_print_child_footer(device_get_parent(dev), dev); xbd_instance_create(sc, sectors, sc->xbd_vdevice, binfo, - sector_size); + sector_size, phys_sector_size); } (void)xenbus_set_state(dev, XenbusStateConnected); Modified: stable/10/sys/dev/xen/blkfront/block.h ============================================================================== --- stable/10/sys/dev/xen/blkfront/block.h Tue May 3 07:50:58 2016 (r298959) +++ stable/10/sys/dev/xen/blkfront/block.h Tue May 3 07:52:06 2016 (r298960) @@ -159,10 +159,12 @@ typedef enum { XBDF_READY = 1 << 3, /* Is ready */ XBDF_CM_SHORTAGE = 1 << 4, /* Free cm resource shortage active. */ XBDF_GNT_SHORTAGE = 1 << 5, /* Grant ref resource shortage active */ - XBDF_WAIT_IDLE = 1 << 6 /* + XBDF_WAIT_IDLE = 1 << 6, /* * No new work until oustanding work * completes. */ + XBDF_DISCARD = 1 << 7, /* backend supports discard */ + XBDF_PERSISTENT = 1 << 8 /* backend supports persistent grants */ } xbd_flag_t; /* @@ -200,7 +202,8 @@ struct xbd_softc { }; int xbd_instance_create(struct xbd_softc *, blkif_sector_t sectors, int device, - uint16_t vdisk_info, unsigned long sector_size); + uint16_t vdisk_info, unsigned long sector_size, + unsigned long phys_sector_size); static inline void xbd_added_qentry(struct xbd_softc *sc, xbd_q_index_t index) From owner-svn-src-all@freebsd.org Tue May 3 07:56:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78BFB2BA82; Tue, 3 May 2016 07:56:43 +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 7407B1136; Tue, 3 May 2016 07:56:43 +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 u437ugE1041505; Tue, 3 May 2016 07:56:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437ug6d041504; Tue, 3 May 2016 07:56:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030756.u437ug6d041504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:56:42 +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: r298961 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:56:43 -0000 Author: mav Date: Tue May 3 07:56:42 2016 New Revision: 298961 URL: https://svnweb.freebsd.org/changeset/base/298961 Log: MFC r297741: Reduce code duplication when executing Passthrough IOCB. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:52:06 2016 (r298960) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:56:42 2016 (r298961) @@ -3494,26 +3494,17 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan } static int -isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan) +isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); union { isp_ct_pt_t plocal; - ct_hdr_t clocal; uint8_t q[QENTRY_LEN]; } un; isp_ct_pt_t *pt; - ct_hdr_t *ct; - uint32_t *rp; uint8_t *scp = fcp->isp_scratch; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - /* * Build a Passthrough IOCB in memory. */ @@ -3527,39 +3518,21 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); pt->ctp_time = 10; pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = GIDLEN; - pt->ctp_cmd_bcnt = sizeof (*ct) + sizeof (uint32_t); + pt->ctp_rsp_bcnt = rsp_bcnt; + pt->ctp_cmd_bcnt = cmd_bcnt; pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (*ct) + sizeof (uint32_t); + pt->ctp_dataseg[0].ds_count = cmd_bcnt; pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = GIDLEN; - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "ct IOCB", QENTRY_LEN, pt); - } - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); + pt->ctp_dataseg[1].ds_count = rsp_bcnt; + isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)&scp[CTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, &scp[CTXOFF]); /* - * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. + * Execute the Passthrough IOCB. */ - ct = &un.clocal; - ISP_MEMZERO(ct, sizeof (*ct)); - ct->ct_revision = CT_REVISION; - ct->ct_fcs_type = CT_FC_TYPE_FC; - ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; - ct->ct_cmd_resp = SNS_GID_FT; - ct->ct_bcnt_resid = (GIDLEN - 16) >> 2; - - isp_put_ct_hdr(isp, ct, (ct_hdr_t *) &scp[XTXOFF]); - rp = (uint32_t *) &scp[XTXOFF+sizeof (*ct)]; - ISP_IOZPUT_32(isp, FC4_SCSI, rp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT HDR + payload after put", - sizeof (*ct) + sizeof (uint32_t), &scp[XTXOFF]); - } ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); @@ -3574,18 +3547,58 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, return (-1); } MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, &scp[ZTXOFF]); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d GID_FT CT Passthrough returned 0x%x", chan, pt->ctp_status); return (-1); } + + return (0); +} + +static int +isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t ct; + uint32_t *rp; + uint8_t *scp = fcp->isp_scratch; + + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + * + * Note that the CT header has to end up as Big Endian format in memory. + */ + ISP_MEMZERO(&ct, sizeof (ct)); + ct.ct_revision = CT_REVISION; + ct.ct_fcs_type = CT_FC_TYPE_FC; + ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct.ct_cmd_resp = SNS_GID_FT; + ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *) &scp[XTXOFF]); + rp = (uint32_t *) &scp[XTXOFF + sizeof(ct)]; + ISP_IOZPUT_32(isp, FC4_SCSI, rp); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "CT request", + sizeof(ct) + sizeof(uint32_t), &scp[XTXOFF]); + } + + if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "CT response", GIDLEN, scp); isp_get_gid_ft_response(isp, (sns_gid_ft_rsp_t *)scp, @@ -3957,16 +3970,9 @@ isp_register_fc4_type(ispsoftc_t *isp, i static int isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - rft_id_t clocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; ct_hdr_t *ct; - rft_id_t *rp; + rft_id_t rp; uint8_t *scp = fcp->isp_scratch; if (FC_SCRATCH_ACQUIRE(isp, chan)) { @@ -3975,110 +3981,50 @@ isp_register_fc4_type_24xx(ispsoftc_t *i } /* - * Build a Passthrough IOCB in memory. - */ - ISP_MEMZERO(un.q, QENTRY_LEN); - pt = &un.plocal; - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 4; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); - pt->ctp_cmd_bcnt = sizeof (rft_id_t); - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (rft_id_t); - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t); - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB CT Request", QENTRY_LEN, pt); - } - - /* * Build the CT header and command in memory. * * Note that the CT header has to end up as Big Endian format in memory. */ - ISP_MEMZERO(&un.clocal, sizeof (un.clocal)); - ct = &un.clocal.rftid_hdr; + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rftid_hdr; ct->ct_revision = CT_REVISION; ct->ct_fcs_type = CT_FC_TYPE_FC; ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct->ct_cmd_resp = SNS_RFT_ID; ct->ct_bcnt_resid = (sizeof (rft_id_t) - sizeof (ct_hdr_t)) >> 2; - rp = &un.clocal; - rp->rftid_portid[0] = fcp->isp_portid >> 16; - rp->rftid_portid[1] = fcp->isp_portid >> 8; - rp->rftid_portid[2] = fcp->isp_portid; - rp->rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); - isp_put_rft_id(isp, rp, (rft_id_t *) &scp[XTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT Header", QENTRY_LEN, &scp[XTXOFF]); - } - - ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); + rp.rftid_portid[0] = fcp->isp_portid >> 16; + rp.rftid_portid[1] = fcp->isp_portid >> 8; + rp.rftid_portid[2] = fcp->isp_portid; + rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); + isp_put_rft_id(isp, &rp, (rft_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status) { - FC_SCRATCH_RELEASE(isp, chan); - isp_prt(isp, ISP_LOGWARN, - "Chan %d Register FC4 Type CT Passthrough returned 0x%x", - chan, pt->ctp_status); - return (1); - } isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); FC_SCRATCH_RELEASE(isp, chan); - if (ct->ct_cmd_resp == LS_RJT) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "Chan %d Register FC4 Type rejected", chan); return (-1); } else if (ct->ct_cmd_resp == LS_ACC) { isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Register FC4 Type accepted", chan); - return (0); } else { isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", chan, ct->ct_cmd_resp); return (-1); } + return (0); } static int isp_register_fc4_features_24xx(ispsoftc_t *isp, int chan) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - rff_id_t clocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; ct_hdr_t *ct; - rff_id_t *rp; + rff_id_t rp; uint8_t *scp = fcp->isp_scratch; if (FC_SCRATCH_ACQUIRE(isp, chan)) { @@ -4087,90 +4033,37 @@ isp_register_fc4_features_24xx(ispsoftc_ } /* - * Build a Passthrough IOCB in memory. - */ - ISP_MEMZERO(un.q, QENTRY_LEN); - pt = &un.plocal; - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 4; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); - pt->ctp_cmd_bcnt = sizeof (rff_id_t); - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = sizeof (rff_id_t); - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t); - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB CT Request", QENTRY_LEN, pt); - } - - /* * Build the CT header and command in memory. * * Note that the CT header has to end up as Big Endian format in memory. */ - ISP_MEMZERO(&un.clocal, sizeof (un.clocal)); - ct = &un.clocal.rffid_hdr; + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rffid_hdr; ct->ct_revision = CT_REVISION; ct->ct_fcs_type = CT_FC_TYPE_FC; ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct->ct_cmd_resp = SNS_RFF_ID; ct->ct_bcnt_resid = (sizeof (rff_id_t) - sizeof (ct_hdr_t)) >> 2; - rp = &un.clocal; - rp->rffid_portid[0] = fcp->isp_portid >> 16; - rp->rffid_portid[1] = fcp->isp_portid >> 8; - rp->rffid_portid[2] = fcp->isp_portid; - rp->rffid_fc4features = 0; + rp.rffid_portid[0] = fcp->isp_portid >> 16; + rp.rffid_portid[1] = fcp->isp_portid >> 8; + rp.rffid_portid[2] = fcp->isp_portid; + rp.rffid_fc4features = 0; if (fcp->role & ISP_ROLE_TARGET) - rp->rffid_fc4features |= 1; + rp.rffid_fc4features |= 1; if (fcp->role & ISP_ROLE_INITIATOR) - rp->rffid_fc4features |= 2; - rp->rffid_fc4type = FC4_SCSI; - isp_put_rff_id(isp, rp, (rff_id_t *) &scp[XTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT Header", QENTRY_LEN, &scp[XTXOFF]); - } - - ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); + rp.rffid_fc4features |= 2; + rp.rffid_fc4type = FC4_SCSI; + isp_put_rff_id(isp, &rp, (rff_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); - } - if (pt->ctp_status) { - FC_SCRATCH_RELEASE(isp, chan); - isp_prt(isp, ISP_LOGWARN, - "Chan %d Register FC4 Features CT Passthrough returned 0x%x", - chan, pt->ctp_status); - return (1); - } isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); FC_SCRATCH_RELEASE(isp, chan); - if (ct->ct_cmd_resp == LS_RJT) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "Chan %d Register FC4 Features rejected", chan); @@ -4178,12 +4071,12 @@ isp_register_fc4_features_24xx(ispsoftc_ } else if (ct->ct_cmd_resp == LS_ACC) { isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Register FC4 Features accepted", chan); - return (0); } else { isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Features: 0x%x", chan, ct->ct_cmd_resp); return (-1); } + return (0); } static uint16_t From owner-svn-src-all@freebsd.org Tue May 3 07:57:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5200AB2BAEA; Tue, 3 May 2016 07:57:28 +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 10B341292; Tue, 3 May 2016 07:57:27 +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 u437vRjL041596; Tue, 3 May 2016 07:57:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437vQML041590; Tue, 3 May 2016 07:57:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030757.u437vQML041590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:57: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: r298962 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:57:28 -0000 Author: mav Date: Tue May 3 07:57:26 2016 New Revision: 298962 URL: https://svnweb.freebsd.org/changeset/base/298962 Log: MFC r297751: Register symbolic port/node names in FC name server. This is cosmetics that simplifies identification of new ports on FC switch. It would be good to use target name from CTL here instead of hostname, but it is not passed here through CAM now. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_stds.h stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:57:26 2016 (r298962) @@ -126,6 +126,8 @@ static int isp_send_change_request(ispso static int isp_register_fc4_type(ispsoftc_t *, int); static int isp_register_fc4_type_24xx(ispsoftc_t *, int); static int isp_register_fc4_features_24xx(ispsoftc_t *, int); +static int isp_register_port_name_24xx(ispsoftc_t *, int); +static int isp_register_node_name_24xx(ispsoftc_t *, int); static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static int isp_fw_state(ispsoftc_t *, int); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); @@ -3073,6 +3075,8 @@ isp_fclink_test(ispsoftc_t *isp, int cha r = isp_register_fc4_type_24xx(isp, chan); if (r == 0) isp_register_fc4_features_24xx(isp, chan); + isp_register_port_name_24xx(isp, chan); + isp_register_node_name_24xx(isp, chan); } else { fcp->isp_sns_hdl = SNS_ID; r = isp_register_fc4_type(isp, chan); @@ -3577,8 +3581,6 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&ct, sizeof (ct)); ct.ct_revision = CT_REVISION; @@ -3982,8 +3984,6 @@ isp_register_fc4_type_24xx(ispsoftc_t *i /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&rp, sizeof(rp)); ct = &rp.rftid_hdr; @@ -4034,8 +4034,6 @@ isp_register_fc4_features_24xx(ispsoftc_ /* * Build the CT header and command in memory. - * - * Note that the CT header has to end up as Big Endian format in memory. */ ISP_MEMZERO(&rp, sizeof(rp)); ct = &rp.rffid_hdr; @@ -4079,6 +4077,130 @@ isp_register_fc4_features_24xx(ispsoftc_ return (0); } +static int +isp_register_port_name_24xx(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t *ct; + rspn_id_t rp; + uint8_t *scp = fcp->isp_scratch; + int len; + + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + */ + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rspnid_hdr; + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RSPN_ID; + rp.rspnid_portid[0] = fcp->isp_portid >> 16; + rp.rspnid_portid[1] = fcp->isp_portid >> 8; + rp.rspnid_portid[2] = fcp->isp_portid; + rp.rspnid_length = 0; + len = offsetof(rspn_id_t, rspnid_name); + mtx_lock(&prison0.pr_mtx); + rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); + mtx_unlock(&prison0.pr_mtx); + rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + ":%s", device_get_nameunit(isp->isp_dev)); + if (chan != 0) { + rp.rspnid_length += sprintf(&scp[XTXOFF + len + + rp.rspnid_length], "/%d", chan); + } + len += rp.rspnid_length; + ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; + isp_put_rspn_id(isp, &rp, (rspn_id_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + + if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + + isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); + FC_SCRATCH_RELEASE(isp, chan); + if (ct->ct_cmd_resp == LS_RJT) { + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, + "Chan %d Register Symbolic Port Name rejected", chan); + return (-1); + } else if (ct->ct_cmd_resp == LS_ACC) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Register Symbolic Port Name accepted", chan); + } else { + isp_prt(isp, ISP_LOGWARN, + "Chan %d Register Symbolic Port Name: 0x%x", chan, ct->ct_cmd_resp); + return (-1); + } + return (0); +} + +static int +isp_register_node_name_24xx(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t *ct; + rsnn_nn_t rp; + uint8_t *scp = fcp->isp_scratch; + int len; + + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + + /* + * Build the CT header and command in memory. + */ + ISP_MEMZERO(&rp, sizeof(rp)); + ct = &rp.rsnnnn_hdr; + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RSNN_NN; + MAKE_NODE_NAME_FROM_WWN(rp.rsnnnn_nodename, fcp->isp_wwnn); + rp.rsnnnn_length = 0; + len = offsetof(rsnn_nn_t, rsnnnn_name); + mtx_lock(&prison0.pr_mtx); + rp.rsnnnn_length += sprintf(&scp[XTXOFF + len + rp.rsnnnn_length], + "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); + mtx_unlock(&prison0.pr_mtx); + len += rp.rsnnnn_length; + ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; + isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)&scp[XTXOFF]); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + + if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + + isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); + FC_SCRATCH_RELEASE(isp, chan); + if (ct->ct_cmd_resp == LS_RJT) { + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, + "Chan %d Register Symbolic Node Name rejected", chan); + return (-1); + } else if (ct->ct_cmd_resp == LS_ACC) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Register Symbolic Node Name accepted", chan); + } else { + isp_prt(isp, ISP_LOGWARN, + "Chan %d Register Symbolic Node Name: 0x%x", chan, ct->ct_cmd_resp); + return (-1); + } + return (0); +} + static uint16_t isp_next_handle(ispsoftc_t *isp, uint16_t *ohp) { Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:57:26 2016 (r298962) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 07:57:26 2016 (r298962) @@ -1988,6 +1988,17 @@ isp_put_rft_id(ispsoftc_t *isp, rft_id_t } void +isp_put_rspn_id(ispsoftc_t *isp, rspn_id_t *src, rspn_id_t *dst) +{ +/* int i;*/ + isp_put_ct_hdr(isp, &src->rspnid_hdr, &dst->rspnid_hdr); + ISP_IOZPUT_8(isp, src->rspnid_reserved, &dst->rspnid_reserved); + ISP_IOZPUT_8(isp, src->rspnid_length, &dst->rspnid_length); +/* for (i = 0; i < src->rspnid_length; i++) + ISP_IOZPUT_8(isp, src->rspnid_name[i], &dst->rspnid_name[i]);*/ +} + +void isp_put_rff_id(ispsoftc_t *isp, rff_id_t *src, rff_id_t *dst) { int i; @@ -2002,6 +2013,18 @@ isp_put_rff_id(ispsoftc_t *isp, rff_id_t } void +isp_put_rsnn_nn(ispsoftc_t *isp, rsnn_nn_t *src, rsnn_nn_t *dst) +{ + int i; + isp_put_ct_hdr(isp, &src->rsnnnn_hdr, &dst->rsnnnn_hdr); + for (i = 0; i < 8; i++) + ISP_IOZPUT_8(isp, src->rsnnnn_nodename[i], &dst->rsnnnn_nodename[i]); + ISP_IOZPUT_8(isp, src->rsnnnn_length, &dst->rsnnnn_length); +/* for (i = 0; i < src->rsnnnn_length; i++) + ISP_IOZPUT_8(isp, src->rsnnnn_name[i], &dst->rsnnnn_name[i]);*/ +} + +void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) { ISP_IOZGET_8(isp, &src->ct_revision, dst->ct_revision); Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_library.h Tue May 3 07:57:26 2016 (r298962) @@ -144,7 +144,9 @@ void isp_get_fc_hdr(ispsoftc_t *, fc_hdr void isp_put_fc_hdr(ispsoftc_t *, fc_hdr_t *, fc_hdr_t *); void isp_get_fcp_cmnd_iu(ispsoftc_t *, fcp_cmnd_iu_t *, fcp_cmnd_iu_t *); void isp_put_rft_id(ispsoftc_t *, rft_id_t *, rft_id_t *); +void isp_put_rspn_id(ispsoftc_t *, rspn_id_t *, rspn_id_t *); void isp_put_rff_id(ispsoftc_t *, rff_id_t *, rff_id_t *); +void isp_put_rsnn_nn(ispsoftc_t *, rsnn_nn_t *, rsnn_nn_t *); void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_fcp_rsp_iu(ispsoftc_t *isp, fcp_rsp_iu_t *, fcp_rsp_iu_t *); Modified: stable/10/sys/dev/isp/isp_stds.h ============================================================================== --- stable/10/sys/dev/isp/isp_stds.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/isp_stds.h Tue May 3 07:57:26 2016 (r298962) @@ -139,6 +139,19 @@ typedef struct { } rft_id_t; /* + * RSPN_ID Requet CT_IU + * + * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.32 + */ +typedef struct { + ct_hdr_t rspnid_hdr; + uint8_t rspnid_reserved; + uint8_t rspnid_portid[3]; + uint8_t rspnid_length; + uint8_t rspnid_name[0]; +} rspn_id_t; + +/* * RFF_ID Requet CT_IU * * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.34 @@ -153,6 +166,18 @@ typedef struct { } rff_id_t; /* + * RSNN_NN Requet CT_IU + * + * Source: INCITS 463-2010 Generic Services 6 Section 5.2.5.35 + */ +typedef struct { + ct_hdr_t rsnnnn_hdr; + uint8_t rsnnnn_nodename[8]; + uint8_t rsnnnn_length; + uint8_t rsnnnn_name[0]; +} rsnn_nn_t; + +/* * FCP Response IU and bits of interest * Source: NCITS T10, Project 1828D, Revision 02b (aka FCP4r02b) */ Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Tue May 3 07:56:42 2016 (r298961) +++ stable/10/sys/dev/isp/ispmbox.h Tue May 3 07:57:26 2016 (r298962) @@ -1548,7 +1548,9 @@ typedef struct { #define SNS_GFF_ID 0x11F #define SNS_GID_FT 0x171 #define SNS_RFT_ID 0x217 +#define SNS_RSPN_ID 0x218 #define SNS_RFF_ID 0x21F +#define SNS_RSNN_NN 0x239 typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ uint16_t snscb_reserved0; From owner-svn-src-all@freebsd.org Tue May 3 07:58:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA96B2BB55; Tue, 3 May 2016 07:58:12 +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 386F213E5; Tue, 3 May 2016 07:58:12 +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 u437wBDK041690; Tue, 3 May 2016 07:58:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437wBBt041688; Tue, 3 May 2016 07:58:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030758.u437wBBt041688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:58: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: r298963 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:58:12 -0000 Author: mav Date: Tue May 3 07:58:11 2016 New Revision: 298963 URL: https://svnweb.freebsd.org/changeset/base/298963 Log: MFC r297817: Polish debugging IOCB dumping. Add few more missing cases, unify byte order. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:57:26 2016 (r298962) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:58:11 2016 (r298963) @@ -1972,10 +1972,12 @@ isp_fibre_init(ispsoftc_t *isp) } isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init", + sizeof(*icbp), fcp->isp_scratch); + } /* * Init the firmware @@ -2240,16 +2242,16 @@ isp_fibre_init_2400(ispsoftc_t *isp) DMA_WD1(isp->isp_rquest_dma), DMA_WD0(isp->isp_rquest_dma), DMA_WD3(isp->isp_result_dma), DMA_WD2(isp->isp_result_dma), DMA_WD1(isp->isp_result_dma), DMA_WD0(isp->isp_result_dma)); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "isp_fibre_init_2400", sizeof (*icbp), icbp); - } - if (FC_SCRATCH_ACQUIRE(isp, 0)) { isp_prt(isp, ISP_LOGERR, sacq); return; } ISP_MEMZERO(fcp->isp_scratch, ISP_FC_SCRLEN); isp_put_icb_2400(isp, icbp, fcp->isp_scratch); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "isp_fibre_init_2400", + sizeof (*icbp), fcp->isp_scratch); + } /* * Now fill in information about any additional channels @@ -2395,6 +2397,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch return (EIO); } isp_put_vp_modify(isp, &vp, (vp_modify_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2402,6 +2406,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch isp_destroy_handle(isp, vp.vp_mod_hdl); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_MODIFY response", QENTRY_LEN, resp); isp_get_vp_modify(isp, (vp_modify_t *)resp, &vp); if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) { @@ -2452,6 +2458,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c return (EIO); } isp_put_vp_ctrl_info(isp, &vp, (vp_ctrl_info_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "VP_CTRL", 5*hz) == EWOULDBLOCK) { isp_prt(isp, ISP_LOGERR, @@ -2459,6 +2467,8 @@ isp_fc_disable_vp(ispsoftc_t *isp, int c isp_destroy_handle(isp, vp.vp_ctrl_handle); return (EIO); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB VP_CTRL response", QENTRY_LEN, resp); isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)resp, &vp); if (vp.vp_ctrl_hdr.rqs_flags != 0 || vp.vp_ctrl_status != 0) { @@ -2602,9 +2612,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, &pl); isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2613,9 +2623,9 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } - isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, &pl); + isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); + isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); if (pl.plogx_status == PLOGX_STATUS_OK) { return (0); @@ -5155,15 +5165,14 @@ again: * Synchronize our view of this response queue entry. */ MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_qentry(isp, "Response Queue Entry", oop, hp); isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; if (IS_24XX(isp) && etype == RQSTYPE_RESPONSE) { isp24xx_statusreq_t *sp2 = (isp24xx_statusreq_t *)qe; isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp2); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp2); - } scsi_status = sp2->req_scsi_status; completion_status = sp2->req_completion_status; if ((scsi_status & 0xff) != 0) @@ -5173,9 +5182,6 @@ again: resid = sp2->req_resid; } else if (etype == RQSTYPE_RESPONSE) { isp_get_response(isp, (ispstatusreq_t *) hp, sp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp); - } scsi_status = sp->req_scsi_status; completion_status = sp->req_completion_status; req_status_flags = sp->req_status_flags; @@ -5184,9 +5190,6 @@ again: } else if (etype == RQSTYPE_RIO1) { isp_rio1_t *rio = (isp_rio1_t *) qe; isp_get_rio1(isp, (isp_rio1_t *) hp, rio); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, rio); - } for (i = 0; i < rio->req_header.rqs_seqno; i++) { isp_fastpost_complete(isp, rio->req_handles[i]); } @@ -5250,7 +5253,6 @@ again: */ if (etype != RQSTYPE_REQUEST) { isp_prt(isp, ISP_LOGERR, notresp, etype, oop, optr, nlooked); - isp_print_bytes(isp, "Request Queue Entry", QENTRY_LEN, sp); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5265,7 +5267,8 @@ again: if (sp->req_header.rqs_flags & RQSFLAG_MASK) { if (sp->req_header.rqs_flags & RQSFLAG_CONTINUATION) { - isp_print_bytes(isp, "unexpected continuation segment", QENTRY_LEN, sp); + isp_print_qentry(isp, "unexpected continuation segment", + oop, hp); last_etype = etype; continue; } @@ -5276,19 +5279,23 @@ again: */ } if (sp->req_header.rqs_flags & RQSFLAG_BADHEADER) { - isp_print_bytes(isp, "bad header flag", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad header flag", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADPACKET) { - isp_print_bytes(isp, "bad request packet", QENTRY_LEN, sp); + isp_print_qentry(isp, "bad request packet", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADCOUNT) { - isp_print_bytes(isp, "invalid entry count", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid entry count", + oop, hp); buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { - isp_print_bytes(isp, "invalid IOCB ordering", QENTRY_LEN, sp); + isp_print_qentry(isp, "invalid IOCB ordering", + oop, hp); last_etype = etype; continue; } @@ -5446,7 +5453,8 @@ again: XS_SAVE_SENSE(xs, snsp, totslen, slen); } else if ((req_status_flags & RQSF_GOT_STATUS) && (scsi_status & 0xff) == SCSI_CHECK && IS_FC(isp)) { isp_prt(isp, ISP_LOGWARN, "CHECK CONDITION w/o sense data for CDB=0x%x", XS_CDBP(xs)[0] & 0xff); - isp_print_bytes(isp, "CC with no Sense", QENTRY_LEN, qe); + isp_print_qentry(isp, "CC with no Sense", + oop, hp); } isp_prt(isp, ISP_LOGDEBUG2, "asked for %ld got raw resid %ld settled for %ld", (long) XS_XFRLEN(xs), resid, (long) XS_GET_RESID(xs)); break; @@ -5472,7 +5480,8 @@ again: XS_SET_RESID(xs, XS_XFRLEN(xs)); break; default: - isp_print_bytes(isp, "Unhandled Response Type", QENTRY_LEN, qe); + isp_print_qentry(isp, "Unhandled Response Type", + oop, hp); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_BOTCH); } Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 07:57:26 2016 (r298962) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 07:58:11 2016 (r298963) @@ -180,7 +180,8 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -241,7 +242,7 @@ copy_and_sync: return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); @@ -2193,7 +2194,8 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * isp_put_cont_req(isp, (ispcontreq_t *)storage, qe1); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, storage); + isp_print_bytes(isp, "additional queue entry", + QENTRY_LEN, qe1); } nqe++; } @@ -2230,7 +2232,7 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * return (CMD_COMPLETE); } if (isp->isp_dblev & ISP_LOGTDEBUG1) { - isp_print_bytes(isp, "first queue entry", QENTRY_LEN, fqe); + isp_print_bytes(isp, "first queue entry", QENTRY_LEN, qe0); } ISP_ADD_REQUEST(isp, nxt); return (CMD_QUEUED); From owner-svn-src-all@freebsd.org Tue May 3 07:58:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A283B2BBAC; Tue, 3 May 2016 07:58:52 +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 52EC616C0; Tue, 3 May 2016 07:58:52 +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 u437wpSY041772; Tue, 3 May 2016 07:58:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437wpE9041771; Tue, 3 May 2016 07:58:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030758.u437wpE9041771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:58: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: r298964 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:58:52 -0000 Author: mav Date: Tue May 3 07:58:51 2016 New Revision: 298964 URL: https://svnweb.freebsd.org/changeset/base/298964 Log: MFC r297854: Add couple missing memory barriers. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:58:11 2016 (r298963) +++ stable/10/sys/dev/isp/isp.c Tue May 3 07:58:51 2016 (r298964) @@ -2802,12 +2802,13 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGERR, sacq); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); pdb->handle = un.bill.pdb_handle; @@ -2875,6 +2876,7 @@ isp_gethandles(ispsoftc_t *isp, int chan FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); elp1 = fcp->isp_scratch; elp3 = fcp->isp_scratch; elp4 = fcp->isp_scratch; From owner-svn-src-all@freebsd.org Tue May 3 07:59:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C49BBB2BC33; Tue, 3 May 2016 07:59:43 +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 83D4D184D; Tue, 3 May 2016 07:59:43 +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 u437xgPf041862; Tue, 3 May 2016 07:59:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u437xg9m041861; Tue, 3 May 2016 07:59:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030759.u437xg9m041861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 07:59:42 +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: r298965 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 07:59:43 -0000 Author: mav Date: Tue May 3 07:59:42 2016 New Revision: 298965 URL: https://svnweb.freebsd.org/changeset/base/298965 Log: MFC r297856: Reimplement ISP_TSK_MGMT IOCTL via asynchronous request. I am not sure this code is not completely dead, but it used DMA scratch are without good reason and asked to be refactored. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue May 3 07:58:51 2016 (r298964) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue May 3 07:59:42 2016 (r298965) @@ -607,9 +607,10 @@ ispioctl(struct cdev *dev, u_long c, cad nphdl = fct->loopid; ISP_LOCK(isp); if (IS_24XX(isp)) { - uint8_t local[QENTRY_LEN]; - isp24xx_tmf_t *tmf; - isp24xx_statusreq_t *sp; + void *reqp; + uint8_t resp[QENTRY_LEN]; + isp24xx_tmf_t tmf; + isp24xx_statusreq_t sp; fcparam *fcp = FCPARAM(isp, chan); fcportdb_t *lp; int i; @@ -625,39 +626,37 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - /* XXX VALIDATE LP XXX */ - tmf = (isp24xx_tmf_t *) local; - ISP_MEMZERO(tmf, QENTRY_LEN); - tmf->tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; - tmf->tmf_header.rqs_entry_count = 1; - tmf->tmf_nphdl = lp->handle; - tmf->tmf_delay = 2; - tmf->tmf_timeout = 4; - tmf->tmf_tidlo = lp->portid; - tmf->tmf_tidhi = lp->portid >> 16; - tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); - tmf->tmf_lun[1] = fct->lun & 0xff; + ISP_MEMZERO(&tmf, sizeof(tmf)); + tmf.tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT; + tmf.tmf_header.rqs_entry_count = 1; + tmf.tmf_nphdl = lp->handle; + tmf.tmf_delay = 2; + tmf.tmf_timeout = 4; + tmf.tmf_tidlo = lp->portid; + tmf.tmf_tidhi = lp->portid >> 16; + tmf.tmf_vpidx = ISP_GET_VPIDX(isp, chan); + tmf.tmf_lun[1] = fct->lun & 0xff; if (fct->lun >= 256) { - tmf->tmf_lun[0] = 0x40 | (fct->lun >> 8); + tmf.tmf_lun[0] = 0x40 | (fct->lun >> 8); } switch (fct->action) { case IPT_CLEAR_ACA: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_ACA; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_ACA; break; case IPT_TARGET_RESET: - tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET; + tmf.tmf_flags = ISP24XX_TMF_TARGET_RESET; needmarker = 1; break; case IPT_LUN_RESET: - tmf->tmf_flags = ISP24XX_TMF_LUN_RESET; + tmf.tmf_flags = ISP24XX_TMF_LUN_RESET; needmarker = 1; break; case IPT_CLEAR_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET; needmarker = 1; break; case IPT_ABORT_TASK_SET: - tmf->tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; + tmf.tmf_flags = ISP24XX_TMF_ABORT_TASK_SET; needmarker = 1; break; default: @@ -668,36 +667,52 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + tmf.tmf_handle = isp_allocate_handle(isp, resp, + ISP_HANDLE_CTRL); + if (tmf.tmf_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of handles", + __func__, chan); ISP_UNLOCK(isp); retval = ENOMEM; break; } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - sp = (isp24xx_statusreq_t *) local; - sp->req_completion_status = 1; - retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); - if (retval || sp->req_completion_status != 0) { - FC_SCRATCH_RELEASE(isp, chan); + + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d out of rqent", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); retval = EIO; + break; } - if (retval == 0) { - if (needmarker) { - fcp->sendmarker = 1; - } + isp_put_24xx_tmf(isp, &tmf, (isp24xx_tmf_t *)reqp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "TMF", 5*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: TMF of Chan %d timed out", + __func__, chan); + isp_destroy_handle(isp, tmf.tmf_handle); + ISP_UNLOCK(isp); + retval = EIO; + break; } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB TMF response", QENTRY_LEN, resp); + isp_get_24xx_response(isp, (isp24xx_statusreq_t *)resp, &sp); + + if (sp.req_completion_status != 0) + retval = EIO; + else if (needmarker) + fcp->sendmarker = 1; } else { MBSINIT(&mbs, 0, MBLOGALL, 0); if (ISP_CAP_2KLOGIN(isp) == 0) { From owner-svn-src-all@freebsd.org Tue May 3 08:00:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA34FB2BFBC; Tue, 3 May 2016 08:00:55 +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 B2A181A61; Tue, 3 May 2016 08:00:55 +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 u4380sis042626; Tue, 3 May 2016 08:00:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4380sDg042622; Tue, 3 May 2016 08:00:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030800.u4380sDg042622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:00: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: r298966 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:00:56 -0000 Author: mav Date: Tue May 3 08:00:54 2016 New Revision: 298966 URL: https://svnweb.freebsd.org/changeset/base/298966 Log: MFC r297858: Allocate separate DMA area for synchronous IOCB execution. Usually IOCBs should be put on queue for asynchronous processing and should not require additional DMA memory. But there are some cases like aborts and resets that for external reasons has to be synchronous. Give those cases separate 2*64 byte DMA area to decouple them from other DMA scratch area users, using it for asynchronous requests. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:00:54 2016 (r298966) @@ -4667,31 +4667,25 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_tmf(isp, tmf, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan); + fcp->sendmarker = 1; + isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - fcp->sendmarker = 1; + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); - FC_SCRATCH_RELEASE(isp, chan); + isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], sp); if (sp->req_completion_status == 0) { return (0); } @@ -4731,7 +4725,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } if (IS_24XX(isp)) { - isp24xx_abrt_t local, *ab = &local, *ab2; + isp24xx_abrt_t local, *ab = &local; fcparam *fcp; fcportdb_t *lp; @@ -4755,31 +4749,23 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab->abrt_tidlo = lp->portid; ab->abrt_tidhi = lp->portid >> 16; ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan); + isp_put_24xx_abrt(isp, ab, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, chan); ISP_MEMZERO(&mbs, sizeof (mbs)); MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - break; - } - isp_put_24xx_abrt(isp, ab, fcp->isp_scratch); - ab2 = (isp24xx_abrt_t *) &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; - ab2->abrt_nphdl = 0xdeaf; - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) break; - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_24xx_abrt(isp, ab2, ab); - FC_SCRATCH_RELEASE(isp, chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_24xx_abrt(isp, &((isp24xx_abrt_t *)isp->isp_iocb)[1], ab); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { return (0); } Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue May 3 08:00:54 2016 (r298966) @@ -293,10 +293,12 @@ struct isposinfo { bus_dma_tag_t reqdmat; bus_dma_tag_t respdmat; bus_dma_tag_t atiodmat; + bus_dma_tag_t iocbdmat; bus_dma_tag_t scdmat; bus_dmamap_t reqmap; bus_dmamap_t respmap; bus_dmamap_t atiomap; + bus_dmamap_t iocbmap; /* * Command and transaction related related stuff @@ -441,6 +443,14 @@ case SYNC_ATIOQ: \ bus_dmamap_sync(isp->isp_osinfo.atiodmat, \ isp->isp_osinfo.atiomap, BUS_DMASYNC_POSTREAD); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } @@ -469,6 +479,14 @@ case SYNC_REG: \ bus_barrier(isp->isp_osinfo.regs, offset, size, \ BUS_SPACE_BARRIER_WRITE); \ break; \ +case SYNC_IFORDEV: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_IFORCPU: \ + bus_dmamap_sync(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, \ + BUS_DMASYNC_POSTWRITE); \ + break; \ default: \ break; \ } Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/isp_pci.c Tue May 3 08:00:54 2016 (r298966) @@ -1730,9 +1730,23 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (IS_FC(isp)) { if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) { + 2*QENTRY_LEN, 1, 2*QENTRY_LEN, 0, &isp->isp_osinfo.iocbdmat)) { goto bad; } + if (bus_dmamem_alloc(isp->isp_osinfo.iocbdmat, + (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.iocbmap) != 0) + goto bad; + isp->isp_iocb = base; + im.error = 0; + if (bus_dmamap_load(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap, + base, 2*QENTRY_LEN, imc, &im, 0) || im.error) + goto bad; + isp->isp_iocb_dma = im.maddr; + + if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) + goto bad; for (cmap = 0; cmap < isp->isp_nchan; cmap++) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); if (bus_dmamem_alloc(isp->isp_osinfo.scdmat, @@ -1791,7 +1805,8 @@ bad: while (--cmap >= 0) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); bus_dmamap_unload(isp->isp_osinfo.scdmat, fc->scmap); - bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + bus_dmamem_free(isp->isp_osinfo.scdmat, + FCPARAM(isp, cmap)->isp_scratch, fc->scmap); while (fc->nexus_free_list) { struct isp_nexus *n = fc->nexus_free_list; fc->nexus_free_list = n->next; @@ -1799,6 +1814,10 @@ bad: } } bus_dma_tag_destroy(isp->isp_osinfo.scdmat); + bus_dmamap_unload(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap); + bus_dmamem_free(isp->isp_osinfo.iocbdmat, isp->isp_iocb, + isp->isp_osinfo.iocbmap); + bus_dma_tag_destroy(isp->isp_osinfo.iocbdmat); } bad1: if (isp->isp_rquest_dma != 0) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 07:59:42 2016 (r298965) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:00:54 2016 (r298966) @@ -130,6 +130,8 @@ struct ispmdvec { #define SYNC_SFORCPU 3 /* scratch, sync for CPU */ #define SYNC_REG 4 /* for registers */ #define SYNC_ATIOQ 5 /* atio result queue (24xx) */ +#define SYNC_IFORDEV 6 /* synchrounous IOCB, sync for ISP */ +#define SYNC_IFORCPU 7 /* synchrounous IOCB, sync for CPU */ /* * Request/Response Queue defines and macros. @@ -596,6 +598,12 @@ struct ispsoftc { isp_hdl_t *isp_xffree; /* + * DMA mapped in area for synchronous IOCB requests. + */ + void * isp_iocb; + XS_DMA_ADDR_T isp_iocb_dma; + + /* * request/result queue pointers and DMA handles for them. */ void * isp_rquest; From owner-svn-src-all@freebsd.org Tue May 3 08:02:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913DEB29041; Tue, 3 May 2016 08:02:01 +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 515721CD9; Tue, 3 May 2016 08:02:01 +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 u43820sh044690; Tue, 3 May 2016 08:02:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43820nO044689; Tue, 3 May 2016 08:02:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030802.u43820nO044689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:02: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: r298967 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:02:01 -0000 Author: mav Date: Tue May 3 08:02:00 2016 New Revision: 298967 URL: https://svnweb.freebsd.org/changeset/base/298967 Log: MFC r297859: Switch isp_getpdb() to synchronous IOCB DMA area. While technically it is not IOCB, it is synchronous and can be called from different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:00:54 2016 (r298966) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:02:00 2016 (r298967) @@ -2776,7 +2776,6 @@ isp_port_logout(ispsoftc_t *isp, uint16_ static int isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb) { - fcparam *fcp = FCPARAM(isp, chan); mbreg_t mbs; union { isp_pdb_21xx_t fred; @@ -2794,23 +2793,19 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui } else { mbs.param[1] = id << 8; } - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan); + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, sizeof(un), chan); + isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return (mbs.param[0] | (mbs.param[1] << 16)); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan); + + MEMORYBARRIER(isp, SYNC_IFORCPU, 0, sizeof(un), chan); if (IS_24XX(isp)) { - isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); + isp_get_pdb_24xx(isp, isp->isp_iocb, &un.bill); pdb->handle = un.bill.pdb_handle; pdb->prli_word3 = un.bill.pdb_prli_svc3; pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits); @@ -2822,11 +2817,10 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui un.bill.pdb_curstate); if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) { mbs.param[0] = MBOX_NOT_LOGGED_IN; - FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0]); } } else { - isp_get_pdb_21xx(isp, fcp->isp_scratch, &un.fred); + isp_get_pdb_21xx(isp, isp->isp_iocb, &un.fred); pdb->handle = un.fred.pdb_loopid; pdb->prli_word3 = un.fred.pdb_prli_svc3; pdb->portid = BITS2WORD(un.fred.pdb_portid_bits); @@ -2835,7 +2829,6 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_prt(isp, ISP_LOGDEBUG1, "Chan %d handle 0x%x Port 0x%06x", chan, id, pdb->portid); } - FC_SCRATCH_RELEASE(isp, chan); return (0); } From owner-svn-src-all@freebsd.org Tue May 3 08:03:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98BB7B29127; Tue, 3 May 2016 08:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E531F96; Tue, 3 May 2016 08:03:08 +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 u438371A044783; Tue, 3 May 2016 08:03:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43837Md044782; Tue, 3 May 2016 08:03:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030803.u43837Md044782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:03: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: r298968 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:03:08 -0000 Author: mav Date: Tue May 3 08:03:07 2016 New Revision: 298968 URL: https://svnweb.freebsd.org/changeset/base/298968 Log: MFC r297867: Make all CT Pass-Through (name server requests) asynchronous. Previously we had to do it synchronously because we could not drop the lock due to potential scratch memory use conflicts. Previous commits fixed that collision, so here it goes -- slower and less reliable external requests are executed asynchronously without spinning in tight loop and with more safe timeout handling. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:02:00 2016 (r298967) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:03:07 2016 (r298968) @@ -3078,20 +3078,31 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_fabric_params = mbs.param[7]; fcp->isp_sns_hdl = NPH_SNS_ID; r = isp_register_fc4_type_24xx(isp, chan); - if (r == 0) - isp_register_fc4_features_24xx(isp, chan); - isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_fc4_features_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; + r = isp_register_port_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; + if (r != 0) + goto not_on_fabric; isp_register_node_name_24xx(isp, chan); + if (fcp->isp_loopstate < LOOP_TESTING_LINK) + goto abort; } else { fcp->isp_sns_hdl = SNS_ID; r = isp_register_fc4_type(isp, chan); - if (r == 0 && fcp->role == ISP_ROLE_TARGET) + if (r != 0) + goto not_on_fabric; + if (fcp->role == ISP_ROLE_TARGET) isp_send_change_request(isp, chan); } - if (r) { - isp_prt(isp, ISP_LOGWARN|ISP_LOG_SANCFG, "%s: register fc4 type failed", __func__); - return (-1); - } } not_on_fabric: @@ -3505,65 +3516,66 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan static int isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { - mbreg_t mbs; fcparam *fcp = FCPARAM(isp, chan); - union { - isp_ct_pt_t plocal; - uint8_t q[QENTRY_LEN]; - } un; - isp_ct_pt_t *pt; - uint8_t *scp = fcp->isp_scratch; + isp_ct_pt_t pt; + void *reqp; + uint8_t resp[QENTRY_LEN]; /* * Build a Passthrough IOCB in memory. */ - pt = &un.plocal; - ISP_MEMZERO(un.q, QENTRY_LEN); - pt->ctp_header.rqs_entry_count = 1; - pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; - pt->ctp_handle = 0xffffffff; - pt->ctp_nphdl = fcp->isp_sns_hdl; - pt->ctp_cmd_cnt = 1; - pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 10; - pt->ctp_rsp_cnt = 1; - pt->ctp_rsp_bcnt = rsp_bcnt; - pt->ctp_cmd_bcnt = cmd_bcnt; - pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); - pt->ctp_dataseg[0].ds_count = cmd_bcnt; - pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); - pt->ctp_dataseg[1].ds_count = rsp_bcnt; - isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)&scp[CTXOFF]); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, &scp[CTXOFF]); + ISP_MEMZERO(&pt, sizeof(pt)); + pt.ctp_header.rqs_entry_count = 1; + pt.ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; + pt.ctp_nphdl = fcp->isp_sns_hdl; + pt.ctp_cmd_cnt = 1; + pt.ctp_vpidx = ISP_GET_VPIDX(isp, chan); + pt.ctp_time = 10; + pt.ctp_rsp_cnt = 1; + pt.ctp_rsp_bcnt = rsp_bcnt; + pt.ctp_cmd_bcnt = cmd_bcnt; + pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_count = cmd_bcnt; + pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); + pt.ctp_dataseg[1].ds_count = rsp_bcnt; + + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + pt.ctp_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (pt.ctp_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of handles", __func__, chan); + return (-1); + } - /* - * Execute the Passthrough IOCB. - */ - ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); + isp_put_ct_pt(isp, &pt, (isp_ct_pt_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, &scp[ZTXOFF]); - pt = &un.plocal; - isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); - if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { + isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "CTP", pt.ctp_time*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: CTP of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, pt.ctp_handle); + return (-1); + } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, resp); + + isp_get_ct_pt(isp, (isp_ct_pt_t *)resp, &pt); + if (pt.ctp_status && pt.ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d GID_FT CT Passthrough returned 0x%x", - chan, pt->ctp_status); + chan, pt.ctp_status); return (-1); } @@ -3931,7 +3943,13 @@ isp_send_change_request(ispsoftc_t *isp, mbs.param[1] = 0x03; mbs.param[9] = chan; isp_mboxcmd(isp, &mbs); - return (mbs.param[0] == MBOX_COMMAND_COMPLETE ? 0 : -1); + if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { + return (0); + } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Send Change Request: 0x%x", + chan, mbs.param[0]); + return (-1); + } } static int @@ -3970,6 +3988,8 @@ isp_register_fc4_type(ispsoftc_t *isp, i if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { return (0); } else { + isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", + chan, mbs.param[0]); return (-1); } } @@ -6140,6 +6160,7 @@ isp_handle_other_response(ispsoftc_t *is } } return (1); + case RQSTYPE_CT_PASSTHRU: case RQSTYPE_VP_MODIFY: case RQSTYPE_VP_CTRL: case RQSTYPE_LOGIN: From owner-svn-src-all@freebsd.org Tue May 3 08:03:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9851CB291F2; Tue, 3 May 2016 08:03:52 +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 5758B116E; Tue, 3 May 2016 08:03:52 +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 u4383pS3044884; Tue, 3 May 2016 08:03:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4383pG8044882; Tue, 3 May 2016 08:03:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030803.u4383pG8044882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:03: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: r298969 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:03:52 -0000 Author: mav Date: Tue May 3 08:03:51 2016 New Revision: 298969 URL: https://svnweb.freebsd.org/changeset/base/298969 Log: MFC r297912: Respect NVRAM topology settings on 24xx and above chips. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) @@ -1822,22 +1822,24 @@ isp_fibre_init(ispsoftc_t *isp) * Prefer or force Point-To-Point instead Loop? */ switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT: + case ISP_CFG_LPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; break; case ISP_CFG_NPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_PTP_ONLY; break; - case ISP_CFG_LPORT_ONLY: + case ISP_CFG_LPORT: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP; + break; + case ISP_CFG_NPORT: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; + icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; break; default: - /* - * Let NVRAM settings define it if they are sane - */ + /* Let NVRAM settings define it if they are sane */ switch (icbp->icb_xfwoptions & ICBXOPT_TOPO_MASK) { case ICBXOPT_PTP_2_LOOP: case ICBXOPT_PTP_ONLY: @@ -2109,19 +2111,32 @@ isp_fibre_init_2400(ispsoftc_t *isp) } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT_ONLY: - icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; - icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; - break; case ISP_CFG_LPORT_ONLY: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_ONLY; break; - default: + case ISP_CFG_NPORT_ONLY: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; + break; + case ISP_CFG_NPORT: /* ISP_CFG_PTP_2_LOOP not available in 24XX/25XX */ + case ISP_CFG_LPORT: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; break; + default: + /* Let NVRAM settings define it if they are sane */ + switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TOPO_MASK) { + case ICB2400_OPT2_LOOP_ONLY: + case ICB2400_OPT2_PTP_ONLY: + case ICB2400_OPT2_LOOP_2_PTP: + break; + default: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; + } + break; } switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TIMER_MASK) { @@ -7807,23 +7822,23 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; - } fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; + fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP; fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO; } else { fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; - } /* * Make sure this is turned off now until we get * extended options from NVRAM */ fcp->isp_fwoptions &= ~ICBOPT_EXTENDED; + fcp->isp_xfwoptions |= ICBXOPT_LOOP_2_PTP; fcp->isp_zfwoptions |= ICBZOPT_RATE_AUTO; } Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) @@ -645,11 +645,12 @@ struct ispsoftc { * ISP Runtime Configuration Options */ #define ISP_CFG_FULL_DUPLEX 0x01 /* Full Duplex (Fibre Channel only) */ -#define ISP_CFG_PORT_PREF 0x0c /* Mask for Port Prefs (all FC except 2100) */ -#define ISP_CFG_LPORT 0x00 /* prefer {N/F}L-Port connection */ -#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ -#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ -#define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */ +#define ISP_CFG_PORT_PREF 0x0e /* Mask for Port Prefs (all FC except 2100) */ +#define ISP_CFG_PORT_DEF 0x00 /* prefer connection type from NVRAM */ +#define ISP_CFG_LPORT_ONLY 0x02 /* insist on {N/F}L-Port connection */ +#define ISP_CFG_NPORT_ONLY 0x04 /* insist on {N/F}-Port connection */ +#define ISP_CFG_LPORT 0x06 /* prefer {N/F}L-Port connection */ +#define ISP_CFG_NPORT 0x08 /* prefer {N/F}-Port connection */ #define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */ #define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ From owner-svn-src-all@freebsd.org Tue May 3 08:04:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733DFB292C7; Tue, 3 May 2016 08:04:35 +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 34CA312E1; Tue, 3 May 2016 08:04:35 +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 u4384Y4c044979; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4384YHt044977; Tue, 3 May 2016 08:04:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030804.u4384YHt044977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:04: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: r298970 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:04:35 -0000 Author: mav Date: Tue May 3 08:04:34 2016 New Revision: 298970 URL: https://svnweb.freebsd.org/changeset/base/298970 Log: MFC r297915: Filter Port Database Changed notifications. For some reason firmware sends Port Database Changed notifications in case of explicit login requests from the driver when target port is unavailabe. Those notifications don't give driver any new information, but only cause infinite scan loop. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:04:34 2016 (r298970) @@ -2630,6 +2630,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); + FCPARAM(isp, chan)->isp_login_hdl = handle; ISP_SYNC_REQUEST(isp); if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) == EWOULDBLOCK) { @@ -2638,6 +2639,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin isp_destroy_handle(isp, pl.plogx_handle); return (-1); } + FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE; if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); @@ -6000,9 +6002,13 @@ isp_parse_async_fc(ispsoftc_t *isp, uint fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) continue; - if (fcp->isp_loopstate > LOOP_LTEST_DONE) + if (fcp->isp_loopstate > LOOP_LTEST_DONE) { + if (nphdl != NIL_HANDLE && + nphdl == fcp->isp_login_hdl && + reason == PDB24XX_AE_OPN_2) + continue; fcp->isp_loopstate = LOOP_LTEST_DONE; - else if (fcp->isp_loopstate < LOOP_HAVE_LINK) + } else if (fcp->isp_loopstate < LOOP_HAVE_LINK) fcp->isp_loopstate = LOOP_HAVE_LINK; isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); @@ -7818,6 +7824,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_xfwoptions = 0; fcp->isp_zfwoptions = 0; fcp->isp_lasthdl = NIL_HANDLE; + fcp->isp_login_hdl = NIL_HANDLE; if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:04:34 2016 (r298970) @@ -449,6 +449,7 @@ typedef struct { uint16_t isp_lasthdl; /* only valid for channel 0 */ uint16_t isp_maxalloc; uint16_t isp_fabric_params; + uint16_t isp_login_hdl; /* Logging in handle */ uint8_t isp_retry_delay; uint8_t isp_retry_count; From owner-svn-src-all@freebsd.org Tue May 3 08:05:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50E15B293C1; Tue, 3 May 2016 08:05:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21FFC1489; Tue, 3 May 2016 08:05:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4385E2R045068; Tue, 3 May 2016 08:05:14 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4385Evk045067; Tue, 3 May 2016 08:05:14 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605030805.u4385Evk045067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 3 May 2016 08:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298971 - head/sys/i386/include/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:05:15 -0000 Author: royger Date: Tue May 3 08:05:14 2016 New Revision: 298971 URL: https://svnweb.freebsd.org/changeset/base/298971 Log: xen/i386: enable the platform hypercall for i386 Not sure why the platform hypercall was disabled on i386, just enable it in order to fix compilation of the PV timer on i386. Sponsored by: Citrix Systems R&D Modified: head/sys/i386/include/xen/hypercall.h Modified: head/sys/i386/include/xen/hypercall.h ============================================================================== --- head/sys/i386/include/xen/hypercall.h Tue May 3 08:04:34 2016 (r298970) +++ head/sys/i386/include/xen/hypercall.h Tue May 3 08:05:14 2016 (r298971) @@ -209,7 +209,7 @@ HYPERVISOR_set_timer_op( unsigned long timeout_lo = (unsigned long)timeout; return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi); } -#if 0 + static inline int HYPERVISOR_platform_op( struct xen_platform_op *platform_op) @@ -217,7 +217,7 @@ HYPERVISOR_platform_op( platform_op->interface_version = XENPF_INTERFACE_VERSION; return _hypercall1(int, platform_op, platform_op); } -#endif + static inline int HYPERVISOR_set_debugreg( int reg, unsigned long value) From owner-svn-src-all@freebsd.org Tue May 3 08:05:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DAEB29401; Tue, 3 May 2016 08:05:32 +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 3C407171A; Tue, 3 May 2016 08:05:32 +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 u4385VC2045131; Tue, 3 May 2016 08:05:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4385VcT045128; Tue, 3 May 2016 08:05:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030805.u4385VcT045128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:05: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: r298972 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:05:32 -0000 Author: mav Date: Tue May 3 08:05:31 2016 New Revision: 298972 URL: https://svnweb.freebsd.org/changeset/base/298972 Log: MFC r297991: Extract virtual port address from RQSTYPE_RPT_ID_ACQ. This should close the race between request arriving on new target mode virtual port and its scanner thread finally fetch its address for request routing. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:05:31 2016 (r298972) @@ -3011,7 +3011,6 @@ isp_fclink_test(ispsoftc_t *isp, int cha return (0); isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC link test", chan); - fcp->isp_loopstate = LOOP_TESTING_LINK; /* * Wait up to N microseconds for F/W to go to a ready state. @@ -3022,7 +3021,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha if (fcp->isp_fwstate == FW_READY) { break; } - if (fcp->isp_loopstate < LOOP_TESTING_LINK) + if (fcp->isp_loopstate < LOOP_HAVE_LINK) goto abort; GET_NANOTIME(&hrb); if ((NANOTIME_SUB(&hrb, &hra) / 1000 + 1000 >= usdelay)) @@ -3077,6 +3076,11 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_loopid = i; } +#if 0 + fcp->isp_loopstate = LOOP_HAVE_ADDR; +#endif + fcp->isp_loopstate = LOOP_TESTING_LINK; + if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { nphdl = IS_24XX(isp) ? NPH_FL_ID : FL_ID; r = isp_getpdb(isp, chan, nphdl, &pdb); @@ -6138,7 +6142,7 @@ isp_handle_other_response(ispsoftc_t *is { isp_ridacq_t rid; int chan, c; - uint32_t hdl; + uint32_t hdl, portid; void *ptr; switch (type) { @@ -6150,6 +6154,8 @@ isp_handle_other_response(ispsoftc_t *is return (1); case RQSTYPE_RPT_ID_ACQ: isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid); + portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | + rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); @@ -6171,7 +6177,9 @@ isp_handle_other_response(ispsoftc_t *is fcparam *fcp = FCPARAM(isp, rid.ridacq_vp_index); if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE || rid.ridacq_vp_status == RIDACQ_STS_CHANGED) { - fcp->isp_loopstate = LOOP_HAVE_LINK; + fcp->isp_topo = (rid.ridacq_map[0] >> 9) & 0x7; + fcp->isp_portid = portid; + fcp->isp_loopstate = LOOP_HAVE_ADDR; isp_async(isp, ISPASYNC_CHANGE_NOTIFY, rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER); } else { Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/isp_library.c Tue May 3 08:05:31 2016 (r298972) @@ -532,6 +532,7 @@ isp_fc_loop_statename(int state) switch (state) { case LOOP_NIL: return "NIL"; case LOOP_HAVE_LINK: return "Have Link"; + case LOOP_HAVE_ADDR: return "Have Address"; case LOOP_TESTING_LINK: return "Testing Link"; case LOOP_LTEST_DONE: return "Link Test Done"; case LOOP_SCANNING_LOOP: return "Scanning Loop"; @@ -548,7 +549,7 @@ const char * isp_fc_toponame(fcparam *fcp) { - if (fcp->isp_loopstate < LOOP_LTEST_DONE) { + if (fcp->isp_loopstate < LOOP_HAVE_ADDR) { return "Unavailable"; } switch (fcp->isp_topo) { @@ -2329,7 +2330,7 @@ isp_find_chan_by_did(ispsoftc_t *isp, ui for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if ((fcp->role & ISP_ROLE_TARGET) == 0 || - fcp->isp_loopstate < LOOP_LTEST_DONE) { + fcp->isp_loopstate < LOOP_HAVE_ADDR) { continue; } if (fcp->isp_portid == did) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:05:14 2016 (r298971) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:05:31 2016 (r298972) @@ -490,14 +490,15 @@ typedef struct { #define LOOP_NIL 0 #define LOOP_HAVE_LINK 1 -#define LOOP_TESTING_LINK 2 -#define LOOP_LTEST_DONE 3 -#define LOOP_SCANNING_LOOP 4 -#define LOOP_LSCAN_DONE 5 -#define LOOP_SCANNING_FABRIC 6 -#define LOOP_FSCAN_DONE 7 -#define LOOP_SYNCING_PDB 8 -#define LOOP_READY 9 +#define LOOP_HAVE_ADDR 2 +#define LOOP_TESTING_LINK 3 +#define LOOP_LTEST_DONE 4 +#define LOOP_SCANNING_LOOP 5 +#define LOOP_LSCAN_DONE 6 +#define LOOP_SCANNING_FABRIC 7 +#define LOOP_FSCAN_DONE 8 +#define LOOP_SYNCING_PDB 9 +#define LOOP_READY 10 #define TOPO_NL_PORT 0 #define TOPO_FL_PORT 1 From owner-svn-src-all@freebsd.org Tue May 3 08:07:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C57B295B3; Tue, 3 May 2016 08:07:39 +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 7CFFA1937; Tue, 3 May 2016 08:07:39 +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 u4387cPx045274; Tue, 3 May 2016 08:07:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4387cGB045273; Tue, 3 May 2016 08:07:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030807.u4387cGB045273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:07: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: r298973 - stable/10/sys/dev/ispfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:07:40 -0000 Author: mav Date: Tue May 3 08:07:38 2016 New Revision: 298973 URL: https://svnweb.freebsd.org/changeset/base/298973 Log: MFC r297818: Update 25xx chips firmware from 7.03.00 to 8.03.00. While the same update is also available for 24xx chips, it seems have a problem with disabling virtual ports -- firmware handles the request, but does not respong on it, causing timeout in driver. Modified: stable/10/sys/dev/ispfw/asm_2500.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ispfw/asm_2500.h ============================================================================== --- stable/10/sys/dev/ispfw/asm_2500.h Tue May 3 08:05:31 2016 (r298972) +++ stable/10/sys/dev/ispfw/asm_2500.h Tue May 3 08:07:38 2016 (r298973) @@ -30,1158 +30,1197 @@ * * * ******************************************************************** */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.03.00 (2015) */ #ifdef ISP_2500 static const uint32_t isp_2500_risc_code[] = { - 0x0501f042, 0x00112000, 0x00100000, 0x0000d32a, - 0x00000007, 0x00000003, 0x00000000, 0x000090d5, + 0x0501f06b, 0x00116000, 0x00100000, 0x0000daa9, + 0x00000008, 0x00000003, 0x00000000, 0x001090d5, 0x00000004, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313520, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32357878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30332e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100000, 0x00100000, - 0x0000d32a, 0xffffffff, 0x00112004, 0x00020000, - 0x000011a6, 0xffffffff, 0x001131af, 0x0000c000, - 0x00000aa2, 0x00ffffff, 0x00113c51, 0x00008000, - 0x00000703, 0x00ffffff, 0x00114354, 0x0000a000, - 0x00000621, 0x00ffffff, 0x00114975, 0x0000400e, + 0x0000daa9, 0xffffffff, 0x00116004, 0x00020000, + 0x000011e7, 0xffffffff, 0x001171f0, 0x0000c000, + 0x00000adf, 0x00ffffff, 0x00117ccf, 0x00008000, + 0x0000070b, 0x00ffffff, 0x001183da, 0x0000a000, + 0x0000062a, 0x00ffffff, 0x00118a04, 0x0000400e, 0x00000808, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, - 0x40000000, 0x4203e000, 0x90000100, 0x40000000, - 0x42000800, 0x000211a7, 0x6002f000, 0x608c00e0, - 0x50000000, 0x8c000500, 0x05020003, 0x42000800, - 0x00020000, 0x45780800, 0x80040800, 0x82040580, - 0x00022000, 0x05fe07fc, 0x4178a000, 0x4200a800, - 0x0010d32a, 0x42000800, 0x00111b00, 0x40540000, - 0x8004b480, 0x0569f852, 0x0501ffcd, 0x600c6020, - 0x50304800, 0x8c240500, 0x0500001c, 0x59e00016, - 0x8c000504, 0x05020019, 0x0569f8a9, 0x604808fa, - 0x50041000, 0x82081500, 0xfffffffc, 0x90081d43, - 0x90081540, 0x84244d00, 0x440c0800, 0x44080800, - 0x44246000, 0x64030000, 0x4203e000, 0x70000000, - 0x4203e000, 0xb0300000, 0x603ff84e, 0x59e00016, - 0x8c000504, 0x05020002, 0x05fe47fd, 0x84244d40, - 0x44246000, 0x0569f892, 0x64030000, 0x0501fde5, - 0x4803c856, 0x0509fbf8, 0x6413c020, 0x4203e000, - 0x6000000f, 0x640f70e8, 0x640f78e8, 0x640da8e8, - 0x59e00023, 0x8c000500, 0x0502002b, 0x42002800, - 0x00100022, 0x58140800, 0x4817c857, 0x4807c857, - 0x800409c0, 0x0500000a, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x0501ff8c, 0x5c002800, - 0x0502003d, 0x90142c04, 0x05fdf7f3, 0x42002800, - 0x00100022, 0x5814a000, 0x4817c857, 0x4853c857, - 0x8050a1c0, 0x05000014, 0x4c140000, 0x5814a801, - 0x4857c857, 0x40500000, 0x80540480, 0x0500000b, - 0x82540480, 0x0000400e, 0x05020005, 0x9050a404, - 0x0509ff8a, 0x05020028, 0x0501f004, 0x5814b002, - 0x485bc857, 0x0565fff6, 0x5c002800, 0x90142c04, - 0x05fdf7e9, 0x050dfdf3, 0x42001000, 0x7ff481fe, - 0x59e00002, 0x8c00051e, 0x05020003, 0x42001000, - 0x7ff480fe, 0x50081000, 0x480b5092, 0x42002800, - 0x00100022, 0x58140801, 0x4817c857, 0x4807c857, - 0x800409c0, 0x05000023, 0x58142002, 0x4813c857, - 0x58141003, 0x4c140000, 0x82040480, 0x0000400e, - 0x05020004, 0x0509ff94, 0x4803c856, 0x0501f003, - 0x0501ff52, 0x05020004, 0x5c002800, 0x90142c04, - 0x05fdf7ed, 0x4803c856, 0x4a03c020, 0x00004010, - 0x4a03c011, 0x40100011, 0x05006000, 0x4203e000, - 0x40000000, 0x59e00017, 0x60000800, 0x8c00050a, - 0x050a0df0, 0x8d0c0530, 0x050a0de3, 0x050a0de5, - 0x6403c017, 0x4203e000, 0x30000001, 0x0501f000, - 0x4803c856, 0x59e00024, 0x8c000500, 0x050a0f32, - 0x0501ffca, 0x4a03c014, 0x001c001c, 0x4817c857, - 0x0501fff8, 0x42002000, 0x00111b00, 0x0565ffc3, - 0x59a800a1, 0x800001c0, 0x0500000c, 0x59a800ca, - 0x8c000500, 0x05000005, 0x59a8000a, 0x82000480, - 0x0013ffff, 0x05001005, 0x59a820a1, 0x80102000, - 0x59a8280a, 0x0565ffb5, 0x0569f9db, 0x0569fa02, - 0x59a8280a, 0x60000812, 0x60001802, 0x4807503b, - 0x480f529c, 0x60c01000, 0x053dfe68, 0x82040c00, - 0x00111b00, 0x4807500b, 0x600400de, 0x50000000, - 0x8c000502, 0x05000004, 0x59a800ca, 0x84000540, - 0x480350ca, 0x4a03c810, 0x00100000, 0x4a03c811, - 0x0010d32a, 0x0501ff90, 0x6447c829, 0x59e40001, - 0x82000540, 0x0003401f, 0x4803c801, 0x4a03c802, - 0x00000933, 0x59e00003, 0x82000540, 0x00240000, - 0x4803c003, 0x64ffc019, 0x60701000, 0x0501fedf, - 0x4202c000, 0x00111b00, 0x59aab00b, 0x59aaa00b, - 0x59aaa80b, 0x59aac83b, 0x4967509b, 0x496754dd, - 0x59a8000b, 0x4803500c, 0x0501fffe, 0x0549fa90, - 0x0505f807, 0x0505f875, 0x0509ffb5, 0x59a80084, - 0x8c000508, 0x05000004, 0x050dfebf, 0x0525f87d, - 0x050dffef, 0x0505f9b8, 0x0505ffb0, 0x053dfe71, - 0x0501fc55, 0x0515f812, 0x0531fb18, 0x052dfc90, - 0x0539fd03, 0x0509ffe6, 0x0509fe0f, 0x4203e000, - 0xf0000001, 0x0569f9c9, 0x6403c018, 0x4203e000, - 0xa0000001, 0x59a800ca, 0x80000540, 0x05000004, - 0x4203e000, 0x20000551, 0x0501f003, 0x4203e000, - 0x20000511, 0x4203e000, 0x50010000, 0x6403c020, - 0x05027019, 0x59e00020, 0x90000582, 0x05020016, - 0x4a03c020, 0x00004000, 0x4a03c011, 0x40000010, - 0x05006000, 0x4203e000, 0x40000000, 0x4df00000, - 0x4203e000, 0x50000000, 0x59e00017, 0x60000800, - 0x8c00050a, 0x00020892, 0x8d0c0530, 0x050a0d5a, - 0x000209bc, 0x5c03e000, 0x6403c017, 0x4203e000, - 0x30000001, 0x6002d800, 0x4203e000, 0xb0600000, - 0x59a800d5, 0x4003f800, 0x0001f004, 0x4df00000, - 0x4203e000, 0x50000000, 0x416c0000, 0x90000c88, - 0x05021c5e, 0x0c01f803, 0x5c03e000, 0x0001f006, - 0x00100189, 0x0010019a, 0x001002bf, 0x00100188, - 0x001003fa, 0x00100188, 0x00100188, 0x00100592, - 0x0501fc52, 0x42000800, 0x0010dceb, 0x5804001e, - 0x8c000500, 0x0500000c, 0x84000500, 0x4800081e, - 0x6012d800, 0x0501fe6d, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00007e20, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x41780000, 0x800001c0, - 0x05020039, 0x59c4000d, 0x8c00051e, 0x0502001f, - 0x59a800a7, 0x8c000500, 0x05000012, 0x60300830, - 0x050dfc0d, 0x90040560, 0x60300830, 0x4c000000, - 0x050dfc0e, 0x6041d04e, 0x0539fe5b, 0x5c000000, - 0x8400050a, 0x60300830, 0x050dfc08, 0x6191d000, - 0x0539fe55, 0x59c4000d, 0x8c00051e, 0x0502000b, - 0x59c40005, 0x8c000500, 0x05020008, 0x050dff96, - 0x640b50b4, 0x64075075, 0x6012d800, 0x42000000, - 0x0010e4be, 0x0565f622, 0x0501fe39, 0x052dfeef, - 0x0500000f, 0x052dfeff, 0x05020032, 0x5994002d, - 0x82000580, 0x001051ae, 0x05020004, 0x5994002c, - 0x800001c0, 0x0502002b, 0x59c40006, 0x82000540, - 0x000000c0, 0x48038806, 0x0501f026, 0x052dfe62, - 0x916c0581, 0x050200c5, 0x59a8003f, 0x90000589, - 0x050200c2, 0x497b503d, 0x42000800, 0xffffd815, - 0x0511fcf2, 0x42024800, 0x0010e512, 0x497a4805, - 0x64078893, 0x4a038805, 0x000000f0, 0x052dfedb, - 0x59c41006, 0x05020006, 0x82081540, 0x000000f1, - 0x82081500, 0xbbffffff, 0x0501f003, 0x82081540, - 0x440000f1, 0x480b8806, 0x0539fe23, 0x0541fb6d, - 0x0501f8ab, 0x050000a9, 0x42000000, 0x0010e39b, - 0x0565fdec, 0x60c01100, 0x497b50b2, 0x0501f036, - 0x0525f9b0, 0x59c400a4, 0x9000050f, 0x90000487, - 0x0502109e, 0x0539fe14, 0x59c400a3, 0x82000500, - 0xffefffff, 0x480388a3, 0x59a800bd, 0x800001c0, - 0x05020003, 0x0525ff01, 0x0501f094, 0x59a80043, - 0x84000546, 0x48035043, 0x052dfeae, 0x59c41006, - 0x05020006, 0x82081540, 0x44000001, 0x82081500, - 0xffffff0f, 0x0501f003, 0x82081540, 0x440000f1, - 0x480b8806, 0x497b9005, 0x0501f885, 0x05000083, - 0x60000000, 0x052dfc3b, 0x4a038802, 0x0000ffff, - 0x4a0378e4, 0x00003000, 0x42007000, 0x0010e060, - 0x58380401, 0x8c000508, 0x05020003, 0x4a01a8e4, - 0x0000c000, 0x42000000, 0x0010e392, 0x0565fdb9, - 0x59a8103d, 0x600c0800, 0x0541fb1b, 0x60401100, - 0x59a81809, 0x0521fdb3, 0x59a804cc, 0x82000500, - 0xffffff40, 0x480354cc, 0x59a80249, 0x84000518, - 0x48035249, 0x59c40001, 0x82000500, 0x00018000, - 0x82000580, 0x00018000, 0x59c400a3, 0x05020004, - 0x82000540, 0x00001000, 0x0501f003, 0x82000500, - 0xffffefff, 0x480388a3, 0x59c80015, 0x84000548, - 0x48039015, 0x050dfacb, 0x59a81008, 0x84081500, - 0x480b5008, 0x850e1d0a, 0x0529fd8a, 0x052dfe67, - 0x05000007, 0x8d0c0506, 0x05000005, 0x640750b2, - 0x850e1d0e, 0x0525fa79, 0x0501f048, 0x0529fe89, - 0x05000005, 0x59c41002, 0x8408150c, 0x480b8802, - 0x0501f017, 0x052dfe59, 0x05020005, 0x59a80046, - 0x80000540, 0x05540e1d, 0x0501f011, 0x0555fe1b, - 0x59a80249, 0x8c000506, 0x0502000d, 0x59a80046, - 0x80000540, 0x05020007, 0x59a81c49, 0x820c0580, - 0x0000ffff, 0x05000006, 0x8c0c0508, 0x05000004, - 0x4a035449, 0x0000ffff, 0x0525ffb4, 0x497b504b, - 0x497b504a, 0x497b50b3, 0x052dfe40, 0x59a81249, - 0x05020009, 0x050df8bd, 0x80001580, 0x59a8004d, - 0x82000500, 0xffff0000, 0x80040d40, 0x4807504d, - 0x0501f005, 0x59a8004d, 0x82000500, 0xffff0000, - 0x4803504d, 0x599c0017, 0x8c00050a, 0x05000002, - 0x84081544, 0x480b5249, 0x052dfe2c, 0x05000003, - 0x050df8aa, 0x48078880, 0x60141000, 0x0541ffae, - 0x497b504b, 0x497b5044, 0x4a035045, 0x0000ffff, - 0x4a01a8e4, 0x000000c0, 0x600ad800, 0x052dfe1f, - 0x05000005, 0x59a80249, 0x9000050c, 0x90000584, - 0x05000002, 0x0511fa30, 0x1c01f000, 0x0521fe7f, - 0x05020026, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x05020020, 0x59c40001, - 0x82000d00, 0x00018000, 0x82040580, 0x00010000, - 0x05000004, 0x82040580, 0x00008000, 0x05020017, - 0x59a800a6, 0x90000483, 0x05001003, 0x90000541, - 0x0501f012, 0x050dfe6f, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x6403506a, 0x6012d800, - 0x59a800a6, 0x80000000, 0x480350a6, 0x59a800a5, - 0x82000500, 0xfffffff8, 0x90000544, 0x480350a5, - 0x0501fd42, 0x80000580, 0x1c01f000, 0x0525f854, - 0x05000051, 0x59a80249, 0x90000523, 0x900005a3, - 0x0502004d, 0x0525f853, 0x0500004b, 0x4a038802, - 0x0000ffbf, 0x59a804cc, 0x8c00050c, 0x0502012e, - 0x8c000506, 0x0502000b, 0x8c000508, 0x0502012a, - 0x84000548, 0x480354cc, 0x0525f84b, 0x05000004, - 0x417a5800, 0x0559fcae, 0x0501f123, 0x0501f0ea, - 0x8c00050a, 0x05020038, 0x8400054a, 0x480354cc, - 0x497b504b, 0x497b504a, 0x497b5044, 0x4a035045, - 0x0000ffff, 0x59a80249, 0x82000500, 0xffffff7c, - 0x48035249, 0x42024800, 0x0010e512, 0x59240200, - 0x82000500, 0xffffff1f, 0x48024a00, 0x59a802cc, - 0x5924100b, 0x82081500, 0x00001fff, 0x80080580, - 0x05000012, 0x4d3c0000, 0x4d300000, 0x4d400000, - 0x60aa8000, 0x417a6000, 0x600a7800, 0x41780800, - 0x0511fc4a, 0x5c028000, 0x5c026000, 0x5c027800, - 0x59a802cc, 0x5924080b, 0x82040d00, 0xffffe000, - 0x80040540, 0x4802480b, 0x4d300000, 0x417a6000, - 0x0511fbeb, 0x5c026000, 0x4803c856, 0x5924000c, - 0x800001c0, 0x05020006, 0x0001f817, 0x050000ee, - 0x492e480c, 0x5924000b, 0x48025802, 0x0511f9b6, - 0x0501f0e9, 0x59a80045, 0x82000580, 0x0000ffff, - 0x05000003, 0x0511f9b0, 0x0501f0e3, 0x0565fdfe, - 0x05000017, 0x0565fe01, 0x05000008, 0x052dfd93, - 0x05000006, 0x59a80249, 0x8c000506, 0x0500004e, - 0x0529fdb8, 0x050200d8, 0x80000580, 0x0509ff61, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x4a01a8e4, - 0x00000080, 0x4a038802, 0x0000ffff, 0x850e1d02, - 0x0541fd6a, 0x0501fcb8, 0x0501f0cb, 0x59a80249, - 0x8c00050a, 0x05020003, 0x8c000506, 0x05000037, - 0x8c000500, 0x05000035, 0x4a038802, 0x0000ffbf, - 0x8c000502, 0x05000031, 0x0521ffde, 0x05020004, - 0x599c0018, 0x8c000516, 0x05020029, 0x59a8004a, - 0x82000580, 0x0000ffff, 0x05000020, 0x0521ffd5, - 0x05000006, 0x59a804cc, 0x8c000500, 0x05000003, - 0x0511fc27, 0x0501f008, 0x41781800, 0x0565fddb, - 0x05000002, 0x60401800, 0x59a80249, 0x8c00050a, - 0x05120a8a, 0x42024800, 0x0010e512, 0x417a4000, - 0x59240200, 0x82000500, 0x000000e0, 0x82000580, - 0x000000e0, 0x050200a0, 0x050dff2c, 0x59a80249, - 0x8c000504, 0x0502009c, 0x600c1000, 0x417a5800, - 0x050dff4b, 0x0501f098, 0x59a80249, 0x8c00051c, - 0x05020003, 0x8c000504, 0x05fc07f8, 0x59a8004b, - 0x80000540, 0x05020090, 0x59a80249, 0x8c000508, - 0x05020017, 0x59a80044, 0x80000540, 0x0502008a, - 0x59a80249, 0x8c00050e, 0x0500000c, 0x8c000502, - 0x0502000a, 0x052dfd39, 0x05000083, 0x82000500, - 0xffffff77, 0x48035249, 0x4a035045, 0x0000ffff, - 0x0511f949, 0x0501f07c, 0x0565fda8, 0x0500000c, - 0x0511fcc7, 0x05020078, 0x0501f009, 0x599c1819, - 0x8c0c0510, 0x05000004, 0x8c000502, 0x0502001d, - 0x0501f071, 0x8c000516, 0x0500006f, 0x0529fd4d, - 0x0502006d, 0x0521ff8b, 0x05020004, 0x599c0018, - 0x8c000516, 0x05020003, 0x052df90d, 0x05020066, - 0x59a80006, 0x8c00051c, 0x05020004, 0x599c0017, - 0x8c00050a, 0x0500000b, 0x61c0b00f, 0x417a8800, - 0x0001fb00, 0x05020004, 0x59340200, 0x8c00051a, - 0x05020059, 0x81468800, 0x8058b040, 0x05fe07f9, - 0x0565fda3, 0x05000004, 0x4a038802, 0x0000ffbf, - 0x0501f003, 0x4a038802, 0x0000ffff, 0x42001800, - 0x0010dd46, 0x0501fd73, 0x42001800, 0x0010dd53, - 0x0501fd70, 0x850e1d02, 0x4a01a8e4, 0x00000080, - 0x600ed800, 0x4a035045, 0x0000ffff, 0x0501fc2e, - 0x80000580, 0x0509fecb, 0x497b50a6, 0x64075078, - 0x0521ff5c, 0x0502000b, 0x599c0018, 0x8c000516, - 0x05000008, 0x59a804cc, 0x8c00050e, 0x05020036, - 0x8400054e, 0x480354cc, 0x0521fcda, 0x0501f016, - 0x59a81a49, 0x59a82041, 0x82102580, 0x0000aaaa, - 0x05000004, 0x8c0c0506, 0x05020002, 0x480f5449, - 0x8c0c0508, 0x05000007, 0x599c1819, 0x8c0c0510, - 0x05000004, 0x61f8180f, 0x60102000, 0x0501f003, - 0x61fc19ff, 0x60182000, 0x60003000, 0x417a4000, - 0x0521fc6c, 0x052dfce3, 0x0500000a, 0x59c40006, - 0x052dfcce, 0x05000004, 0x82000500, 0xffffff0f, - 0x0501f003, 0x82000500, 0xfbffffff, 0x48038806, - 0x0521ff30, 0x0500000a, 0x59a804cc, 0x8c000500, - 0x05000007, 0x59c40801, 0x82040d40, 0x00004000, - 0x48078801, 0x64c378e4, 0x0501f006, 0x59c40801, - 0x82040d00, 0xffffbfff, 0x48078801, 0x648378e4, - 0x0541fc9e, 0x1c01f000, 0x4c040000, 0x4c080000, - 0x4c100000, 0x59a8006a, 0x90000c84, 0x050219db, - 0x0c01f805, 0x5c002000, 0x5c001000, 0x5c000800, - 0x1c01f000, 0x00100409, 0x001004a3, 0x001004c8, - 0x00100576, 0x60380938, 0x050df9a7, 0x90040550, - 0x82000500, 0xfffffff7, 0x60380938, 0x050df9a7, - 0x59c410a3, 0x84081518, 0x480b88a3, 0x0521fd03, - 0x05020021, 0x599c0019, 0x82000500, 0x0000e000, - 0x82000580, 0x00004000, 0x0502001b, 0x59a808a5, - 0x90040d07, 0x90040580, 0x0502000b, 0x59a80069, - 0x90000582, 0x05000011, 0x050df8ea, 0x497b5068, - 0x050dfce9, 0x640f5076, 0x640b5069, 0x64075075, - 0x0501f00a, 0x90040584, 0x05020008, 0x497b2804, - 0x497b2805, 0x050dfcef, 0x64075075, 0x4a035076, - 0xaabbccdd, 0x64135069, 0x59a800a5, 0x80000000, - 0x480350a5, 0x60000001, 0x0509fe4e, 0x0539fbd6, - 0x59c408a3, 0x82040d00, 0xfffffff7, 0x480788a3, - 0x052dfc78, 0x0500000d, 0x052dfc82, 0x0500000b, - 0x052dfc7a, 0x05020999, 0x59c400a3, 0x84000532, - 0x84000570, 0x480388a3, 0x052dffa3, 0x4a038808, - 0x00000208, 0x0501f012, 0x59c400a3, 0x84000530, - 0x82000500, 0xbf7fffff, 0x480388a3, 0x61e00801, - 0x0525fd72, 0x59c400a3, 0x82000540, 0x00018000, - 0x8400051c, 0x480388a3, 0x82000500, 0xfffeffff, - 0x480388a3, 0x4a038808, 0x00000200, 0x59c40006, - 0x82000500, 0xfbffff0e, 0x48038806, 0x497b282c, - 0x497b282d, 0x61d00803, 0x42001000, 0x00100590, - 0x0539fa3c, 0x59c40805, 0x64078805, 0x0509fefb, - 0x05020006, 0x60040000, 0x050df8db, 0x60040000, - 0x050df8a9, 0x0501f01e, 0x0509fefa, 0x05020006, - 0x41780000, 0x050df8d4, 0x41780000, 0x050df8a2, - 0x0501f017, 0x0509fef9, 0x05020006, 0x60080000, - 0x050df8cd, 0x60080000, 0x050df89b, 0x0501f010, - 0x0509fef8, 0x05020006, 0x600c0000, 0x050df8c6, - 0x600c0000, 0x050df894, 0x0501f009, 0x0509fef7, - 0x05020956, 0x59a80075, 0x800001c0, 0x05000004, - 0x0509fef7, 0x6407506a, 0x0501f018, 0x050df914, - 0x6407506a, 0x052dfc27, 0x05000008, 0x052dfc31, - 0x05000006, 0x052dfc29, 0x05020948, 0x64075042, - 0x052dfb9d, 0x0501f00d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000003, 0x4a038805, 0x04000000, - 0x59c400a3, 0x82000540, 0x0001c000, 0x480388a3, - 0x84000520, 0x480388a3, 0x1c01f000, 0x0501f8e9, - 0x05020003, 0x640f506a, 0x0501f021, 0x0509fed3, - 0x0502000d, 0x59a80075, 0x800001c0, 0x0500000a, - 0x0509fed3, 0x59a80074, 0x8c00051e, 0x05000018, - 0x052dfc0a, 0x05020006, 0x64075042, 0x052dfb7e, - 0x0501f003, 0x050df8be, 0x05020011, 0x050df855, - 0x640b506a, 0x497b5075, 0x59c400a3, 0x84000520, - 0x480388a3, 0x052dfbfd, 0x05000009, 0x0521fc57, - 0x05000007, 0x497b282c, 0x497b282d, 0x60b40800, - 0x42001000, 0x00100590, 0x0539f9da, 0x1c01f000, - 0x0501f8c4, 0x05020003, 0x640f506a, 0x0501f0a9, - 0x4a038805, 0x000000f0, 0x050df8a5, 0x050200a0, - 0x050dfab0, 0x05000017, 0x050dfa95, 0x05020015, - 0x050dfa9e, 0x0502000a, 0x59a80076, 0x90000584, - 0x05fc07f2, 0x0509fe9b, 0x0502000e, 0x59a80076, - 0x82000580, 0xaabbccdd, 0x05fc07ec, 0x59a80076, - 0x90000580, 0x05fc07e9, 0x0509fe80, 0x05020005, - 0x59a80076, 0x82000580, 0xaabbccdd, 0x05fc07e3, - 0x59a800a7, 0x8c000500, 0x0502000b, 0x59a80884, - 0x8c04050c, 0x05020008, 0x60380938, 0x050df8c2, - 0x90040548, 0x82000500, 0xffffffef, 0x60380938, - 0x050df8c2, 0x050dfa8b, 0x05000032, 0x0521fe5a, - 0x0500000c, 0x4a03c014, 0x00200020, 0x59c40001, - 0x82000500, 0x00018000, 0x82000580, 0x00018000, - 0x05020026, 0x4a03c013, 0x00200020, 0x0501f025, - 0x4a03c013, 0x03800300, 0x4a03c014, 0x03800380, + 0x00000000, 0x00000000, 0x00000009, 0x0000000c, + 0x0000000f, 0x00000012, 0x00000015, 0x00000000, + 0x00000000, 0x0000000f, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00100045, 0x00000000, + 0x00100046, 0x00000000, 0x00000000, 0x00100046, + 0x00100045, 0x00100042, 0x00100046, 0x00100045, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00100046, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00100046, + 0x00100046, 0x00100046, 0x00000000, 0x00100046, + 0x00000000, 0x00000000, 0x00000000, 0x4203f000, + 0x00021fff, 0x40000000, 0x4203e000, 0x90000100, + 0x40000000, 0x42000800, 0x000211e8, 0x6002f000, + 0x608c00e0, 0x50000000, 0x8c000500, 0x05020003, + 0x42000800, 0x00020000, 0x45780800, 0x80040800, + 0x82040580, 0x00022000, 0x05fe07fc, 0x4178a000, + 0x4200a800, 0x0010daa9, 0x42000800, 0x00115aa4, + 0x40540000, 0x8004b480, 0x0569ffa4, 0x0501ffd3, + 0x600c6020, 0x50304800, 0x8c240500, 0x0500001c, + 0x59e00016, 0x8c000504, 0x05020019, 0x0569fffb, + 0x604808fa, 0x50041000, 0x82081500, 0xfffffffc, + 0x90081d43, 0x90081540, 0x84244d00, 0x440c0800, + 0x44080800, 0x44246000, 0x64030000, 0x4203e000, + 0x70000000, 0x4203e000, 0xb0300000, 0x603ff84e, + 0x59e00016, 0x8c000504, 0x05020002, 0x05fe47fd, + 0x84244d40, 0x44246000, 0x0569ffe4, 0x64030000, + 0x0501fdf7, 0x4803c856, 0x0509fc3e, 0x6413c020, + 0x4203e000, 0x6000000f, 0x640f70e8, 0x640f78e8, + 0x640da8e8, 0x59e00023, 0x8c000500, 0x0502002b, + 0x42002800, 0x00100022, 0x58140800, 0x4817c857, + 0x4807c857, 0x800409c0, 0x0500000a, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x0501ff92, + 0x5c002800, 0x0502003d, 0x90142c04, 0x05fdf7f3, + 0x42002800, 0x00100022, 0x5814a000, 0x4817c857, + 0x4853c857, 0x8050a1c0, 0x05000014, 0x4c140000, + 0x5814a801, 0x4857c857, 0x40500000, 0x80540480, + 0x0500000b, 0x82540480, 0x0000400e, 0x05020005, + 0x9050a404, 0x0509ffd2, 0x05020028, 0x0501f004, + 0x5814b002, 0x485bc857, 0x0569ff48, 0x5c002800, + 0x90142c04, 0x05fdf7e9, 0x050dfe4a, 0x42001000, + 0x7ff481fe, 0x59e00002, 0x8c00051e, 0x05020003, + 0x42001000, 0x7ff480fe, 0x50081000, 0x480b5095, + 0x42002800, 0x00100022, 0x58140801, 0x4817c857, + 0x4807c857, 0x800409c0, 0x05000023, 0x58142002, + 0x4813c857, 0x58141003, 0x4c140000, 0x82040480, + 0x0000400e, 0x05020004, 0x0509ffdc, 0x4803c856, + 0x0501f003, 0x0501ff58, 0x05020004, 0x5c002800, + 0x90142c04, 0x05fdf7ed, 0x4803c856, 0x4a03c020, + 0x00004010, 0x4a03c011, 0x40100011, 0x05006000, + 0x4203e000, 0x40000000, 0x59e00017, 0x60000800, + 0x8c00050a, 0x050a0e38, 0x8d0c0530, 0x050a0e2b, + 0x050a0e2d, 0x6403c017, 0x4203e000, 0x30000001, + 0x0501f000, 0x4803c856, 0x59e00024, 0x8c000500, + 0x050a0f7a, 0x59e00024, 0x8c00050e, 0x05000003, + 0x4a020200, 0x00003800, 0x0501ffd3, 0x4a03c014, + 0x001c001c, 0x4817c857, 0x0505f801, 0x42002000, + 0x00115aa4, 0x0569ff10, 0x59a800a4, 0x800001c0, + 0x0500000c, 0x59a800cf, 0x8c000500, 0x05000005, + 0x59a8000a, 0x82000480, 0x0013ffff, 0x05001005, + 0x59a820a4, 0x80102000, 0x59a8280a, 0x0569ff02, + 0x056df92b, 0x056df953, 0x59a8280a, 0x60800812, + 0x60001802, 0x4807503d, 0x480f529f, 0x900d0420, + 0x800404a0, 0x4803543e, 0x60c01000, 0x0541faf0, + 0x82040c00, 0x00115aa4, 0x4807500b, 0x600400de, + 0x50000000, 0x8c000502, 0x05000004, 0x59a800cf, + 0x84000540, 0x480350cf, 0x4a03c810, 0x00100000, + 0x4a03c811, 0x0010daa9, 0x0501ff96, 0x6447c829, + 0x59e40001, 0x82000540, 0x0003401f, 0x4803c801, + 0x4a03c802, 0x00000933, 0x59e00003, 0x82000540, + 0x00240000, 0x4803c003, 0x64ffc019, 0x60701000, + 0x0501fedd, 0x4202c000, 0x00115aa4, 0x42017800, + 0x00115aa4, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, + 0x59aac83d, 0x4967509e, 0x496754e2, 0x59a8000b, + 0x4803500c, 0x0505f802, 0x0549ff51, 0x0505f80b, + 0x0505f898, 0x0509fff9, 0x59a80087, 0x8c000508, + 0x05000004, 0x050dff0c, 0x0525f9f0, 0x0511f83c, + 0x0505f9e7, 0x0509f81c, 0x0541faf7, 0x0501fc59, + 0x0515f887, 0x0531fdd5, 0x052dff41, 0x053df8ea, + 0x050df82a, 0x0509fe4d, 0x4203e000, 0xf0000001, + 0x056df915, 0x6403c018, 0x4203e000, 0xa0000001, + 0x59a800cf, 0x80000540, 0x05000004, 0x4203e000, + 0x20000551, 0x0501f003, 0x4203e000, 0x20000511, + 0x4203e000, 0x50010000, 0x6403c020, 0x05027019, + 0x59e00020, 0x90000582, 0x05020016, 0x4a03c020, + 0x00004000, 0x4a03c011, 0x40000010, 0x05006000, + 0x4203e000, 0x40000000, 0x4df00000, 0x4203e000, + 0x50000000, 0x59e00017, 0x60000800, 0x8c00050a, + 0x0002089a, 0x8d0c0530, 0x050a0d98, 0x000209c4, + 0x5c03e000, 0x6403c017, 0x4203e000, 0x30000001, + 0x6002d800, 0x4203e000, 0xb0600000, 0x59a800da, + 0x4003f800, 0x0001f004, 0x4df00000, 0x4203e000, + 0x50000000, 0x416c0000, 0x90000c88, 0x05021c66, + 0x0c01f803, 0x5c03e000, 0x0001f006, 0x001001bc, + 0x001001cd, 0x001002f2, 0x001001bb, 0x00100431, + 0x001001bb, 0x001001bb, 0x001005c9, 0x0501fc5a, + 0x42000800, 0x00111c71, 0x5804001e, 0x8c000500, + 0x0500000c, 0x84000500, 0x4800081e, 0x6012d800, + 0x0501fe69, 0x49f3c857, 0x5c000800, 0x5c000000, + 0x82000540, 0x00007e20, 0x4c000000, 0x4c040000, + 0x1c01f000, 0x41780000, 0x800001c0, 0x05020039, + 0x59c4000d, 0x8c00051e, 0x0502001f, 0x59a800aa, + 0x8c000500, 0x05000012, 0x60300830, 0x050dfc5a, + 0x90040560, 0x60300830, 0x4c000000, 0x050dfc5b, + 0x6041d04e, 0x053dfa93, 0x5c000000, 0x8400050a, + 0x60300830, 0x050dfc55, 0x6191d000, 0x053dfa8d, + 0x59c4000d, 0x8c00051e, 0x0502000b, 0x59c40005, + 0x8c000500, 0x05020008, 0x050dffe3, 0x640b50b9, + 0x64075078, 0x6012d800, 0x42000000, 0x00112462, + 0x0569f56a, 0x0501fe35, 0x0531f9a6, 0x0500000f, + 0x0531f9b6, 0x05020032, 0x5994002e, 0x82000580, + 0x001053a5, 0x05020004, 0x5994002d, 0x800001c0, + 0x0502002b, 0x59c40006, 0x82000540, 0x000000c0, + 0x48038806, 0x0501f026, 0x0531f913, 0x916c0581, + 0x050200c5, 0x59a80042, 0x90000589, 0x050200c2, + 0x497b5040, 0x42000800, 0xffffd815, 0x0511fd66, + 0x42024800, 0x001124b6, 0x497a4805, 0x64078893, + 0x4a038805, 0x000000f0, 0x0531f992, 0x59c41006, + 0x05020006, 0x82081540, 0x000000f1, 0x82081500, + 0xbbffffff, 0x0501f003, 0x82081540, 0x440000f1, + 0x480b8806, 0x053dfa5b, 0x0541fff8, 0x0501f8ab, + 0x050000a9, 0x42000000, 0x0011233c, 0x0569fd34, + 0x60c01100, 0x497b50b7, 0x0501f036, 0x0525fb72, + 0x59c400a4, 0x9000050f, 0x90000487, 0x0502109e, + 0x053dfa4c, 0x59c400a3, 0x82000500, 0xffefffff, + 0x480388a3, 0x59a800c2, 0x800001c0, 0x05020003, + 0x0529f8c5, 0x0501f094, 0x59a80046, 0x84000546, + 0x48035046, 0x0531f965, 0x59c41006, 0x05020006, + 0x82081540, 0x44000001, 0x82081500, 0xffffff0f, + 0x0501f003, 0x82081540, 0x440000f1, 0x480b8806, + 0x497b9005, 0x0501f885, 0x05000083, 0x60000000, + 0x052dfeec, 0x4a038802, 0x0000ffff, 0x4a0378e4, + 0x00003000, 0x42007000, 0x00111ffa, 0x58380401, + 0x8c000508, 0x05020003, 0x4a01a8e4, 0x0000c000, + 0x42000000, 0x00112333, 0x0569fd01, 0x59a81040, + 0x600c0800, 0x0541ffa6, 0x60401100, 0x59a81809, + 0x0521ff1d, 0x59a804d1, 0x82000500, 0xffffff40, + 0x480354d1, 0x59a8024c, 0x84000518, 0x4803524c, 0x59c40001, 0x82000500, 0x00018000, 0x82000580, - 0x00018000, 0x0502000c, 0x60880801, 0x61d81000, - 0x60201800, 0x0521fe44, 0x050008c8, 0x60880801, - 0x61b81000, 0x60201800, 0x0521fe3f, 0x050008c3, - 0x0501f00b, 0x60880801, 0x61d81000, 0x60201800, - 0x0521fe47, 0x050008bd, 0x60880801, 0x61b81000, - 0x60201800, 0x0521fe42, 0x050008b8, 0x4a03c014, - 0x03800000, 0x0501f003, 0x4a03c013, 0x00200000, - 0x052dfb92, 0x0500003d, 0x59c400a4, 0x9000050f, - 0x90000588, 0x05000021, 0x59c40005, 0x8c000534, - 0x0502001e, 0x5994002e, 0x800001c0, 0x05000007, - 0x0501fae3, 0x90000402, 0x5994082c, 0x80040480, - 0x0502103c, 0x0501f004, 0x5994002c, 0x90000482, - 0x05021038, 0x052dfb83, 0x05020036, 0x4a038805, - 0x000000f0, 0x052dfbad, 0x4a035041, 0x0000aaaa, - 0x64035042, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f019, 0x052dfb72, 0x05020007, - 0x59a80041, 0x82000580, 0x0000aaaa, 0x05020003, - 0x4a03503d, 0x00ffffff, 0x497b5041, 0x59c40006, - 0x82000540, 0x04000001, 0x48038806, 0x8d0c0506, - 0x05020004, 0x59c408a3, 0x90040d48, 0x480788a3, - 0x6006d800, 0x6403506a, 0x64078805, 0x497b282c, - 0x497b282d, 0x0501f00f, 0x59c40005, 0x82000500, - 0x000000c0, 0x0500000b, 0x59c40006, 0x82000540, - 0x000000f1, 0x48038806, 0x05fdf7f2, 0x0509fe0b, - 0x05020004, 0x59a80075, 0x800001c0, 0x05fe0757, - 0x497b8885, 0x1c01f000, 0x4803c856, 0x0521fb9f, - 0x05020005, 0x050dfbc2, 0x42000000, 0x0010e4bf, - 0x0565fa63, 0x60000001, 0x0509fd06, 0x6403506a, - 0x0509fdfa, 0x05020009, 0x59a80068, 0x800001c0, - 0x05000004, 0x80000040, 0x48035068, 0x05020003, - 0x642b5068, 0x64075075, 0x497b8885, 0x0501f22c, - 0x5994002c, 0x5994082d, 0x80040540, 0x1c01f000, - 0x497b282d, 0x1c01f000, 0x4a038805, 0x000000f0, - 0x1c01f000, 0x641f5093, 0x640f5094, 0x64035095, - 0x4a035096, 0x000090d5, 0x052dfe64, 0x4a035449, - 0x0000ffff, 0x4a03503d, 0x00ffffff, 0x0555fad7, - 0x4a03504d, 0x20200000, 0x4a03504e, 0x88000200, - 0x4a03504f, 0x00ff001f, 0x4a035050, 0x000007d0, - 0x4a035051, 0x80000a00, 0x4a035052, 0xa0000200, - 0x4a035053, 0x00ff0004, 0x4a035054, 0x00010000, - 0x4a035055, 0x80000000, 0x4a035056, 0x00000200, - 0x4a035057, 0x00ff0000, 0x4a035058, 0x00010000, - 0x4a03505f, 0x514c4f47, 0x4a035060, 0x49432020, - 0x1c01f000, 0x4d440000, 0x417a8800, 0x4c5c0000, - 0x4178b800, 0x0001fb00, 0x05020004, 0x0529fc62, - 0x05020002, 0x805cb800, 0x81468800, 0x83440580, - 0x000007f0, 0x05fe07f8, 0x405c0800, 0x5c00b800, - 0x5c028800, 0x1c01f000, 0x4803c857, 0x5c000000, - 0x4c000000, 0x4803c857, 0x0501f808, 0x485fc857, - 0x4203e000, 0x50000000, 0x5c000000, 0x4d780000, - 0x6008b900, 0x0501f005, 0x485fc857, 0x4203e000, - 0x50000000, 0x6008b900, 0x05006000, 0x4c000000, - 0x4c040000, 0x59bc00ea, 0x4803c857, 0x90000507, - 0x90000581, 0x05020003, 0x60000800, 0x053dff51, - 0x59b800ea, 0x4803c857, 0x641370e8, 0x5c000800, - 0x4807c025, 0x80040920, 0x4807c026, 0x5c000000, - 0x4803c023, 0x80000120, 0x4803c024, 0x5c000000, - 0x4803c857, 0x4803c021, 0x80000120, 0x4803c022, - 0x41f80000, 0x4803c029, 0x80000120, 0x4803c02a, - 0x41780800, 0x4807c027, 0x59a800af, 0x8c00050a, - 0x05000005, 0x59e00027, 0x8400054a, 0x4803c857, - 0x4803c027, 0x0565fafa, 0x0500004a, 0x42000800, - 0x001105c8, 0x46000800, 0xfaceface, 0x80040800, - 0x4c080000, 0x4c0c0000, 0x600010f4, 0x58080013, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x58080024, 0x44000800, 0x80040800, 0x58080025, - 0x44000800, 0x80040800, 0x58080028, 0x44000800, - 0x80040800, 0x610010f4, 0x602c1800, 0x50080000, - 0x44000800, 0x80081000, 0x80040800, 0x800c1840, - 0x05fe07fb, 0x600c1800, 0x600010f6, 0x480c1003, - 0x58080005, 0x44000800, 0x80040800, 0x800c1840, - 0x05fe17fb, 0x600010f8, 0x58080002, 0x44000800, - 0x80040800, 0x58080003, 0x44000800, 0x80040800, - 0x58080020, 0x44000800, 0x80040800, 0x58080021, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x600010f6, 0x58080007, 0x44000800, 0x80040800, - 0x5808002b, 0x44000800, 0x80040800, 0x5808007c, - 0x44000800, 0x80040800, 0x5c001800, 0x5c001000, - 0x64030000, 0x485fc020, 0x905cb9c0, 0x905cbd52, - 0x485fc011, 0x4203e000, 0x40000000, 0x6016d800, - 0x59e00017, 0x60000800, 0x8c00050a, 0x050a0875, - 0x8d0c0530, 0x050a0868, 0x050a086a, 0x6403c017, - 0x4203e000, 0x30000001, 0x0501f956, 0x05fdf7ff, - 0x60100000, 0x0501f80c, 0x4a03c855, 0x0001eb5a, - 0x59e40001, 0x82000540, 0xff000700, 0x4803c801, - 0x42000000, 0x0010e4e5, 0x49780003, 0x49780004, - 0x1c01f000, 0x42000800, 0x0010e4e7, 0x44000800, - 0x59e40801, 0x82041500, 0x00f3c0ff, 0x480bc801, - 0x8c040524, 0x0500000b, 0x4c000000, 0x59e41052, - 0x59e40054, 0x800000d4, 0x82000400, 0x00110772, - 0x80081480, 0x480bc853, 0x6503c800, 0x5c000000, - 0x4a03c850, 0x00110772, 0x800000d4, 0x82002400, - 0x00110771, 0x4813c851, 0x4a03c853, 0x00000400, - 0x42000000, 0x00110772, 0x82001400, 0x00001000, - 0x45780000, 0x80000000, 0x80081d80, 0x05fe07fd, - 0x4807c801, 0x1c01f000, 0x42002000, 0x0010e4e5, - 0x59e41801, 0x58100c01, 0x82040500, 0x00003800, - 0x820c1d00, 0xffffc7ff, 0x800c1d40, 0x480fc801, - 0x1c01f000, 0x5c036000, 0x4db00000, 0x49b3c857, - 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, - 0x4c640000, 0x8d0c052a, 0x0500002f, 0x401c0000, - 0x80040d40, 0x4004b800, 0x400cc000, 0x4018c800, - 0x0501f8d3, 0x41784000, 0x42002800, 0x0010e4e5, - 0x58142017, 0x5814000d, 0x80100400, 0x445c0000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x050008a9, 0x0500001c, 0x4c000000, 0x0501f890, - 0x5c000000, 0x44080000, 0x80102000, 0x80000000, - 0x82104d00, 0x000000ff, 0x0500089f, 0x05000012, - 0x44600000, 0x80102000, 0x80000000, 0x82104d00, - 0x000000ff, 0x05000898, 0x0500000b, 0x44640000, - 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, - 0x05000891, 0x05000004, 0x48102817, 0x802041c0, - 0x05060d32, 0x5c00c800, 0x5c00c000, 0x5c00b800, + 0x00018000, 0x59c400a3, 0x05020004, 0x82000540, + 0x00001000, 0x0501f003, 0x82000500, 0xffffefff, + 0x480388a3, 0x59c80015, 0x84000548, 0x48039015, + 0x050dfb18, 0x59a81008, 0x84081500, 0x480b5008, + 0x850e1d0a, 0x0529ffc1, 0x0531f91e, 0x05000007, + 0x8d0c0506, 0x05000005, 0x640750b7, 0x850e1d0e, + 0x0525fc3b, 0x0501f048, 0x052df8c8, 0x05000005, + 0x59c41002, 0x8408150c, 0x480b8802, 0x0501f017, + 0x0531f910, 0x05020005, 0x59a80049, 0x80000540, + 0x05580b82, 0x0501f011, 0x0559fb80, 0x59a8024c, + 0x8c000506, 0x0502000d, 0x59a80049, 0x80000540, + 0x05020007, 0x59a81c4c, 0x820c0580, 0x0000ffff, + 0x05000006, 0x8c0c0508, 0x05000004, 0x4a03544c, + 0x0000ffff, 0x0529f978, 0x497b504e, 0x497b504d, + 0x497b50b8, 0x0531f8f7, 0x59a8124c, 0x05020009, + 0x050df90a, 0x80001580, 0x59a80050, 0x82000500, + 0xffff0000, 0x80040d40, 0x48075050, 0x0501f005, + 0x59a80050, 0x82000500, 0xffff0000, 0x48035050, + 0x599c0017, 0x8c00050a, 0x05000002, 0x84081544, + 0x480b524c, 0x0531f8e3, 0x05000003, 0x050df8f7, + 0x48078880, 0x60141000, 0x0545fc39, 0x497b504e, + 0x497b5047, 0x4a035048, 0x0000ffff, 0x4a01a8e4, + 0x000000c0, 0x600ad800, 0x0531f8d6, 0x05000005, + 0x59a8024c, 0x9000050c, 0x90000584, 0x05000002, + 0x0511fa95, 0x1c01f000, 0x0521fff2, 0x05020026, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x05020020, 0x59c40001, 0x82000d00, + 0x00018000, 0x82040580, 0x00010000, 0x05000004, + 0x82040580, 0x00008000, 0x05020017, 0x59a800a9, + 0x90000483, 0x05001003, 0x90000541, 0x0501f012, + 0x050dfebc, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x6403506d, 0x6012d800, 0x59a800a9, + 0x80000000, 0x480350a9, 0x59a800a8, 0x82000500, + 0xfffffff8, 0x90000544, 0x480350a8, 0x0501fd3e, + 0x80000580, 0x1c01f000, 0x0525f9c7, 0x05000051, + 0x59a8024c, 0x90000523, 0x900005a3, 0x0502004d, + 0x0525f9c6, 0x0500004b, 0x4a038802, 0x0000ffbf, + 0x59a804d1, 0x8c00050c, 0x05020132, 0x8c000506, + 0x0502000b, 0x8c000508, 0x0502012e, 0x84000548, + 0x480354d1, 0x0525f9be, 0x05000004, 0x417a5800, + 0x055dfa2c, 0x0501f127, 0x0501f0ee, 0x8c00050a, + 0x05020038, 0x8400054a, 0x480354d1, 0x497b504e, + 0x497b504d, 0x497b5047, 0x4a035048, 0x0000ffff, + 0x59a8024c, 0x82000500, 0xffffff7c, 0x4803524c, + 0x42024800, 0x001124b6, 0x59240200, 0x82000500, + 0xffffff1f, 0x48024a00, 0x59a802d1, 0x5924100b, + 0x82081500, 0x00001fff, 0x80080580, 0x05000012, + 0x4d3c0000, 0x4d300000, 0x4d400000, 0x60aa8000, + 0x417a6000, 0x600a7800, 0x41780800, 0x0511fcbe, + 0x5c028000, 0x5c026000, 0x5c027800, 0x59a802d1, + 0x5924080b, 0x82040d00, 0xffffe000, 0x80040540, + 0x4802480b, 0x4d300000, 0x417a6000, 0x0511fc5f, + 0x5c026000, 0x4803c856, 0x5924000c, 0x800001c0, + 0x05020006, 0x0001f81f, 0x050000f2, 0x492e480c, + 0x5924000b, 0x48025802, 0x0511fa1b, 0x0501f0ed, + 0x59a80048, 0x82000580, 0x0000ffff, 0x05000003, + 0x0511fa15, 0x0501f0e7, 0x0569fd46, 0x05000017, + 0x0569fd49, 0x05000008, 0x0531f84a, 0x05000006, + 0x59a8024c, 0x8c000506, 0x0500004e, 0x0529fff7, + 0x050200dc, 0x80000580, 0x0509ffae, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x4a01a8e4, 0x00000080, + 0x4a038802, 0x0000ffff, 0x850e1d02, 0x0545f9f5, + 0x0501fcb4, 0x0501f0cf, 0x59a8024c, 0x8c00050a, + 0x05020003, 0x8c000506, 0x05000037, 0x8c000500, + 0x05000035, 0x4a038802, 0x0000ffbf, 0x8c000502, + 0x05000031, 0x0525f951, 0x05020004, 0x599c0018, + 0x8c000516, 0x05020029, 0x59a8004d, 0x82000580, + 0x0000ffff, 0x05000020, 0x0525f948, 0x05000006, + 0x59a804d1, 0x8c000500, 0x05000003, 0x0511fc9b, + 0x0501f008, 0x41781800, 0x0569fd23, 0x05000002, + 0x60401800, 0x59a8024c, 0x8c00050a, 0x05120af3, + 0x42024800, 0x001124b6, 0x417a4000, 0x59240200, + 0x82000500, 0x000000e0, 0x82000580, 0x000000e0, + 0x050200a4, 0x050dff8c, 0x59a8024c, 0x8c000504, + 0x050200a0, 0x600c1000, 0x417a5800, 0x050dffab, + 0x0501f09c, 0x59a8024c, 0x8c00051c, 0x05020003, + 0x8c000504, 0x05fc07f8, 0x59a8004e, 0x80000540, + 0x05020094, 0x59a8024c, 0x8c000508, 0x05020017, + 0x59a80047, 0x80000540, 0x0502008e, 0x59a8024c, + 0x8c00050e, 0x0500000c, 0x8c000502, 0x0502000a, + 0x052dfff0, 0x05000087, 0x82000500, 0xffffff77, + 0x4803524c, 0x4a035048, 0x0000ffff, 0x0511f9ae, + 0x0501f080, 0x0569fcf0, 0x0500000c, 0x0511fd3c, + 0x0502007c, 0x0501f009, 0x599c1819, 0x8c0c0510, + 0x05000004, 0x8c000502, 0x05020021, 0x0501f075, + 0x8c000516, 0x05000073, 0x0529ff8c, 0x05020071, + 0x0525f8fe, 0x05020004, 0x599c0018, 0x8c000516, + 0x05020003, 0x052dfbaf, 0x0502006a, 0x59a80006, + 0x8c00051c, 0x05020004, 0x599c0017, 0x8c00050a, + 0x0500000f, 0x59a8b0ac, 0x417a8800, 0x0001fb08, + 0x05020004, 0x59340200, 0x8c00051a, 0x0502005d, + 0x81468800, 0x83440580, 0x000007f0, 0x05020002, + 0x60028810, 0x8058b040, 0x05fe07f5, 0x0569fce7, + 0x05000004, 0x4a038802, 0x0000ffbf, 0x0501f003, + 0x4a038802, 0x0000ffff, 0x42001800, 0x00111ce0, + 0x0501fd73, 0x42001800, 0x00111ced, 0x0501fd70, + 0x850e1d02, 0x4a01a8e4, 0x00000080, 0x600ed800, + 0x4a035048, 0x0000ffff, 0x0501fc26, 0x80000580, + 0x0509ff14, 0x497b50a9, 0x6407507b, 0x0525f8cb, + 0x0502000b, 0x599c0018, 0x8c000516, 0x05000008, + 0x59a804d1, 0x8c00050e, 0x05020036, 0x8400054e, + 0x480354d1, 0x0521fe46, 0x0501f016, 0x59a81a4c, + 0x59a82044, 0x82102580, 0x0000aaaa, 0x05000004, + 0x8c0c0506, 0x05020002, 0x480f544c, 0x8c0c0508, + 0x05000007, 0x599c1819, 0x8c0c0510, 0x05000004, + 0x61f8180f, 0x60102000, 0x0501f003, 0x61fc19ff, + 0x60182000, 0x60003000, 0x417a4000, 0x0521fdd2, + 0x052dff96, 0x0500000a, 0x59c40006, 0x052dff81, + 0x05000004, 0x82000500, 0xffffff0f, 0x0501f003, + 0x82000500, 0xfbffffff, 0x48038806, 0x0525f89f, + 0x0500000a, 0x59a804d1, 0x8c000500, 0x05000007, + 0x59c40801, 0x82040d40, 0x00004000, 0x48078801, + 0x64c378e4, 0x0501f006, 0x59c40801, 0x82040d00, + 0xffffbfff, 0x48078801, 0x648378e4, 0x0545f925, + 0x1c01f000, 0x4c040000, 0x4c080000, 0x4c100000, + 0x59a8006d, 0x90000c84, 0x050219df, 0x0c01f805, + 0x5c002000, 0x5c001000, 0x5c000800, 0x1c01f000, + 0x00100440, 0x001004da, 0x001004ff, 0x001005ad, + 0x60380938, 0x050df9f0, 0x90040550, 0x82000500, + 0xfffffff7, 0x60380938, 0x050df9f0, 0x59c410a3, + 0x84081518, 0x480b88a3, 0x0521fe72, 0x05020021, + 0x599c0019, 0x82000500, 0x0000e000, 0x82000580, + 0x00004000, 0x0502001b, 0x59a808a8, 0x90040d07, + 0x90040580, 0x0502000b, 0x59a8006c, 0x90000582, + 0x05000011, 0x050df933, 0x497b506b, 0x050dfd32, + 0x640f5079, 0x640b506c, 0x64075078, 0x0501f00a, + 0x90040584, 0x05020008, 0x497b2804, 0x497b2805, + 0x050dfd38, 0x64075078, 0x4a035079, 0xaabbccdd, + 0x6413506c, 0x59a800a8, 0x80000000, 0x480350a8, + 0x60000001, 0x0509fe97, 0x053df80a, 0x59c408a3, + 0x82040d00, 0xfffffff7, 0x480788a3, 0x052dff2b, + 0x0500000d, 0x052dff35, 0x0500000b, 0x052dff2d, + 0x0502099d, 0x59c400a3, 0x84000532, 0x84000570, + 0x480388a3, 0x0531fa5c, 0x4a038808, 0x00000208, + 0x0501f012, 0x59c400a3, 0x84000530, 0x82000500, + 0xbf7fffff, 0x480388a3, 0x61e00801, 0x0525ff32, + 0x59c400a3, 0x82000540, 0x00018000, 0x8400051c, + 0x480388a3, 0x82000500, 0xfffeffff, 0x480388a3, + 0x4a038808, 0x00000200, 0x59c40006, 0x82000500, + 0xfbffff0e, 0x48038806, 0x497b282d, 0x497b282e, + 0x61d00803, 0x42001000, 0x001005c7, 0x0539fe1f, + 0x59c40805, 0x64078805, 0x0509ff44, 0x05020006, + 0x60040000, 0x050df924, 0x60040000, 0x050df8f2, + 0x0501f01e, 0x0509ff43, 0x05020006, 0x41780000, + 0x050df91d, 0x41780000, 0x050df8eb, 0x0501f017, + 0x0509ff42, 0x05020006, 0x60080000, 0x050df916, + 0x60080000, 0x050df8e4, 0x0501f010, 0x0509ff41, + 0x05020006, 0x600c0000, 0x050df90f, 0x600c0000, + 0x050df8dd, 0x0501f009, 0x0509ff40, 0x0502095a, + 0x59a80078, 0x800001c0, 0x05000004, 0x0509ff40, + 0x6407506d, 0x0501f018, 0x050df95d, 0x6407506d, + 0x052dfeda, 0x05000008, 0x052dfee4, 0x05000006, + 0x052dfedc, 0x0502094c, 0x64075045, 0x052dfe4a, + 0x0501f00d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000003, 0x4a038805, 0x04000000, 0x59c400a3, + 0x82000540, 0x0001c000, 0x480388a3, 0x84000520, + 0x480388a3, 0x1c01f000, 0x0501f8e9, 0x05020003, + 0x640f506d, 0x0501f021, 0x0509ff1c, 0x0502000d, + 0x59a80078, 0x800001c0, 0x0500000a, 0x0509ff1c, + 0x59a80077, 0x8c00051e, 0x05000018, 0x052dfebd, + 0x05020006, 0x64075045, 0x052dfe2b, 0x0501f003, + 0x050df907, 0x05020011, 0x050df89e, 0x640b506d, + 0x497b5078, 0x59c400a3, 0x84000520, 0x480388a3, + 0x052dfeb0, 0x05000009, 0x0521fdc6, 0x05000007, + 0x497b282d, 0x497b282e, 0x60b40800, 0x42001000, + 0x001005c7, 0x0539fdbd, 0x1c01f000, 0x0501f8c4, + 0x05020003, 0x640f506d, 0x0501f0a9, 0x4a038805, + 0x000000f0, 0x050df8ee, 0x050200a0, 0x050dfaf9, + 0x05000017, 0x050dfade, 0x05020015, 0x050dfae7, + 0x0502000a, 0x59a80079, 0x90000584, 0x05fc07f2, + 0x0509fee4, 0x0502000e, 0x59a80079, 0x82000580, + 0xaabbccdd, 0x05fc07ec, 0x59a80079, 0x90000580, + 0x05fc07e9, 0x0509fec9, 0x05020005, 0x59a80079, + 0x82000580, 0xaabbccdd, 0x05fc07e3, 0x59a800aa, + 0x8c000500, 0x0502000b, 0x59a80887, 0x8c04050c, + 0x05020008, 0x60380938, 0x050df90b, 0x90040548, + 0x82000500, 0xffffffef, 0x60380938, 0x050df90b, + 0x050dfad4, 0x05000032, 0x0525f817, 0x0500000c, + 0x4a03c014, 0x00200020, 0x59c40001, 0x82000500, + 0x00018000, 0x82000580, 0x00018000, 0x05020026, + 0x4a03c013, 0x00200020, 0x0501f025, 0x4a03c013, + 0x03800300, 0x4a03c014, 0x03800380, 0x59c40001, + 0x82000500, 0x00018000, 0x82000580, 0x00018000, + 0x0502000c, 0x60880801, 0x61d81000, 0x60201800, + 0x0525f801, 0x050008cc, 0x60880801, 0x61b81000, + 0x60201800, 0x0521fffc, 0x050008c7, 0x0501f00b, + 0x60880801, 0x61d81000, 0x60201800, 0x0525f804, + 0x050008c1, 0x60880801, 0x61b81000, 0x60201800, + 0x0521ffff, 0x050008bc, 0x4a03c014, 0x03800000, + 0x0501f003, 0x4a03c013, 0x00200000, 0x052dfe45, + 0x0500003d, 0x59c400a4, 0x9000050f, 0x90000588, + 0x05000021, 0x59c40005, 0x8c000534, 0x0502001e, + 0x5994002f, 0x800001c0, 0x05000007, 0x0501fadb, + 0x90000402, 0x5994082d, 0x80040480, 0x0502103c, + 0x0501f004, 0x5994002d, 0x90000482, 0x05021038, + 0x052dfe36, 0x05020036, 0x4a038805, 0x000000f0, + 0x052dfe60, 0x4a035044, 0x0000aaaa, 0x64035045, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f019, 0x052dfe25, 0x05020007, 0x59a80044, + 0x82000580, 0x0000aaaa, 0x05020003, 0x4a035040, + 0x00ffffff, 0x497b5044, 0x59c40006, 0x82000540, + 0x04000001, 0x48038806, 0x8d0c0506, 0x05020004, + 0x59c408a3, 0x90040d48, 0x480788a3, 0x6006d800, + 0x6403506d, 0x64078805, 0x497b282d, 0x497b282e, + 0x0501f00f, 0x59c40005, 0x82000500, 0x000000c0, + 0x0500000b, 0x59c40006, 0x82000540, 0x000000f1, + 0x48038806, 0x05fdf7f2, 0x0509fe54, 0x05020004, + 0x59a80078, 0x800001c0, 0x05fe0757, 0x497b8885, + 0x1c01f000, 0x4803c856, 0x0521fd0e, 0x05020005, + 0x050dfc0b, 0x42000000, 0x00112463, 0x0569f9a7, + 0x60000001, 0x0509fd4f, 0x6403506d, 0x0509fe43, + 0x05020009, 0x59a8006b, 0x800001c0, 0x05000004, + 0x80000040, 0x4803506b, 0x05020003, 0x642b506b, + 0x64075078, 0x497b8885, 0x0501f224, 0x5994002d, + 0x5994082e, 0x80040540, 0x1c01f000, 0x497b282e, + 0x1c01f000, 0x4a038805, 0x000000f0, 0x1c01f000, + 0x64235096, 0x640f5097, 0x64035098, 0x4a035099, + 0x001090d5, 0x0531f91d, 0x4a03544c, 0x0000ffff, + 0x4a035040, 0x00ffffff, 0x0559f838, 0x4a035050, + 0x20200000, 0x4a035051, 0x88000200, 0x4a035052, + 0x00ff001f, 0x4a035053, 0x000007d0, 0x4a035054, + 0x80000a00, 0x4a035055, 0xa0000200, 0x4a035056, + 0x00ff0004, 0x4a035057, 0x00010000, 0x4a035058, + 0x80000000, 0x4a035059, 0x00000200, 0x4a03505a, + 0x00ff0000, 0x4a03505b, 0x00010000, 0x4a035062, + 0x514c4f47, 0x4a035063, 0x49432020, 0x1c01f000, + 0x4d440000, 0x417a8800, 0x4c5c0000, 0x4178b800, + 0x0001fb08, 0x05020004, 0x0529fef4, 0x05020002, + 0x805cb800, 0x81468800, 0x83440580, 0x000007f0, + 0x05020002, 0x60028810, 0x59a800ad, 0x81440580, + 0x05fe07f4, 0x405c0800, 0x5c00b800, 0x5c028800, + 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, + 0x4803c857, 0x0501f808, 0x485fc857, 0x4203e000, + 0x50000000, 0x5c000000, 0x4d780000, 0x6008b900, + 0x0501f005, 0x485fc857, 0x4203e000, 0x50000000, + 0x6008b900, 0x05006000, 0x4c000000, 0x4c040000, + 0x59bc00ea, 0x4803c857, 0x90000507, 0x90000581, + 0x05020003, 0x60000800, 0x0541fbd4, 0x59b800ea, + 0x4803c857, 0x641370e8, 0x5c000800, 0x4807c025, + 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, + 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, + 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, + 0x4803c029, 0x80000120, 0x4803c02a, 0x41780800, + 0x4807c027, 0x59a800b4, 0x8c00050a, 0x05000005, + 0x59e00027, 0x8400054a, 0x4803c857, 0x4803c027, + 0x0569fa3a, 0x0500004a, 0x42000800, 0x0011456c, + 0x46000800, 0xfaceface, 0x80040800, 0x4c080000, + 0x4c0c0000, 0x600010f4, 0x58080013, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x58080024, + 0x44000800, 0x80040800, 0x58080025, 0x44000800, + 0x80040800, 0x58080028, 0x44000800, 0x80040800, + 0x610010f4, 0x602c1800, 0x50080000, 0x44000800, + 0x80081000, 0x80040800, 0x800c1840, 0x05fe07fb, + 0x600c1800, 0x600010f6, 0x480c1003, 0x58080005, + 0x44000800, 0x80040800, 0x800c1840, 0x05fe17fb, + 0x600010f8, 0x58080002, 0x44000800, 0x80040800, + 0x58080003, 0x44000800, 0x80040800, 0x58080020, + 0x44000800, 0x80040800, 0x58080021, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x600010f6, + 0x58080007, 0x44000800, 0x80040800, 0x5808002b, + 0x44000800, 0x80040800, 0x5808007c, 0x44000800, + 0x80040800, 0x5c001800, 0x5c001000, 0x64030000, + 0x485fc020, 0x905cb9c0, 0x905cbd52, 0x485fc011, + 0x4203e000, 0x40000000, 0x6016d800, 0x59e00017, + 0x60000800, 0x8c00050a, 0x050a08ab, 0x8d0c0530, + 0x050a089e, 0x050a08a0, 0x6403c017, 0x4203e000, + 0x30000001, 0x0501f94a, 0x05fdf7ff, 0x600c0000, + 0x0501f80c, 0x4a03c855, 0x0001eb5a, 0x59e40001, + 0x82000540, 0xff000700, 0x4803c801, 0x42000000, + 0x00112489, 0x49780003, 0x49780004, 0x1c01f000, + 0x42000800, 0x0011248b, 0x44000800, 0x59e40801, + 0x82041500, 0x00f3c0ff, 0x480bc801, 0x4a03c850, + 0x00114716, 0x800000d4, 0x82002400, 0x00114715, + 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, + 0x00114716, 0x82001400, 0x00000c00, 0x45780000, + 0x80000000, 0x80081d80, 0x05fe07fd, 0x4807c801, + 0x1c01f000, 0x42002000, 0x00112489, 0x59e41801, + 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, + 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, + 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, 0x1c01f000, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x42001000, 0x04000000, 0x41ccc800, 0x42002800, - 0x0010e4e5, 0x59a800d0, 0x82000d00, 0x000003ff, - 0x4c000000, 0x58140212, 0x0501f85d, 0x5c000000, - 0x4004b800, 0x4008c000, 0x905cbc06, 0x8c000516, - 0x05000002, 0x905cbc02, 0x0501f016, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x42002800, 0x0010e4e5, - 0x42001000, 0x03000000, 0x4000c800, 0x821c0500, - 0x00003c00, 0x80000114, 0x821c0d00, 0x000003ff, - 0x4c000000, 0x58140412, 0x0501f845, 0x5c000000, - 0x4004b800, 0x4008c000, 0x805cbc00, 0x805cb840, - 0x825c0480, 0x00000240, 0x05fe1ed0, 0x0501f878, - 0x405c0000, 0x905cbc02, 0x80600d40, 0x42002800, - 0x0010e4e5, 0x41784000, 0x58142017, 0x825c0480, - 0x00000101, 0x05021028, 0x5814000d, 0x80100400, - 0x44040000, 0x80102000, 0x80000000, 0x805cb840, - 0x82104d00, 0x000000ff, 0x05000847, 0x0500001a, - 0x4c000000, 0x0501f82e, 0x5c000000, 0x44080000, + 0x8d0c052a, 0x0500002f, 0x401c0000, 0x80040d40, + 0x4004b800, 0x400cc000, 0x4018c800, 0x0501f8d3, + 0x41784000, 0x42002800, 0x00112489, 0x58142017, + 0x5814000d, 0x80100400, 0x445c0000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x050008a9, + 0x0500001c, 0x4c000000, 0x0501f890, 0x5c000000, + 0x44080000, 0x80102000, 0x80000000, 0x82104d00, + 0x000000ff, 0x0500089f, 0x05000012, 0x44600000, + 0x80102000, 0x80000000, 0x82104d00, 0x000000ff, + 0x05000898, 0x0500000b, 0x44640000, 0x80102000, + 0x80000000, 0x82104d00, 0x000000ff, 0x05000891, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d72, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x4c5c0000, 0x4c600000, 0x4c640000, 0x42001000, + 0x04000000, 0x41ccc800, 0x42002800, 0x00112489, + 0x59a800d5, 0x82000d00, 0x000003ff, 0x4c000000, + 0x58140212, 0x0501f85d, 0x5c000000, 0x4004b800, + 0x4008c000, 0x905cbc06, 0x8c000516, 0x05000002, + 0x905cbc02, 0x0501f016, 0x4c5c0000, 0x4c600000, + 0x4c640000, 0x42002800, 0x00112489, 0x42001000, + 0x03000000, 0x4000c800, 0x821c0500, 0x00003c00, + 0x80000114, 0x821c0d00, 0x000003ff, 0x4c000000, + 0x58140412, 0x0501f845, 0x5c000000, 0x4004b800, + 0x4008c000, 0x805cbc00, 0x805cb840, 0x825c0480, + 0x00000240, 0x05fe1edc, 0x0501f878, 0x405c0000, + 0x905cbc02, 0x80600d40, 0x42002800, 0x00112489, + 0x41784000, 0x58142017, 0x825c0480, 0x00000101, + 0x05021028, 0x5814000d, 0x80100400, 0x44040000, 0x80102000, 0x80000000, 0x805cb840, 0x82104d00, - 0x000000ff, 0x0500083c, 0x0500000f, 0x50641800, - 0x440c0000, 0x80000000, 0x80102000, 0x8064c800, - 0x805cb840, 0x05fe07f6, 0x82104d00, 0x000000ff, - 0x05000831, 0x05000004, 0x48102817, 0x802041c0, - 0x05060cd2, 0x5c00c800, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x82100500, 0x000000ff, 0x805c0400, - 0x82000480, 0x00000200, 0x05fc17d4, 0x6108b800, - 0x82600d40, 0x00008040, 0x05fdf7d0, 0x800001c0, - 0x05000006, 0x80041c80, 0x05001004, 0x05000003, - 0x40000800, 0x8408155c, 0x1c01f000, 0x59a800ba, - 0x800018c4, 0x800010ca, 0x800000cc, 0x800c0400, - 0x80081400, 0x59940024, 0x61a01807, 0x800c1c80, - 0x05021002, 0x61a01807, 0x5994002e, 0x800c0400, - 0x82001c80, 0x000007d0, 0x05001002, 0x6140000f, - 0x4c080000, 0x0501f8b6, 0x5c001000, 0x80081400, - 0x1c01f000, 0x4813c857, 0x5c036000, 0x4db00000, - 0x49b3c857, 0x40001800, 0x58140000, 0x8c000502, - 0x05000009, 0x58140821, 0x80040800, 0x48042821, - 0x4807c857, 0x8400054a, 0x48002800, 0x80000580, - 0x0501f00e, 0x82102500, 0x000003ff, 0x80204000, - 0x58140014, 0x80000000, 0x90000503, 0x48002814, - 0x05000003, 0x400c0000, 0x0501f002, 0x5814000d, - 0x80000540, 0x4803c857, 0x1c01f000, 0x42002800, - 0x0010e4e5, 0x58140000, 0x8c00050a, 0x0500002f, - 0x8c000502, 0x0502002d, 0x4c5c0000, 0x5814b821, - 0x49782821, 0x8400050a, 0x48002800, 0x58142017, - 0x4813c857, 0x5814000d, 0x80100400, 0x41784000, - 0x42000800, 0x0b000001, 0x44040000, 0x80000000, - 0x80102000, 0x82104d00, 0x000000ff, 0x05fc0fca, - 0x05fc0e3e, 0x4c000000, 0x05fdffb1, 0x5c000000, - 0x44080000, 0x80000000, 0x80102000, 0x82104d00, - 0x000000ff, 0x05fc0fc0, 0x05fc0e34, 0x445c0000, + 0x000000ff, 0x05000847, 0x0500001a, 0x4c000000, + 0x0501f82e, 0x5c000000, 0x44080000, 0x80102000, + 0x80000000, 0x805cb840, 0x82104d00, 0x000000ff, + 0x0500083c, 0x0500000f, 0x50641800, 0x440c0000, + 0x80000000, 0x80102000, 0x8064c800, 0x805cb840, + 0x05fe07f6, 0x82104d00, 0x000000ff, 0x05000831, + 0x05000004, 0x48102817, 0x802041c0, 0x05060d12, + 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x1c01f000, + 0x82100500, 0x000000ff, 0x805c0400, 0x82000480, + 0x00000200, 0x05fc17d4, 0x6108b800, 0x82600d40, + 0x00008040, 0x05fdf7d0, 0x800001c0, 0x05000006, + 0x80041c80, 0x05001004, 0x05000003, 0x40000800, + 0x8408155c, 0x1c01f000, 0x59a800bf, 0x800018c4, + 0x800010ca, 0x800000cc, 0x800c0400, 0x80081400, + 0x59940024, 0x61a01807, 0x800c1c80, 0x05021002, + 0x61a01807, 0x5994002f, 0x800c0400, 0x82001c80, + 0x000007d0, 0x05001002, 0x6140000f, 0x4c080000, + 0x0501f8b6, 0x5c001000, 0x80081400, 0x1c01f000, + 0x4813c857, 0x5c036000, 0x4db00000, 0x49b3c857, + 0x40001800, 0x58140000, 0x8c000502, 0x05000009, + 0x58140821, 0x80040800, 0x48042821, 0x4807c857, + 0x8400054a, 0x48002800, 0x80000580, 0x0501f00e, + 0x82102500, 0x000003ff, 0x80204000, 0x58140014, + 0x80000000, 0x90000503, 0x48002814, 0x05000003, + 0x400c0000, 0x0501f002, 0x5814000d, 0x80000540, + 0x4803c857, 0x1c01f000, 0x42002800, 0x00112489, + 0x58140000, 0x8c00050a, 0x0500002f, 0x8c000502, + 0x0502002d, 0x4c5c0000, 0x5814b821, 0x49782821, + 0x8400050a, 0x48002800, 0x58142017, 0x4813c857, + 0x5814000d, 0x80100400, 0x41784000, 0x42000800, + 0x0b000001, 0x44040000, 0x80000000, 0x80102000, + 0x82104d00, 0x000000ff, 0x05fc0fca, 0x05fc0e4a, + 0x4c000000, 0x05fdffb1, 0x5c000000, 0x44080000, 0x80000000, 0x80102000, 0x82104d00, 0x000000ff, - 0x05fc0fb9, 0x05fc0e2d, 0x48102817, 0x802041c0, - 0x05060c5a, 0x405c2000, 0x600c1800, 0x60a01100, - 0x0521f828, 0x5c00b800, 0x1c01f000, 0x1c01f000, - 0x59a800b5, 0x8c000530, 0x05fe07fe, 0x4c080000, - 0x60101000, 0x0501f849, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0539f844, 0x4c080000, 0x60201000, - 0x0501f842, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0539f83d, 0x4c080000, 0x60401000, 0x0501f83b, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 08:07:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1EBBB295C4; Tue, 3 May 2016 08:07:41 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::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 77F941938; Tue, 3 May 2016 08:07:41 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id n129so2337844wmn.1; Tue, 03 May 2016 01:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=66zd5Jf7kQ3lbDelOA6rr8pzIKPytvh6J+a87S6qy+Y=; b=zAHCcZ3jVDi8gmG/XwEYwcemA2jGoi8bFf6H/0eZ84sFAK+FmT0S317u6emAU8dvPr EcSf8IwDEeLwDBVZGM5IFyJKfqhfRWADk4pJ215tVrtR5xAn1UqwDcl48iYtFJAnbeBX 3WvLf5XR2+QmcF9tGFnPxLXIhIjGzNuFulmh0UvPUJ51R4Q2IW4DAXdkT4bCFLcm7EmY hwEJhewHitdbBDdtH9+QqIQJGsMMoNEaDPX2fD7rLPxTZNvl8iI6U3OVZweaebRoWNRi 5xoSVw5++BLjxIkbnXIlrcv4L0QbvjNDgM6HO6xkygtomGw10Y1V3W7isoSiXRrcMC5w BbyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=66zd5Jf7kQ3lbDelOA6rr8pzIKPytvh6J+a87S6qy+Y=; b=GVh+8aVDFcigdf3N1uRKy5VP8xL6x0cpfrm2fDZUOdo+kkP4yYNqw0kOnqc/OCu44t +d5G6f/gBMBa2Z4LuwBFpnmo+G+rk0w2P2wO8eqcLTMlteqvyp/HYJpmCE3d6Nm7RtYh 8DUyOiS9AtGI3K7SmjEgeimhF1f4IWjjGxJqs09m7oABpIJPJ1Svg5Px4lY4pUp0Z0hr hnGcbDn/euhkL4p6E3edIdbNwdj70Gdfe1gUlx6lRZHXFPY1ADTA9Bh3NtOcdRCagl2B q0NQ/m+E1DXsRVNemcJbLAL58M/oWi3DnBTOUURRwpqsinYjkhuG49rze8mNP3OpPBCz XK0Q== X-Gm-Message-State: AOPr4FUbdi6RkXMaIVXpBNzoby8L5fK99inAvu+uaODlkkrawq8ebu+QwrraUouqwfrWiw== X-Received: by 10.194.175.168 with SMTP id cb8mr1341704wjc.56.1462262860084; Tue, 03 May 2016 01:07:40 -0700 (PDT) Received: from localhost (172.red-83-45-36.dynamicip.rima-tde.net. [83.45.36.172]) by smtp.gmail.com with ESMTPSA id o73sm23214942wme.16.2016.05.03.01.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 01:07:39 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Tue, 3 May 2016 10:07:33 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: "Ngie Cooper (yaneurabeya)" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298929 - head/sys/dev/xen/timer Message-ID: <20160503080733.gs3jkxysf7zntnno@mac> References: <201605021615.u42GFSeR052375@repo.freebsd.org> <337D6745-6821-4035-B1CB-F22C6A96E568@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <337D6745-6821-4035-B1CB-F22C6A96E568@gmail.com> User-Agent: Mutt/1.6.0-neo (2016-04-07) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:07:42 -0000 On Mon, May 02, 2016 at 11:46:31AM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On May 2, 2016, at 09:15, Roger Pau Monné wrote: > > > > Author: royger > > Date: Mon May 2 16:15:28 2016 > > New Revision: 298929 > > URL: https://svnweb.freebsd.org/changeset/base/298929 > > > > Log: > > xen/time: allow Dom0 to set the host time > > > > Dom0 should be able to set the host time. This is implemented by first > > writing to the RTC (as would be done on bare metal), and then using the > > XENPF_settime64 hypercall in order to force Xen to update the wallclock > > shared page of all domains. > > > > Sponsored by: Citrix Systems R&D > > > > Modified: > > head/sys/dev/xen/timer/timer.c > > > > Modified: head/sys/dev/xen/timer/timer.c > > ============================================================================== > > --- head/sys/dev/xen/timer/timer.c Mon May 2 16:14:55 2016 (r298928) > > +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:15:28 2016 (r298929) > > @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); > > > > #include > > > > +#include > > + > > #include "clock_if.h" > > > > static devclass_t xentimer_devclass; > > @@ -211,11 +214,32 @@ xen_fetch_uptime(struct timespec *ts) > > static int > > xentimer_settime(device_t dev __unused, struct timespec *ts) > > { > > + struct xen_platform_op settime; > > + int ret; > > + > > /* > > * Don't return EINVAL here; just silently fail if the domain isn't > > * privileged enough to set the TOD. > > */ > > - return (0); > > + if (!xen_initial_domain()) > > + return (0); > > + > > + /* Set the native RTC. */ > > + atrtc_set(ts); > > + > > + settime.cmd = XENPF_settime64; > > + settime.u.settime64.mbz = 0; > > + settime.u.settime64.secs = ts->tv_sec; > > + settime.u.settime64.nsecs = ts->tv_nsec; > > + settime.u.settime64.system_time = > > + xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); > > + > > + ret = HYPERVISOR_platform_op(&settime); > > + ret = ret != 0 ? xen_translate_error(ret) : 0; > > + if (ret != 0 && bootverbose) > > + device_printf(dev, "failed to set Xen PV clock: %d\n", ret); > > + > > + return (ret); > > } > > This broke the build on i386 with clang: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3028/ Should be fixed in 298971. Roger. From owner-svn-src-all@freebsd.org Tue May 3 08:13:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06982B298B6; Tue, 3 May 2016 08: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 B8F501F0D; Tue, 3 May 2016 08:13:26 +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 u438DPHq048181; Tue, 3 May 2016 08:13:25 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u438DPTe048180; Tue, 3 May 2016 08:13:25 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605030813.u438DPTe048180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 3 May 2016 08:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298974 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:13:27 -0000 Author: sephe Date: Tue May 3 08:13:25 2016 New Revision: 298974 URL: https://svnweb.freebsd.org/changeset/base/298974 Log: tcp/lro: Refactor the active list operation. Ease more work concerning active list, e.g. hash table etc. Reviewed by: gallatin, rrs (earlier version) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6137 Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Tue May 3 08:07:38 2016 (r298973) +++ head/sys/netinet/tcp_lro.c Tue May 3 08:13:25 2016 (r298974) @@ -69,6 +69,20 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO static void tcp_lro_rx_done(struct lro_ctrl *lc); +static __inline void +tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_entry *le) +{ + + LIST_INSERT_HEAD(&lc->lro_active, le, next); +} + +static __inline void +tcp_lro_active_remove(struct lro_entry *le) +{ + + LIST_REMOVE(le, next); +} + int tcp_lro_init(struct lro_ctrl *lc) { @@ -129,7 +143,7 @@ tcp_lro_free(struct lro_ctrl *lc) /* free active mbufs, if any */ while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); m_freem(le->m_head); } @@ -234,7 +248,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc) struct lro_entry *le; while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } @@ -252,7 +266,7 @@ tcp_lro_flush_inactive(struct lro_ctrl * timevalsub(&tv, timeout); LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (timevalcmp(&tv, &le->mtime, >=)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } @@ -620,7 +634,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Flush now if appending will result in overflow. */ if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); break; } @@ -629,7 +643,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m if (__predict_false(seq != le->next_seq || (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { /* Out of order packet or duplicate ACK. */ - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); return (TCP_LRO_CANNOT); } @@ -662,7 +676,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * be further delayed. */ if (le->append_cnt >= lc->lro_ackcnt_lim) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } return (0); @@ -686,7 +700,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m * overflow, pro-actively flush now. */ if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { - LIST_REMOVE(le, next); + tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } else getmicrotime(&le->mtime); @@ -701,7 +715,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Start a new segment chain. */ le = LIST_FIRST(&lc->lro_free); LIST_REMOVE(le, next); - LIST_INSERT_HEAD(&lc->lro_active, le, next); + tcp_lro_active_insert(lc, le); getmicrotime(&le->mtime); /* Start filling in details. */ From owner-svn-src-all@freebsd.org Tue May 3 08:35:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FE9B2A080; Tue, 3 May 2016 08:35:36 +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 71A321C6B; Tue, 3 May 2016 08:35:36 +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 u438ZZgi054748; Tue, 3 May 2016 08:35:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u438ZZ0w054747; Tue, 3 May 2016 08:35:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605030835.u438ZZ0w054747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 08:35: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: r298975 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 08:35:36 -0000 Author: mav Date: Tue May 3 08:35:35 2016 New Revision: 298975 URL: https://svnweb.freebsd.org/changeset/base/298975 Log: MFC r298103: Simplify memory allocation for NS requests. Since we no longer need additional buffers for request and response IOCBs, we can increase receive space by 192 bytes, that is enough for fetching 48 more ports. The new limit is 1020 fabric ports per virtual port. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:13:25 2016 (r298974) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:35:35 2016 (r298975) @@ -3465,19 +3465,14 @@ abort: * * Use the GID_FT command to get all Port IDs for FC4 SCSI devices it knows. * - * For 2100-23XX cards, we can use the SNS mailbox command to pass simple - * name server commands to the switch management server via the QLogic f/w. + * For 2100-23XX cards, we use the SNS mailbox command to pass simple name + * server commands to the switch management server via the QLogic f/w. * - * For the 24XX card, we have to use CT-Pass through run via the Execute IOCB - * mailbox command. + * For the 24XX and above card, we use CT Pass-through IOCB. */ -#define GIDLEN (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) +#define GIDLEN ISP_FC_SCRLEN #define NGENT ((GIDLEN - 16) >> 2) -#define XTXOFF (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) /* CT request */ -#define CTXOFF (ISP_FC_SCRLEN - (2 * QENTRY_LEN)) /* Request IOCB */ -#define ZTXOFF (ISP_FC_SCRLEN - (1 * QENTRY_LEN)) /* Response IOCB */ - static int isp_gid_ft_sns(ispsoftc_t *isp, int chan) { @@ -3507,16 +3502,16 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan rq->snscb_mword_div_2 = NGENT; rq->snscb_fc4_type = FC4_SCSI; - isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)&scp[CTXOFF]); - MEMORYBARRIER(isp, SYNC_SFORDEV, CTXOFF, SNS_GID_FT_REQ_SIZE, chan); + isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)scp); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); mbs.param[0] = MBOX_SEND_SNS; mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; - mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); - mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); - mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); - mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { if (mbs.param[0] == MBOX_INVALID_COMMAND) { @@ -3555,8 +3550,8 @@ isp_ct_passthru(ispsoftc_t *isp, int cha pt.ctp_rsp_cnt = 1; pt.ctp_rsp_bcnt = rsp_bcnt; pt.ctp_cmd_bcnt = cmd_bcnt; - pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); - pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma); + pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma); pt.ctp_dataseg[0].ds_count = cmd_bcnt; pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma); pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); @@ -3626,12 +3621,12 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; ct.ct_cmd_resp = SNS_GID_FT; ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; - isp_put_ct_hdr(isp, &ct, (ct_hdr_t *) &scp[XTXOFF]); - rp = (uint32_t *) &scp[XTXOFF + sizeof(ct)]; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); + rp = (uint32_t *) &scp[sizeof(ct)]; ISP_IOZPUT_32(isp, FC4_SCSI, rp); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "CT request", - sizeof(ct) + sizeof(uint32_t), &scp[XTXOFF]); + sizeof(ct) + sizeof(uint32_t), scp); } if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { @@ -4042,9 +4037,9 @@ isp_register_fc4_type_24xx(ispsoftc_t *i rp.rftid_portid[1] = fcp->isp_portid >> 8; rp.rftid_portid[2] = fcp->isp_portid; rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); - isp_put_rft_id(isp, &rp, (rft_id_t *)&scp[XTXOFF]); + isp_put_rft_id(isp, &rp, (rft_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), scp); if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4097,9 +4092,9 @@ isp_register_fc4_features_24xx(ispsoftc_ if (fcp->role & ISP_ROLE_INITIATOR) rp.rffid_fc4features |= 2; rp.rffid_fc4type = FC4_SCSI; - isp_put_rff_id(isp, &rp, (rff_id_t *)&scp[XTXOFF]); + isp_put_rff_id(isp, &rp, (rff_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", sizeof(rft_id_t), &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", sizeof(rft_id_t), scp); if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4152,20 +4147,20 @@ isp_register_port_name_24xx(ispsoftc_t * rp.rspnid_length = 0; len = offsetof(rspn_id_t, rspnid_name); mtx_lock(&prison0.pr_mtx); - rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); mtx_unlock(&prison0.pr_mtx); - rp.rspnid_length += sprintf(&scp[XTXOFF + len + rp.rspnid_length], + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], ":%s", device_get_nameunit(isp->isp_dev)); if (chan != 0) { - rp.rspnid_length += sprintf(&scp[XTXOFF + len + - rp.rspnid_length], "/%d", chan); + rp.rspnid_length += sprintf(&scp[len + rp.rspnid_length], + "/%d", chan); } len += rp.rspnid_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; - isp_put_rspn_id(isp, &rp, (rspn_id_t *)&scp[XTXOFF]); + isp_put_rspn_id(isp, &rp, (rspn_id_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4216,14 +4211,14 @@ isp_register_node_name_24xx(ispsoftc_t * rp.rsnnnn_length = 0; len = offsetof(rsnn_nn_t, rsnnnn_name); mtx_lock(&prison0.pr_mtx); - rp.rsnnnn_length += sprintf(&scp[XTXOFF + len + rp.rsnnnn_length], + rp.rsnnnn_length += sprintf(&scp[len + rp.rsnnnn_length], "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD"); mtx_unlock(&prison0.pr_mtx); len += rp.rsnnnn_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; - isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)&scp[XTXOFF]); + isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)scp); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, &scp[XTXOFF]); + isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); From owner-svn-src-all@freebsd.org Tue May 3 11:49:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFA9FB2B9C4; Tue, 3 May 2016 11:49:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B28C1E92; Tue, 3 May 2016 11:49:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43BnT6g014335; Tue, 3 May 2016 11:49:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43BnTeS014332; Tue, 3 May 2016 11:49:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031149.u43BnTeS014332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 11:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298976 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 11:49:30 -0000 Author: pfg Date: Tue May 3 11:49:29 2016 New Revision: 298976 URL: https://svnweb.freebsd.org/changeset/base/298976 Log: Revert r298955 for the cxgbe firmware. These files have checksums that are none of my business. Requested by: np Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Tue May 3 08:35:35 2016 (r298975) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Tue May 3 11:49:29 2016 (r298976) @@ -17,7 +17,7 @@ # finite. This requires balancing the configuration/operation needs of # device drivers across OSes and a large number of customer application. # -# Some of the more important resources to allocate and their constraints are: +# Some of the more important resources to allocate and their constaints are: # 1. Virtual Interfaces: 128. # 2. Ingress Queues with Free Lists: 1024. PCI-E SR-IOV Virtual Functions # must use a power of 2 Ingress Queues. @@ -275,7 +275,7 @@ # to directly select the type of Physical Function to which they wish to be # attached. # -# Note that the actual values used for the PCI-E Intellectual Property will be +# Note that the actual values used for the PCI-E Intelectual Property will be # 1 less than those below since that's the way it "counts" things. For # readability, we use the number we actually mean ... # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Tue May 3 08:35:35 2016 (r298975) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Tue May 3 11:49:29 2016 (r298976) @@ -17,7 +17,7 @@ # finite. This requires balancing the configuration/operation needs of # device drivers across OSes and a large number of customer application. # -# Some of the more important resources to allocate and their constraints are: +# Some of the more important resources to allocate and their constaints are: # 1. Virtual Interfaces: 128. # 2. Ingress Queues with Free Lists: 1024. PCI-E SR-IOV Virtual Functions # must use a power of 2 Ingress Queues. @@ -292,7 +292,7 @@ # to directly select the type of Physical Function to which they wish to be # attached. # -# Note that the actual values used for the PCI-E Intellectual Property will be +# Note that the actual values used for the PCI-E Intelectual Property will be # 1 less than those below since that's the way it "counts" things. For # readability, we use the number we actually mean ... # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Tue May 3 08:35:35 2016 (r298975) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Tue May 3 11:49:29 2016 (r298976) @@ -18,7 +18,7 @@ # are finite. This requires balancing the configuration/operation needs of # device drivers across OSes and a large number of customer application. # -# Some of the more important resources to allocate and their constraints are: +# Some of the more important resources to allocate and their constaints are: # 1. Virtual Interfaces: 256. # 2. Ingress Queues with Free Lists: 1024. # 3. Egress Queues: 128K. @@ -309,7 +309,7 @@ # to directly select the type of Physical Function to which they wish to be # attached. # -# Note that the actual values used for the PCI-E Intellectual Property will be +# Note that the actual values used for the PCI-E Intelectual Property will be # 1 less than those below since that's the way it "counts" things. For # readability, we use the number we actually mean ... # From owner-svn-src-all@freebsd.org Tue May 3 12:17:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF1DB2B94B for ; Tue, 3 May 2016 12:17:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm32-vm6.bullet.mail.bf1.yahoo.com (nm32-vm6.bullet.mail.bf1.yahoo.com [72.30.239.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96C001FAE for ; Tue, 3 May 2016 12:17:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462276225; bh=yBsSP/xtGFo7rSuAkorY8f7XcdCiXYzI9HLHuowB32I=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=lvZAiBGrEXJFNQ36S7NTcEJ5KEnXJgYeBKdiPKelJqunhSjmo3Us6HT4y6E3S5sZU7Dl9jQIvhTucY65FBdlGrCF+G8cUHV5zJZY4bk96i83LTBoSC0HdN0wDwl2f0NoKfDFEj57CgmC+Z7wtc6n+q3gWP8Mj4HlqrILhh3vEMrF6JHHaGtBGPJGfRztyewBqG2Y6Ceq1R1/+FC7TbXrTzqADR0XNcM4xGzBMu1dm9e7kMJOcnYouo6nxs9DYlw8tXOefpBtbji/Ypc4mm7t7WJxOcykHCr9GRKb0mRmiW8OyjiOn+ojJUQ8rYwUkQt2UTvq2oc0HHVg8civu1qqPA== Received: from [98.139.215.141] by nm32.bullet.mail.bf1.yahoo.com with NNFMP; 03 May 2016 11:50:25 -0000 Received: from [98.139.211.202] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 03 May 2016 11:50:25 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 03 May 2016 11:50:25 -0000 X-Yahoo-Newman-Id: 610677.73181.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: WPwZcFAVM1mTuf6zMXNDz8WKEjC_yywkIoDZWcsRLcixfS0 YNVkdcwMPpwFBXRuoiFAnJiFTXtw4nHJom760nHyKrIvHg9am95w7wk6Ig1u z6KARph5x8qQt9xomr3aKCix1pdGqO2fCKn8Ey9jWfFvXc4eMWN_ekWLHFJB eY.s_1pOMoYCorm828JNIMqEDYBcs4mA0lwcffFFuC_LETh457wiVIFzRNRP LKzgstdFHfeDC6GwALNRu_KdZn9uU0jrce0g.Hwlg2F9XlmCd8r9qq0NzgFt Z6YitU.t9O7tqfqhx2sASSnATgAe7j_UYTRWH0xOmgS.2jKNzCRnK0BHvMdG BsZml65SrDXqjSJo0UD6UbKGzwrpFg6eA8tAE2qh57g6ljLwRtbnPPdCcVuc S7X6cv4uHfzSpFMBzGXIIB6cxDkOyn4LZnMAzVaqeFXfBp3CpTFOdqy9atFi 1sGL3DTQNqoWk0D.sdVxE2VS612K3Neyka0rtU4h1ewiIlmMbhPVlX2qo8Za t7u.qe.O9yOm36djvnNC6jA.T6zsMgPey X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298955 - in head/sys/dev: aac aacraid acpi_support acpica advansys aha ahb ahci alpm altera/atse amr an asmc ata ata/chipsets atkbdc bce bhnd bhnd/bhndb bhnd/siba bktr buslogic bwi bxe... To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605030341.u433fQLh066657@repo.freebsd.org> <20160503074710.GA14852@ox> From: Pedro Giffuni Message-ID: Date: Tue, 3 May 2016 06:50:31 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160503074710.GA14852@ox> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 12:17:42 -0000 On 05/03/16 02:48, Navdeep Parhar wrote: > On Tue, May 03, 2016 at 03:41:26AM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Tue May 3 03:41:25 2016 >> New Revision: 298955 >> URL: https://svnweb.freebsd.org/changeset/base/298955 >> >> Log: >> sys/dev: minor spelling fixes. >> >> Most affect comments, very few have user-visible effects. >> >> Modified: >> ... >> head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt >> ... >> head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt >> head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt >> ... > > These 3 files have a checksum (see the checksum = line in the > [fini] section) that covers all of the contents of the file, including > comments. You can't modify these files without updating the checksum. > Please fix properly or revert. > Reverted, thanks! Pedro. From owner-svn-src-all@freebsd.org Tue May 3 14:30:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C6B5B2AD06; Tue, 3 May 2016 14:30:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F391675; Tue, 3 May 2016 14:30:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43EURgA063495; Tue, 3 May 2016 14:30:27 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43EURx9063494; Tue, 3 May 2016 14:30:27 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605031430.u43EURx9063494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 3 May 2016 14:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298977 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 14:30:28 -0000 Author: scottl Date: Tue May 3 14:30:26 2016 New Revision: 298977 URL: https://svnweb.freebsd.org/changeset/base/298977 Log: Fix a memory leak in the devctl notify code. Submitted by: markj MFC after: asap Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue May 3 11:49:29 2016 (r298976) +++ head/sys/cam/cam_periph.c Tue May 3 14:30:26 2016 (r298977) @@ -1876,6 +1876,7 @@ cam_periph_devctl_notify(union ccb *ccb) if (cgd->ccb_h.status == CAM_REQ_CMP) sbuf_bcat(&sb, cgd->serial_num, cgd->serial_num_len); + xpt_free_ccb((union ccb *)cgd); } sbuf_printf(&sb, "\" "); sbuf_printf(&sb, "cam_status=\"0x%x\" ", ccb->ccb_h.status); From owner-svn-src-all@freebsd.org Tue May 3 14:49:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97657B2B2AC; Tue, 3 May 2016 14:49:50 +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 6A00B10D0; Tue, 3 May 2016 14:49:50 +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 u43EnnUR069303; Tue, 3 May 2016 14:49:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43EnneY069302; Tue, 3 May 2016 14:49:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031449.u43EnneY069302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 14:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298978 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 14:49:50 -0000 Author: pfg Date: Tue May 3 14:49:49 2016 New Revision: 298978 URL: https://svnweb.freebsd.org/changeset/base/298978 Log: dev/iscsi: minor spelling fixes. No functional change. Reviewed by: trasz Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue May 3 14:30:26 2016 (r298977) +++ head/sys/dev/iscsi/icl_soft.c Tue May 3 14:49:49 2016 (r298978) @@ -782,7 +782,7 @@ icl_receive_thread(void *arg) /* * Set the low watermark, to be checked by * soreadable() in icl_soupcall_receive() - * to avoid unneccessary wakeups until there + * to avoid unnecessary wakeups until there * is enough data received to read the PDU. */ SOCKBUF_LOCK(&so->so_rcv); @@ -908,7 +908,7 @@ icl_conn_send_pdus(struct icl_conn *ic, /* * Set the low watermark, to be checked by * sowriteable() in icl_soupcall_send() - * to avoid unneccessary wakeups until there + * to avoid unnecessary wakeups until there * is enough space for the PDU to fit. */ SOCKBUF_LOCK(&so->so_snd); From owner-svn-src-all@freebsd.org Tue May 3 15:04:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C56FB2B5AA; Tue, 3 May 2016 15:04:58 +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 B174E1970; Tue, 3 May 2016 15:04:57 +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 u43F4uvU075143; Tue, 3 May 2016 15:04:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43F4ubx075142; Tue, 3 May 2016 15:04:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031504.u43F4ubx075142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 15:04: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: r298979 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:04:58 -0000 Author: pfg Date: Tue May 3 15:04:56 2016 New Revision: 298979 URL: https://svnweb.freebsd.org/changeset/base/298979 Log: MFC r298556: ifconfig: prevent some improbable signed integer overflows. ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int. Use an unsigned index to prevent overflowing the index. Adopt unsigned integers in other cases where it is useful to be aware of the unsigned quantities and there is no risk of the values being negative. Modified: stable/10/sbin/ifconfig/ifieee80211.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Tue May 3 14:49:49 2016 (r298978) +++ stable/10/sbin/ifconfig/ifieee80211.c Tue May 3 15:04:56 2016 (r298979) @@ -223,7 +223,7 @@ static int canpromote(int i, int from, int to) { const struct ieee80211_channel *fc = &chaninfo->ic_chans[i]; - int j; + u_int j; if ((fc->ic_flags & from) != from) return i; @@ -302,7 +302,7 @@ promote(int i) static void mapfreq(struct ieee80211_channel *chan, int freq, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -322,7 +322,7 @@ mapfreq(struct ieee80211_channel *chan, static void mapchan(struct ieee80211_channel *chan, int ieee, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -2939,7 +2939,7 @@ copy_essid(char buf[], size_t bufsize, c { const u_int8_t *p; size_t maxlen; - int i; + u_int i; if (essid_len > bufsize) maxlen = bufsize; @@ -4133,7 +4133,7 @@ static void printkey(const struct ieee80211req_key *ik) { static const uint8_t zerodata[IEEE80211_KEYBUF_SIZE]; - int keylen = ik->ik_keylen; + u_int keylen = ik->ik_keylen; int printcontents; printcontents = printkeys && @@ -4170,7 +4170,7 @@ printkey(const struct ieee80211req_key * break; } if (printcontents) { - int i; + u_int i; printf(" <"); for (i = 0; i < keylen; i++) From owner-svn-src-all@freebsd.org Tue May 3 15:06:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11E45B2B635; Tue, 3 May 2016 15:06:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE1991AE6; Tue, 3 May 2016 15:06:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43F6Tb5075238; Tue, 3 May 2016 15:06:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43F6TDV075237; Tue, 3 May 2016 15:06:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031506.u43F6TDV075237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 15:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r298980 - stable/9/sbin/ifconfig X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:06:31 -0000 Author: pfg Date: Tue May 3 15:06:29 2016 New Revision: 298980 URL: https://svnweb.freebsd.org/changeset/base/298980 Log: MFC r298556: ifconfig: prevent some improbable signed integer overflows. ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int. Use an unsigned index to prevent overflowing the index. Adopt unsigned integers in other cases where it is useful to be aware of the unsigned quantities and there is no risk of the values being negative. Modified: stable/9/sbin/ifconfig/ifieee80211.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/9/sbin/ifconfig/ifieee80211.c Tue May 3 15:04:56 2016 (r298979) +++ stable/9/sbin/ifconfig/ifieee80211.c Tue May 3 15:06:29 2016 (r298980) @@ -223,7 +223,7 @@ static int canpromote(int i, int from, int to) { const struct ieee80211_channel *fc = &chaninfo->ic_chans[i]; - int j; + u_int j; if ((fc->ic_flags & from) != from) return i; @@ -302,7 +302,7 @@ promote(int i) static void mapfreq(struct ieee80211_channel *chan, int freq, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -322,7 +322,7 @@ mapfreq(struct ieee80211_channel *chan, static void mapchan(struct ieee80211_channel *chan, int ieee, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -2903,7 +2903,7 @@ copy_essid(char buf[], size_t bufsize, c { const u_int8_t *p; size_t maxlen; - int i; + u_int i; if (essid_len > bufsize) maxlen = bufsize; @@ -4093,7 +4093,7 @@ static void printkey(const struct ieee80211req_key *ik) { static const uint8_t zerodata[IEEE80211_KEYBUF_SIZE]; - int keylen = ik->ik_keylen; + u_int keylen = ik->ik_keylen; int printcontents; printcontents = printkeys && @@ -4130,7 +4130,7 @@ printkey(const struct ieee80211req_key * break; } if (printcontents) { - int i; + u_int i; printf(" <"); for (i = 0; i < keylen; i++) From owner-svn-src-all@freebsd.org Tue May 3 15:14:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D76B2BA0E; Tue, 3 May 2016 15:14:21 +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 C3B2F125A; Tue, 3 May 2016 15:14:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43FEJlT078149; Tue, 3 May 2016 15:14:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43FEH4F078126; Tue, 3 May 2016 15:14:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031514.u43FEH4F078126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 15:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298981 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:14:21 -0000 Author: pfg Date: Tue May 3 15:14:17 2016 New Revision: 298981 URL: https://svnweb.freebsd.org/changeset/base/298981 Log: sys/sys: minor spelling fixes. While the changes are minor, these headers are very visible. MFC after: 2 weeks Modified: head/sys/sys/ata.h head/sys/sys/buf.h head/sys/sys/buf_ring.h head/sys/sys/iconv.h head/sys/sys/imgact_binmisc.h head/sys/sys/imgact_elf.h head/sys/sys/ipc.h head/sys/sys/ipmi.h head/sys/sys/linker.h head/sys/sys/memrange.h head/sys/sys/pmc.h head/sys/sys/priority.h head/sys/sys/priv.h head/sys/sys/proc.h head/sys/sys/procctl.h head/sys/sys/shm.h head/sys/sys/sockio.h head/sys/sys/soundcard.h head/sys/sys/sx.h head/sys/sys/sysctl.h head/sys/sys/timex.h head/sys/sys/user.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/ata.h Tue May 3 15:14:17 2016 (r298981) @@ -377,10 +377,10 @@ struct ata_params { #define ATA_NCQ_NON_DATA 0x63 /* NCQ non-data command */ #define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ #define ATA_SFPDMA_DSM 0x00 /* Data set management */ -#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxilary */ +#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxiliary */ #define ATA_SFPDMA_HYBRID_EVICT 0x01 /* Hybrid Evict */ #define ATA_SFPDMA_WLDMA 0x02 /* Write Log DMA EXT */ -#define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ +#define ATA_RECV_FPDMA_QUEUED 0x65 /* receive DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/buf.h Tue May 3 15:14:17 2016 (r298981) @@ -206,7 +206,7 @@ struct buf { #define B_NOREUSE 0x00000800 /* Contents not reused once released. */ #define B_00001000 0x00001000 /* Available flag. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ -#define B_BARRIER 0x00004000 /* Write this and all preceeding first. */ +#define B_BARRIER 0x00004000 /* Write this and all preceding first. */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/buf_ring.h Tue May 3 15:14:17 2016 (r298981) @@ -98,7 +98,7 @@ buf_ring_enqueue(struct buf_ring *br, vo /* * If there are other enqueues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_prod_tail != prod_head) @@ -135,7 +135,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) #endif /* * If there are other dequeues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_cons_tail != cons_head) Modified: head/sys/sys/iconv.h ============================================================================== --- head/sys/sys/iconv.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/iconv.h Tue May 3 15:14:17 2016 (r298981) @@ -65,7 +65,7 @@ struct iconv_cspair_info { }; /* - * Paramters for 'add' sysctl + * Parameters for 'add' sysctl */ #define ICONV_ADD_VER 1 Modified: head/sys/sys/imgact_binmisc.h ============================================================================== --- head/sys/sys/imgact_binmisc.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/imgact_binmisc.h Tue May 3 15:14:17 2016 (r298981) @@ -41,7 +41,7 @@ #define IBE_NAME_MAX 32 /* Max size for entry name. */ #define IBE_MAGIC_MAX 256 /* Max size for header magic and mask. */ #define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- - line argruments seperated by white space */ + line argruments separated by white space */ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/imgact_elf.h Tue May 3 15:14:17 2016 (r298981) @@ -41,7 +41,7 @@ struct image_params; struct thread; /* - * Structure used to pass infomation from the loader to the + * Structure used to pass information from the loader to the * stack fixup routine. */ typedef struct { Modified: head/sys/sys/ipc.h ============================================================================== --- head/sys/sys/ipc.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/ipc.h Tue May 3 15:14:17 2016 (r298981) @@ -112,7 +112,7 @@ struct ipc_perm { #define IPC_STAT 2 /* get options */ #if __BSD_VISIBLE /* - * For Linux compatability. + * For Linux compatibility. */ #define IPC_INFO 3 /* get info */ #endif Modified: head/sys/sys/ipmi.h ============================================================================== --- head/sys/sys/ipmi.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/ipmi.h Tue May 3 15:14:17 2016 (r298981) @@ -122,7 +122,7 @@ struct ipmi_ipmb_addr { }; #if defined(__amd64__) -/* Compatiblity with 32-bit binaries. */ +/* Compatibility with 32-bit binaries. */ #define IPMICTL_RECEIVE_MSG_TRUNC_32 _IOWR(IPMI_IOC_MAGIC, 11, struct ipmi_recv32) #define IPMICTL_RECEIVE_MSG_32 _IOWR(IPMI_IOC_MAGIC, 12, struct ipmi_recv32) Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/linker.h Tue May 3 15:14:17 2016 (r298981) @@ -160,7 +160,7 @@ int linker_file_function_listall(linker_ linker_function_nameval_callback_t, void *); /* - * Functions soley for use by the linker class handlers. + * Functions solely for use by the linker class handlers. */ int linker_add_class(linker_class_t _cls); int linker_file_unload(linker_file_t _file, int flags); Modified: head/sys/sys/memrange.h ============================================================================== --- head/sys/sys/memrange.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/memrange.h Tue May 3 15:14:17 2016 (r298981) @@ -1,5 +1,5 @@ /* - * Memory range attribute operations, peformed on /dev/mem + * Memory range attribute operations, performed on /dev/mem * * $FreeBSD$ */ Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/pmc.h Tue May 3 15:14:17 2016 (r298981) @@ -283,7 +283,7 @@ enum pmc_disp { __PMC_CAP(THRESHOLD, 4, "ignore events below a threshold") \ __PMC_CAP(READ, 5, "read PMC counter") \ __PMC_CAP(WRITE, 6, "reprogram PMC counter") \ - __PMC_CAP(INVERT, 7, "invert comparision sense") \ + __PMC_CAP(INVERT, 7, "invert comparison sense") \ __PMC_CAP(QUALIFIER, 8, "further qualify monitored events") \ __PMC_CAP(PRECISE, 9, "perform precise sampling") \ __PMC_CAP(TAGGING, 10, "tag upstream events") \ @@ -587,7 +587,7 @@ struct pmc_op_writelog { /* * OP GETMSR * - * Retrieve the machine specific address assoicated with the allocated + * Retrieve the machine specific address associated with the allocated * PMC. This number can be used subsequently with a read-performance-counter * instruction. */ Modified: head/sys/sys/priority.h ============================================================================== --- head/sys/sys/priority.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/priority.h Tue May 3 15:14:17 2016 (r298981) @@ -126,7 +126,7 @@ struct priority { u_char pri_class; /* Scheduling class. */ u_char pri_level; /* Normal priority level. */ - u_char pri_native; /* Priority before propogation. */ + u_char pri_native; /* Priority before propagation. */ u_char pri_user; /* User priority based on p_cpu and p_nice. */ }; Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/priv.h Tue May 3 15:14:17 2016 (r298981) @@ -134,7 +134,7 @@ #define PRIV_JAIL_REMOVE 112 /* Remove a jail. */ /* - * Kernel environment priveleges. + * Kernel environment privileges. */ #define PRIV_KENV_SET 120 /* Set kernel env. variables. */ #define PRIV_KENV_UNSET 121 /* Unset kernel env. variables. */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/proc.h Tue May 3 15:14:17 2016 (r298981) @@ -426,7 +426,7 @@ do { \ #define TDP_BUFNEED 0x00000008 /* Do not recurse into the buf flush */ #define TDP_COWINPROGRESS 0x00000010 /* Snapshot copy-on-write in progress. */ #define TDP_ALTSTACK 0x00000020 /* Have alternate signal stack. */ -#define TDP_DEADLKTREAT 0x00000040 /* Lock aquisition - deadlock treatment. */ +#define TDP_DEADLKTREAT 0x00000040 /* Lock acquisition - deadlock treatment. */ #define TDP_NOFAULTING 0x00000080 /* Do not handle page faults. */ #define TDP_UNUSED9 0x00000100 /* --available-- */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ Modified: head/sys/sys/procctl.h ============================================================================== --- head/sys/sys/procctl.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/procctl.h Tue May 3 15:14:17 2016 (r298981) @@ -88,7 +88,7 @@ struct procctl_reaper_kill { int rk_sig; /* in - signal to send */ u_int rk_flags; /* in - REAPER_KILL flags */ pid_t rk_subtree; /* in - subtree, if REAPER_KILL_SUBTREE */ - u_int rk_killed; /* out - count of processes sucessfully + u_int rk_killed; /* out - count of processes successfully killed */ pid_t rk_fpid; /* out - first failed pid for which error is returned */ Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/shm.h Tue May 3 15:14:17 2016 (r298981) @@ -56,7 +56,7 @@ #define SHM_LOCK 11 #define SHM_UNLOCK 12 -/* ipcs shmctl commands for Linux compatability */ +/* ipcs shmctl commands for Linux compatibility */ #define SHM_STAT 13 #define SHM_INFO 14 Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/sockio.h Tue May 3 15:14:17 2016 (r298981) @@ -98,7 +98,7 @@ #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set linklevel addr */ #define SIOCGI2C _IOWR('i', 61, struct ifreq) /* get I2C data */ -#define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif addres */ +#define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif address */ #define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq) /* get gif psrc addr */ #define SIOCGIFPDSTADDR _IOWR('i', 72, struct ifreq) /* get gif pdst addr */ #define SIOCDIFPHYADDR _IOW('i', 73, struct ifreq) /* delete gif addrs */ Modified: head/sys/sys/soundcard.h ============================================================================== --- head/sys/sys/soundcard.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/soundcard.h Tue May 3 15:14:17 2016 (r298981) @@ -185,7 +185,7 @@ struct snd_size { #define AFMT_U24_LE 0x00040000 /* Little endian unsigned 24-bit */ #define AFMT_U24_BE 0x00080000 /* Big endian unsigned 24-bit */ -/* Machine dependant AFMT_* definitions. */ +/* Machine dependent AFMT_* definitions. */ #if BYTE_ORDER == LITTLE_ENDIAN #define AFMT_S16_NE AFMT_S16_LE #define AFMT_S24_NE AFMT_S24_LE @@ -1447,7 +1447,7 @@ void seqbuf_dump(void); /* This function SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2) /* - * Timing and syncronization macros + * Timing and synchronization macros */ #define _TIMER_EVENT(ev, parm) { \ Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/sx.h Tue May 3 15:14:17 2016 (r298981) @@ -308,7 +308,7 @@ __sx_sunlock(struct sx *sx, const char * #define SA_RECURSED LA_RECURSED #define SA_NOTRECURSED LA_NOTRECURSED -/* Backwards compatability. */ +/* Backwards compatibility. */ #define SX_LOCKED LA_LOCKED #define SX_SLOCKED LA_SLOCKED #define SX_XLOCKED LA_XLOCKED Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/sysctl.h Tue May 3 15:14:17 2016 (r298981) @@ -608,7 +608,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e __ptr, 0, sysctl_handle_64, "QU", __DESCR(descr)); \ }) -/* Oid for a CPU dependant variable */ +/* Oid for a CPU dependent variable */ #define SYSCTL_ADD_UAUTO(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ struct sysctl_oid *__ret; \ @@ -753,7 +753,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e }) /* - * A macro to generate a read-only sysctl to indicate the presense of optional + * A macro to generate a read-only sysctl to indicate the presence of optional * kernel features. */ #define FEATURE(name, desc) \ Modified: head/sys/sys/timex.h ============================================================================== --- head/sys/sys/timex.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/timex.h Tue May 3 15:14:17 2016 (r298981) @@ -105,7 +105,7 @@ #define TIME_INS 1 /* insert leap second warning */ #define TIME_DEL 2 /* delete leap second warning */ #define TIME_OOP 3 /* leap second in progress */ -#define TIME_WAIT 4 /* leap second has occured */ +#define TIME_WAIT 4 /* leap second has occurred */ #define TIME_ERROR 5 /* error (see status word) */ /* Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue May 3 15:06:29 2016 (r298980) +++ head/sys/sys/user.h Tue May 3 15:14:17 2016 (r298981) @@ -296,7 +296,7 @@ struct user { /* * Old format. Has variable hidden padding due to alignment. - * This is a compatability hack for pre-build 7.1 packages. + * This is a compatibility hack for pre-build 7.1 packages. */ #if defined(__amd64__) #define KINFO_OFILE_SIZE 1328 From owner-svn-src-all@freebsd.org Tue May 3 15:17:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33152B2BA91; Tue, 3 May 2016 15:17:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA21147D; Tue, 3 May 2016 15:17:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43FHijY078302; Tue, 3 May 2016 15:17:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43FHhXs078297; Tue, 3 May 2016 15:17:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605031517.u43FHhXs078297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 3 May 2016 15:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298982 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:17:45 -0000 Author: kib Date: Tue May 3 15:17:43 2016 New Revision: 298982 URL: https://svnweb.freebsd.org/changeset/base/298982 Log: Add EVFILT_VNODE open, read and close notifications. While there, order EVFILT_VNODE notes descriptions alphabetically. Based on submission, and tested by: Vladimir Kondratyev MFC after: 2 weeks Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/event.h head/sys/sys/vnode.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Tue May 3 15:14:17 2016 (r298981) +++ head/lib/libc/sys/kqueue.2 Tue May 3 15:17:43 2016 (r298982) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2016 +.Dd May 3, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -367,14 +367,28 @@ Takes a file descriptor as the identifie .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width "Dv NOTE_RENAME" +.Bl -tag -width "Dv NOTE_CLOSE_WRITE" +.It Dv NOTE_ATTRIB +The file referenced by the descriptor had its attributes changed. +.It Dv NOTE_CLOSE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor did not possesed write access. +.It Dv NOTE_CLOSE_WRITE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor has write access. +.Pp +This note, as well as +.Dv NOTE_CLOSE , +are not activated when files are closed forcibly by +.Xr unmount 2 or +.Xr revoke 2 . +Instead, +.Dv NOTE_REVOKE +is sent for such events. .It Dv NOTE_DELETE The .Fn unlink -system call -was called on the file referenced by the descriptor. -.It Dv NOTE_WRITE -A write occurred on the file referenced by the descriptor. +system call was called on the file referenced by the descriptor. .It Dv NOTE_EXTEND For regular file, the file referenced by the descriptor was extended. .Pp @@ -383,20 +397,24 @@ as the result of rename operation. The .Dv NOTE_EXTEND event is not reported when a name is changed inside the directory. -.It Dv NOTE_ATTRIB -The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK The link count on the file changed. In particular, the .Dv NOTE_LINK event is reported if a subdirectory was created or deleted inside the directory referenced by the descriptor. +.It Dv NOTE_OPEN +The file referenced by the descriptor was opened. +.It Dv NOTE_READ +A read occurred on the file referenced by the descriptor. .It Dv NOTE_RENAME The file referenced by the descriptor was renamed. .It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. +.It Dv NOTE_WRITE +A write occurred on the file referenced by the descriptor. .El .Pp On return, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue May 3 15:14:17 2016 (r298981) +++ head/sys/kern/vfs_subr.c Tue May 3 15:17:43 2016 (r298982) @@ -4722,6 +4722,45 @@ vop_symlink_post(void *ap, int rc) VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); } +void +vop_open_post(void *ap, int rc) +{ + struct vop_open_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_OPEN); +} + +void +vop_close_post(void *ap, int rc) +{ + struct vop_close_args *a = ap; + + if (!rc && (a->a_cred != NOCRED || /* filter out revokes */ + (a->a_vp->v_iflag & VI_DOOMED) == 0)) { + VFS_KNOTE_LOCKED(a->a_vp, (a->a_fflag & FWRITE) != 0 ? + NOTE_CLOSE_WRITE : NOTE_CLOSE); + } +} + +void +vop_read_post(void *ap, int rc) +{ + struct vop_read_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + +void +vop_readdir_post(void *ap, int rc) +{ + struct vop_readdir_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + static struct knlist fs_knlist; static void Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Tue May 3 15:14:17 2016 (r298981) +++ head/sys/kern/vnode_if.src Tue May 3 15:17:43 2016 (r298982) @@ -121,6 +121,7 @@ vop_mknod { %% open vp L L L +%! open post vop_open_post vop_open { IN struct vnode *vp; @@ -132,6 +133,7 @@ vop_open { %% close vp L L L +%! close post vop_close_post vop_close { IN struct vnode *vp; @@ -186,6 +188,7 @@ vop_markatime { }; %% read vp L L L +%! read post vop_read_post vop_read { IN struct vnode *vp; @@ -326,6 +329,7 @@ vop_symlink { %% readdir vp L L L +%! readdir post vop_readdir_post vop_readdir { IN struct vnode *vp; Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Tue May 3 15:14:17 2016 (r298981) +++ head/sys/sys/event.h Tue May 3 15:17:43 2016 (r298982) @@ -121,6 +121,12 @@ struct kevent { #define NOTE_LINK 0x0010 /* link count changed */ #define NOTE_RENAME 0x0020 /* vnode was renamed */ #define NOTE_REVOKE 0x0040 /* vnode access was revoked */ +#define NOTE_OPEN 0x0080 /* vnode was opened */ +#define NOTE_CLOSE 0x0100 /* file closed, fd did not + allowed write */ +#define NOTE_CLOSE_WRITE 0x0200 /* file closed, fd did allowed + write */ +#define NOTE_READ 0x0400 /* file was read */ /* * data/hint flags for EVFILT_PROC and EVFILT_PROCDESC, shared with userspace Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue May 3 15:14:17 2016 (r298981) +++ head/sys/sys/vnode.h Tue May 3 15:17:43 2016 (r298982) @@ -774,6 +774,7 @@ int dead_read(struct vop_read_args *ap); int dead_write(struct vop_write_args *ap); /* These are called from within the actual VOPS. */ +void vop_close_post(void *a, int rc); void vop_create_post(void *a, int rc); void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); @@ -783,6 +784,9 @@ void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); void vop_mknod_post(void *a, int rc); +void vop_open_post(void *a, int rc); +void vop_read_post(void *a, int rc); +void vop_readdir_post(void *a, int rc); void vop_reclaim_post(void *a, int rc); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); From owner-svn-src-all@freebsd.org Tue May 3 15:27:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF25DB2BFEC; Tue, 3 May 2016 15:27:48 +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 B6AB01E39; Tue, 3 May 2016 15:27:48 +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 u43FRlFH081614; Tue, 3 May 2016 15:27:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43FRlwx081610; Tue, 3 May 2016 15:27:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605031527.u43FRlwx081610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 May 2016 15:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298983 - in head/sys/dev: ahci sound/pci/hda usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:27:49 -0000 Author: mav Date: Tue May 3 15:27:47 2016 New Revision: 298983 URL: https://svnweb.freebsd.org/changeset/base/298983 Log: Add some device IDs from Intel Sunrise Point chipsets. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci_pci.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Tue May 3 15:17:43 2016 (r298982) +++ head/sys/dev/ahci/ahci_pci.c Tue May 3 15:27:47 2016 (r298983) @@ -176,6 +176,15 @@ static const struct { {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9d038086, 0x00, "Intel Sunrise Point-LP", 0}, + {0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0xa1028086, 0x00, "Intel Sunrise Point", 0}, + {0xa1038086, 0x00, "Intel Sunrise Point", 0}, + {0xa1058086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1068086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1078086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa10f8086, 0x00, "Intel Sunrise Point (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue May 3 15:17:43 2016 (r298982) +++ head/sys/dev/sound/pci/hda/hdac.c Tue May 3 15:27:47 2016 (r298983) @@ -93,6 +93,8 @@ static const struct { { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, + { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, + { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Tue May 3 15:17:43 2016 (r298982) +++ head/sys/dev/sound/pci/hda/hdac.h Tue May 3 15:27:47 2016 (r298983) @@ -69,6 +69,8 @@ #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) +#define HDA_INTEL_SRPTLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d70) +#define HDA_INTEL_SRPT HDA_MODEL_CONSTRUCT(INTEL, 0xa170) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue May 3 15:17:43 2016 (r298982) +++ head/sys/dev/usb/controller/xhci_pci.c Tue May 3 15:27:47 2016 (r298983) @@ -122,6 +122,8 @@ xhci_pci_match(device_t self) return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); + case 0xa12f8086: + return ("Intel Sunrise Point USB 3.0 controller"); case 0xa01b177d: return ("Cavium ThunderX USB 3.0 controller"); From owner-svn-src-all@freebsd.org Tue May 3 15:58:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12BC1B2C5F0; Tue, 3 May 2016 15:58:37 +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 D801F1F4E; Tue, 3 May 2016 15:58:36 +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 u43Fwa8r090592; Tue, 3 May 2016 15:58:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43FwaAo090591; Tue, 3 May 2016 15:58:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605031558.u43FwaAo090591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 3 May 2016 15:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298984 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 15:58:37 -0000 Author: kib Date: Tue May 3 15:58:35 2016 New Revision: 298984 URL: https://svnweb.freebsd.org/changeset/base/298984 Log: Correct wording. Submitted by: David A. Bright MFC after: 2 weeks Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Tue May 3 15:27:47 2016 (r298983) +++ head/lib/libc/sys/kqueue.2 Tue May 3 15:58:35 2016 (r298984) @@ -372,7 +372,7 @@ The events to monitor are: The file referenced by the descriptor had its attributes changed. .It Dv NOTE_CLOSE A file descriptor referencing the monitored file, was closed. -The closed file descriptor did not possesed write access. +The closed file descriptor did not have write access. .It Dv NOTE_CLOSE_WRITE A file descriptor referencing the monitored file, was closed. The closed file descriptor has write access. From owner-svn-src-all@freebsd.org Tue May 3 16:01:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 108D9B2C7B2; Tue, 3 May 2016 16:01:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D781C1497; Tue, 3 May 2016 16:01:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43G1skS093348; Tue, 3 May 2016 16:01:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43G1sik093347; Tue, 3 May 2016 16:01:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605031601.u43G1sik093347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 3 May 2016 16:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298985 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 16:01:55 -0000 Author: bz Date: Tue May 3 16:01:53 2016 New Revision: 298985 URL: https://svnweb.freebsd.org/changeset/base/298985 Log: Remove the most useful INET || INET6 check leftover from whenever, doing nothing. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue May 3 15:58:35 2016 (r298984) +++ head/sys/net/if_ethersubr.c Tue May 3 16:01:53 2016 (r298985) @@ -426,9 +426,6 @@ ether_output_frame(struct ifnet *ifp, st return ((ifp->if_transmit)(ifp, m)); } -#if defined(INET) || defined(INET6) -#endif - /* * Process a received Ethernet packet; the packet is in the * mbuf chain m with the ethernet header at the front. From owner-svn-src-all@freebsd.org Tue May 3 16:35:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B411CB2B1E3; Tue, 3 May 2016 16:35:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 8A4AD1E0A; Tue, 3 May 2016 16:35: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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C577B93A; Tue, 3 May 2016 12:35:25 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: Pedro Giffuni , "Ngie Cooper (yaneurabeya)" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 Date: Tue, 03 May 2016 09:35:18 -0700 Message-ID: <8989101.JIAk4LJusf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160503152502.A939@besplex.bde.org> References: <201605021800.u42I0cjK084243@repo.freebsd.org> <20160503152502.A939@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 03 May 2016 12:35:25 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 16:35:26 -0000 On Tuesday, May 03, 2016 03:52:56 PM Bruce Evans wrote: > On Mon, 2 May 2016, Pedro Giffuni wrote: > > > > On 05/02/16 15:52, John Baldwin wrote: > >> On Monday, May 02, 2016 11:45:41 AM Ngie Cooper wrote: > >>> > >>>> On May 2, 2016, at 11:00, John Baldwin wrote: > >>>> > >>>> Author: jhb > >>>> [... excessive quoting trimmed] > >>>> New Revision: 298933 > >>>> URL: https://svnweb.freebsd.org/changeset/base/298933 > >>>> > >>>> Log: > >>>> Add a new bus method to fetch device-specific CPU sets. > >>>> [... excessive quoting trimmed] > >>>> kernel > >>> > >>> This broke the build with gcc: > >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1211/ > >> > >> I saw. What is odd though is that my tinderbox builds all passed. This > >> might > >> be due to the recent howmany() changes since _bitset.h only needed > >> > >> before but now needs (which is borderline to being pointless > >> for > >> a _foo.h header). > > > > TBH, I thought so too, but I avoided applying such changes to headers, > > and I haven't touched _bitset.h, > > _foo.h headers cannot use howmany() due to namespace pollution. > > _bitset.h was already broken, unless it is supposed to be kernel-only -- > it uses howmany(). It is kernel-only according to its documention -- > bitset is only documented in kernel manpages (in a single unreadable one > than is linked ad nauseum). cpuset.h is used in userland for cpuset_getaffinity(2), etc. > It is otherwise fairly clean. It defines the symbols BITSET_DEFINE, > BITSET_T_INITIALIZER, and BITSET_SET in the application namespace > This is not completely clean for a _foo.h header. All other BITSET* > macros are already in bitset.h I think only BITSET_DEFINE should be > in _bitset.h (for use declarations in other headers). > > select.h avoids this problem by defining its own howmany() macro. This > seems to be correct except for the bogus ifdef around the private macro. > This ifdef is a little more than a style bug (verboseness) -- it breaks > detection of other definitions that might be different. Lexical > differences wouldn't matter, but it is easier to never have them. > > Old versions of select polluted . The select macros just > used howmany(). howmany() was in too. I would be happy to fix _bitset.h and _cpuset.h to not need sys/param.h. However, they also use NBBY which is defined in sys/param.h. _sigset.h gets around this because it uses an array of uint32_t and hardcodes a shift count of 5 in _SIG_WORD() and a mask of 31 in _SIG_BIT(). If you think it is fine to hardcode '8' instead of 'NBBY' I'll do that. Hmm, sys/select.h hardcodes '8' for _NFDBITS, so I guess that is fine. I will fix _bitset.h and _cpuset.h first and then come back to bus_get_cpus(). -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 3 16:37:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 394B2B2B435; Tue, 3 May 2016 16:37:10 +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 0BD0C1126; Tue, 3 May 2016 16:37:09 +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 u43Gb9U5003109; Tue, 3 May 2016 16:37:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43Gb9WE003108; Tue, 3 May 2016 16:37:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031637.u43Gb9WE003108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 16:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298986 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 16:37:10 -0000 Author: pfg Date: Tue May 3 16:37:09 2016 New Revision: 298986 URL: https://svnweb.freebsd.org/changeset/base/298986 Log: sys/sys: missed in r298981. I am sure I've missed others as well, but at least it should be more readable now. No functional change. Modified: head/sys/sys/imgact_binmisc.h Modified: head/sys/sys/imgact_binmisc.h ============================================================================== --- head/sys/sys/imgact_binmisc.h Tue May 3 16:01:53 2016 (r298985) +++ head/sys/sys/imgact_binmisc.h Tue May 3 16:37:09 2016 (r298986) @@ -41,7 +41,7 @@ #define IBE_NAME_MAX 32 /* Max size for entry name. */ #define IBE_MAGIC_MAX 256 /* Max size for header magic and mask. */ #define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- - line argruments separated by white space */ + line arguments separated by white space */ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ From owner-svn-src-all@freebsd.org Tue May 3 17:05:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53018B2BD58; Tue, 3 May 2016 17:05:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24D391108; Tue, 3 May 2016 17:05:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43H5waH011829; Tue, 3 May 2016 17:05:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43H5wUb011828; Tue, 3 May 2016 17:05:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605031705.u43H5wUb011828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 3 May 2016 17:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298987 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 17:05:59 -0000 Author: cem Date: Tue May 3 17:05:58 2016 New Revision: 298987 URL: https://svnweb.freebsd.org/changeset/base/298987 Log: ioat(4): Limit descriptor allocation to low 40 bits The IOAT engine can only address the low 40 bits (1 TB) of physmem via the 'next descriptor' pointer. Restrict acceptable range given to bus_dma_tag_create to match. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue May 3 16:37:09 2016 (r298986) +++ head/sys/dev/ioat/ioat.c Tue May 3 17:05:58 2016 (r298987) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); #include "ioat_hw.h" #include "ioat_internal.h" +#ifndef BUS_SPACE_MAXADDR_40BIT +#define BUS_SPACE_MAXADDR_40BIT 0xFFFFFFFFFFULL +#endif #define IOAT_INTR_TIMO (hz / 10) #define IOAT_REFLK (&ioat->submit_lock) @@ -454,7 +457,7 @@ ioat3_attach(device_t device) num_descriptors = 1 << ioat->ring_size_order; bus_dma_tag_create(bus_get_dma_tag(ioat->device), 0x40, 0x0, - BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXADDR_40BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct ioat_dma_hw_descriptor), 1, sizeof(struct ioat_dma_hw_descriptor), 0, NULL, NULL, &ioat->hw_desc_tag); From owner-svn-src-all@freebsd.org Tue May 3 17:06:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B193EB2BDF5; Tue, 3 May 2016 17:06:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C509128E; Tue, 3 May 2016 17:06:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43H6XkY011890; Tue, 3 May 2016 17:06:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43H6Xvb011889; Tue, 3 May 2016 17:06:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605031706.u43H6Xvb011889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 3 May 2016 17:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298988 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 17:06:34 -0000 Author: cem Date: Tue May 3 17:06:33 2016 New Revision: 298988 URL: https://svnweb.freebsd.org/changeset/base/298988 Log: ioat(4): Add CRC descriptor structure Add CRC/MOVECRC operations, as well as the TEST and STORE variants. With these operations, a CRC32C can be computed over one or more descriptors' source data. When the STORE operation is encountered, the accumulated CRC32C is emitted to memory. A TEST operations triggers an IOAT channel error if the accumulated CRC32C does not match one in memory. These operations are not exposed through any API yet. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Tue May 3 17:05:58 2016 (r298987) +++ head/sys/dev/ioat/ioat_internal.h Tue May 3 17:06:33 2016 (r298988) @@ -211,6 +211,85 @@ struct ioat_fill_hw_descriptor { uint64_t user2; }; +struct ioat_crc32_hw_descriptor { + uint32_t size; + union { + uint32_t control_raw; + struct generic_dma_control control_generic; + struct { + uint32_t int_enable:1; + uint32_t src_snoop_disable:1; + uint32_t dest_snoop_disable:1; + uint32_t completion_update:1; + uint32_t fence:1; + uint32_t reserved1:3; + uint32_t bundle:1; + uint32_t dest_dca:1; + uint32_t hint:1; + uint32_t use_seed:1; + /* + * crc_location: + * For IOAT_OP_MOVECRC_TEST and IOAT_OP_CRC_TEST: + * 0: comparison value is pointed to by CRC Address + * field. + * 1: comparison value follows data in wire format + * ("inverted reflected bit order") in the 4 bytes + * following the source data. + * + * For IOAT_OP_CRC_STORE: + * 0: Result will be stored at location pointed to by + * CRC Address field (in wire format). + * 1: Result will be stored directly following the + * source data. + * + * For IOAT_OP_MOVECRC_STORE: + * 0: Result will be stored at location pointed to by + * CRC Address field (in wire format). + * 1: Result will be stored directly following the + * *destination* data. + */ + uint32_t crc_location:1; + uint32_t reserved2:11; + /* + * MOVECRC - Move data in the same way as standard copy + * operation, but also compute CRC32. + * + * CRC - Only compute CRC on source data. + * + * There is a CRC accumulator register in the hardware. + * If 'initial' is set, it is initialized to the value + * in 'seed.' + * + * In all modes, these operators accumulate size bytes + * at src_addr into the running CRC32C. + * + * Store mode emits the accumulated CRC, in wire + * format, as specified by the crc_location bit above. + * + * Test mode compares the accumulated CRC against the + * reference CRC, as described in crc_location above. + * On failure, halts the DMA engine with a CRC error + * status. + */ + #define IOAT_OP_MOVECRC 0x41 + #define IOAT_OP_MOVECRC_TEST 0x42 + #define IOAT_OP_MOVECRC_STORE 0x43 + #define IOAT_OP_CRC 0x81 + #define IOAT_OP_CRC_TEST 0x82 + #define IOAT_OP_CRC_STORE 0x83 + uint32_t op:8; + } control; + } u; + uint64_t src_addr; + uint64_t dest_addr; + uint64_t next; + uint64_t next_src_addr; + uint64_t next_dest_addr; + uint32_t seed; + uint32_t reserved; + uint64_t crc_address; +}; + struct ioat_xor_hw_descriptor { uint32_t size; union { @@ -338,6 +417,7 @@ struct ioat_descriptor { struct ioat_generic_hw_descriptor *generic; struct ioat_dma_hw_descriptor *dma; struct ioat_fill_hw_descriptor *fill; + struct ioat_crc32_hw_descriptor *crc32; struct ioat_xor_hw_descriptor *xor; struct ioat_xor_ext_hw_descriptor *xor_ext; struct ioat_pq_hw_descriptor *pq; @@ -348,13 +428,7 @@ struct ioat_descriptor { bus_addr_t hw_desc_bus_addr; }; -/* Unsupported by this driver at this time. */ -#define IOAT_OP_MOVECRC 0x41 -#define IOAT_OP_MOVECRC_TEST 0x42 -#define IOAT_OP_MOVECRC_STORE 0x43 -#define IOAT_OP_CRC 0x81 -#define IOAT_OP_CRC_TEST 0x82 -#define IOAT_OP_CRC_STORE 0x83 +/* Unused by this driver at this time. */ #define IOAT_OP_MARKER 0x84 /* From owner-svn-src-all@freebsd.org Tue May 3 17:07:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06FFB2BEAD; Tue, 3 May 2016 17:07:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2786142F; Tue, 3 May 2016 17:07:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43H7Iht011958; Tue, 3 May 2016 17:07:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43H7IHE011955; Tue, 3 May 2016 17:07:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605031707.u43H7IHE011955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 3 May 2016 17:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298989 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 17:07:20 -0000 Author: cem Date: Tue May 3 17:07:18 2016 New Revision: 298989 URL: https://svnweb.freebsd.org/changeset/base/298989 Log: ioat(4): Implement CRC and MOVECRC APIs And document them in ioat.4. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Tue May 3 17:06:33 2016 (r298988) +++ head/share/man/man4/ioat.4 Tue May 3 17:07:18 2016 (r298989) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2016 +.Dd May 3, 2016 .Dt IOAT 4 .Os .Sh NAME @@ -99,6 +99,29 @@ In .Fa "uint32_t flags" .Fc .Ft struct bus_dmadesc * +.Fo ioat_copy_crc +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst" +.Fa "bus_addr_t src" +.Fa "bus_size_t len" +.Fa "uint32_t *initialseed" +.Fa "bus_addr_t crcptr" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * +.Fo ioat_crc +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t src" +.Fa "bus_size_t len" +.Fa "uint32_t *initialseed" +.Fa "bus_addr_t crcptr" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * .Fo ioat_blockfill .Fa "bus_dmaengine_t dmaengine" .Fa "bus_addr_t dst" @@ -183,6 +206,43 @@ from. It is invalid to attempt to submit new DMA operations in a .Fa bus_dmaengine_callback_t context. +.Pp +The CRC operations have three distinct modes. +The default mode is to accumulate. +By accumulating over multiple descriptors, a user may gather a CRC over several +chunks of memory and only write out the result once. +.Pp +The +.Ar DMA_CRC_STORE +flag causes the operation to emit the CRC32C result. +If +.Ar DMA_CRC_INLINE +is set, the result is written inline with the destination data (or source in +.Fn ioat_crc +mode). +If +.Ar DMA_CRC_INLINE +is not set, the result is written to the provided +.Fa crcptr . +.Pp +Similarly, the +.Ar DMA_CRC_TEST +flag causes the operation to compare the CRC32C result to an existing checksum. +If +.Ar DMA_CRC_INLINE +is set, the result is compared against the inline four bytes trailing the +source data. +If it is not set, the result is compared against the value pointed to by +.Fa crcptr . +.Pp +.Fn ioat_copy_crc +calculates a CRC32C while copying data. +.Fn ioat_crc +only computes a CRC32C of some data. +If the +.Fa initialseed +argument to either routine is non-NULL, the CRC32C engine is initialized with +the value it points to. .Sh USAGE A typical user will lookup the DMA engine object for a given channel with .Fn ioat_get_dmaengine . @@ -199,9 +259,13 @@ If succeeds, there is guaranteed to be room for .Fa N new operations in the internal ring buffer. +.Pp Then, they will submit one or more operations using .Fn ioat_blockfill , .Fn ioat_copy , +.Fn ioat_copy_8k_aligned , +.Fn ioat_copy_crc , +.Fn ioat_crc , or .Fn ioat_null . After queuing one or more individual DMA operations, they will Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue May 3 17:06:33 2016 (r298988) +++ head/sys/dev/ioat/ioat.c Tue May 3 17:07:18 2016 (r298989) @@ -882,8 +882,8 @@ ioat_op_generic(struct ioat_softc *ioat, mtx_assert(&ioat->submit_lock, MA_OWNED); - KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", - flags & ~DMA_ALL_FLAGS)); + KASSERT((flags & ~_DMA_GENERIC_FLAGS) == 0, + ("Unrecognized flag(s): %#x", flags & ~_DMA_GENERIC_FLAGS)); if ((flags & DMA_NO_WAIT) != 0) mflags = M_NOWAIT; else @@ -1018,6 +1018,164 @@ ioat_copy_8k_aligned(bus_dmaengine_t dma } struct bus_dmadesc * +ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t dst, bus_addr_t src, + bus_size_t len, uint32_t *initialseed, bus_addr_t crcptr, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) +{ + struct ioat_crc32_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + uint32_t teststore; + uint8_t op; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + + if ((ioat->capabilities & IOAT_DMACAP_MOVECRC) == 0) { + ioat_log_message(0, "%s: Device lacks MOVECRC capability\n", + __func__); + return (NULL); + } + if (((src | dst) & (0xffffffull << 40)) != 0) { + ioat_log_message(0, "%s: High 24 bits of src/dst invalid\n", + __func__); + return (NULL); + } + teststore = (flags & _DMA_CRC_TESTSTORE); + if (teststore == _DMA_CRC_TESTSTORE) { + ioat_log_message(0, "%s: TEST and STORE invalid\n", __func__); + return (NULL); + } + if (teststore == 0 && (flags & DMA_CRC_INLINE) != 0) { + ioat_log_message(0, "%s: INLINE invalid without TEST or STORE\n", + __func__); + return (NULL); + } + + switch (teststore) { + case DMA_CRC_STORE: + op = IOAT_OP_MOVECRC_STORE; + break; + case DMA_CRC_TEST: + op = IOAT_OP_MOVECRC_TEST; + break; + default: + KASSERT(teststore == 0, ("bogus")); + op = IOAT_OP_MOVECRC; + break; + } + + if ((flags & DMA_CRC_INLINE) == 0 && + (crcptr & (0xffffffull << 40)) != 0) { + ioat_log_message(0, + "%s: High 24 bits of crcptr invalid\n", __func__); + return (NULL); + } + + desc = ioat_op_generic(ioat, op, len, src, dst, callback_fn, + callback_arg, flags & ~_DMA_CRC_FLAGS); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.crc32; + + if ((flags & DMA_CRC_INLINE) == 0) + hw_desc->crc_address = crcptr; + else + hw_desc->u.control.crc_location = 1; + + if (initialseed != NULL) { + hw_desc->u.control.use_seed = 1; + hw_desc->seed = *initialseed; + } + + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +struct bus_dmadesc * +ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, bus_size_t len, + uint32_t *initialseed, bus_addr_t crcptr, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) +{ + struct ioat_crc32_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + uint32_t teststore; + uint8_t op; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + + if ((ioat->capabilities & IOAT_DMACAP_CRC) == 0) { + ioat_log_message(0, "%s: Device lacks CRC capability\n", + __func__); + return (NULL); + } + if ((src & (0xffffffull << 40)) != 0) { + ioat_log_message(0, "%s: High 24 bits of src invalid\n", + __func__); + return (NULL); + } + teststore = (flags & _DMA_CRC_TESTSTORE); + if (teststore == _DMA_CRC_TESTSTORE) { + ioat_log_message(0, "%s: TEST and STORE invalid\n", __func__); + return (NULL); + } + if (teststore == 0 && (flags & DMA_CRC_INLINE) != 0) { + ioat_log_message(0, "%s: INLINE invalid without TEST or STORE\n", + __func__); + return (NULL); + } + + switch (teststore) { + case DMA_CRC_STORE: + op = IOAT_OP_CRC_STORE; + break; + case DMA_CRC_TEST: + op = IOAT_OP_CRC_TEST; + break; + default: + KASSERT(teststore == 0, ("bogus")); + op = IOAT_OP_CRC; + break; + } + + if ((flags & DMA_CRC_INLINE) == 0 && + (crcptr & (0xffffffull << 40)) != 0) { + ioat_log_message(0, + "%s: High 24 bits of crcptr invalid\n", __func__); + return (NULL); + } + + desc = ioat_op_generic(ioat, op, len, src, 0, callback_fn, + callback_arg, flags & ~_DMA_CRC_FLAGS); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.crc32; + + if ((flags & DMA_CRC_INLINE) == 0) + hw_desc->crc_address = crcptr; + else + hw_desc->u.control.crc_location = 1; + + if (initialseed != NULL) { + hw_desc->u.control.use_seed = 1; + hw_desc->seed = *initialseed; + } + + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +struct bus_dmadesc * ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern, bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Tue May 3 17:06:33 2016 (r298988) +++ head/sys/dev/ioat/ioat.h Tue May 3 17:07:18 2016 (r298989) @@ -52,7 +52,26 @@ __FBSDID("$FreeBSD$"); * may be prefetched before operation 1 completes. */ #define DMA_FENCE 0x4 -#define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT | DMA_FENCE) +#define _DMA_GENERIC_FLAGS (DMA_INT_EN | DMA_NO_WAIT | DMA_FENCE) + +/* + * Emit a CRC32C as the result of a ioat_copy_crc() or ioat_crc(). + */ +#define DMA_CRC_STORE 0x8 + +/* + * Compare the CRC32C of a ioat_copy_crc() or ioat_crc() against an expeceted + * value. It is invalid to specify both TEST and STORE. + */ +#define DMA_CRC_TEST 0x10 +#define _DMA_CRC_TESTSTORE (DMA_CRC_STORE | DMA_CRC_TEST) + +/* + * Use an inline comparison CRC32C or emit an inline CRC32C result. Invalid + * without one of STORE or TEST. + */ +#define DMA_CRC_INLINE 0x20 +#define _DMA_CRC_FLAGS (DMA_CRC_STORE | DMA_CRC_TEST | DMA_CRC_INLINE) /* * Hardware revision number. Different hardware revisions support different @@ -152,6 +171,42 @@ struct bus_dmadesc *ioat_copy_8k_aligned bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags); /* + * Copy len bytes from dst to src, like ioat_copy(). + * + * Additionally, accumulate a CRC32C of the data. + * + * If initialseed is not NULL, the value it points to is used to seed the + * initial value of the CRC32C. + * + * If flags include DMA_CRC_STORE and not DMA_CRC_INLINE, crcptr is written + * with the 32-bit CRC32C result (in wire format). + * + * If flags include DMA_CRC_TEST and not DMA_CRC_INLINE, the computed CRC32C is + * compared with the 32-bit CRC32C pointed to by crcptr. If they do not match, + * a channel error is raised. + * + * If the DMA_CRC_INLINE flag is set, crcptr is ignored and the DMA engine uses + * the 4 bytes trailing the source data (TEST) or the destination data (STORE). + */ +struct bus_dmadesc *ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t dst, + bus_addr_t src, bus_size_t len, uint32_t *initialseed, bus_addr_t crcptr, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags); + +/* + * ioat_crc() is nearly identical to ioat_copy_crc(), but does not actually + * move data around. + * + * Like ioat_copy_crc, ioat_crc computes a CRC32C over len bytes pointed to by + * src. The flags affect its operation in the same way, with one exception: + * + * If flags includes both DMA_CRC_STORE and DMA_CRC_INLINE, the computed CRC32C + * is written to the 4 bytes trailing the *source* data. + */ +struct bus_dmadesc *ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, + bus_size_t len, uint32_t *initialseed, bus_addr_t crcptr, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags); + +/* * Issues a null operation. This issues the operation to the hardware, but the * hardware doesn't do anything with it. */ From owner-svn-src-all@freebsd.org Tue May 3 17:11:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD08DB2C0BE; Tue, 3 May 2016 17:11:34 +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 818491936; Tue, 3 May 2016 17:11:34 +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 u43HBXDN012899; Tue, 3 May 2016 17:11:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43HBXfS012897; Tue, 3 May 2016 17:11:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605031711.u43HBXfS012897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 3 May 2016 17:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298990 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 17:11:34 -0000 Author: adrian Date: Tue May 3 17:11:33 2016 New Revision: 298990 URL: https://svnweb.freebsd.org/changeset/base/298990 Log: [asmc] Add support for MacBookPro5,1 Tested by: Johannes Lundberg PR: kern/209179 Submitted by: Thomas Brierley Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Tue May 3 17:07:18 2016 (r298989) +++ head/sys/dev/asmc/asmc.c Tue May 3 17:11:33 2016 (r298990) @@ -216,6 +216,12 @@ struct asmc_model asmc_models[] = { }, { + "MacBookPro5,1", "Apple SMC MacBook Pro Core 2 Duo (2008/2009)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP5_TEMPS, ASMC_MBP5_TEMPNAMES, ASMC_MBP5_TEMPDESCS + }, + + { "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Tue May 3 17:07:18 2016 (r298989) +++ head/sys/dev/asmc/asmcvar.h Tue May 3 17:11:33 2016 (r298990) @@ -188,6 +188,34 @@ struct asmc_softc { "Unknown", "Unknown", \ "Wireless Module", } +#define ASMC_MBP5_TEMPS { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", \ + "TC0F", "TC0P", "TG0D", "TG0F", "TG0H", \ + "TG0P", "TG0T", "TG1H", "TN0D", "TN0P", \ + "TTF0", "Th2H", "Tm0P", "Ts0P", "Ts0S", \ + NULL } + +#define ASMC_MBP5_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \ + "enclosure_bottom_2", "enclosure_bottom_3", \ + "cpu_diode", "cpu", \ + "cpu_pin", "gpu_diode", \ + "gpu", "gpu_heatsink", \ + "gpu_pin", "gpu_transistor", \ + "gpu_2_heatsink", "northbridge_diode", \ + "northbridge_pin", "unknown", \ + "heatsink_2", "memory_controller", \ + "pci_express_slot_pin", "pci_express_slot_unk" } + +#define ASMC_MBP5_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \ + "Enclosure Bottom 2", "Enclosure Bottom 3", \ + "CPU Diode", "CPU ???", \ + "CPU Pin", "GPU Diode", \ + "GPU ???", "GPU Heatsink", \ + "GPU Pin", "GPU Transistor", \ + "GPU 2 Heatsink", "Northbridge Diode", \ + "Northbridge Pin", "Unknown", \ + "Heatsink 2", "Memory Controller", \ + "PCI Express Slot Pin", "PCI Express Slot (unk)" } + #define ASMC_MBP8_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ From owner-svn-src-all@freebsd.org Tue May 3 17:58:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 781EFB2CF13; Tue, 3 May 2016 17:58:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 0CAE51A3A; Tue, 3 May 2016 17:58:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C01B41A1B20; Wed, 4 May 2016 03:58:41 +1000 (AEST) Date: Wed, 4 May 2016 03:58:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Bruce Evans , Pedro Giffuni , "Ngie Cooper (yaneurabeya)" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 In-Reply-To: <8989101.JIAk4LJusf@ralph.baldwin.cx> Message-ID: <20160504031930.A3395@besplex.bde.org> References: <201605021800.u42I0cjK084243@repo.freebsd.org> <20160503152502.A939@besplex.bde.org> <8989101.JIAk4LJusf@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=yQTNAvRlwjzvZyhg9ksA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 17:58:45 -0000 On Tue, 3 May 2016, John Baldwin wrote: > On Tuesday, May 03, 2016 03:52:56 PM Bruce Evans wrote: >> On Mon, 2 May 2016, Pedro Giffuni wrote: >... >>> TBH, I thought so too, but I avoided applying such changes to headers, >>> and I haven't touched _bitset.h, >> >> _foo.h headers cannot use howmany() due to namespace pollution. >> >> _bitset.h was already broken, unless it is supposed to be kernel-only -- >> it uses howmany(). It is kernel-only according to its documention -- >> bitset is only documented in kernel manpages (in a single unreadable one >> than is linked ad nauseum). > > cpuset.h is used in userland for cpuset_getaffinity(2), etc. > >> It is otherwise fairly clean. It defines the symbols BITSET_DEFINE, >> BITSET_T_INITIALIZER, and BITSET_SET in the application namespace >> This is not completely clean for a _foo.h header. All other BITSET* >> macros are already in bitset.h I think only BITSET_DEFINE should be >> in _bitset.h (for use declarations in other headers). >> >> select.h avoids this problem by defining its own howmany() macro. This >> seems to be correct except for the bogus ifdef around the private macro. >> This ifdef is a little more than a style bug (verboseness) -- it breaks >> detection of other definitions that might be different. Lexical >> differences wouldn't matter, but it is easier to never have them. >> >> Old versions of select polluted . The select macros just >> used howmany(). howmany() was in too. > > I would be happy to fix _bitset.h and _cpuset.h to not need sys/param.h. > However, they also use NBBY which is defined in sys/param.h. _sigset.h > gets around this because it uses an array of uint32_t and hardcodes a > shift count of 5 in _SIG_WORD() and a mask of 31 in _SIG_BIT(). If you > think it is fine to hardcode '8' instead of 'NBBY' I'll do that. Hmm, > sys/select.h hardcodes '8' for _NFDBITS, so I guess that is fine. NBBY can be cleaned up too. I rather like it, but it is bogus in C90 since it is spelled CHAR_BIT there, and it is now more bogus in POSIX since POSIX started specifying 8-bit bytes in 2001. Thus 8 is the correct spelling of it in the implementation where you don't want to expose a macro that makes it clearer what this magic 8 is. BTW, I don't like select's and bitset's use of longs. Using unsigned for select is a historical mistake. Bitset apparently copied select except it unimproved to signed long. Bitstring uses unsigned char with no optimizations. Sigset uses uint32_t with no obvious optimizations, but compilers do a good job with with it due to its fixed size. I doubt that the manual optimization of using a wider size is important. Bruce From owner-svn-src-all@freebsd.org Tue May 3 18:00:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66E07B2CF98; Tue, 3 May 2016 18:00:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1A081C06; Tue, 3 May 2016 18:00:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43I0Un3027849; Tue, 3 May 2016 18:00:30 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I0R66027818; Tue, 3 May 2016 18:00:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031800.u43I0R66027818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298991 - in vendor-crypto/openssl/dist: . apps crypto crypto/aes/asm crypto/asn1 crypto/bn/asm crypto/comp crypto/evp crypto/modes/asm crypto/pem crypto/perlasm crypto/sha/asm crypto/x... X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:00:31 -0000 Author: jkim Date: Tue May 3 18:00:27 2016 New Revision: 298991 URL: https://svnweb.freebsd.org/changeset/base/298991 Log: Import OpenSSL 1.0.2h. Added: vendor-crypto/openssl/dist/doc/crypto/EVP_EncodeInit.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_alpn_select_cb.pod Modified: vendor-crypto/openssl/dist/CHANGES vendor-crypto/openssl/dist/FREEBSD-upgrade vendor-crypto/openssl/dist/Makefile vendor-crypto/openssl/dist/NEWS vendor-crypto/openssl/dist/README vendor-crypto/openssl/dist/apps/pkcs7.c vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl vendor-crypto/openssl/dist/crypto/asn1/a_bytes.c vendor-crypto/openssl/dist/crypto/asn1/a_d2i_fp.c vendor-crypto/openssl/dist/crypto/asn1/a_type.c vendor-crypto/openssl/dist/crypto/asn1/asn1_lib.c vendor-crypto/openssl/dist/crypto/asn1/asn1_par.c vendor-crypto/openssl/dist/crypto/asn1/t_x509.c vendor-crypto/openssl/dist/crypto/asn1/tasn_dec.c vendor-crypto/openssl/dist/crypto/asn1/tasn_enc.c vendor-crypto/openssl/dist/crypto/asn1/x_name.c vendor-crypto/openssl/dist/crypto/asn1/x_x509.c vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl vendor-crypto/openssl/dist/crypto/comp/comp.h vendor-crypto/openssl/dist/crypto/evp/Makefile vendor-crypto/openssl/dist/crypto/evp/digest.c vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha256.c vendor-crypto/openssl/dist/crypto/evp/encode.c vendor-crypto/openssl/dist/crypto/evp/evp_enc.c vendor-crypto/openssl/dist/crypto/modes/asm/ghash-s390x.pl vendor-crypto/openssl/dist/crypto/opensslv.h vendor-crypto/openssl/dist/crypto/pem/pem_lib.c vendor-crypto/openssl/dist/crypto/pem/pvkfmt.c vendor-crypto/openssl/dist/crypto/perlasm/x86_64-xlate.pl vendor-crypto/openssl/dist/crypto/s390xcpuid.S vendor-crypto/openssl/dist/crypto/sha/asm/sha1-ppc.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha1-s390x.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha512-ppc.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha512-s390x.pl vendor-crypto/openssl/dist/crypto/x509/x509.h vendor-crypto/openssl/dist/crypto/x509/x509_err.c vendor-crypto/openssl/dist/crypto/x509/x509_obj.c vendor-crypto/openssl/dist/doc/apps/ciphers.pod vendor-crypto/openssl/dist/doc/apps/ocsp.pod vendor-crypto/openssl/dist/doc/crypto/evp.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_use_serverinfo.pod vendor-crypto/openssl/dist/ssl/d1_both.c vendor-crypto/openssl/dist/ssl/s2_lib.c vendor-crypto/openssl/dist/ssl/s2_meth.c vendor-crypto/openssl/dist/ssl/s3_clnt.c vendor-crypto/openssl/dist/ssl/s3_lib.c vendor-crypto/openssl/dist/ssl/ssl.h vendor-crypto/openssl/dist/ssl/ssl_cert.c vendor-crypto/openssl/dist/ssl/ssl_ciph.c vendor-crypto/openssl/dist/ssl/ssl_lib.c vendor-crypto/openssl/dist/ssl/ssl_locl.h vendor-crypto/openssl/dist/ssl/ssl_rsa.c vendor-crypto/openssl/dist/ssl/ssltest.c vendor-crypto/openssl/dist/ssl/t1_lib.c vendor-crypto/openssl/dist/util/libeay.num vendor-crypto/openssl/dist/util/mk1mf.pl vendor-crypto/openssl/dist/util/mkdef.pl vendor-crypto/openssl/dist/util/shlib_wrap.sh vendor-crypto/openssl/dist/util/ssleay.num Modified: vendor-crypto/openssl/dist/CHANGES ============================================================================== --- vendor-crypto/openssl/dist/CHANGES Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/CHANGES Tue May 3 18:00:27 2016 (r298991) @@ -2,6 +2,103 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2g and 1.0.2h [3 May 2016] + + *) Prevent padding oracle in AES-NI CBC MAC check + + A MITM attacker can use a padding oracle attack to decrypt traffic + when the connection uses an AES CBC cipher and the server support + AES-NI. + + This issue was introduced as part of the fix for Lucky 13 padding + attack (CVE-2013-0169). The padding check was rewritten to be in + constant time by making sure that always the same bytes are read and + compared against either the MAC or padding bytes. But it no longer + checked that there was enough data to have both the MAC and padding + bytes. + + This issue was reported by Juraj Somorovsky using TLS-Attacker. + (CVE-2016-2107) + [Kurt Roeckx] + + *) Fix EVP_EncodeUpdate overflow + + An overflow can occur in the EVP_EncodeUpdate() function which is used for + Base64 encoding of binary data. If an attacker is able to supply very large + amounts of input data then a length check can overflow resulting in a heap + corruption. + + Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by + the PEM_write_bio* family of functions. These are mainly used within the + OpenSSL command line applications, so any application which processes data + from an untrusted source and outputs it as a PEM file should be considered + vulnerable to this issue. User applications that call these APIs directly + with large amounts of untrusted data may also be vulnerable. + + This issue was reported by Guido Vranken. + (CVE-2016-2105) + [Matt Caswell] + + *) Fix EVP_EncryptUpdate overflow + + An overflow can occur in the EVP_EncryptUpdate() function. If an attacker + is able to supply very large amounts of input data after a previous call to + EVP_EncryptUpdate() with a partial block then a length check can overflow + resulting in a heap corruption. Following an analysis of all OpenSSL + internal usage of the EVP_EncryptUpdate() function all usage is one of two + forms. The first form is where the EVP_EncryptUpdate() call is known to be + the first called function after an EVP_EncryptInit(), and therefore that + specific call must be safe. The second form is where the length passed to + EVP_EncryptUpdate() can be seen from the code to be some small value and + therefore there is no possibility of an overflow. Since all instances are + one of these two forms, it is believed that there can be no overflows in + internal code due to this problem. It should be noted that + EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths. + Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances + of these calls have also been analysed too and it is believed there are no + instances in internal usage where an overflow could occur. + + This issue was reported by Guido Vranken. + (CVE-2016-2106) + [Matt Caswell] + + *) Prevent ASN.1 BIO excessive memory allocation + + When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio() + a short invalid encoding can casuse allocation of large amounts of memory + potentially consuming excessive resources or exhausting memory. + + Any application parsing untrusted data through d2i BIO functions is + affected. The memory based functions such as d2i_X509() are *not* affected. + Since the memory based functions are used by the TLS library, TLS + applications are not affected. + + This issue was reported by Brian Carpenter. + (CVE-2016-2109) + [Stephen Henson] + + *) EBCDIC overread + + ASN1 Strings that are over 1024 bytes can cause an overread in applications + using the X509_NAME_oneline() function on EBCDIC systems. This could result + in arbitrary stack data being returned in the buffer. + + This issue was reported by Guido Vranken. + (CVE-2016-2176) + [Matt Caswell] + + *) Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + [Todd Short] + + *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the + default. + [Kurt Roeckx] + + *) Only remove the SSLv2 methods with the no-ssl2-method option. When the + methods are enabled and ssl2 is disabled the methods return NULL. + [Kurt Roeckx] + Changes between 1.0.2f and 1.0.2g [1 Mar 2016] * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: vendor-crypto/openssl/dist/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist/FREEBSD-upgrade Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/FREEBSD-upgrade Tue May 3 18:00:27 2016 (r298991) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/Subv # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://repo.freebsd.org/base" -setenv OSSLVER 1.0.2f -# OSSLTAG format: v1_0_2f +setenv OSSLVER 1.0.2h +# OSSLTAG format: v1_0_2h ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` Modified: vendor-crypto/openssl/dist/Makefile ============================================================================== --- vendor-crypto/openssl/dist/Makefile Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/Makefile Tue May 3 18:00:27 2016 (r298991) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2g +VERSION=1.0.2h MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 Modified: vendor-crypto/openssl/dist/NEWS ============================================================================== --- vendor-crypto/openssl/dist/NEWS Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/NEWS Tue May 3 18:00:27 2016 (r298991) @@ -5,6 +5,19 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2g and OpenSSL 1.0.2h [3 May 2016] + + o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) + o Fix EVP_EncodeUpdate overflow (CVE-2016-2105) + o Fix EVP_EncryptUpdate overflow (CVE-2016-2106) + o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109) + o EBCDIC overread (CVE-2016-2176) + o Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + o Remove LOW from the DEFAULT cipher list. This removes singles DES from + the default. + o Only remove the SSLv2 methods with the no-ssl2-method option. + Major changes between OpenSSL 1.0.2f and OpenSSL 1.0.2g [1 Mar 2016] o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: vendor-crypto/openssl/dist/README ============================================================================== --- vendor-crypto/openssl/dist/README Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/README Tue May 3 18:00:27 2016 (r298991) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2g 1 Mar 2016 + OpenSSL 1.0.2h 3 May 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist/apps/pkcs7.c ============================================================================== --- vendor-crypto/openssl/dist/apps/pkcs7.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/apps/pkcs7.c Tue May 3 18:00:27 2016 (r298991) @@ -235,12 +235,16 @@ int MAIN(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; Modified: vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl Tue May 3 18:00:27 2016 (r298991) @@ -590,7 +590,7 @@ Lenc_loop: xor $s2,$t2,$acc14 xor $s3,$t3,$acc15 addi $key,$key,16 - bdnz- Lenc_loop + bdnz Lenc_loop addi $Tbl2,$Tbl0,2048 nop @@ -1068,7 +1068,7 @@ Ldec_loop: xor $s2,$t2,$acc14 xor $s3,$t3,$acc15 addi $key,$key,16 - bdnz- Ldec_loop + bdnz Ldec_loop addi $Tbl2,$Tbl0,2048 nop Modified: vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl Tue May 3 18:00:27 2016 (r298991) @@ -818,13 +818,9 @@ $code.=<<___ if (!$softonly); tmhl %r0,0x4000 # check for message-security assist jz .Lekey_internal - lghi %r0,0 # query capability vector - la %r1,16($sp) - .long 0xb92f0042 # kmc %r4,%r2 - - llihh %r1,0x8000 - srlg %r1,%r1,0(%r5) - ng %r1,16($sp) + llihh %r0,0x8000 + srlg %r0,%r0,0(%r5) + ng %r0,48(%r1) # check kmc capability vector jz .Lekey_internal lmg %r0,%r1,0($inp) # just copy 128 bits... @@ -1444,13 +1440,10 @@ $code.=<<___ if (0); ######### kmctr cod llgfr $s0,%r0 lgr $s1,%r1 - lghi %r0,0 - la %r1,16($sp) - .long 0xb92d2042 # kmctr %r4,%r2,%r2 - + larl %r1,OPENSSL_s390xcap_P llihh %r0,0x8000 # check if kmctr supports the function code srlg %r0,%r0,0($s0) - ng %r0,16($sp) + ng %r0,64(%r1) # check kmctr capability vector lgr %r0,$s0 lgr %r1,$s1 jz .Lctr32_km_loop @@ -1597,12 +1590,10 @@ $code.=<<___ if(1); llgfr $s0,%r0 # put aside the function code lghi $s1,0x7f nr $s1,%r0 - lghi %r0,0 # query capability vector - la %r1,$tweak-16($sp) - .long 0xb92e0042 # km %r4,%r2 - llihh %r1,0x8000 - srlg %r1,%r1,32($s1) # check for 32+function code - ng %r1,$tweak-16($sp) + larl %r1,OPENSSL_s390xcap_P + llihh %r0,0x8000 + srlg %r0,%r0,32($s1) # check for 32+function code + ng %r0,32(%r1) # check km capability vector lgr %r0,$s0 # restore the function code la %r1,0($key1) # restore $key1 jz .Lxts_km_vanilla @@ -2229,7 +2220,7 @@ ___ } $code.=<<___; .string "AES for s390x, CRYPTOGAMS by " -.comm OPENSSL_s390xcap_P,16,8 +.comm OPENSSL_s390xcap_P,80,8 ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; Modified: vendor-crypto/openssl/dist/crypto/asn1/a_bytes.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/a_bytes.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/a_bytes.c Tue May 3 18:00:27 2016 (r298991) @@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) - OPENSSL_free(ret->data); s = (unsigned char *)OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; } + if (ret->data != NULL) + OPENSSL_free(ret->data); } else s = ret->data; memcpy(s, p, (int)len); Modified: vendor-crypto/openssl/dist/crypto/asn1/a_d2i_fp.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/a_d2i_fp.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/a_d2i_fp.c Tue May 3 18:00:27 2016 (r298991) @@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM * #endif #define HEADER_SIZE 8 +#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; @@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BU /* suck in c.slen bytes of data */ want = c.slen; if (want > (len - off)) { + size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; + want -= (len - off); if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) { ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG); goto err; } - if (!BUF_MEM_grow_clean(b, len + want)) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } while (want > 0) { - i = BIO_read(in, &(b->data[len]), want); - if (i <= 0) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, - ASN1_R_NOT_ENOUGH_DATA); + /* + * Read content in chunks of increasing size + * so we can return an error for EOF without + * having to allocate the entire content length + * in one go. + */ + size_t chunk = want > chunk_max ? chunk_max : want; + + if (!BUF_MEM_grow_clean(b, len + chunk)) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); goto err; } + want -= chunk; + while (chunk > 0) { + i = BIO_read(in, &(b->data[len]), chunk); + if (i <= 0) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, + ASN1_R_NOT_ENOUGH_DATA); + goto err; + } /* * This can't overflow because |len+want| didn't * overflow. */ - len += i; - want -= i; + len += i; + chunk -= i; + } + if (chunk_max < INT_MAX/2) + chunk_max *= 2; } } if (off + c.slen < off) { Modified: vendor-crypto/openssl/dist/crypto/asn1/a_type.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/a_type.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/a_type.c Tue May 3 18:00:27 2016 (r298991) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: vendor-crypto/openssl/dist/crypto/asn1/asn1_lib.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/asn1_lib.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/asn1_lib.c Tue May 3 18:00:27 2016 (r298991) @@ -63,7 +63,7 @@ #include static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max); + long max); static void asn1_put_length(unsigned char **pp, int length); const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; @@ -131,7 +131,7 @@ int ASN1_get_object(const unsigned char } *ptag = tag; *pclass = xclass; - if (!asn1_get_length(&p, &inf, plength, (int)max)) + if (!asn1_get_length(&p, &inf, plength, max)) goto err; if (inf && !(ret & V_ASN1_CONSTRUCTED)) @@ -159,14 +159,14 @@ int ASN1_get_object(const unsigned char } static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max) + long max) { const unsigned char *p = *pp; unsigned long ret = 0; - unsigned int i; + unsigned long i; if (max-- < 1) - return (0); + return 0; if (*p == 0x80) { *inf = 1; ret = 0; @@ -175,15 +175,11 @@ static int asn1_get_length(const unsigne *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { - if (i > sizeof(long)) + if (i > sizeof(ret) || max < (long)i) return 0; - if (max-- == 0) - return (0); while (i-- > 0) { ret <<= 8L; ret |= *(p++); - if (max-- == 0) - return (0); } } else ret = i; @@ -192,7 +188,7 @@ static int asn1_get_length(const unsigne return 0; *pp = p; *rl = (long)ret; - return (1); + return 1; } /* Modified: vendor-crypto/openssl/dist/crypto/asn1/asn1_par.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/asn1_par.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/asn1_par.c Tue May 3 18:00:27 2016 (r298991) @@ -173,6 +173,8 @@ static int asn1_parse2(BIO *bp, const un if (!asn1_print_info(bp, tag, xclass, j, (indent) ? depth : 0)) goto end; if (j & V_ASN1_CONSTRUCTED) { + const unsigned char *sp; + ep = p + len; if (BIO_write(bp, "\n", 1) <= 0) goto end; @@ -182,6 +184,7 @@ static int asn1_parse2(BIO *bp, const un goto end; } if ((j == 0x21) && (len == 0)) { + sp = p; for (;;) { r = asn1_parse2(bp, &p, (long)(tot - p), offset + (p - *pp), depth + 1, @@ -190,19 +193,25 @@ static int asn1_parse2(BIO *bp, const un ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = p - sp; break; + } } - } else + } else { + long tmp = len; + while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, - offset + (p - *pp), depth + 1, + sp = p; + r = asn1_parse2(bp, &p, tmp, offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { ret = 0; goto end; } + tmp -= p - sp; } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) Modified: vendor-crypto/openssl/dist/crypto/asn1/t_x509.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/t_x509.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/t_x509.c Tue May 3 18:00:27 2016 (r298991) @@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsi goto err; bs = X509_get_serialNumber(x); - if (bs->length <= (int)sizeof(long)) { + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { l = ASN1_INTEGER_get(bs); if (bs->type == V_ASN1_NEG_INTEGER) { l = -l; Modified: vendor-crypto/openssl/dist/crypto/asn1/tasn_dec.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/tasn_dec.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/tasn_dec.c Tue May 3 18:00:27 2016 (r298991) @@ -901,9 +901,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: vendor-crypto/openssl/dist/crypto/asn1/tasn_enc.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/tasn_enc.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/tasn_enc.c Tue May 3 18:00:27 2016 (r298991) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: vendor-crypto/openssl/dist/crypto/asn1/x_name.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/x_name.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/x_name.c Tue May 3 18:00:27 2016 (r298991) @@ -66,6 +66,13 @@ typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, @@ -192,6 +199,10 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; + if (len > X509_NAME_MAX) { + ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); + return 0; + } q = p; /* Get internal representation of Name */ Modified: vendor-crypto/openssl/dist/crypto/asn1/x_x509.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/asn1/x_x509.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/asn1/x_x509.c Tue May 3 18:00:27 2016 (r298991) @@ -201,10 +201,20 @@ X509 *d2i_X509_AUX(X509 **a, const unsig int i2d_X509_AUX(X509 *a, unsigned char **pp) { - int length; + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); - if (a) - length += i2d_X509_CERT_AUX(a->aux, pp); + if (length < 0 || a == NULL) + return length; + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + return length; } Modified: vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl Tue May 3 18:00:27 2016 (r298991) @@ -191,7 +191,7 @@ L1st: addi $j,$j,$BNSZ ; j++ addi $tp,$tp,$BNSZ ; tp++ - bdnz- L1st + bdnz L1st ;L1st addc $lo0,$alo,$hi0 addze $hi0,$ahi @@ -253,7 +253,7 @@ Linner: addze $hi1,$hi1 $ST $lo1,0($tp) ; tp[j-1] addi $tp,$tp,$BNSZ ; tp++ - bdnz- Linner + bdnz Linner ;Linner $LD $tj,$BNSZ($tp) ; tp[j] addc $lo0,$alo,$hi0 @@ -276,7 +276,7 @@ Linner: slwi $tj,$num,`log($BNSZ)/log(2)` $UCMP $i,$tj addi $i,$i,$BNSZ - ble- Louter + ble Louter addi $num,$num,2 ; restore $num subfc $j,$j,$j ; j=0 and "clear" XER[CA] @@ -289,7 +289,7 @@ Lsub: $LDX $tj,$tp,$j subfe $aj,$nj,$tj ; tp[j]-np[j] $STX $aj,$rp,$j addi $j,$j,$BNSZ - bdnz- Lsub + bdnz Lsub li $j,0 mtctr $num @@ -304,7 +304,7 @@ Lcopy: ; copy or in-place refresh $STX $tj,$rp,$j $STX $j,$tp,$j ; zap at once addi $j,$j,$BNSZ - bdnz- Lcopy + bdnz Lcopy $POP $tj,0($sp) li r3,1 Modified: vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl Tue May 3 18:00:27 2016 (r298991) @@ -1556,7 +1556,7 @@ Lppcasm_sub_mainloop: # if carry = 1 this is r7-r8. Else it # is r7-r8 -1 as we need. $STU r6,$BNSZ(r3) - bdnz- Lppcasm_sub_mainloop + bdnz Lppcasm_sub_mainloop Lppcasm_sub_adios: subfze r3,r0 # if carry bit is set then r3 = 0 else -1 andi. r3,r3,1 # keep only last bit. @@ -1603,7 +1603,7 @@ Lppcasm_add_mainloop: $LDU r8,$BNSZ(r5) adde r8,r7,r8 $STU r8,$BNSZ(r3) - bdnz- Lppcasm_add_mainloop + bdnz Lppcasm_add_mainloop Lppcasm_add_adios: addze r3,r0 #return carry bit. blr @@ -1762,7 +1762,7 @@ Lppcasm_sqr_mainloop: $UMULH r8,r6,r6 $STU r7,$BNSZ(r3) $STU r8,$BNSZ(r3) - bdnz- Lppcasm_sqr_mainloop + bdnz Lppcasm_sqr_mainloop Lppcasm_sqr_adios: blr .long 0 @@ -1827,7 +1827,7 @@ Lppcasm_mw_LOOP: addi r3,r3,`4*$BNSZ` addi r4,r4,`4*$BNSZ` - bdnz- Lppcasm_mw_LOOP + bdnz Lppcasm_mw_LOOP Lppcasm_mw_REM: andi. r5,r5,0x3 @@ -1951,7 +1951,7 @@ Lppcasm_maw_mainloop: $ST r11,`3*$BNSZ`(r3) addi r3,r3,`4*$BNSZ` addi r4,r4,`4*$BNSZ` - bdnz- Lppcasm_maw_mainloop + bdnz Lppcasm_maw_mainloop Lppcasm_maw_leftover: andi. r5,r5,0x3 Modified: vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl Tue May 3 18:00:27 2016 (r298991) @@ -734,7 +734,7 @@ $code.=<<___; ___ } $code.=<<___; - bdnz- L1st + bdnz L1st fctid $dota,$dota fctid $dotb,$dotb @@ -1280,7 +1280,7 @@ $code.=<<___; ___ } $code.=<<___; - bdnz- Linner + bdnz Linner fctid $dota,$dota fctid $dotb,$dotb @@ -1490,7 +1490,7 @@ Lsub: ldx $t0,$tp,$i stdx $t0,$rp,$i stdx $t2,$t6,$i addi $i,$i,16 - bdnz- Lsub + bdnz Lsub li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit @@ -1517,7 +1517,7 @@ Lcopy: ; copy or in-place refresh stdx $i,$tp,$i ; zap tp at once stdx $i,$t4,$i addi $i,$i,16 - bdnz- Lcopy + bdnz Lcopy ___ $code.=<<___ if ($SIZE_T==4); subf $np,$num,$np ; rewind np @@ -1550,7 +1550,7 @@ Lsub: lwz $t0,12($tp) ; load tp[j..j+3] stw $t5,8($rp) stw $t6,12($rp) stwu $t7,16($rp) - bdnz- Lsub + bdnz Lsub li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit @@ -1582,7 +1582,7 @@ Lcopy: ; copy or in-place refresh stwu $t3,16($rp) std $i,8($tp) ; zap tp at once stdu $i,16($tp) - bdnz- Lcopy + bdnz Lcopy ___ $code.=<<___; Modified: vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl Tue May 3 18:00:27 2016 (r298991) @@ -85,6 +85,21 @@ $frame=32; # size of above frame roun &and ("esp",-64); # align to cache line + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + &mov ("eax","ebp"); + &sub ("eax","esp"); + &and ("eax",-4096); +&set_label("page_walk"); + &mov ("edx",&DWP(0,"esp","eax")); + &sub ("eax",4096); + &data_byte(0x2e); + &jnc (&label("page_walk")); + ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap Modified: vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:00:27 2016 (r298991) @@ -130,6 +130,20 @@ $code.=<<___; mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmul_page_walk + mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -342,6 +356,14 @@ $code.=<<___; mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -795,6 +817,15 @@ bn_sqr8x_mont: sub %r11,%rsp .Lsqr8x_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lsqr8x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lsqr8x_page_walk + mov $num,%r10 neg $num @@ -932,8 +963,17 @@ bn_mulx4x_mont: sub $num,%r10 # -$num mov ($n0),$n0 # *n0 lea -72(%rsp,%r10),%rsp # alloca(frame+$num+8) - lea ($bp,$num),%r10 and \$-128,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmulx4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmulx4x_page_walk + + lea ($bp,$num),%r10 ############################################################## # Stack layout # +0 num Modified: vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:00:27 2016 (r298991) @@ -115,6 +115,20 @@ $code.=<<___; mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%rax + and \$-4096,%rax +.Lmul_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul_page_walk + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; @@ -469,6 +483,15 @@ $code.=<<___; sub %r11,%rsp .Lmul4xsp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + neg $num mov %rax,40(%rsp) @@ -1058,6 +1081,15 @@ $code.=<<___; sub %r11,%rsp .Lpwr_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lpwr_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lpwr_page_walk + mov $num,%r10 neg $num @@ -2028,7 +2060,16 @@ bn_from_mont8x: sub %r11,%rsp .Lfrom_sp_done: and \$-64,%rsp - mov $num,%r10 + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lfrom_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lfrom_page_walk + + mov $num,%r10 neg $num ############################################################## @@ -2173,6 +2214,15 @@ bn_mulx4x_mont_gather5: sub %r11,%rsp .Lmulx4xsp_done: and \$-64,%rsp # ensure alignment + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmulx4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmulx4x_page_walk + ############################################################## # Stack layout # +0 -num @@ -2619,6 +2669,15 @@ bn_powerx5: sub %r11,%rsp .Lpwrx_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lpwrx_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lpwrx_page_walk + mov $num,%r10 neg $num Modified: vendor-crypto/openssl/dist/crypto/comp/comp.h ============================================================================== --- vendor-crypto/openssl/dist/crypto/comp/comp.h Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/comp/comp.h Tue May 3 18:00:27 2016 (r298991) @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif Modified: vendor-crypto/openssl/dist/crypto/evp/Makefile ============================================================================== --- vendor-crypto/openssl/dist/crypto/evp/Makefile Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/evp/Makefile Tue May 3 18:00:27 2016 (r298991) @@ -199,8 +199,8 @@ e_aes.o: ../../include/openssl/opensslv. e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h +e_aes_cbc_hmac_sha1.o: ../../e_os.h ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h @@ -214,9 +214,9 @@ e_aes_cbc_hmac_sha1.o: ../../include/ope e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../modes/modes_lcl.h -e_aes_cbc_hmac_sha1.o: e_aes_cbc_hmac_sha1.c -e_aes_cbc_hmac_sha256.o: ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +e_aes_cbc_hmac_sha1.o: ../modes/modes_lcl.h e_aes_cbc_hmac_sha1.c +e_aes_cbc_hmac_sha256.o: ../../e_os.h ../../include/openssl/aes.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/asn1.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/bio.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/crypto.h @@ -232,7 +232,8 @@ e_aes_cbc_hmac_sha256.o: ../../include/o e_aes_cbc_hmac_sha256.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha256.o: ../../include/openssl/symhacks.h ../modes/modes_lcl.h +e_aes_cbc_hmac_sha256.o: ../../include/openssl/symhacks.h +e_aes_cbc_hmac_sha256.o: ../constant_time_locl.h ../modes/modes_lcl.h e_aes_cbc_hmac_sha256.o: e_aes_cbc_hmac_sha256.c e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h Modified: vendor-crypto/openssl/dist/crypto/evp/digest.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/evp/digest.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/evp/digest.c Tue May 3 18:00:27 2016 (r298991) @@ -212,8 +212,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; Modified: vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:00:27 2016 (r298991) @@ -60,6 +60,7 @@ # include # include # include "modes_lcl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -578,6 +579,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha256.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha256.c Tue May 3 17:11:33 2016 (r298990) +++ vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha256.c Tue May 3 18:00:27 2016 (r298991) @@ -60,6 +60,7 @@ # include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 18:01:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA71B2A032; Tue, 3 May 2016 18:01:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB761EE8; Tue, 3 May 2016 18:01:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43I1F85028693; Tue, 3 May 2016 18:01:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I1Ffu028692; Tue, 3 May 2016 18:01:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031801.u43I1Ffu028692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298992 - vendor-crypto/openssl/1.0.2h X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:01:16 -0000 Author: jkim Date: Tue May 3 18:01:15 2016 New Revision: 298992 URL: https://svnweb.freebsd.org/changeset/base/298992 Log: Tag OpenSSL 1.0.2h. Added: vendor-crypto/openssl/1.0.2h/ - copied from r298991, vendor-crypto/openssl/dist/ From owner-svn-src-all@freebsd.org Tue May 3 18:02:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF367B2A0DB; Tue, 3 May 2016 18:02:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7173711B5; Tue, 3 May 2016 18:02:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43I24gi028797; Tue, 3 May 2016 18:02:04 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I21vY028763; Tue, 3 May 2016 18:02:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031802.u43I21vY028763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298993 - in vendor-crypto/openssl/dist-1.0.1: . apps crypto crypto/asn1 crypto/bn/asm crypto/comp crypto/evp crypto/pem crypto/x509 doc/apps doc/crypto ssl util X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:02:05 -0000 Author: jkim Date: Tue May 3 18:02:01 2016 New Revision: 298993 URL: https://svnweb.freebsd.org/changeset/base/298993 Log: Import OpenSSL 1.0.1t. Added: vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod Modified: vendor-crypto/openssl/dist-1.0.1/CHANGES vendor-crypto/openssl/dist-1.0.1/FREEBSD-upgrade vendor-crypto/openssl/dist-1.0.1/Makefile vendor-crypto/openssl/dist-1.0.1/NEWS vendor-crypto/openssl/dist-1.0.1/README vendor-crypto/openssl/dist-1.0.1/apps/pkcs7.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_bytes.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_d2i_fp.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_type.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_lib.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_par.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/t_x509.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_dec.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_enc.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_name.c vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_x509.c vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86-mont.pl vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont.pl vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont5.pl vendor-crypto/openssl/dist-1.0.1/crypto/comp/comp.h vendor-crypto/openssl/dist-1.0.1/crypto/evp/Makefile vendor-crypto/openssl/dist-1.0.1/crypto/evp/digest.c vendor-crypto/openssl/dist-1.0.1/crypto/evp/e_aes_cbc_hmac_sha1.c vendor-crypto/openssl/dist-1.0.1/crypto/evp/encode.c vendor-crypto/openssl/dist-1.0.1/crypto/evp/evp_enc.c vendor-crypto/openssl/dist-1.0.1/crypto/opensslv.h vendor-crypto/openssl/dist-1.0.1/crypto/pem/pem_lib.c vendor-crypto/openssl/dist-1.0.1/crypto/pem/pvkfmt.c vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509.h vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_err.c vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_obj.c vendor-crypto/openssl/dist-1.0.1/doc/apps/ciphers.pod vendor-crypto/openssl/dist-1.0.1/doc/crypto/evp.pod vendor-crypto/openssl/dist-1.0.1/ssl/d1_both.c vendor-crypto/openssl/dist-1.0.1/ssl/s2_lib.c vendor-crypto/openssl/dist-1.0.1/ssl/s2_meth.c vendor-crypto/openssl/dist-1.0.1/ssl/s3_clnt.c vendor-crypto/openssl/dist-1.0.1/ssl/s3_lib.c vendor-crypto/openssl/dist-1.0.1/ssl/ssl.h vendor-crypto/openssl/dist-1.0.1/ssl/ssl_ciph.c vendor-crypto/openssl/dist-1.0.1/ssl/ssl_locl.h vendor-crypto/openssl/dist-1.0.1/ssl/t1_lib.c vendor-crypto/openssl/dist-1.0.1/util/libeay.num vendor-crypto/openssl/dist-1.0.1/util/mk1mf.pl vendor-crypto/openssl/dist-1.0.1/util/mkdef.pl vendor-crypto/openssl/dist-1.0.1/util/ssleay.num Modified: vendor-crypto/openssl/dist-1.0.1/CHANGES ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/CHANGES Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/CHANGES Tue May 3 18:02:01 2016 (r298993) @@ -2,6 +2,103 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1s and 1.0.1t [3 May 2016] + + *) Prevent padding oracle in AES-NI CBC MAC check + + A MITM attacker can use a padding oracle attack to decrypt traffic + when the connection uses an AES CBC cipher and the server support + AES-NI. + + This issue was introduced as part of the fix for Lucky 13 padding + attack (CVE-2013-0169). The padding check was rewritten to be in + constant time by making sure that always the same bytes are read and + compared against either the MAC or padding bytes. But it no longer + checked that there was enough data to have both the MAC and padding + bytes. + + This issue was reported by Juraj Somorovsky using TLS-Attacker. + (CVE-2016-2107) + [Kurt Roeckx] + + *) Fix EVP_EncodeUpdate overflow + + An overflow can occur in the EVP_EncodeUpdate() function which is used for + Base64 encoding of binary data. If an attacker is able to supply very large + amounts of input data then a length check can overflow resulting in a heap + corruption. + + Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by + the PEM_write_bio* family of functions. These are mainly used within the + OpenSSL command line applications, so any application which processes data + from an untrusted source and outputs it as a PEM file should be considered + vulnerable to this issue. User applications that call these APIs directly + with large amounts of untrusted data may also be vulnerable. + + This issue was reported by Guido Vranken. + (CVE-2016-2105) + [Matt Caswell] + + *) Fix EVP_EncryptUpdate overflow + + An overflow can occur in the EVP_EncryptUpdate() function. If an attacker + is able to supply very large amounts of input data after a previous call to + EVP_EncryptUpdate() with a partial block then a length check can overflow + resulting in a heap corruption. Following an analysis of all OpenSSL + internal usage of the EVP_EncryptUpdate() function all usage is one of two + forms. The first form is where the EVP_EncryptUpdate() call is known to be + the first called function after an EVP_EncryptInit(), and therefore that + specific call must be safe. The second form is where the length passed to + EVP_EncryptUpdate() can be seen from the code to be some small value and + therefore there is no possibility of an overflow. Since all instances are + one of these two forms, it is believed that there can be no overflows in + internal code due to this problem. It should be noted that + EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths. + Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances + of these calls have also been analysed too and it is believed there are no + instances in internal usage where an overflow could occur. + + This issue was reported by Guido Vranken. + (CVE-2016-2106) + [Matt Caswell] + + *) Prevent ASN.1 BIO excessive memory allocation + + When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio() + a short invalid encoding can casuse allocation of large amounts of memory + potentially consuming excessive resources or exhausting memory. + + Any application parsing untrusted data through d2i BIO functions is + affected. The memory based functions such as d2i_X509() are *not* affected. + Since the memory based functions are used by the TLS library, TLS + applications are not affected. + + This issue was reported by Brian Carpenter. + (CVE-2016-2109) + [Stephen Henson] + + *) EBCDIC overread + + ASN1 Strings that are over 1024 bytes can cause an overread in applications + using the X509_NAME_oneline() function on EBCDIC systems. This could result + in arbitrary stack data being returned in the buffer. + + This issue was reported by Guido Vranken. + (CVE-2016-2176) + [Matt Caswell] + + *) Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + [Todd Short] + + *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the + default. + [Kurt Roeckx] + + *) Only remove the SSLv2 methods with the no-ssl2-method option. When the + methods are enabled and ssl2 is disabled the methods return NULL. + [Kurt Roeckx] + Changes between 1.0.1r and 1.0.1s [1 Mar 2016] * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: vendor-crypto/openssl/dist-1.0.1/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/FREEBSD-upgrade Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/FREEBSD-upgrade Tue May 3 18:02:01 2016 (r298993) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/Subv # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://svn.freebsd.org/base" -setenv OSSLVER 1.0.1r -# OSSLTAG format: v1_0_1r +setenv OSSLVER 1.0.1t +# OSSLTAG format: v1_0_1t ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` Modified: vendor-crypto/openssl/dist-1.0.1/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/Makefile Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/Makefile Tue May 3 18:02:01 2016 (r298993) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1s +VERSION=1.0.1t MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: vendor-crypto/openssl/dist-1.0.1/NEWS ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/NEWS Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/NEWS Tue May 3 18:02:01 2016 (r298993) @@ -5,6 +5,19 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1s and OpenSSL 1.0.1t [3 May 2016] + + o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) + o Fix EVP_EncodeUpdate overflow (CVE-2016-2105) + o Fix EVP_EncryptUpdate overflow (CVE-2016-2106) + o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109) + o EBCDIC overread (CVE-2016-2176) + o Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + o Remove LOW from the DEFAULT cipher list. This removes singles DES from + the default. + o Only remove the SSLv2 methods with the no-ssl2-method option. + Major changes between OpenSSL 1.0.1r and OpenSSL 1.0.1s [1 Mar 2016] o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: vendor-crypto/openssl/dist-1.0.1/README ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/README Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/README Tue May 3 18:02:01 2016 (r298993) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1s 1 Mar 2016 + OpenSSL 1.0.1t 3 May 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist-1.0.1/apps/pkcs7.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/apps/pkcs7.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/apps/pkcs7.c Tue May 3 18:02:01 2016 (r298993) @@ -235,12 +235,16 @@ int MAIN(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_bytes.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_bytes.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_bytes.c Tue May 3 18:02:01 2016 (r298993) @@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) - OPENSSL_free(ret->data); s = (unsigned char *)OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; } + if (ret->data != NULL) + OPENSSL_free(ret->data); } else s = ret->data; memcpy(s, p, (int)len); Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_d2i_fp.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_d2i_fp.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_d2i_fp.c Tue May 3 18:02:01 2016 (r298993) @@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM * #endif #define HEADER_SIZE 8 +#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; @@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BU /* suck in c.slen bytes of data */ want = c.slen; if (want > (len - off)) { + size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; + want -= (len - off); if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) { ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG); goto err; } - if (!BUF_MEM_grow_clean(b, len + want)) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } while (want > 0) { - i = BIO_read(in, &(b->data[len]), want); - if (i <= 0) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, - ASN1_R_NOT_ENOUGH_DATA); + /* + * Read content in chunks of increasing size + * so we can return an error for EOF without + * having to allocate the entire content length + * in one go. + */ + size_t chunk = want > chunk_max ? chunk_max : want; + + if (!BUF_MEM_grow_clean(b, len + chunk)) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); goto err; } + want -= chunk; + while (chunk > 0) { + i = BIO_read(in, &(b->data[len]), chunk); + if (i <= 0) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, + ASN1_R_NOT_ENOUGH_DATA); + goto err; + } /* * This can't overflow because |len+want| didn't * overflow. */ - len += i; - want -= i; + len += i; + chunk -= i; + } + if (chunk_max < INT_MAX/2) + chunk_max *= 2; } } if (off + c.slen < off) { Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_type.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_type.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/a_type.c Tue May 3 18:02:01 2016 (r298993) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_lib.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_lib.c Tue May 3 18:02:01 2016 (r298993) @@ -63,7 +63,7 @@ #include static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max); + long max); static void asn1_put_length(unsigned char **pp, int length); const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; @@ -131,7 +131,7 @@ int ASN1_get_object(const unsigned char } *ptag = tag; *pclass = xclass; - if (!asn1_get_length(&p, &inf, plength, (int)max)) + if (!asn1_get_length(&p, &inf, plength, max)) goto err; if (inf && !(ret & V_ASN1_CONSTRUCTED)) @@ -159,14 +159,14 @@ int ASN1_get_object(const unsigned char } static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max) + long max) { const unsigned char *p = *pp; unsigned long ret = 0; - unsigned int i; + unsigned long i; if (max-- < 1) - return (0); + return 0; if (*p == 0x80) { *inf = 1; ret = 0; @@ -175,15 +175,11 @@ static int asn1_get_length(const unsigne *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { - if (i > sizeof(long)) + if (i > sizeof(ret) || max < (long)i) return 0; - if (max-- == 0) - return (0); while (i-- > 0) { ret <<= 8L; ret |= *(p++); - if (max-- == 0) - return (0); } } else ret = i; @@ -192,7 +188,7 @@ static int asn1_get_length(const unsigne return 0; *pp = p; *rl = (long)ret; - return (1); + return 1; } /* Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_par.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_par.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/asn1_par.c Tue May 3 18:02:01 2016 (r298993) @@ -173,6 +173,8 @@ static int asn1_parse2(BIO *bp, const un if (!asn1_print_info(bp, tag, xclass, j, (indent) ? depth : 0)) goto end; if (j & V_ASN1_CONSTRUCTED) { + const unsigned char *sp; + ep = p + len; if (BIO_write(bp, "\n", 1) <= 0) goto end; @@ -182,6 +184,7 @@ static int asn1_parse2(BIO *bp, const un goto end; } if ((j == 0x21) && (len == 0)) { + sp = p; for (;;) { r = asn1_parse2(bp, &p, (long)(tot - p), offset + (p - *pp), depth + 1, @@ -190,19 +193,25 @@ static int asn1_parse2(BIO *bp, const un ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = p - sp; break; + } } - } else + } else { + long tmp = len; + while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, - offset + (p - *pp), depth + 1, + sp = p; + r = asn1_parse2(bp, &p, tmp, offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { ret = 0; goto end; } + tmp -= p - sp; } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/t_x509.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/t_x509.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/t_x509.c Tue May 3 18:02:01 2016 (r298993) @@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsi goto err; bs = X509_get_serialNumber(x); - if (bs->length <= (int)sizeof(long)) { + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { l = ASN1_INTEGER_get(bs); if (bs->type == V_ASN1_NEG_INTEGER) { l = -l; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_dec.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_dec.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_dec.c Tue May 3 18:02:01 2016 (r298993) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_enc.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_enc.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/tasn_enc.c Tue May 3 18:02:01 2016 (r298993) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_name.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_name.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_name.c Tue May 3 18:02:01 2016 (r298993) @@ -66,6 +66,13 @@ typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, @@ -192,6 +199,10 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; + if (len > X509_NAME_MAX) { + ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); + return 0; + } q = p; /* Get internal representation of Name */ Modified: vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_x509.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_x509.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/asn1/x_x509.c Tue May 3 18:02:01 2016 (r298993) @@ -201,9 +201,19 @@ X509 *d2i_X509_AUX(X509 **a, const unsig int i2d_X509_AUX(X509 *a, unsigned char **pp) { - int length; + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); - if (a) - length += i2d_X509_CERT_AUX(a->aux, pp); + if (length < 0 || a == NULL) + return length; + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + return length; } Modified: vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86-mont.pl ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86-mont.pl Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86-mont.pl Tue May 3 18:02:01 2016 (r298993) @@ -85,6 +85,21 @@ $frame=32; # size of above frame roun &and ("esp",-64); # align to cache line + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + &mov ("eax","ebp"); + &sub ("eax","esp"); + &and ("eax",-4096); +&set_label("page_walk"); + &mov ("edx",&DWP(0,"esp","eax")); + &sub ("eax",4096); + &data_byte(0x2e); + &jnc (&label("page_walk")); + ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap Modified: vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:02:01 2016 (r298993) @@ -91,6 +91,20 @@ bn_mul_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmul_page_walk + mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -296,6 +310,14 @@ bn_mul4x_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -707,6 +729,7 @@ $code.=<<___; .align 16 bn_sqr4x_mont: .Lsqr4x_enter: + mov %rsp,%rax push %rbx push %rbp push %r12 @@ -715,12 +738,23 @@ bn_sqr4x_mont: push %r15 shl \$3,${num}d # convert $num to bytes - xor %r10,%r10 mov %rsp,%r11 # put aside %rsp - sub $num,%r10 # -$num + neg $num # -$num mov ($n0),$n0 # *n0 - lea -72(%rsp,%r10,2),%rsp # alloca(frame+2*$num) + lea -72(%rsp,$num,2),%rsp # alloca(frame+2*$num) and \$-1024,%rsp # minimize TLB usage + + sub %rsp,%r11 + and \$-4096,%r11 +.Lsqr4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lsqr4x_page_walk + + mov $num,%r10 + neg $num # restore $num + lea -48(%rax),%r11 # restore saved %rsp ############################################################## # Stack layout # Modified: vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:02:01 2016 (r298993) @@ -84,6 +84,20 @@ bn_mul_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%rax + and \$-4096,%rax +.Lmul_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul_page_walk + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; @@ -407,6 +421,14 @@ bn_mul4x_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%rax + and \$-4096,%rax +.Lmul4x_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp lea 128(%rdx),%r12 # reassign $bp (+size optimization) ___ Modified: vendor-crypto/openssl/dist-1.0.1/crypto/comp/comp.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/comp/comp.h Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/comp/comp.h Tue May 3 18:02:01 2016 (r298993) @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif Modified: vendor-crypto/openssl/dist-1.0.1/crypto/evp/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/evp/Makefile Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/evp/Makefile Tue May 3 18:02:01 2016 (r298993) @@ -199,8 +199,8 @@ e_aes.o: ../../include/openssl/opensslv. e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h +e_aes_cbc_hmac_sha1.o: ../../e_os.h ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h @@ -212,8 +212,8 @@ e_aes_cbc_hmac_sha1.o: ../../include/ope e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h e_aes_cbc_hmac_sha1.c -e_aes_cbc_hmac_sha1.o: evp_locl.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +e_aes_cbc_hmac_sha1.o: e_aes_cbc_hmac_sha1.c evp_locl.h e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h Modified: vendor-crypto/openssl/dist-1.0.1/crypto/evp/digest.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/evp/digest.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/evp/digest.c Tue May 3 18:02:01 2016 (r298993) @@ -200,8 +200,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:02:01 2016 (r298993) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/evp/encode.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/evp/encode.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/evp/encode.c Tue May 3 18:02:01 2016 (r298993) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -151,13 +152,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -174,7 +175,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -183,6 +184,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/evp/evp_enc.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/evp/evp_enc.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/evp/evp_enc.c Tue May 3 18:02:01 2016 (r298993) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/opensslv.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/opensslv.h Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/opensslv.h Tue May 3 18:02:01 2016 (r298993) @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000113fL +# define OPENSSL_VERSION_NUMBER 0x1000114fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s-fips 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t-fips 3 May 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t 3 May 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: vendor-crypto/openssl/dist-1.0.1/crypto/pem/pem_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/pem/pem_lib.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/pem/pem_lib.c Tue May 3 18:02:01 2016 (r298993) @@ -344,7 +344,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, if (enc != NULL) { objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL) { + if (objstr == NULL || EVP_CIPHER_iv_length(enc) == 0) { PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, PEM_R_UNSUPPORTED_CIPHER); goto err; } Modified: vendor-crypto/openssl/dist-1.0.1/crypto/pem/pvkfmt.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/pem/pvkfmt.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/pem/pvkfmt.c Tue May 3 18:02:01 2016 (r298993) @@ -131,6 +131,10 @@ static int read_lebn(const unsigned char # define MS_PVKMAGIC 0xb0b5f11eL /* Salt length for PVK files */ # define PVK_SALTLEN 0x10 +/* Maximum length in PVK header */ +# define PVK_MAX_KEYLEN 102400 +/* Maximum salt length */ +# define PVK_MAX_SALTLEN 10240 static EVP_PKEY *b2i_rsa(const unsigned char **in, unsigned int length, unsigned int bitlen, int ispub); @@ -644,6 +648,9 @@ static int do_PVK_header(const unsigned *psaltlen = read_ledword(&p); *pkeylen = read_ledword(&p); + if (*pkeylen > PVK_MAX_KEYLEN || *psaltlen > PVK_MAX_SALTLEN) + return 0; + if (is_encrypted && !*psaltlen) { PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_INCONSISTENT_HEADER); return 0; Modified: vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509.h Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509.h Tue May 3 18:02:01 2016 (r298993) @@ -1281,6 +1281,7 @@ void ERR_load_X509_strings(void); # define X509_R_LOADING_CERT_DIR 103 # define X509_R_LOADING_DEFAULTS 104 # define X509_R_METHOD_NOT_SUPPORTED 124 +# define X509_R_NAME_TOO_LONG 134 # define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 # define X509_R_PUBLIC_KEY_DECODE_ERROR 125 # define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 Modified: vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_err.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_err.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_err.c Tue May 3 18:02:01 2016 (r298993) @@ -145,6 +145,7 @@ static ERR_STRING_DATA X509_str_reasons[ {ERR_REASON(X509_R_LOADING_CERT_DIR), "loading cert dir"}, {ERR_REASON(X509_R_LOADING_DEFAULTS), "loading defaults"}, {ERR_REASON(X509_R_METHOD_NOT_SUPPORTED), "method not supported"}, + {ERR_REASON(X509_R_NAME_TOO_LONG), "name too long"}, {ERR_REASON(X509_R_NO_CERT_SET_FOR_US_TO_VERIFY), "no cert set for us to verify"}, {ERR_REASON(X509_R_PUBLIC_KEY_DECODE_ERROR), "public key decode error"}, Modified: vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_obj.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_obj.c Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/crypto/x509/x509_obj.c Tue May 3 18:02:01 2016 (r298993) @@ -63,6 +63,13 @@ #include #include +/* + * Limit to ensure we don't overflow: much greater than + * anything enountered in practice. + */ + +#define NAME_ONELINE_MAX (1024 * 1024) + char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; @@ -86,6 +93,8 @@ char *X509_NAME_oneline(X509_NAME *a, ch goto err; b->data[0] = '\0'; len = 200; + } else if (len == 0) { + return NULL; } if (a == NULL) { if (b) { @@ -110,6 +119,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch type = ne->value->type; num = ne->value->length; + if (num > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || @@ -117,8 +130,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif @@ -154,6 +168,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch lold = l; l += 1 + l1 + 1 + l2; + if (l > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; @@ -206,7 +224,7 @@ char *X509_NAME_oneline(X509_NAME *a, ch return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); - if (b != NULL) - BUF_MEM_free(b); + end: + BUF_MEM_free(b); return (NULL); } Modified: vendor-crypto/openssl/dist-1.0.1/doc/apps/ciphers.pod ============================================================================== --- vendor-crypto/openssl/dist-1.0.1/doc/apps/ciphers.pod Tue May 3 18:01:15 2016 (r298992) +++ vendor-crypto/openssl/dist-1.0.1/doc/apps/ciphers.pod Tue May 3 18:02:01 2016 (r298993) @@ -107,7 +107,7 @@ The following is a list of all permitted The default cipher list. This is determined at compile time and is normally -B. +B. When used, this must be the first cipherstring specified. =item B Added: vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod Tue May 3 18:02:01 2016 (r298993) @@ -0,0 +1,127 @@ +=pod + +=head1 NAME + +EVP_EncodeInit, EVP_EncodeUpdate, EVP_EncodeFinal, EVP_EncodeBlock, +EVP_DecodeInit, EVP_DecodeUpdate, EVP_DecodeFinal, EVP_DecodeBlock - EVP base 64 +encode/decode routines + +=head1 SYNOPSIS + + #include + + void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); + void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); + int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + + void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); + int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned + char *out, int *outl); + int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +=head1 DESCRIPTION + +The EVP encode routines provide a high level interface to base 64 encoding and +decoding. Base 64 encoding converts binary data into a printable form that uses +the characters A-Z, a-z, 0-9, "+" and "/" to represent the data. For every 3 +bytes of binary data provided 4 bytes of base 64 encoded data will be produced +plus some occasional newlines (see below). If the input data length is not a +multiple of 3 then the output data will be padded at the end using the "=" +character. + +Encoding of binary data is performed in blocks of 48 input bytes (or less for +the final block). For each 48 byte input block encoded 64 bytes of base 64 data +is output plus an additional newline character (i.e. 65 bytes in total). The +final block (which may be less than 48 bytes) will output 4 bytes for every 3 +bytes of input. If the data length is not divisible by 3 then a full 4 bytes is +still output for the final 1 or 2 bytes of input. Similarly a newline character +will also be output. + +EVP_EncodeInit() initialises B for the start of a new encoding operation. + +EVP_EncodeUpdate() encode B bytes of data found in the buffer pointed to by +B. The output is stored in the buffer B and the number of bytes output +is stored in B<*outl>. It is the caller's responsibility to ensure that the +buffer at B is sufficiently large to accommodate the output data. Only full +blocks of data (48 bytes) will be immediately processed and output by this +function. Any remainder is held in the B object and will be processed by a +subsequent call to EVP_EncodeUpdate() or EVP_EncodeFinal(). To calculate the +required size of the output buffer add together the value of B with the +amount of unprocessed data held in B and divide the result by 48 (ignore +any remainder). This gives the number of blocks of data that will be processed. +Ensure the output buffer contains 65 bytes of storage for each block, plus an +additional byte for a NUL terminator. EVP_EncodeUpdate() may be called +repeatedly to process large amounts of input data. In the event of an error +EVP_EncodeUpdate() will set B<*outl> to 0. + +EVP_EncodeFinal() must be called at the end of an encoding operation. It will +process any partial block of data remaining in the B object. The output +data will be stored in B and the length of the data written will be stored +in B<*outl>. It is the caller's responsibility to ensure that B is +sufficiently large to accommodate the output data which will never be more than +65 bytes plus an additional NUL terminator (i.e. 66 bytes in total). + +EVP_EncodeBlock() encodes a full block of input data in B and of length +B and stores it in B. For every 3 bytes of input provided 4 bytes of +output data will be produced. If B is not divisible by 3 then the block is +encoded as a final block of data and the output is padded such that it is always +divisible by 4. Additionally a NUL terminator character will be added. For +example if 16 bytes of input data is provided then 24 bytes of encoded data is +created plus 1 byte for a NUL terminator (i.e. 25 bytes in total). The length of +the data generated I the NUL terminator is returned from the function. + +EVP_DecodeInit() initialises B for the start of a new decoding operation. + +EVP_DecodeUpdate() decodes B characters of data found in the buffer pointed +to by B. The output is stored in the buffer B and the number of bytes +output is stored in B<*outl>. It is the caller's responsibility to ensure that +the buffer at B is sufficiently large to accommodate the output data. This +function will attempt to decode as much data as possible in 4 byte chunks. Any +whitespace, newline or carriage return characters are ignored. Any partial chunk +of unprocessed data (1, 2 or 3 bytes) that remains at the end will be held in +the B object and processed by a subsequent call to EVP_DecodeUpdate(). If +any illegal base 64 characters are encountered or if the base 64 padding +character "=" is encountered in the middle of the data then the function returns +-1 to indicate an error. A return value of 0 or 1 indicates successful +processing of the data. A return value of 0 additionally indicates that the last +input data characters processed included the base 64 padding character "=" and +therefore no more non-padding character data is expected to be processed. For +every 4 valid base 64 bytes processed (ignoring whitespace, carriage returns and +line feeds), 3 bytes of binary output data will be produced (or less at the end +of the data where the padding character "=" has been used). + +EVP_DecodeFinal() must be called at the end of a decoding operation. If there +is any unprocessed data still in B then the input data must not have been +a multiple of 4 and therefore an error has occurred. The function will return -1 +in this case. Otherwise the function returns 1 on success. + +EVP_DecodeBlock() will decode the block of B characters of base 64 data +contained in B and store the result in B. Any leading whitespace will be *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 18:02:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E69B2A205; Tue, 3 May 2016 18:02:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DDB3132D; Tue, 3 May 2016 18:02:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43I2P7N030810; Tue, 3 May 2016 18:02:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I2P2g030809; Tue, 3 May 2016 18:02:25 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031802.u43I2P2g030809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r298994 - vendor-crypto/openssl/1.0.1t X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:02:27 -0000 Author: jkim Date: Tue May 3 18:02:25 2016 New Revision: 298994 URL: https://svnweb.freebsd.org/changeset/base/298994 Log: Tag OpenSSL 1.0.1t. Added: vendor-crypto/openssl/1.0.1t/ - copied from r298993, vendor-crypto/openssl/dist-1.0.1/ From owner-svn-src-all@freebsd.org Tue May 3 18:05:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA431B2A28A; Tue, 3 May 2016 18:05:51 +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 82CCE1657; Tue, 3 May 2016 18:05:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43I5oUd031050; Tue, 3 May 2016 18:05:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I5h1Q030980; Tue, 3 May 2016 18:05:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605031805.u43I5h1Q030980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 18:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298995 - in head/sys: net net/altq net80211 netinet netinet/cc netinet/libalias netinet/tcp_stacks netinet6 netipsec netpfil/ipfw netpfil/pf netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:05:52 -0000 Author: pfg Date: Tue May 3 18:05:43 2016 New Revision: 298995 URL: https://svnweb.freebsd.org/changeset/base/298995 Log: sys/net*: minor spelling fixes. No functional change. Modified: head/sys/net/altq/altq_cbq.c head/sys/net/altq/altq_red.c head/sys/net/altq/altq_rio.c head/sys/net/altq/altq_rmclass.h head/sys/net/bpf.h head/sys/net/bridgestp.c head/sys/net/if.c head/sys/net/if_arcsubr.c head/sys/net/if_atm.h head/sys/net/if_bridge.c head/sys/net/if_clone.c head/sys/net/if_epair.c head/sys/net/if_lagg.c head/sys/net/if_llatbl.c head/sys/net/if_sppp.h head/sys/net/if_spppsubr.c head/sys/net/if_vlan.c head/sys/net/rss_config.c head/sys/net/rtsock.c head/sys/net/sff8472.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan_sw.c head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/igmp.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.h head/sys/netinet/ip.h head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_fw.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_options.c head/sys/netinet/libalias/alias_irc.c head/sys/netinet/libalias/alias_local.h head/sys/netinet/libalias/alias_smedia.c head/sys/netinet/libalias/libalias.3 head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet6/frag6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_id.c head/sys/netinet6/ip6protosw.h head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c head/sys/netpfil/ipfw/dn_heap.h head/sys/netpfil/ipfw/dummynet.txt head/sys/netpfil/ipfw/ip_dn_glue.c head/sys/netpfil/ipfw/ip_dummynet.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table_algo.c head/sys/netpfil/ipfw/ip_fw_table_value.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c head/sys/netpfil/pf/pf_norm.c head/sys/netsmb/smb_usr.c Modified: head/sys/net/altq/altq_cbq.c ============================================================================== --- head/sys/net/altq/altq_cbq.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/altq/altq_cbq.c Tue May 3 18:05:43 2016 (r298995) @@ -701,7 +701,7 @@ cbq_modify_class(acp) * struct rm_class *parent, struct rm_class *borrow) * * This function create a new traffic class in the CBQ class hierarchy of - * given paramters. The class that created is either the root, default, + * given parameters. The class that created is either the root, default, * or a new dynamic class. If CBQ is not initilaized, the the root class * will be created. */ Modified: head/sys/net/altq/altq_red.c ============================================================================== --- head/sys/net/altq/altq_red.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/altq/altq_red.c Tue May 3 18:05:43 2016 (r298995) @@ -158,7 +158,7 @@ #define TH_MIN 5 /* min threshold */ #define TH_MAX 15 /* max threshold */ -#define RED_LIMIT 60 /* default max queue lenght */ +#define RED_LIMIT 60 /* default max queue length */ #define RED_STATS /* collect statistics */ /* @@ -171,7 +171,7 @@ #ifdef ALTQ3_COMPAT #ifdef ALTQ_FLOWVALVE /* - * flow-valve is an extention to protect red from unresponsive flows + * flow-valve is an extension to protect red from unresponsive flows * and to promote end-to-end congestion control. * flow-valve observes the average drop rates of the flows that have * experienced packet drops in the recent past. Modified: head/sys/net/altq/altq_rio.c ============================================================================== --- head/sys/net/altq/altq_rio.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/altq/altq_rio.c Tue May 3 18:05:43 2016 (r298995) @@ -146,7 +146,7 @@ #define TH_MIN 5 /* min threshold */ #define TH_MAX 15 /* max threshold */ -#define RIO_LIMIT 60 /* default max queue lenght */ +#define RIO_LIMIT 60 /* default max queue length */ #define RIO_STATS /* collect statistics */ #define TV_DELTA(a, b, delta) { \ Modified: head/sys/net/altq/altq_rmclass.h ============================================================================== --- head/sys/net/altq/altq_rmclass.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/altq/altq_rmclass.h Tue May 3 18:05:43 2016 (r298995) @@ -188,7 +188,7 @@ struct rm_class { */ struct rm_ifdat { int queued_; /* # pkts queued downstream */ - int efficient_; /* Link Efficency bit */ + int efficient_; /* Link Efficiency bit */ int wrr_; /* Enable Weighted Round-Robin */ u_long ns_per_byte_; /* Link byte speed. */ int maxqueued_; /* Max packets to queue */ Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/bpf.h Tue May 3 18:05:43 2016 (r298995) @@ -579,7 +579,7 @@ struct bpf_zbuf_header { * input packets such as port scans, packets from old lost connections, * etc. to force the connection to stay up). * - * The first byte of the PPP header (0xff03) is modified to accomodate + * The first byte of the PPP header (0xff03) is modified to accommodate * the direction - 0x00 = IN, 0x01 = OUT. */ #define DLT_PPP_PPPD 166 Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/bridgestp.c Tue May 3 18:05:43 2016 (r298995) @@ -789,7 +789,7 @@ bstp_assign_roles(struct bstp_state *bs) bs->bs_root_htime = bs->bs_bridge_htime; bs->bs_root_port = NULL; - /* check if any recieved info supersedes us */ + /* check if any received info supersedes us */ LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { if (bp->bp_infois != BSTP_INFO_RECEIVED) continue; Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if.c Tue May 3 18:05:43 2016 (r298995) @@ -558,7 +558,7 @@ ifq_delete(struct ifaltq *ifq) } /* - * Perform generic interface initalization tasks and attach the interface + * Perform generic interface initialization tasks and attach the interface * to the list of "active" interfaces. If vmove flag is set on entry * to if_attach_internal(), perform only a limited subset of initialization * tasks, given that we are moving from one vnet to another an ifnet which Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_arcsubr.c Tue May 3 18:05:43 2016 (r298995) @@ -345,7 +345,7 @@ arc_frag_next(struct ifnet *ifp) /* * Defragmenter. Returns mbuf if last packet found, else - * NULL. frees imcoming mbuf as necessary. + * NULL. frees incoming mbuf as necessary. */ static __inline struct mbuf * Modified: head/sys/net/if_atm.h ============================================================================== --- head/sys/net/if_atm.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_atm.h Tue May 3 18:05:43 2016 (r298995) @@ -96,7 +96,7 @@ struct ifatm_mib { /* * Traffic parameters for ATM connections. This contains all parameters - * to accomodate UBR, UBR+MCR, CBR, VBR and ABR connections. + * to accommodate UBR, UBR+MCR, CBR, VBR and ABR connections. * * Keep in sync with ng_atm.h */ Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_bridge.c Tue May 3 18:05:43 2016 (r298995) @@ -71,7 +71,7 @@ * - Currently only supports Ethernet-like interfaces (Ethernet, * 802.11, VLANs on Ethernet, etc.) Figure out a nice way * to bridge other types of interfaces (FDDI-FDDI, and maybe - * consider heterogenous bridges). + * consider heterogeneous bridges). */ #include Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_clone.c Tue May 3 18:05:43 2016 (r298995) @@ -484,7 +484,7 @@ if_clone_list(struct if_clonereq *ifcr) * below, but that's not a major problem. Not caping our * allocation to the number of cloners actually in the system * could be because that would let arbitrary users cause us to - * allocate abritrary amounts of kernel memory. + * allocate arbitrary amounts of kernel memory. */ buf_count = (V_if_cloners_count < ifcr->ifcr_count) ? V_if_cloners_count : ifcr->ifcr_count; Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_epair.c Tue May 3 18:05:43 2016 (r298995) @@ -514,7 +514,7 @@ epair_transmit_locked(struct ifnet *ifp, DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); #ifdef ALTQ - /* Support ALTQ via the clasic if_start() path. */ + /* Support ALTQ via the classic if_start() path. */ IF_LOCK(&ifp->if_snd); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_lagg.c Tue May 3 18:05:43 2016 (r298995) @@ -2031,7 +2031,7 @@ lagg_fail_input(struct lagg_softc *sc, s if (!LAGG_PORTACTIVE(sc->sc_primary)) { tmp_tp = lagg_link_active(sc, sc->sc_primary); /* - * If tmp_tp is null, we've recieved a packet when all + * If tmp_tp is null, we've received a packet when all * our links are down. Weird, but process it anyways. */ if ((tmp_tp == NULL || tmp_tp == lp)) { Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_llatbl.c Tue May 3 18:05:43 2016 (r298995) @@ -409,7 +409,7 @@ lltable_update_ifaddr(struct lltable *ll /* * - * Performes generic cleanup routines and frees lle. + * Performs generic cleanup routines and frees lle. * * Called for non-linked entries, with callouts and * other AF-specific cleanups performed. Modified: head/sys/net/if_sppp.h ============================================================================== --- head/sys/net/if_sppp.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_sppp.h Tue May 3 18:05:43 2016 (r298995) @@ -78,7 +78,7 @@ struct sauth { /* * Don't change the order of this. Ordering the phases this way allows - * for a comparision of ``pp_phase >= PHASE_AUTHENTICATE'' in order to + * for a comparison of ``pp_phase >= PHASE_AUTHENTICATE'' in order to * know whether LCP is up. */ enum ppp_phase { Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_spppsubr.c Tue May 3 18:05:43 2016 (r298995) @@ -2962,7 +2962,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lc * since our algorithm always uses the * original option to NAK it with new values, * things would become more complicated. In - * pratice, the only commonly implemented IP + * practice, the only commonly implemented IP * compression option is VJ anyway, so the * difference is negligible. */ @@ -4295,7 +4295,7 @@ sppp_chap_tlu(struct sppp *sp) if ((sp->hisauth.flags & AUTHFLAG_NORECHALLENGE) == 0) log(-1, "next re-challenge in %d seconds\n", i); else - log(-1, "re-challenging supressed\n"); + log(-1, "re-challenging suppressed\n"); } SPPP_LOCK(sp); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/if_vlan.c Tue May 3 18:05:43 2016 (r298995) @@ -700,7 +700,7 @@ vlan_devat(struct ifnet *ifp, uint16_t v * VLAN support can be loaded as a module. The only place in the * system that's intimately aware of this is ether_input. We hook * into this code through vlan_input_p which is defined there and - * set here. Noone else in the system should be aware of this so + * set here. No one else in the system should be aware of this so * we use an explicit reference here. */ extern void (*vlan_input_p)(struct ifnet *, struct mbuf *); @@ -873,7 +873,7 @@ vlan_clone_create(struct if_clone *ifc, * o specify no parameters and get an unattached device that * must be configured separately. * The first technique is preferred; the latter two are - * supported for backwards compatibilty. + * supported for backwards compatibility. * * XXXRW: Note historic use of the word "tag" here. New ioctls may be * called for. Modified: head/sys/net/rss_config.c ============================================================================== --- head/sys/net/rss_config.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/rss_config.c Tue May 3 18:05:43 2016 (r298995) @@ -168,7 +168,7 @@ static uint8_t rss_key[RSS_KEYSIZE] = { /* * RSS hash->CPU table, which maps hashed packet headers to particular CPUs. - * Drivers may supplement this table with a seperate CPU<->queue table when + * Drivers may supplement this table with a separate CPU<->queue table when * programming devices. */ struct rss_table_entry { Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/rtsock.c Tue May 3 18:05:43 2016 (r298995) @@ -1199,7 +1199,7 @@ rtsock_msg_buffer(int type, struct rt_ad /* * This routine is called to generate a message from the routing - * socket indicating that a redirect has occured, a routing lookup + * socket indicating that a redirect has occurred, a routing lookup * has failed, or that a protocol has detected timeouts to a particular * destination. */ Modified: head/sys/net/sff8472.h ============================================================================== --- head/sys/net/sff8472.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net/sff8472.h Tue May 3 18:05:43 2016 (r298995) @@ -431,7 +431,7 @@ static const char *sff_8024_id[SFF_8024_ "SMM8", "CDFP3"}; -/* Keep compability with old definitions */ +/* Keep compatibility with old definitions */ #define SFF_8472_ID_UNKNOWN SFF_8024_ID_UNKNOWN #define SFF_8472_ID_GBIC SFF_8024_ID_GBIC #define SFF_8472_ID_SFF SFF_8024_ID_SFF Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211.c Tue May 3 18:05:43 2016 (r298995) @@ -1833,7 +1833,7 @@ ieee80211_rate2media(struct ieee80211com { 6 | IFM_IEEE80211_11A, IFM_IEEE80211_OFDM3 }, { 9 | IFM_IEEE80211_11A, IFM_IEEE80211_OFDM4 }, { 54 | IFM_IEEE80211_11A, IFM_IEEE80211_OFDM27 }, - /* NB: OFDM72 doesn't realy exist so we don't handle it */ + /* NB: OFDM72 doesn't really exist so we don't handle it */ }; static const struct ratemedia htrates[] = { { 0, IFM_IEEE80211_MCS }, Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_adhoc.c Tue May 3 18:05:43 2016 (r298995) @@ -775,7 +775,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n * * Since there's no (current) way to inform * the driver that a channel width change has - * occured for a single node, just stub this + * occurred for a single node, just stub this * out. */ #if 0 Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_hostap.c Tue May 3 18:05:43 2016 (r298995) @@ -1452,7 +1452,7 @@ ieee80211_parse_rsn(struct ieee80211vap } /* - * WPA/802.11i assocation request processing. + * WPA/802.11i association request processing. */ static int wpa_assocreq(struct ieee80211_node *ni, struct ieee80211_rsnparms *rsnparms, Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_ht.c Tue May 3 18:05:43 2016 (r298995) @@ -2298,7 +2298,7 @@ bar_timeout(void *arg) * to make sure we notify the driver that a BAR * TX did occur and fail. This gives the driver * a chance to undo any queue pause that may - * have occured. + * have occurred. */ ic->ic_bar_response(ni, tap, 1); ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_ioctl.c Tue May 3 18:05:43 2016 (r298995) @@ -3428,10 +3428,10 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon break; case SIOCSIFADDR: /* - * XXX Handle this directly so we can supress if_init calls. + * XXX Handle this directly so we can suppress if_init calls. * XXX This should be done in ether_ioctl but for the moment * XXX there are too many other parts of the system that - * XXX set IFF_UP and so supress if_init being called when + * XXX set IFF_UP and so suppress if_init being called when * XXX it should be. */ ifa = (struct ifaddr *) data; Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_mesh.c Tue May 3 18:05:43 2016 (r298995) @@ -1155,7 +1155,7 @@ mesh_forward(struct ieee80211vap *vap, s IEEE80211_TX_UNLOCK_ASSERT(ic); /* - * mesh ttl of 1 means we are the last one receving it, + * mesh ttl of 1 means we are the last one receiving it, * according to amendment we decrement and then check if * 0, if so we dont forward. */ Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_node.c Tue May 3 18:05:43 2016 (r298995) @@ -2217,7 +2217,7 @@ ieee80211_node_timeout(void *arg) * Defer timeout processing if a channel switch is pending. * We typically need to be mute so not doing things that * might generate frames is good to handle in one place. - * Supressing the station timeout processing may extend the + * Suppressing the station timeout processing may extend the * lifetime of inactive stations (by not decrementing their * idle counters) but this should be ok unless the CSA is * active for an unusually long time. Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_output.c Tue May 3 18:05:43 2016 (r298995) @@ -2894,7 +2894,7 @@ ieee80211_tx_mgt_cb(struct ieee80211_nod /* * Frame transmit completed; arrange timer callback. If - * transmit was successfuly we wait for response. Otherwise + * transmit was successfully we wait for response. Otherwise * we arrange an immediate callback instead of doing the * callback directly since we don't know what state the driver * is in (e.g. what locks it is holding). This work should @@ -3231,10 +3231,10 @@ ieee80211_beacon_update(struct ieee80211 struct ieee80211_wme_state *wme = &ic->ic_wme; /* - * Check for agressive mode change. When there is + * Check for aggressive mode change. When there is * significant high priority traffic in the BSS * throttle back BE traffic by using conservative - * parameters. Otherwise BE uses agressive params + * parameters. Otherwise BE uses aggressive params * to optimize performance of legacy/non-QoS traffic. */ if (wme->wme_flags & WME_F_AGGRMODE) { Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_proto.c Tue May 3 18:05:43 2016 (r298995) @@ -1082,7 +1082,7 @@ ieee80211_wme_initparams_locked(struct i /* NB: check ic_bss to avoid NULL deref on initial attach */ if (vap->iv_bss != NULL) { /* - * Calculate agressive mode switching threshold based + * Calculate aggressive mode switching threshold based * on beacon interval. This doesn't need locking since * we're only called before entering the RUN state at * which point we start sending beacon frames. @@ -1164,11 +1164,11 @@ ieee80211_wme_updateparams_locked(struct mode = IEEE80211_MODE_AUTO; /* - * This implements agressive mode as found in certain + * This implements aggressive mode as found in certain * vendors' AP's. When there is significant high * priority (VI/VO) traffic in the BSS throttle back BE * traffic by using conservative parameters. Otherwise - * BE uses agressive params to optimize performance of + * BE uses aggressive params to optimize performance of * legacy/non-QoS traffic. */ Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_proto.h Tue May 3 18:05:43 2016 (r298995) @@ -276,10 +276,10 @@ struct chanAccParams { struct ieee80211_wme_state { u_int wme_flags; -#define WME_F_AGGRMODE 0x00000001 /* STATUS: WME agressive mode */ +#define WME_F_AGGRMODE 0x00000001 /* STATUS: WME aggressive mode */ u_int wme_hipri_traffic; /* VI/VO frames in beacon interval */ - u_int wme_hipri_switch_thresh;/* agressive mode switch thresh */ - u_int wme_hipri_switch_hysteresis;/* agressive mode switch hysteresis */ + u_int wme_hipri_switch_thresh;/* aggressive mode switch thresh */ + u_int wme_hipri_switch_hysteresis;/* aggressive mode switch hysteresis */ struct wmeParams wme_params[4]; /* from assoc resp for each AC*/ struct chanAccParams wme_wmeChanParams; /* WME params applied to self */ Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_regdomain.c Tue May 3 18:05:43 2016 (r298995) @@ -266,7 +266,7 @@ ieee80211_alloc_countryie(struct ieee802 * Indoor/Outdoor portion of country string: * 'I' indoor only * 'O' outdoor only - * ' ' all enviroments + * ' ' all environments */ ie->cc[2] = (rd->location == 'I' ? 'I' : rd->location == 'O' ? 'O' : ' '); Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/net80211/ieee80211_scan_sw.c Tue May 3 18:05:43 2016 (r298995) @@ -771,7 +771,7 @@ scan_end(struct ieee80211_scan_state *ss /* XXX scan state can change! Re-validate scan state! */ /* - * Since a cancellation may have occured during one of the + * Since a cancellation may have occurred during one of the * driver calls (whilst unlocked), update scandone. */ if (scandone == 0 && (ss_priv->ss_iflags & ISCAN_CANCEL) != 0) { @@ -818,7 +818,7 @@ scan_end(struct ieee80211_scan_state *ss "[ticks %u, dwell min %lu scanend %lu]\n", __func__, ticks, ss->ss_mindwell, ss_priv->ss_scanend); - ss->ss_next = 0; /* reset to begining */ + ss->ss_next = 0; /* reset to beginning */ if (ss->ss_flags & IEEE80211_SCAN_ACTIVE) vap->iv_stats.is_scan_active++; else @@ -840,7 +840,7 @@ scan_end(struct ieee80211_scan_state *ss ticks, ss->ss_mindwell, ss_priv->ss_scanend); /* - * Since a cancellation may have occured during one of the + * Since a cancellation may have occurred during one of the * driver calls (whilst unlocked), update scandone. */ if (scandone == 0 && (ss_priv->ss_iflags & ISCAN_CANCEL) != 0) { Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/cc/cc_cubic.c Tue May 3 18:05:43 2016 (r298995) @@ -143,7 +143,7 @@ cubic_ack_received(struct cc_var *ccv, u * the I-D. Using min_rtt in the tf_cwnd calculation * causes w_tf to grow much faster than it should if the * RTT is dominated by network buffering rather than - * propogation delay. + * propagation delay. */ w_tf = tf_cwnd(ticks_since_cong, cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/cc/cc_dctcp.c Tue May 3 18:05:43 2016 (r298995) @@ -202,7 +202,7 @@ dctcp_cb_init(struct cc_var *ccv) dctcp_data->bytes_ecn = 0; dctcp_data->bytes_total = 0; /* - * When alpha is set to 0 in the beggining, DCTCP sender transfers as + * When alpha is set to 0 in the beginning, DCTCP sender transfers as * much data as possible until the value converges which may expand the * queueing delay at the switch. When alpha is set to 1, queueing delay * is kept small. Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/cc/cc_htcp.c Tue May 3 18:05:43 2016 (r298995) @@ -440,7 +440,7 @@ htcp_recalc_beta(struct cc_var *ccv) /* * TCPTV_SRTTBASE is the initialised value of each connection's SRTT, so * we only calc beta if the connection's SRTT has been changed from its - * inital value. beta is bounded to ensure it is always between + * initial value. beta is bounded to ensure it is always between * HTCP_MINBETA and HTCP_MAXBETA. */ if (V_htcp_adaptive_backoff && htcp_data->minrtt != TCPTV_SRTTBASE && Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/igmp.c Tue May 3 18:05:43 2016 (r298995) @@ -1103,9 +1103,9 @@ out_locked: } /* - * Process a recieved IGMPv3 group-specific or group-and-source-specific + * Process a received IGMPv3 group-specific or group-and-source-specific * query. - * Return <0 if any error occured. Currently this is ignored. + * Return <0 if any error occurred. Currently this is ignored. */ static int igmp_input_v3_group_query(struct in_multi *inm, struct igmp_ifsoftc *igi, Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/in_mcast.c Tue May 3 18:05:43 2016 (r298995) @@ -619,7 +619,7 @@ inm_clear_recorded(struct in_multi *inm) * * Return 0 if the source didn't exist or was already marked as recorded. * Return 1 if the source was marked as recorded by this function. - * Return <0 if any error occured (negated errno code). + * Return <0 if any error occurred (negated errno code). */ int inm_record_source(struct in_multi *inm, const in_addr_t naddr) Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/in_pcb.h Tue May 3 18:05:43 2016 (r298995) @@ -121,7 +121,7 @@ struct in_conninfo { */ #define INC_ISIPV6 0x01 -#define inc_isipv6 inc_flags /* temp compatability */ +#define inc_isipv6 inc_flags /* temp compatibility */ #define inc_fport inc_ie.ie_fport #define inc_lport inc_ie.ie_lport #define inc_faddr inc_ie.ie_faddr Modified: head/sys/netinet/ip.h ============================================================================== --- head/sys/netinet/ip.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/ip.h Tue May 3 18:05:43 2016 (r298995) @@ -147,7 +147,7 @@ struct ip { #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ #define IPOPT_LSRR 131 /* loose source route */ #define IPOPT_ESO 133 /* extended security */ -#define IPOPT_CIPSO 134 /* commerical security */ +#define IPOPT_CIPSO 134 /* commercial security */ #define IPOPT_SATID 136 /* satnet id */ #define IPOPT_SSRR 137 /* strict source route */ #define IPOPT_RA 148 /* router alert */ Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/ip_fastfwd.c Tue May 3 18:05:43 2016 (r298995) @@ -205,7 +205,7 @@ ip_tryforward(struct mbuf *m) * * XXX: Probably some of these checks could be direct drop * conditions. However it is not clear whether there are some - * hacks or obscure behaviours which make it neccessary to + * hacks or obscure behaviours which make it necessary to * let ip_input handle it. We play safe here and let ip_input * deal with it until it is proven that we can directly drop it. */ Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/ip_fw.h Tue May 3 18:05:43 2016 (r298995) @@ -861,9 +861,9 @@ typedef struct _ipfw_obj_tentry { #define IPFW_CTF_ATOMIC 0x01 /* Perform atomic operation */ /* Operation results */ #define IPFW_TR_IGNORED 0 /* Entry was ignored (rollback) */ -#define IPFW_TR_ADDED 1 /* Entry was succesfully added */ -#define IPFW_TR_UPDATED 2 /* Entry was succesfully updated*/ -#define IPFW_TR_DELETED 3 /* Entry was succesfully deleted*/ +#define IPFW_TR_ADDED 1 /* Entry was successfully added */ +#define IPFW_TR_UPDATED 2 /* Entry was successfully updated*/ +#define IPFW_TR_DELETED 3 /* Entry was successfully deleted*/ #define IPFW_TR_LIMIT 4 /* Entry was ignored (limit) */ #define IPFW_TR_NOTFOUND 5 /* Entry was not found */ #define IPFW_TR_EXISTS 6 /* Entry already exists */ Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/ip_icmp.c Tue May 3 18:05:43 2016 (r298995) @@ -223,7 +223,7 @@ icmp_error(struct mbuf *n, int type, int /* * Calculate length to quote from original packet and * prevent the ICMP mbuf from overflowing. - * Unfortunatly this is non-trivial since ip_forward() + * Unfortunately this is non-trivial since ip_forward() * sends us truncated packets. */ nlen = m_length(n, NULL); Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/ip_options.c Tue May 3 18:05:43 2016 (r298995) @@ -706,7 +706,7 @@ bad: * may change in future. * Router alert options SHOULD be passed if running in IPSTEALTH mode and * we are not the endpoint. - * Length checks on individual options should already have been peformed + * Length checks on individual options should already have been performed * by ip_dooptions() therefore they are folded under INVARIANTS here. * * Return zero if not present or options are invalid, non-zero if present. Modified: head/sys/netinet/libalias/alias_irc.c ============================================================================== --- head/sys/netinet/libalias/alias_irc.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/libalias/alias_irc.c Tue May 3 18:05:43 2016 (r298995) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); Version 2.1: May, 1997 (cjm) Very minor changes to conform with local/global/function naming conventions - withing the packet alising module. + within the packet alising module. */ /* Includes */ @@ -482,7 +482,7 @@ lPACKET_DONE: which will generate a type-error on all but 32-bit machines. [Note 2] This routine really ought to be replaced with one that - creates a transparent proxy on the aliasing host, to allow arbitary + creates a transparent proxy on the aliasing host, to allow arbitrary changes in the TCP stream. This should not be too difficult given this base; I (ee) will try to do this some time later. */ Modified: head/sys/netinet/libalias/alias_local.h ============================================================================== --- head/sys/netinet/libalias/alias_local.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/libalias/alias_local.h Tue May 3 18:05:43 2016 (r298995) @@ -357,7 +357,7 @@ void PunchFWHole(struct alias_link *_ln /* Housekeeping function */ void HouseKeeping(struct libalias *); -/* Tcp specfic routines */ +/* Tcp specific routines */ /* lint -save -library Suppress flexelint warnings */ /* Transparent proxy routines */ Modified: head/sys/netinet/libalias/alias_smedia.c ============================================================================== --- head/sys/netinet/libalias/alias_smedia.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/libalias/alias_smedia.c Tue May 3 18:05:43 2016 (r298995) @@ -518,7 +518,7 @@ AliasHandleRtspOut(struct libalias *la, /* * When aliasing a server, check for the 200 reply - * Accomodate varying number of blanks between 200 & OK + * Accommodate varying number of blanks between 200 & OK */ if (dlen >= (int)strlen(str200)) { Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/libalias/libalias.3 Tue May 3 18:05:43 2016 (r298995) @@ -1067,7 +1067,7 @@ In case the application provides a .Dv SIGHUP signal handler, add a call to .Fn LibAliasRefreshModules -inside the handler, and everytime you want to refresh the loaded modules, +inside the handler, and every time you want to refresh the loaded modules, send it the .Dv SIGHUP signal: Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_input.c Tue May 3 18:05:43 2016 (r298995) @@ -365,7 +365,7 @@ cc_conn_init(struct tcpcb *tp) /* * There's some sort of gateway or interface * buffer limit on the path. Use this to set - * the slow start threshhold, but set the + * the slow start threshold, but set the * threshold to no less than 2*mss. */ tp->snd_ssthresh = max(2 * maxseg, metrics.rmx_ssthresh); @@ -2533,7 +2533,7 @@ tcp_do_segment(struct mbuf *m, struct tc * change and FIN isn't set), * the ack is the biggest we've * seen and we've seen exactly our rexmt - * threshhold of them, assume a packet + * threshold of them, assume a packet * has been dropped and retransmit it. * Kludge snd_nxt & the congestion * window so we send only this one Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_output.c Tue May 3 18:05:43 2016 (r298995) @@ -215,7 +215,7 @@ tcp_output(struct tcpcb *tp) */ if ((tp->t_flags & TF_FASTOPEN) && (tp->t_state == TCPS_SYN_RECEIVED) && - SEQ_GT(tp->snd_max, tp->snd_una) && /* inital SYN|ACK sent */ + SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN|ACK sent */ (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ return (0); #endif @@ -495,9 +495,9 @@ after_sack_rexmit: * and does at most one step per received ACK. This fast * scaling has the drawback of growing the send buffer beyond * what is strictly necessary to make full use of a given - * delay*bandwith product. However testing has shown this not + * delay*bandwidth product. However testing has shown this not * to be much of an problem. At worst we are trading wasting - * of available bandwith (the non-use of it) for wasting some + * of available bandwidth (the non-use of it) for wasting some * socket buffer memory. * * TODO: Shrink send buffer during idle periods together @@ -1619,7 +1619,7 @@ tcp_setpersist(struct tcpcb *tp) if (tcp_timer_active(tp, TT_REXMT)) panic("tcp_setpersist: retransmit pending"); /* - * Start/restart persistance timer. + * Start/restart persistence timer. */ TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], tcp_persmin, tcp_persmax); Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_sack.c Tue May 3 18:05:43 2016 (r298995) @@ -401,8 +401,8 @@ tcp_sack_doack(struct tcpcb *tp, struct /* * Sort the SACK blocks so we can update the scoreboard with just one - * pass. The overhead of sorting upto 4+1 elements is less than - * making upto 4+1 passes over the scoreboard. + * pass. The overhead of sorting up to 4+1 elements is less than + * making up to 4+1 passes over the scoreboard. */ for (i = 0; i < num_sack_blks; i++) { for (j = i + 1; j < num_sack_blks; j++) { Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_stacks/fastpath.c Tue May 3 18:05:43 2016 (r298995) @@ -185,7 +185,7 @@ tcp_do_fastack(struct mbuf *m, struct tc short ostate = 0; #endif /* - * The following if statment will be true if + * The following if statement will be true if * we are doing the win_up_in_fp * - We have more new data (SEQ_LT(tp->snd_wl1, th->th_seq)) * - No more new data, but we have an ack for new data @@ -1061,7 +1061,7 @@ tcp_do_slowpath(struct mbuf *m, struct t * change and FIN isn't set), * the ack is the biggest we've * seen and we've seen exactly our rexmt - * threshhold of them, assume a packet + * threshold of them, assume a packet * has been dropped and retransmit it. * Kludge snd_nxt & the congestion * window so we send only this one Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_subr.c Tue May 3 18:05:43 2016 (r298995) @@ -1376,7 +1376,7 @@ tcp_discardcb(struct tcpcb *tp) * Update the ssthresh always when the conditions below * are satisfied. This gives us better new start value * for the congestion avoidance for new connections. - * ssthresh is only set if packet loss occured on a session. + * ssthresh is only set if packet loss occurred on a session. * * XXXRW: 'so' may be NULL here, and/or socket buffer may be * being torn down. Ideally this code would not use 'so'. Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_syncache.c Tue May 3 18:05:43 2016 (r298995) @@ -1419,7 +1419,7 @@ skip_alloc: * With the default maxsockbuf of 256K, a scale factor * of 3 will be chosen by this algorithm. Those who * choose a larger maxsockbuf should watch out - * for the compatiblity problems mentioned above. + * for the compatibility problems mentioned above. * * RFC1323: The Window field in a SYN (i.e., a * or ) segment itself is never scaled. @@ -1746,7 +1746,7 @@ syncache_respond(struct syncache *sc, st * with the latter taking over when the former is exhausted. When matching * syncache entry is found the syncookie is ignored. * - * The only reliable information persisting the 3WHS is our inital sequence + * The only reliable information persisting the 3WHS is our initial sequence * number ISS of 32 bits. Syncookies embed a cryptographically sufficient * strong hash (MAC) value and a few bits of TCP SYN options in the ISS * of our SYN|ACK. The MAC can be recomputed when the ACK to our SYN|ACK Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet/tcp_timer.c Tue May 3 18:05:43 2016 (r298995) @@ -522,7 +522,7 @@ tcp_timer_persist(void *xtp) KASSERT((tp->t_timers->tt_flags & TT_PERSIST) != 0, ("%s: tp %p persist callout should be running", __func__, tp)); /* - * Persistance timer into zero window. + * Persistence timer into zero window. * Force a byte to be output, if possible. */ TCPSTAT_INC(tcps_persisttimeo); Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/frag6.c Tue May 3 18:05:43 2016 (r298995) @@ -135,7 +135,7 @@ frag6_init(void) * fragment's Fragment header. * -> should grab it from the first fragment only * - * The following note also contradicts with fragment rule - noone is going to + * The following note also contradicts with fragment rule - no one is going to * send different fragment with different next header field. * * additional note (p22): Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/in6.c Tue May 3 18:05:43 2016 (r298995) @@ -1955,7 +1955,7 @@ in6if_do_dad(struct ifnet *ifp) /* * Our DAD routine requires the interface up and running. * However, some interfaces can be up before the RUNNING - * status. Additionaly, users may try to assign addresses + * status. Additionally, users may try to assign addresses * before the interface becomes up (or running). * This function returns EAGAIN in that case. * The caller should mark "tentative" on the address instead of Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/in6_mcast.c Tue May 3 18:05:43 2016 (r298995) @@ -574,7 +574,7 @@ in6m_clear_recorded(struct in6_multi *in * * Return 0 if the source didn't exist or was already marked as recorded. * Return 1 if the source was marked as recorded by this function. - * Return <0 if any error occured (negated errno code). + * Return <0 if any error occurred (negated errno code). */ int in6m_record_source(struct in6_multi *inm, const struct in6_addr *addr) Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/ip6_forward.c Tue May 3 18:05:43 2016 (r298995) @@ -282,7 +282,7 @@ ip6_forward(struct mbuf *m, int srcrt) * ipsec6_proces_packet will send the packet using ip6_output */ error = ipsec6_process_packet(m, sp->req); - /* Release SP if an error occured */ + /* Release SP if an error occurred */ if (error != 0) KEY_FREESP(&sp); if (error == EJUSTRETURN) { Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/ip6_id.c Tue May 3 18:05:43 2016 (r298995) @@ -108,7 +108,7 @@ __FBSDID("$FreeBSD$"); struct randomtab { const int ru_bits; /* resulting bits */ - const long ru_out; /* Time after wich will be reseeded */ + const long ru_out; /* Time after which will be reseeded */ const u_int32_t ru_max; /* Uniq cycle, avoid blackjack prediction */ const u_int32_t ru_gen; /* Starting generator */ const u_int32_t ru_n; /* ru_n: prime, ru_n - 1: product of pfacts[] */ @@ -128,7 +128,7 @@ struct randomtab { static struct randomtab randomtab_32 = { 32, /* resulting bits */ - 180, /* Time after wich will be reseeded */ + 180, /* Time after which will be reseeded */ 1000000000, /* Uniq cycle, avoid blackjack prediction */ 2, /* Starting generator */ 2147483629, /* RU_N-1 = 2^2*3^2*59652323 */ @@ -139,7 +139,7 @@ static struct randomtab randomtab_32 = { static struct randomtab randomtab_20 = { 20, /* resulting bits */ - 180, /* Time after wich will be reseeded */ + 180, /* Time after which will be reseeded */ 200000, /* Uniq cycle, avoid blackjack prediction */ 2, /* Starting generator */ 524269, /* RU_N-1 = 2^2*3^2*14563 */ Modified: head/sys/netinet6/ip6protosw.h ============================================================================== --- head/sys/netinet6/ip6protosw.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/ip6protosw.h Tue May 3 18:05:43 2016 (r298995) @@ -92,7 +92,7 @@ struct pr_usrreqs; * * ip6c_finaldst usually points to ip6c_ip6->ip6_dst. if the original * (internal) packet carries a routing header, it may point the final - * dstination address in the routing header. + * destination address in the routing header. * * ip6c_src: ip6c_ip6->ip6_src + scope info + flowlabel in ip6c_ip6 * (beware of flowlabel, if you try to compare it against others) Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/mld6.c Tue May 3 18:05:43 2016 (r298995) @@ -971,9 +971,9 @@ out_locked: } /* - * Process a recieved MLDv2 group-specific or group-and-source-specific + * Process a received MLDv2 group-specific or group-and-source-specific * query. - * Return <0 if any error occured. Currently this is ignored. + * Return <0 if any error occurred. Currently this is ignored. */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/nd6.c Tue May 3 18:05:43 2016 (r298995) @@ -479,7 +479,7 @@ nd6_options(union nd_opts *ndopts) default: /* * Unknown options must be silently ignored, - * to accomodate future extension to the protocol. + * to accommodate future extension to the protocol. */ nd6log((LOG_DEBUG, "nd6_options: unsupported option %d - " @@ -1604,7 +1604,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru case SIOCSIFINFO_IN6: /* * used to change host variables from userland. - * intented for a use on router to reflect RA configurations. + * intended for a use on router to reflect RA configurations. */ /* 0 means 'unspecified' */ if (ND.linkmtu != 0) { Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netinet6/nd6_rtr.c Tue May 3 18:05:43 2016 (r298995) @@ -482,7 +482,7 @@ nd6_rtmsg(int cmd, struct rtentry *rt) } /* - * default router list proccessing sub routines + * default router list processing sub routines */ static void Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netipsec/ipsec.c Tue May 3 18:05:43 2016 (r298995) @@ -290,7 +290,7 @@ key_allocsp_default(const char* where, i * 0 : bypass * EACCES : discard packet. * ENOENT : ipsec_acquire() in progress, maybe. - * others : error occured. + * others : error occurred. * others: a pointer to SP * * NOTE: IPv6 mapped adddress concern is implemented here. @@ -318,7 +318,7 @@ ipsec_getpolicy(struct tdb_ident *tdbi, * 0 : bypass * EACCES : discard packet. * ENOENT : ipsec_acquire() in progress, maybe. - * others : error occured. + * others : error occurred. * others: a pointer to SP * * NOTE: IPv6 mapped adddress concern is implemented here. @@ -425,7 +425,7 @@ ipsec_getpolicybysock(const struct mbuf * 0 : bypass * EACCES : discard packet. * ENOENT : ipsec_acquire() in progress, maybe. - * others : error occured. + * others : error occurred. */ struct secpolicy * ipsec_getpolicybyaddr(const struct mbuf *m, u_int dir, int *error) Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netipsec/ipsec_output.c Tue May 3 18:05:43 2016 (r298995) @@ -589,7 +589,7 @@ ipsec4_process_packet(struct mbuf *m, st * packet will be returned for transmission after crypto * processing, etc. are completed. * - * NB: m & sav are ``passed to caller'' who's reponsible for + * NB: m & sav are ``passed to caller'' who's responsible for * for reclaiming their resources. */ switch(dst->sa.sa_family) { Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netipsec/key.c Tue May 3 18:05:43 2016 (r298995) @@ -933,7 +933,7 @@ key_do_allocsa_policy(struct secashead * { struct secasvar *sav, *nextsav, *candidate, *d; - /* initilize */ + /* initialize */ candidate = NULL; SAHTREE_LOCK(); @@ -1058,7 +1058,7 @@ key_do_allocsa_policy(struct secashead * * allocating a usable SA entry for a *INBOUND* packet. * Must call key_freesav() later. * OUT: positive: pointer to a usable sav (i.e. MATURE or DYING state). - * NULL: not found, or error occured. + * NULL: not found, or error occurred. * * In the comparison, no source address is used--for RFC2401 conformance. * To quote, from section 4.1: @@ -2335,7 +2335,7 @@ key_spdget(struct socket *so, struct mbu * send * * to KMD, and expect to receive - * with SADB_X_SPDACQUIRE if error occured, + * with SADB_X_SPDACQUIRE if error occurred, * or * * with SADB_X_SPDUPDATE from KMD by PF_KEY. @@ -6153,7 +6153,7 @@ key_getprop(const struct secasindex *sai * * to KMD, and expect to receive - * with SADB_ACQUIRE if error occured, + * with SADB_ACQUIRE if error occurred, * or * with SADB_GETSPI * from KMD by PF_KEY. @@ -6517,9 +6517,9 @@ key_acquire2(struct socket *so, struct m /* * Error message from KMd. - * We assume that if error was occured in IKEd, the length of PFKEY + * We assume that if error was occurred in IKEd, the length of PFKEY * message is equal to the size of sadb_msg structure. - * We do not raise error even if error occured in this function. + * We do not raise error even if error occurred in this function. */ if (mhp->msg->sadb_msg_len == PFKEY_UNIT64(sizeof(struct sadb_msg))) { struct secacq *acq; Modified: head/sys/netpfil/ipfw/dn_heap.h ============================================================================== --- head/sys/netpfil/ipfw/dn_heap.h Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netpfil/ipfw/dn_heap.h Tue May 3 18:05:43 2016 (r298995) @@ -83,7 +83,7 @@ enum { * heap_insert() adds a key-pointer pair to the heap * * HEAP_TOP() returns a pointer to the top element of the heap, - * but makes no checks on its existance (XXX should we change ?) + * but makes no checks on its existence (XXX should we change ?) * * heap_extract() removes the entry at the top, returing the pointer. * (the key should have been read before). @@ -146,7 +146,7 @@ int heap_scan(struct dn_heap *, int (*)( * of the dn_ht_find(), and of the callbacks: * * DNHT_KEY_IS_OBJ means the key is the object pointer. - * It is usally of interest for the hash and match functions. + * It is usually of interest for the hash and match functions. * * DNHT_MATCH_PTR during a lookup, match pointers instead * of calling match(). Normally used when removing specific Modified: head/sys/netpfil/ipfw/dummynet.txt ============================================================================== --- head/sys/netpfil/ipfw/dummynet.txt Tue May 3 18:02:25 2016 (r298994) +++ head/sys/netpfil/ipfw/dummynet.txt Tue May 3 18:05:43 2016 (r298995) @@ -86,7 +86,7 @@ USERLAND-KERNEL API (ip_dummynet.h) struct dn_link: contains data about the physical link such as - bandwith, delay, burst size; + bandwidth, delay, burst size; struct dn_fs: describes a flowset, i.e. a template for queues. @@ -444,7 +444,7 @@ of the object to remove Delete of pipe x ---------------- -A pipe can be deleted by the user throught the command 'ipfw pipe x delete'. +A pipe can be deleted by the user through the command 'ipfw pipe x delete'. To delete a pipe, the pipe is removed from the pipe list, and then deleted. Also the scheduler associated with this pipe should be deleted. For compatibility with old dummynet syntax, the associated FIFO scheduler and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 18:06:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC439B2A2EF; Tue, 3 May 2016 18:06: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 6372417E1; Tue, 3 May 2016 18:06: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 u43I6gsm031132; Tue, 3 May 2016 18:06:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43I6gdM031131; Tue, 3 May 2016 18:06:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605031806.u43I6gdM031131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 3 May 2016 18:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298996 - head/contrib/subversion/subversion/svn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:06:43 -0000 Author: dim Date: Tue May 3 18:06:42 2016 New Revision: 298996 URL: https://svnweb.freebsd.org/changeset/base/298996 Log: Re-sync the FreeBSD-specific Subversion template with the one from ports. MFC after: 11 days X-MFC-With: r298845 Modified: head/contrib/subversion/subversion/svn/util.c Modified: head/contrib/subversion/subversion/svn/util.c ============================================================================== --- head/contrib/subversion/subversion/svn/util.c Tue May 3 18:05:43 2016 (r298995) +++ head/contrib/subversion/subversion/svn/util.c Tue May 3 18:06:42 2016 (r298996) @@ -343,6 +343,7 @@ truncate_buffer_at_prefix(apr_size_t *ne static const char *prefixes[] = { "PR:", "Submitted by:", + "Reported by:", "Reviewed by:", "Approved by:", "Obtained from:", @@ -420,6 +421,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "PR:\t\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Submitted by:\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Reported by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Reviewed by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR); @@ -445,8 +447,9 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Description of fields to fill in above: 76 columns --|" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> PR: If a GNATS PR is affected by the change." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> PR: If and which Problem Report is related." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Submitted by: If someone else sent in the change." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Reported by: If someone else reported the issue." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Reviewed by: If someone else reviewed your modification." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is from a third party." APR_EOL_STR); From owner-svn-src-all@freebsd.org Tue May 3 18:19:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17919B2A615; Tue, 3 May 2016 18:19:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 E6B291E51; Tue, 3 May 2016 18:19:50 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 75163B93A; Tue, 3 May 2016 14:19:49 -0400 (EDT) From: John Baldwin To: Bruce Evans Cc: Pedro Giffuni , "Ngie Cooper (yaneurabeya)" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86 Date: Tue, 03 May 2016 11:19:44 -0700 Message-ID: <1928389.rOu33C1eaq@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160504031930.A3395@besplex.bde.org> References: <201605021800.u42I0cjK084243@repo.freebsd.org> <8989101.JIAk4LJusf@ralph.baldwin.cx> <20160504031930.A3395@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 03 May 2016 14:19:49 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:19:51 -0000 On Wednesday, May 04, 2016 03:58:40 AM Bruce Evans wrote: > On Tue, 3 May 2016, John Baldwin wrote: > > > On Tuesday, May 03, 2016 03:52:56 PM Bruce Evans wrote: > >> On Mon, 2 May 2016, Pedro Giffuni wrote: > >... > >>> TBH, I thought so too, but I avoided applying such changes to headers, > >>> and I haven't touched _bitset.h, > >> > >> _foo.h headers cannot use howmany() due to namespace pollution. > >> > >> _bitset.h was already broken, unless it is supposed to be kernel-only -- > >> it uses howmany(). It is kernel-only according to its documention -- > >> bitset is only documented in kernel manpages (in a single unreadable one > >> than is linked ad nauseum). > > > > cpuset.h is used in userland for cpuset_getaffinity(2), etc. > > > >> It is otherwise fairly clean. It defines the symbols BITSET_DEFINE, > >> BITSET_T_INITIALIZER, and BITSET_SET in the application namespace > >> This is not completely clean for a _foo.h header. All other BITSET* > >> macros are already in bitset.h I think only BITSET_DEFINE should be > >> in _bitset.h (for use declarations in other headers). > >> > >> select.h avoids this problem by defining its own howmany() macro. This > >> seems to be correct except for the bogus ifdef around the private macro. > >> This ifdef is a little more than a style bug (verboseness) -- it breaks > >> detection of other definitions that might be different. Lexical > >> differences wouldn't matter, but it is easier to never have them. > >> > >> Old versions of select polluted . The select macros just > >> used howmany(). howmany() was in too. > > > > I would be happy to fix _bitset.h and _cpuset.h to not need sys/param.h. > > However, they also use NBBY which is defined in sys/param.h. _sigset.h > > gets around this because it uses an array of uint32_t and hardcodes a > > shift count of 5 in _SIG_WORD() and a mask of 31 in _SIG_BIT(). If you > > think it is fine to hardcode '8' instead of 'NBBY' I'll do that. Hmm, > > sys/select.h hardcodes '8' for _NFDBITS, so I guess that is fine. > > NBBY can be cleaned up too. I rather like it, but it is bogus in C90 > since it is spelled CHAR_BIT there, and it is now more bogus in POSIX > since POSIX started specifying 8-bit bytes in 2001. Thus 8 is the > correct spelling of it in the implementation where you don't want to > expose a macro that makes it clearer what this magic 8 is. Ok. > BTW, I don't like select's and bitset's use of longs. Using unsigned > for select is a historical mistake. Bitset apparently copied select > except it unimproved to signed long. Bitstring uses unsigned char with > no optimizations. Sigset uses uint32_t with no obvious optimizations, > but compilers do a good job with with it due to its fixed size. I doubt > that the manual optimization of using a wider size is important. I agree, but cpuset_t is already part of the ABI in existing releases. :( Changing it to uint32_t would break the ABI for big-endian platforms. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 3 18:26:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5707EB2AA0C; Tue, 3 May 2016 18:26:08 +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 2886816EC; Tue, 3 May 2016 18:26:08 +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 u43IQ7Ke037218; Tue, 3 May 2016 18:26:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43IQ7MP037217; Tue, 3 May 2016 18:26:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605031826.u43IQ7MP037217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 May 2016 18:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298997 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:26:08 -0000 Author: jhb Date: Tue May 3 18:26:07 2016 New Revision: 298997 URL: https://svnweb.freebsd.org/changeset/base/298997 Log: Add a debug dir for /boot/modules. This provides a place for standalone modules to store debug symbols. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D6190 Modified: head/etc/mtree/BSD.debug.dist Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Tue May 3 18:06:42 2016 (r298996) +++ head/etc/mtree/BSD.debug.dist Tue May 3 18:26:07 2016 (r298997) @@ -11,6 +11,8 @@ boot kernel .. + modules + .. .. lib casper From owner-svn-src-all@freebsd.org Tue May 3 18:50:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80880B2C0D9; Tue, 3 May 2016 18:50:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1206B1716; Tue, 3 May 2016 18:50:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43IoEYD043528; Tue, 3 May 2016 18:50:14 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43IoBeM043499; Tue, 3 May 2016 18:50:11 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031850.u43IoBeM043499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298998 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bn/asm crypto/openssl/crypto/c... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:50:15 -0000 Author: jkim Date: Tue May 3 18:50:10 2016 New Revision: 298998 URL: https://svnweb.freebsd.org/changeset/base/298998 Log: Merge OpenSSL 1.0.2h. Relnotes: yes Added: head/crypto/openssl/doc/crypto/EVP_EncodeInit.pod - copied unchanged from r298991, vendor-crypto/openssl/dist/doc/crypto/EVP_EncodeInit.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_alpn_select_cb.pod - copied unchanged from r298991, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_alpn_select_cb.pod head/secure/lib/libcrypto/man/EVP_EncodeInit.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 (contents, props changed) Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/pkcs7.c head/crypto/openssl/crypto/aes/asm/aes-ppc.pl head/crypto/openssl/crypto/aes/asm/aes-s390x.pl head/crypto/openssl/crypto/asn1/a_bytes.c head/crypto/openssl/crypto/asn1/a_d2i_fp.c head/crypto/openssl/crypto/asn1/a_type.c head/crypto/openssl/crypto/asn1/asn1_lib.c head/crypto/openssl/crypto/asn1/asn1_par.c head/crypto/openssl/crypto/asn1/t_x509.c head/crypto/openssl/crypto/asn1/tasn_dec.c head/crypto/openssl/crypto/asn1/tasn_enc.c head/crypto/openssl/crypto/asn1/x_name.c head/crypto/openssl/crypto/asn1/x_x509.c head/crypto/openssl/crypto/bn/asm/ppc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc.pl head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl head/crypto/openssl/crypto/bn/asm/x86-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/comp/comp.h head/crypto/openssl/crypto/evp/Makefile head/crypto/openssl/crypto/evp/digest.c head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c head/crypto/openssl/crypto/evp/encode.c head/crypto/openssl/crypto/evp/evp_enc.c head/crypto/openssl/crypto/modes/asm/ghash-s390x.pl head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/pem/pem_lib.c head/crypto/openssl/crypto/pem/pvkfmt.c head/crypto/openssl/crypto/perlasm/x86_64-xlate.pl head/crypto/openssl/crypto/s390xcpuid.S head/crypto/openssl/crypto/sha/asm/sha1-ppc.pl head/crypto/openssl/crypto/sha/asm/sha1-s390x.pl head/crypto/openssl/crypto/sha/asm/sha512-ppc.pl head/crypto/openssl/crypto/sha/asm/sha512-s390x.pl head/crypto/openssl/crypto/x509/x509.h head/crypto/openssl/crypto/x509/x509_err.c head/crypto/openssl/crypto/x509/x509_obj.c head/crypto/openssl/doc/apps/ciphers.pod head/crypto/openssl/doc/apps/ocsp.pod head/crypto/openssl/doc/crypto/evp.pod head/crypto/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/s2_lib.c head/crypto/openssl/ssl/s2_meth.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_rsa.c head/crypto/openssl/ssl/ssltest.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/util/libeay.num head/crypto/openssl/util/mk1mf.pl head/crypto/openssl/util/mkdef.pl head/crypto/openssl/util/shlib_wrap.sh head/crypto/openssl/util/ssleay.num head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S head/secure/lib/libcrypto/amd64/aesni-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha1-x86_64.S head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/i386/x86-mont.s head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 (contents, props changed) head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_GROUP_copy.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_GROUP_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_KEY_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_POINT_add.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_POINT_new.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_host.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_ECPKParameters.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ec.3 (contents, props changed) head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CONF_CTX_new.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_cmd.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get0_param.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set1_curves.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 (contents, props changed) head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_check_chain.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/c_rehash.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/CHANGES Tue May 3 18:50:10 2016 (r298998) @@ -2,6 +2,103 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2g and 1.0.2h [3 May 2016] + + *) Prevent padding oracle in AES-NI CBC MAC check + + A MITM attacker can use a padding oracle attack to decrypt traffic + when the connection uses an AES CBC cipher and the server support + AES-NI. + + This issue was introduced as part of the fix for Lucky 13 padding + attack (CVE-2013-0169). The padding check was rewritten to be in + constant time by making sure that always the same bytes are read and + compared against either the MAC or padding bytes. But it no longer + checked that there was enough data to have both the MAC and padding + bytes. + + This issue was reported by Juraj Somorovsky using TLS-Attacker. + (CVE-2016-2107) + [Kurt Roeckx] + + *) Fix EVP_EncodeUpdate overflow + + An overflow can occur in the EVP_EncodeUpdate() function which is used for + Base64 encoding of binary data. If an attacker is able to supply very large + amounts of input data then a length check can overflow resulting in a heap + corruption. + + Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by + the PEM_write_bio* family of functions. These are mainly used within the + OpenSSL command line applications, so any application which processes data + from an untrusted source and outputs it as a PEM file should be considered + vulnerable to this issue. User applications that call these APIs directly + with large amounts of untrusted data may also be vulnerable. + + This issue was reported by Guido Vranken. + (CVE-2016-2105) + [Matt Caswell] + + *) Fix EVP_EncryptUpdate overflow + + An overflow can occur in the EVP_EncryptUpdate() function. If an attacker + is able to supply very large amounts of input data after a previous call to + EVP_EncryptUpdate() with a partial block then a length check can overflow + resulting in a heap corruption. Following an analysis of all OpenSSL + internal usage of the EVP_EncryptUpdate() function all usage is one of two + forms. The first form is where the EVP_EncryptUpdate() call is known to be + the first called function after an EVP_EncryptInit(), and therefore that + specific call must be safe. The second form is where the length passed to + EVP_EncryptUpdate() can be seen from the code to be some small value and + therefore there is no possibility of an overflow. Since all instances are + one of these two forms, it is believed that there can be no overflows in + internal code due to this problem. It should be noted that + EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths. + Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances + of these calls have also been analysed too and it is believed there are no + instances in internal usage where an overflow could occur. + + This issue was reported by Guido Vranken. + (CVE-2016-2106) + [Matt Caswell] + + *) Prevent ASN.1 BIO excessive memory allocation + + When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio() + a short invalid encoding can casuse allocation of large amounts of memory + potentially consuming excessive resources or exhausting memory. + + Any application parsing untrusted data through d2i BIO functions is + affected. The memory based functions such as d2i_X509() are *not* affected. + Since the memory based functions are used by the TLS library, TLS + applications are not affected. + + This issue was reported by Brian Carpenter. + (CVE-2016-2109) + [Stephen Henson] + + *) EBCDIC overread + + ASN1 Strings that are over 1024 bytes can cause an overread in applications + using the X509_NAME_oneline() function on EBCDIC systems. This could result + in arbitrary stack data being returned in the buffer. + + This issue was reported by Guido Vranken. + (CVE-2016-2176) + [Matt Caswell] + + *) Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + [Todd Short] + + *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the + default. + [Kurt Roeckx] + + *) Only remove the SSLv2 methods with the no-ssl2-method option. When the + methods are enabled and ssl2 is disabled the methods return NULL. + [Kurt Roeckx] + Changes between 1.0.2f and 1.0.2g [1 Mar 2016] * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/Makefile Tue May 3 18:50:10 2016 (r298998) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2g +VERSION=1.0.2h MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/NEWS Tue May 3 18:50:10 2016 (r298998) @@ -5,6 +5,19 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2g and OpenSSL 1.0.2h [3 May 2016] + + o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) + o Fix EVP_EncodeUpdate overflow (CVE-2016-2105) + o Fix EVP_EncryptUpdate overflow (CVE-2016-2106) + o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109) + o EBCDIC overread (CVE-2016-2176) + o Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + o Remove LOW from the DEFAULT cipher list. This removes singles DES from + the default. + o Only remove the SSLv2 methods with the no-ssl2-method option. + Major changes between OpenSSL 1.0.2f and OpenSSL 1.0.2g [1 Mar 2016] o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/README Tue May 3 18:50:10 2016 (r298998) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2g 1 Mar 2016 + OpenSSL 1.0.2h 3 May 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/pkcs7.c ============================================================================== --- head/crypto/openssl/apps/pkcs7.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/apps/pkcs7.c Tue May 3 18:50:10 2016 (r298998) @@ -235,12 +235,16 @@ int MAIN(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; Modified: head/crypto/openssl/crypto/aes/asm/aes-ppc.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aes-ppc.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/aes/asm/aes-ppc.pl Tue May 3 18:50:10 2016 (r298998) @@ -590,7 +590,7 @@ Lenc_loop: xor $s2,$t2,$acc14 xor $s3,$t3,$acc15 addi $key,$key,16 - bdnz- Lenc_loop + bdnz Lenc_loop addi $Tbl2,$Tbl0,2048 nop @@ -1068,7 +1068,7 @@ Ldec_loop: xor $s2,$t2,$acc14 xor $s3,$t3,$acc15 addi $key,$key,16 - bdnz- Ldec_loop + bdnz Ldec_loop addi $Tbl2,$Tbl0,2048 nop Modified: head/crypto/openssl/crypto/aes/asm/aes-s390x.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/aes/asm/aes-s390x.pl Tue May 3 18:50:10 2016 (r298998) @@ -818,13 +818,9 @@ $code.=<<___ if (!$softonly); tmhl %r0,0x4000 # check for message-security assist jz .Lekey_internal - lghi %r0,0 # query capability vector - la %r1,16($sp) - .long 0xb92f0042 # kmc %r4,%r2 - - llihh %r1,0x8000 - srlg %r1,%r1,0(%r5) - ng %r1,16($sp) + llihh %r0,0x8000 + srlg %r0,%r0,0(%r5) + ng %r0,48(%r1) # check kmc capability vector jz .Lekey_internal lmg %r0,%r1,0($inp) # just copy 128 bits... @@ -1444,13 +1440,10 @@ $code.=<<___ if (0); ######### kmctr cod llgfr $s0,%r0 lgr $s1,%r1 - lghi %r0,0 - la %r1,16($sp) - .long 0xb92d2042 # kmctr %r4,%r2,%r2 - + larl %r1,OPENSSL_s390xcap_P llihh %r0,0x8000 # check if kmctr supports the function code srlg %r0,%r0,0($s0) - ng %r0,16($sp) + ng %r0,64(%r1) # check kmctr capability vector lgr %r0,$s0 lgr %r1,$s1 jz .Lctr32_km_loop @@ -1597,12 +1590,10 @@ $code.=<<___ if(1); llgfr $s0,%r0 # put aside the function code lghi $s1,0x7f nr $s1,%r0 - lghi %r0,0 # query capability vector - la %r1,$tweak-16($sp) - .long 0xb92e0042 # km %r4,%r2 - llihh %r1,0x8000 - srlg %r1,%r1,32($s1) # check for 32+function code - ng %r1,$tweak-16($sp) + larl %r1,OPENSSL_s390xcap_P + llihh %r0,0x8000 + srlg %r0,%r0,32($s1) # check for 32+function code + ng %r0,32(%r1) # check km capability vector lgr %r0,$s0 # restore the function code la %r1,0($key1) # restore $key1 jz .Lxts_km_vanilla @@ -2229,7 +2220,7 @@ ___ } $code.=<<___; .string "AES for s390x, CRYPTOGAMS by " -.comm OPENSSL_s390xcap_P,16,8 +.comm OPENSSL_s390xcap_P,80,8 ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; Modified: head/crypto/openssl/crypto/asn1/a_bytes.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:50:10 2016 (r298998) @@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) - OPENSSL_free(ret->data); s = (unsigned char *)OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; } + if (ret->data != NULL) + OPENSSL_free(ret->data); } else s = ret->data; memcpy(s, p, (int)len); Modified: head/crypto/openssl/crypto/asn1/a_d2i_fp.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:50:10 2016 (r298998) @@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM * #endif #define HEADER_SIZE 8 +#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; @@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BU /* suck in c.slen bytes of data */ want = c.slen; if (want > (len - off)) { + size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; + want -= (len - off); if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) { ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG); goto err; } - if (!BUF_MEM_grow_clean(b, len + want)) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } while (want > 0) { - i = BIO_read(in, &(b->data[len]), want); - if (i <= 0) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, - ASN1_R_NOT_ENOUGH_DATA); + /* + * Read content in chunks of increasing size + * so we can return an error for EOF without + * having to allocate the entire content length + * in one go. + */ + size_t chunk = want > chunk_max ? chunk_max : want; + + if (!BUF_MEM_grow_clean(b, len + chunk)) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); goto err; } + want -= chunk; + while (chunk > 0) { + i = BIO_read(in, &(b->data[len]), chunk); + if (i <= 0) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, + ASN1_R_NOT_ENOUGH_DATA); + goto err; + } /* * This can't overflow because |len+want| didn't * overflow. */ - len += i; - want -= i; + len += i; + chunk -= i; + } + if (chunk_max < INT_MAX/2) + chunk_max *= 2; } } if (off + c.slen < off) { Modified: head/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:50:10 2016 (r298998) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: head/crypto/openssl/crypto/asn1/asn1_lib.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:50:10 2016 (r298998) @@ -63,7 +63,7 @@ #include static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max); + long max); static void asn1_put_length(unsigned char **pp, int length); const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; @@ -131,7 +131,7 @@ int ASN1_get_object(const unsigned char } *ptag = tag; *pclass = xclass; - if (!asn1_get_length(&p, &inf, plength, (int)max)) + if (!asn1_get_length(&p, &inf, plength, max)) goto err; if (inf && !(ret & V_ASN1_CONSTRUCTED)) @@ -159,14 +159,14 @@ int ASN1_get_object(const unsigned char } static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max) + long max) { const unsigned char *p = *pp; unsigned long ret = 0; - unsigned int i; + unsigned long i; if (max-- < 1) - return (0); + return 0; if (*p == 0x80) { *inf = 1; ret = 0; @@ -175,15 +175,11 @@ static int asn1_get_length(const unsigne *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { - if (i > sizeof(long)) + if (i > sizeof(ret) || max < (long)i) return 0; - if (max-- == 0) - return (0); while (i-- > 0) { ret <<= 8L; ret |= *(p++); - if (max-- == 0) - return (0); } } else ret = i; @@ -192,7 +188,7 @@ static int asn1_get_length(const unsigne return 0; *pp = p; *rl = (long)ret; - return (1); + return 1; } /* Modified: head/crypto/openssl/crypto/asn1/asn1_par.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:50:10 2016 (r298998) @@ -173,6 +173,8 @@ static int asn1_parse2(BIO *bp, const un if (!asn1_print_info(bp, tag, xclass, j, (indent) ? depth : 0)) goto end; if (j & V_ASN1_CONSTRUCTED) { + const unsigned char *sp; + ep = p + len; if (BIO_write(bp, "\n", 1) <= 0) goto end; @@ -182,6 +184,7 @@ static int asn1_parse2(BIO *bp, const un goto end; } if ((j == 0x21) && (len == 0)) { + sp = p; for (;;) { r = asn1_parse2(bp, &p, (long)(tot - p), offset + (p - *pp), depth + 1, @@ -190,19 +193,25 @@ static int asn1_parse2(BIO *bp, const un ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = p - sp; break; + } } - } else + } else { + long tmp = len; + while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, - offset + (p - *pp), depth + 1, + sp = p; + r = asn1_parse2(bp, &p, tmp, offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { ret = 0; goto end; } + tmp -= p - sp; } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) Modified: head/crypto/openssl/crypto/asn1/t_x509.c ============================================================================== --- head/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:50:10 2016 (r298998) @@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsi goto err; bs = X509_get_serialNumber(x); - if (bs->length <= (int)sizeof(long)) { + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { l = ASN1_INTEGER_get(bs); if (bs->type == V_ASN1_NEG_INTEGER) { l = -l; Modified: head/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- head/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:50:10 2016 (r298998) @@ -901,9 +901,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: head/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- head/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:50:10 2016 (r298998) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: head/crypto/openssl/crypto/asn1/x_name.c ============================================================================== --- head/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:50:10 2016 (r298998) @@ -66,6 +66,13 @@ typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, @@ -192,6 +199,10 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; + if (len > X509_NAME_MAX) { + ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); + return 0; + } q = p; /* Get internal representation of Name */ Modified: head/crypto/openssl/crypto/asn1/x_x509.c ============================================================================== --- head/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:50:10 2016 (r298998) @@ -201,10 +201,20 @@ X509 *d2i_X509_AUX(X509 **a, const unsig int i2d_X509_AUX(X509 *a, unsigned char **pp) { - int length; + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); - if (a) - length += i2d_X509_CERT_AUX(a->aux, pp); + if (length < 0 || a == NULL) + return length; + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + return length; } Modified: head/crypto/openssl/crypto/bn/asm/ppc-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/ppc-mont.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/ppc-mont.pl Tue May 3 18:50:10 2016 (r298998) @@ -191,7 +191,7 @@ L1st: addi $j,$j,$BNSZ ; j++ addi $tp,$tp,$BNSZ ; tp++ - bdnz- L1st + bdnz L1st ;L1st addc $lo0,$alo,$hi0 addze $hi0,$ahi @@ -253,7 +253,7 @@ Linner: addze $hi1,$hi1 $ST $lo1,0($tp) ; tp[j-1] addi $tp,$tp,$BNSZ ; tp++ - bdnz- Linner + bdnz Linner ;Linner $LD $tj,$BNSZ($tp) ; tp[j] addc $lo0,$alo,$hi0 @@ -276,7 +276,7 @@ Linner: slwi $tj,$num,`log($BNSZ)/log(2)` $UCMP $i,$tj addi $i,$i,$BNSZ - ble- Louter + ble Louter addi $num,$num,2 ; restore $num subfc $j,$j,$j ; j=0 and "clear" XER[CA] @@ -289,7 +289,7 @@ Lsub: $LDX $tj,$tp,$j subfe $aj,$nj,$tj ; tp[j]-np[j] $STX $aj,$rp,$j addi $j,$j,$BNSZ - bdnz- Lsub + bdnz Lsub li $j,0 mtctr $num @@ -304,7 +304,7 @@ Lcopy: ; copy or in-place refresh $STX $tj,$rp,$j $STX $j,$tp,$j ; zap at once addi $j,$j,$BNSZ - bdnz- Lcopy + bdnz Lcopy $POP $tj,0($sp) li r3,1 Modified: head/crypto/openssl/crypto/bn/asm/ppc.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/ppc.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/ppc.pl Tue May 3 18:50:10 2016 (r298998) @@ -1556,7 +1556,7 @@ Lppcasm_sub_mainloop: # if carry = 1 this is r7-r8. Else it # is r7-r8 -1 as we need. $STU r6,$BNSZ(r3) - bdnz- Lppcasm_sub_mainloop + bdnz Lppcasm_sub_mainloop Lppcasm_sub_adios: subfze r3,r0 # if carry bit is set then r3 = 0 else -1 andi. r3,r3,1 # keep only last bit. @@ -1603,7 +1603,7 @@ Lppcasm_add_mainloop: $LDU r8,$BNSZ(r5) adde r8,r7,r8 $STU r8,$BNSZ(r3) - bdnz- Lppcasm_add_mainloop + bdnz Lppcasm_add_mainloop Lppcasm_add_adios: addze r3,r0 #return carry bit. blr @@ -1762,7 +1762,7 @@ Lppcasm_sqr_mainloop: $UMULH r8,r6,r6 $STU r7,$BNSZ(r3) $STU r8,$BNSZ(r3) - bdnz- Lppcasm_sqr_mainloop + bdnz Lppcasm_sqr_mainloop Lppcasm_sqr_adios: blr .long 0 @@ -1827,7 +1827,7 @@ Lppcasm_mw_LOOP: addi r3,r3,`4*$BNSZ` addi r4,r4,`4*$BNSZ` - bdnz- Lppcasm_mw_LOOP + bdnz Lppcasm_mw_LOOP Lppcasm_mw_REM: andi. r5,r5,0x3 @@ -1951,7 +1951,7 @@ Lppcasm_maw_mainloop: $ST r11,`3*$BNSZ`(r3) addi r3,r3,`4*$BNSZ` addi r4,r4,`4*$BNSZ` - bdnz- Lppcasm_maw_mainloop + bdnz Lppcasm_maw_mainloop Lppcasm_maw_leftover: andi. r5,r5,0x3 Modified: head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl Tue May 3 18:50:10 2016 (r298998) @@ -734,7 +734,7 @@ $code.=<<___; ___ } $code.=<<___; - bdnz- L1st + bdnz L1st fctid $dota,$dota fctid $dotb,$dotb @@ -1280,7 +1280,7 @@ $code.=<<___; ___ } $code.=<<___; - bdnz- Linner + bdnz Linner fctid $dota,$dota fctid $dotb,$dotb @@ -1490,7 +1490,7 @@ Lsub: ldx $t0,$tp,$i stdx $t0,$rp,$i stdx $t2,$t6,$i addi $i,$i,16 - bdnz- Lsub + bdnz Lsub li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit @@ -1517,7 +1517,7 @@ Lcopy: ; copy or in-place refresh stdx $i,$tp,$i ; zap tp at once stdx $i,$t4,$i addi $i,$i,16 - bdnz- Lcopy + bdnz Lcopy ___ $code.=<<___ if ($SIZE_T==4); subf $np,$num,$np ; rewind np @@ -1550,7 +1550,7 @@ Lsub: lwz $t0,12($tp) ; load tp[j..j+3] stw $t5,8($rp) stw $t6,12($rp) stwu $t7,16($rp) - bdnz- Lsub + bdnz Lsub li $i,0 subfe $ovf,$i,$ovf ; handle upmost overflow bit @@ -1582,7 +1582,7 @@ Lcopy: ; copy or in-place refresh stwu $t3,16($rp) std $i,8($tp) ; zap tp at once stdu $i,16($tp) - bdnz- Lcopy + bdnz Lcopy ___ $code.=<<___; Modified: head/crypto/openssl/crypto/bn/asm/x86-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:50:10 2016 (r298998) @@ -85,6 +85,21 @@ $frame=32; # size of above frame roun &and ("esp",-64); # align to cache line + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + &mov ("eax","ebp"); + &sub ("eax","esp"); + &and ("eax",-4096); +&set_label("page_walk"); + &mov ("edx",&DWP(0,"esp","eax")); + &sub ("eax",4096); + &data_byte(0x2e); + &jnc (&label("page_walk")); + ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:50:10 2016 (r298998) @@ -130,6 +130,20 @@ $code.=<<___; mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmul_page_walk + mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -342,6 +356,14 @@ $code.=<<___; mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -795,6 +817,15 @@ bn_sqr8x_mont: sub %r11,%rsp .Lsqr8x_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lsqr8x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lsqr8x_page_walk + mov $num,%r10 neg $num @@ -932,8 +963,17 @@ bn_mulx4x_mont: sub $num,%r10 # -$num mov ($n0),$n0 # *n0 lea -72(%rsp,%r10),%rsp # alloca(frame+$num+8) - lea ($bp,$num),%r10 and \$-128,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmulx4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmulx4x_page_walk + + lea ($bp,$num),%r10 ############################################################## # Stack layout # +0 num Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:50:10 2016 (r298998) @@ -115,6 +115,20 @@ $code.=<<___; mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%rax + and \$-4096,%rax +.Lmul_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul_page_walk + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; @@ -469,6 +483,15 @@ $code.=<<___; sub %r11,%rsp .Lmul4xsp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + neg $num mov %rax,40(%rsp) @@ -1058,6 +1081,15 @@ $code.=<<___; sub %r11,%rsp .Lpwr_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lpwr_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lpwr_page_walk + mov $num,%r10 neg $num @@ -2028,7 +2060,16 @@ bn_from_mont8x: sub %r11,%rsp .Lfrom_sp_done: and \$-64,%rsp - mov $num,%r10 + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lfrom_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lfrom_page_walk + + mov $num,%r10 neg $num ############################################################## @@ -2173,6 +2214,15 @@ bn_mulx4x_mont_gather5: sub %r11,%rsp .Lmulx4xsp_done: and \$-64,%rsp # ensure alignment + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lmulx4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmulx4x_page_walk + ############################################################## # Stack layout # +0 -num @@ -2619,6 +2669,15 @@ bn_powerx5: sub %r11,%rsp .Lpwrx_sp_done: and \$-64,%rsp + mov %rax,%r11 + sub %rsp,%r11 + and \$-4096,%r11 +.Lpwrx_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lpwrx_page_walk + mov $num,%r10 neg $num Modified: head/crypto/openssl/crypto/comp/comp.h ============================================================================== --- head/crypto/openssl/crypto/comp/comp.h Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/comp/comp.h Tue May 3 18:50:10 2016 (r298998) @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif Modified: head/crypto/openssl/crypto/evp/Makefile ============================================================================== --- head/crypto/openssl/crypto/evp/Makefile Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/evp/Makefile Tue May 3 18:50:10 2016 (r298998) @@ -199,8 +199,8 @@ e_aes.o: ../../include/openssl/opensslv. e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h +e_aes_cbc_hmac_sha1.o: ../../e_os.h ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h @@ -214,9 +214,9 @@ e_aes_cbc_hmac_sha1.o: ../../include/ope e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../modes/modes_lcl.h -e_aes_cbc_hmac_sha1.o: e_aes_cbc_hmac_sha1.c -e_aes_cbc_hmac_sha256.o: ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +e_aes_cbc_hmac_sha1.o: ../modes/modes_lcl.h e_aes_cbc_hmac_sha1.c +e_aes_cbc_hmac_sha256.o: ../../e_os.h ../../include/openssl/aes.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/asn1.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/bio.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/crypto.h @@ -232,7 +232,8 @@ e_aes_cbc_hmac_sha256.o: ../../include/o e_aes_cbc_hmac_sha256.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha256.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha256.o: ../../include/openssl/symhacks.h ../modes/modes_lcl.h +e_aes_cbc_hmac_sha256.o: ../../include/openssl/symhacks.h +e_aes_cbc_hmac_sha256.o: ../constant_time_locl.h ../modes/modes_lcl.h e_aes_cbc_hmac_sha256.o: e_aes_cbc_hmac_sha256.c e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h Modified: head/crypto/openssl/crypto/evp/digest.c ============================================================================== --- head/crypto/openssl/crypto/evp/digest.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/evp/digest.c Tue May 3 18:50:10 2016 (r298998) @@ -212,8 +212,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; Modified: head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:50:10 2016 (r298998) @@ -60,6 +60,7 @@ # include # include # include "modes_lcl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -578,6 +579,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c ============================================================================== --- head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c Tue May 3 18:26:07 2016 (r298997) +++ head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c Tue May 3 18:50:10 2016 (r298998) @@ -60,6 +60,7 @@ # include # include # include "modes_lcl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -589,6 +590,8 @@ static int aesni_cbc_hmac_sha256_cipher( maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 18:54:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03016B2C26A; Tue, 3 May 2016 18:54:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C5051BCC; Tue, 3 May 2016 18:54:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43IsN49046322; Tue, 3 May 2016 18:54:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43IsKBj046289; Tue, 3 May 2016 18:54:20 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605031854.u43IsKBj046289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 May 2016 18:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298999 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bn/asm crypto/openssl/crypto/comp crypto/openssl/crypto... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 18:54:25 -0000 Author: jkim Date: Tue May 3 18:54:20 2016 New Revision: 298999 URL: https://svnweb.freebsd.org/changeset/base/298999 Log: Merge OpenSSL 1.0.1t. Relnotes: yes Added: stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod - copied unchanged from r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod stable/10/secure/lib/libcrypto/man/EVP_EncodeInit.3 (contents, props changed) Modified: stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/pkcs7.c stable/10/crypto/openssl/crypto/asn1/a_bytes.c stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c stable/10/crypto/openssl/crypto/asn1/a_type.c stable/10/crypto/openssl/crypto/asn1/asn1_lib.c stable/10/crypto/openssl/crypto/asn1/asn1_par.c stable/10/crypto/openssl/crypto/asn1/t_x509.c stable/10/crypto/openssl/crypto/asn1/tasn_dec.c stable/10/crypto/openssl/crypto/asn1/tasn_enc.c stable/10/crypto/openssl/crypto/asn1/x_name.c stable/10/crypto/openssl/crypto/asn1/x_x509.c stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl stable/10/crypto/openssl/crypto/comp/comp.h stable/10/crypto/openssl/crypto/evp/Makefile stable/10/crypto/openssl/crypto/evp/digest.c stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c stable/10/crypto/openssl/crypto/evp/encode.c stable/10/crypto/openssl/crypto/evp/evp_enc.c stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/pem/pem_lib.c stable/10/crypto/openssl/crypto/pem/pvkfmt.c stable/10/crypto/openssl/crypto/x509/x509.h stable/10/crypto/openssl/crypto/x509/x509_err.c stable/10/crypto/openssl/crypto/x509/x509_obj.c stable/10/crypto/openssl/doc/apps/ciphers.pod stable/10/crypto/openssl/doc/crypto/evp.pod stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/s2_lib.c stable/10/crypto/openssl/ssl/s2_meth.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl_ciph.c stable/10/crypto/openssl/ssl/ssl_locl.h stable/10/crypto/openssl/ssl/t1_lib.c stable/10/crypto/openssl/util/libeay.num stable/10/crypto/openssl/util/mk1mf.pl stable/10/crypto/openssl/util/mkdef.pl stable/10/crypto/openssl/util/ssleay.num stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/Makefile.man stable/10/secure/lib/libcrypto/amd64/x86_64-mont.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/10/secure/lib/libcrypto/i386/x86-mont.s stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/c_rehash.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/CHANGES Tue May 3 18:54:20 2016 (r298999) @@ -2,6 +2,103 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1s and 1.0.1t [3 May 2016] + + *) Prevent padding oracle in AES-NI CBC MAC check + + A MITM attacker can use a padding oracle attack to decrypt traffic + when the connection uses an AES CBC cipher and the server support + AES-NI. + + This issue was introduced as part of the fix for Lucky 13 padding + attack (CVE-2013-0169). The padding check was rewritten to be in + constant time by making sure that always the same bytes are read and + compared against either the MAC or padding bytes. But it no longer + checked that there was enough data to have both the MAC and padding + bytes. + + This issue was reported by Juraj Somorovsky using TLS-Attacker. + (CVE-2016-2107) + [Kurt Roeckx] + + *) Fix EVP_EncodeUpdate overflow + + An overflow can occur in the EVP_EncodeUpdate() function which is used for + Base64 encoding of binary data. If an attacker is able to supply very large + amounts of input data then a length check can overflow resulting in a heap + corruption. + + Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by + the PEM_write_bio* family of functions. These are mainly used within the + OpenSSL command line applications, so any application which processes data + from an untrusted source and outputs it as a PEM file should be considered + vulnerable to this issue. User applications that call these APIs directly + with large amounts of untrusted data may also be vulnerable. + + This issue was reported by Guido Vranken. + (CVE-2016-2105) + [Matt Caswell] + + *) Fix EVP_EncryptUpdate overflow + + An overflow can occur in the EVP_EncryptUpdate() function. If an attacker + is able to supply very large amounts of input data after a previous call to + EVP_EncryptUpdate() with a partial block then a length check can overflow + resulting in a heap corruption. Following an analysis of all OpenSSL + internal usage of the EVP_EncryptUpdate() function all usage is one of two + forms. The first form is where the EVP_EncryptUpdate() call is known to be + the first called function after an EVP_EncryptInit(), and therefore that + specific call must be safe. The second form is where the length passed to + EVP_EncryptUpdate() can be seen from the code to be some small value and + therefore there is no possibility of an overflow. Since all instances are + one of these two forms, it is believed that there can be no overflows in + internal code due to this problem. It should be noted that + EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths. + Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances + of these calls have also been analysed too and it is believed there are no + instances in internal usage where an overflow could occur. + + This issue was reported by Guido Vranken. + (CVE-2016-2106) + [Matt Caswell] + + *) Prevent ASN.1 BIO excessive memory allocation + + When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio() + a short invalid encoding can casuse allocation of large amounts of memory + potentially consuming excessive resources or exhausting memory. + + Any application parsing untrusted data through d2i BIO functions is + affected. The memory based functions such as d2i_X509() are *not* affected. + Since the memory based functions are used by the TLS library, TLS + applications are not affected. + + This issue was reported by Brian Carpenter. + (CVE-2016-2109) + [Stephen Henson] + + *) EBCDIC overread + + ASN1 Strings that are over 1024 bytes can cause an overread in applications + using the X509_NAME_oneline() function on EBCDIC systems. This could result + in arbitrary stack data being returned in the buffer. + + This issue was reported by Guido Vranken. + (CVE-2016-2176) + [Matt Caswell] + + *) Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + [Todd Short] + + *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the + default. + [Kurt Roeckx] + + *) Only remove the SSLv2 methods with the no-ssl2-method option. When the + methods are enabled and ssl2 is disabled the methods return NULL. + [Kurt Roeckx] + Changes between 1.0.1r and 1.0.1s [1 Mar 2016] * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/Makefile Tue May 3 18:54:20 2016 (r298999) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1s +VERSION=1.0.1t MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/NEWS Tue May 3 18:54:20 2016 (r298999) @@ -5,6 +5,19 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1s and OpenSSL 1.0.1t [3 May 2016] + + o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) + o Fix EVP_EncodeUpdate overflow (CVE-2016-2105) + o Fix EVP_EncryptUpdate overflow (CVE-2016-2106) + o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109) + o EBCDIC overread (CVE-2016-2176) + o Modify behavior of ALPN to invoke callback after SNI/servername + callback, such that updates to the SSL_CTX affect ALPN. + o Remove LOW from the DEFAULT cipher list. This removes singles DES from + the default. + o Only remove the SSLv2 methods with the no-ssl2-method option. + Major changes between OpenSSL 1.0.1r and OpenSSL 1.0.1s [1 Mar 2016] o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/README Tue May 3 18:54:20 2016 (r298999) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1s 1 Mar 2016 + OpenSSL 1.0.1t 3 May 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/pkcs7.c ============================================================================== --- stable/10/crypto/openssl/apps/pkcs7.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/apps/pkcs7.c Tue May 3 18:54:20 2016 (r298999) @@ -235,12 +235,16 @@ int MAIN(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; Modified: stable/10/crypto/openssl/crypto/asn1/a_bytes.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_bytes.c Tue May 3 18:54:20 2016 (r298999) @@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) - OPENSSL_free(ret->data); s = (unsigned char *)OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; } + if (ret->data != NULL) + OPENSSL_free(ret->data); } else s = ret->data; memcpy(s, p, (int)len); Modified: stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_d2i_fp.c Tue May 3 18:54:20 2016 (r298999) @@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM * #endif #define HEADER_SIZE 8 +#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; @@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BU /* suck in c.slen bytes of data */ want = c.slen; if (want > (len - off)) { + size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; + want -= (len - off); if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) { ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG); goto err; } - if (!BUF_MEM_grow_clean(b, len + want)) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); - goto err; - } while (want > 0) { - i = BIO_read(in, &(b->data[len]), want); - if (i <= 0) { - ASN1err(ASN1_F_ASN1_D2I_READ_BIO, - ASN1_R_NOT_ENOUGH_DATA); + /* + * Read content in chunks of increasing size + * so we can return an error for EOF without + * having to allocate the entire content length + * in one go. + */ + size_t chunk = want > chunk_max ? chunk_max : want; + + if (!BUF_MEM_grow_clean(b, len + chunk)) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE); goto err; } + want -= chunk; + while (chunk > 0) { + i = BIO_read(in, &(b->data[len]), chunk); + if (i <= 0) { + ASN1err(ASN1_F_ASN1_D2I_READ_BIO, + ASN1_R_NOT_ENOUGH_DATA); + goto err; + } /* * This can't overflow because |len+want| didn't * overflow. */ - len += i; - want -= i; + len += i; + chunk -= i; + } + if (chunk_max < INT_MAX/2) + chunk_max *= 2; } } if (off + c.slen < off) { Modified: stable/10/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/a_type.c Tue May 3 18:54:20 2016 (r298999) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: stable/10/crypto/openssl/crypto/asn1/asn1_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/asn1_lib.c Tue May 3 18:54:20 2016 (r298999) @@ -63,7 +63,7 @@ #include static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max); + long max); static void asn1_put_length(unsigned char **pp, int length); const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; @@ -131,7 +131,7 @@ int ASN1_get_object(const unsigned char } *ptag = tag; *pclass = xclass; - if (!asn1_get_length(&p, &inf, plength, (int)max)) + if (!asn1_get_length(&p, &inf, plength, max)) goto err; if (inf && !(ret & V_ASN1_CONSTRUCTED)) @@ -159,14 +159,14 @@ int ASN1_get_object(const unsigned char } static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, - int max) + long max) { const unsigned char *p = *pp; unsigned long ret = 0; - unsigned int i; + unsigned long i; if (max-- < 1) - return (0); + return 0; if (*p == 0x80) { *inf = 1; ret = 0; @@ -175,15 +175,11 @@ static int asn1_get_length(const unsigne *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { - if (i > sizeof(long)) + if (i > sizeof(ret) || max < (long)i) return 0; - if (max-- == 0) - return (0); while (i-- > 0) { ret <<= 8L; ret |= *(p++); - if (max-- == 0) - return (0); } } else ret = i; @@ -192,7 +188,7 @@ static int asn1_get_length(const unsigne return 0; *pp = p; *rl = (long)ret; - return (1); + return 1; } /* Modified: stable/10/crypto/openssl/crypto/asn1/asn1_par.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/asn1_par.c Tue May 3 18:54:20 2016 (r298999) @@ -173,6 +173,8 @@ static int asn1_parse2(BIO *bp, const un if (!asn1_print_info(bp, tag, xclass, j, (indent) ? depth : 0)) goto end; if (j & V_ASN1_CONSTRUCTED) { + const unsigned char *sp; + ep = p + len; if (BIO_write(bp, "\n", 1) <= 0) goto end; @@ -182,6 +184,7 @@ static int asn1_parse2(BIO *bp, const un goto end; } if ((j == 0x21) && (len == 0)) { + sp = p; for (;;) { r = asn1_parse2(bp, &p, (long)(tot - p), offset + (p - *pp), depth + 1, @@ -190,19 +193,25 @@ static int asn1_parse2(BIO *bp, const un ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = p - sp; break; + } } - } else + } else { + long tmp = len; + while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, - offset + (p - *pp), depth + 1, + sp = p; + r = asn1_parse2(bp, &p, tmp, offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { ret = 0; goto end; } + tmp -= p - sp; } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) Modified: stable/10/crypto/openssl/crypto/asn1/t_x509.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/t_x509.c Tue May 3 18:54:20 2016 (r298999) @@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsi goto err; bs = X509_get_serialNumber(x); - if (bs->length <= (int)sizeof(long)) { + if (bs->length < (int)sizeof(long) + || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) { l = ASN1_INTEGER_get(bs); if (bs->type == V_ASN1_NEG_INTEGER) { l = -l; Modified: stable/10/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/tasn_dec.c Tue May 3 18:54:20 2016 (r298999) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: stable/10/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/tasn_enc.c Tue May 3 18:54:20 2016 (r298999) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: stable/10/crypto/openssl/crypto/asn1/x_name.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/x_name.c Tue May 3 18:54:20 2016 (r298999) @@ -66,6 +66,13 @@ typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +/* + * Maximum length of X509_NAME: much larger than anything we should + * ever see in practice. + */ + +#define X509_NAME_MAX (1024 * 1024) + static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, @@ -192,6 +199,10 @@ static int x509_name_ex_d2i(ASN1_VALUE * int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; + if (len > X509_NAME_MAX) { + ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); + return 0; + } q = p; /* Get internal representation of Name */ Modified: stable/10/crypto/openssl/crypto/asn1/x_x509.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/asn1/x_x509.c Tue May 3 18:54:20 2016 (r298999) @@ -201,9 +201,19 @@ X509 *d2i_X509_AUX(X509 **a, const unsig int i2d_X509_AUX(X509 *a, unsigned char **pp) { - int length; + int length, tmplen; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); - if (a) - length += i2d_X509_CERT_AUX(a->aux, pp); + if (length < 0 || a == NULL) + return length; + + tmplen = i2d_X509_CERT_AUX(a->aux, pp); + if (tmplen < 0) { + if (start != NULL) + *pp = start; + return tmplen; + } + length += tmplen; + return length; } Modified: stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86-mont.pl Tue May 3 18:54:20 2016 (r298999) @@ -85,6 +85,21 @@ $frame=32; # size of above frame roun &and ("esp",-64); # align to cache line + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + &mov ("eax","ebp"); + &sub ("eax","esp"); + &and ("eax",-4096); +&set_label("page_walk"); + &mov ("edx",&DWP(0,"esp","eax")); + &sub ("eax",4096); + &data_byte(0x2e); + &jnc (&label("page_walk")); + ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap Modified: stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Tue May 3 18:54:20 2016 (r298999) @@ -91,6 +91,20 @@ bn_mul_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x66,0x2e # predict non-taken + jnc .Lmul_page_walk + mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -296,6 +310,14 @@ bn_mul4x_mont: mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%r11 + and \$-4096,%r11 +.Lmul4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -707,6 +729,7 @@ $code.=<<___; .align 16 bn_sqr4x_mont: .Lsqr4x_enter: + mov %rsp,%rax push %rbx push %rbp push %r12 @@ -715,12 +738,23 @@ bn_sqr4x_mont: push %r15 shl \$3,${num}d # convert $num to bytes - xor %r10,%r10 mov %rsp,%r11 # put aside %rsp - sub $num,%r10 # -$num + neg $num # -$num mov ($n0),$n0 # *n0 - lea -72(%rsp,%r10,2),%rsp # alloca(frame+2*$num) + lea -72(%rsp,$num,2),%rsp # alloca(frame+2*$num) and \$-1024,%rsp # minimize TLB usage + + sub %rsp,%r11 + and \$-4096,%r11 +.Lsqr4x_page_walk: + mov (%rsp,%r11),%r10 + sub \$4096,%r11 + .byte 0x2e # predict non-taken + jnc .Lsqr4x_page_walk + + mov $num,%r10 + neg $num # restore $num + lea -48(%rax),%r11 # restore saved %rsp ############################################################## # Stack layout # Modified: stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Tue May 3 18:54:20 2016 (r298999) @@ -84,6 +84,20 @@ bn_mul_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: + # Some OSes, *cough*-dows, insist on stack being "wired" to + # physical memory in strictly sequential manner, i.e. if stack + # allocation spans two pages, then reference to farmost one can + # be punishable by SEGV. But page walking can do good even on + # other OSes, because it guarantees that villain thread hits + # the guard page before it can make damage to innocent one... + sub %rsp,%rax + and \$-4096,%rax +.Lmul_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul_page_walk + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; @@ -407,6 +421,14 @@ bn_mul4x_mont_gather5: mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul4x_body: + sub %rsp,%rax + and \$-4096,%rax +.Lmul4x_page_walk: + mov (%rsp,%rax),%r11 + sub \$4096,%rax + .byte 0x2e # predict non-taken + jnc .Lmul4x_page_walk + mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp lea 128(%rdx),%r12 # reassign $bp (+size optimization) ___ Modified: stable/10/crypto/openssl/crypto/comp/comp.h ============================================================================== --- stable/10/crypto/openssl/crypto/comp/comp.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/comp/comp.h Tue May 3 18:54:20 2016 (r298999) @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif Modified: stable/10/crypto/openssl/crypto/evp/Makefile ============================================================================== --- stable/10/crypto/openssl/crypto/evp/Makefile Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/Makefile Tue May 3 18:54:20 2016 (r298999) @@ -199,8 +199,8 @@ e_aes.o: ../../include/openssl/opensslv. e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h +e_aes_cbc_hmac_sha1.o: ../../e_os.h ../../include/openssl/aes.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h @@ -212,8 +212,8 @@ e_aes_cbc_hmac_sha1.o: ../../include/ope e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h -e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h e_aes_cbc_hmac_sha1.c -e_aes_cbc_hmac_sha1.o: evp_locl.h +e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +e_aes_cbc_hmac_sha1.o: e_aes_cbc_hmac_sha1.c evp_locl.h e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h Modified: stable/10/crypto/openssl/crypto/evp/digest.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/digest.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/digest.c Tue May 3 18:54:20 2016 (r298999) @@ -200,8 +200,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; Modified: stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Tue May 3 18:54:20 2016 (r298999) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: stable/10/crypto/openssl/crypto/evp/encode.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/encode.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/encode.c Tue May 3 18:54:20 2016 (r298999) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -151,13 +152,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -174,7 +175,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -183,6 +184,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: stable/10/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/evp_enc.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/evp/evp_enc.c Tue May 3 18:54:20 2016 (r298999) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: stable/10/crypto/openssl/crypto/opensslv.h ============================================================================== --- stable/10/crypto/openssl/crypto/opensslv.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/opensslv.h Tue May 3 18:54:20 2016 (r298999) @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000113fL +# define OPENSSL_VERSION_NUMBER 0x1000114fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s-fips 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t-fips 3 May 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1s-freebsd 1 Mar 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1t-freebsd 3 May 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: stable/10/crypto/openssl/crypto/pem/pem_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/pem/pem_lib.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/pem/pem_lib.c Tue May 3 18:54:20 2016 (r298999) @@ -344,7 +344,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, if (enc != NULL) { objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL) { + if (objstr == NULL || EVP_CIPHER_iv_length(enc) == 0) { PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, PEM_R_UNSUPPORTED_CIPHER); goto err; } Modified: stable/10/crypto/openssl/crypto/pem/pvkfmt.c ============================================================================== --- stable/10/crypto/openssl/crypto/pem/pvkfmt.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/pem/pvkfmt.c Tue May 3 18:54:20 2016 (r298999) @@ -131,6 +131,10 @@ static int read_lebn(const unsigned char # define MS_PVKMAGIC 0xb0b5f11eL /* Salt length for PVK files */ # define PVK_SALTLEN 0x10 +/* Maximum length in PVK header */ +# define PVK_MAX_KEYLEN 102400 +/* Maximum salt length */ +# define PVK_MAX_SALTLEN 10240 static EVP_PKEY *b2i_rsa(const unsigned char **in, unsigned int length, unsigned int bitlen, int ispub); @@ -644,6 +648,9 @@ static int do_PVK_header(const unsigned *psaltlen = read_ledword(&p); *pkeylen = read_ledword(&p); + if (*pkeylen > PVK_MAX_KEYLEN || *psaltlen > PVK_MAX_SALTLEN) + return 0; + if (is_encrypted && !*psaltlen) { PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_INCONSISTENT_HEADER); return 0; Modified: stable/10/crypto/openssl/crypto/x509/x509.h ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509.h Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509.h Tue May 3 18:54:20 2016 (r298999) @@ -1281,6 +1281,7 @@ void ERR_load_X509_strings(void); # define X509_R_LOADING_CERT_DIR 103 # define X509_R_LOADING_DEFAULTS 104 # define X509_R_METHOD_NOT_SUPPORTED 124 +# define X509_R_NAME_TOO_LONG 134 # define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 # define X509_R_PUBLIC_KEY_DECODE_ERROR 125 # define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 Modified: stable/10/crypto/openssl/crypto/x509/x509_err.c ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509_err.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509_err.c Tue May 3 18:54:20 2016 (r298999) @@ -145,6 +145,7 @@ static ERR_STRING_DATA X509_str_reasons[ {ERR_REASON(X509_R_LOADING_CERT_DIR), "loading cert dir"}, {ERR_REASON(X509_R_LOADING_DEFAULTS), "loading defaults"}, {ERR_REASON(X509_R_METHOD_NOT_SUPPORTED), "method not supported"}, + {ERR_REASON(X509_R_NAME_TOO_LONG), "name too long"}, {ERR_REASON(X509_R_NO_CERT_SET_FOR_US_TO_VERIFY), "no cert set for us to verify"}, {ERR_REASON(X509_R_PUBLIC_KEY_DECODE_ERROR), "public key decode error"}, Modified: stable/10/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- stable/10/crypto/openssl/crypto/x509/x509_obj.c Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/crypto/x509/x509_obj.c Tue May 3 18:54:20 2016 (r298999) @@ -63,6 +63,13 @@ #include #include +/* + * Limit to ensure we don't overflow: much greater than + * anything enountered in practice. + */ + +#define NAME_ONELINE_MAX (1024 * 1024) + char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; @@ -86,6 +93,8 @@ char *X509_NAME_oneline(X509_NAME *a, ch goto err; b->data[0] = '\0'; len = 200; + } else if (len == 0) { + return NULL; } if (a == NULL) { if (b) { @@ -110,6 +119,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch type = ne->value->type; num = ne->value->length; + if (num > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || @@ -117,8 +130,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif @@ -154,6 +168,10 @@ char *X509_NAME_oneline(X509_NAME *a, ch lold = l; l += 1 + l1 + 1 + l2; + if (l > NAME_ONELINE_MAX) { + X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); + goto end; + } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; @@ -206,7 +224,7 @@ char *X509_NAME_oneline(X509_NAME *a, ch return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); - if (b != NULL) - BUF_MEM_free(b); + end: + BUF_MEM_free(b); return (NULL); } Modified: stable/10/crypto/openssl/doc/apps/ciphers.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/ciphers.pod Tue May 3 18:50:10 2016 (r298998) +++ stable/10/crypto/openssl/doc/apps/ciphers.pod Tue May 3 18:54:20 2016 (r298999) @@ -107,7 +107,7 @@ The following is a list of all permitted The default cipher list. This is determined at compile time and is normally -B. +B. When used, this must be the first cipherstring specified. =item B Copied: stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod (from r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/crypto/openssl/doc/crypto/EVP_EncodeInit.pod Tue May 3 18:54:20 2016 (r298999, copy of r298993, vendor-crypto/openssl/dist-1.0.1/doc/crypto/EVP_EncodeInit.pod) @@ -0,0 +1,127 @@ +=pod + +=head1 NAME + +EVP_EncodeInit, EVP_EncodeUpdate, EVP_EncodeFinal, EVP_EncodeBlock, +EVP_DecodeInit, EVP_DecodeUpdate, EVP_DecodeFinal, EVP_DecodeBlock - EVP base 64 +encode/decode routines + +=head1 SYNOPSIS + + #include + + void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); + void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); + int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + + void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); + int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); + int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned + char *out, int *outl); + int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +=head1 DESCRIPTION + +The EVP encode routines provide a high level interface to base 64 encoding and +decoding. Base 64 encoding converts binary data into a printable form that uses +the characters A-Z, a-z, 0-9, "+" and "/" to represent the data. For every 3 +bytes of binary data provided 4 bytes of base 64 encoded data will be produced +plus some occasional newlines (see below). If the input data length is not a +multiple of 3 then the output data will be padded at the end using the "=" +character. + +Encoding of binary data is performed in blocks of 48 input bytes (or less for +the final block). For each 48 byte input block encoded 64 bytes of base 64 data +is output plus an additional newline character (i.e. 65 bytes in total). The +final block (which may be less than 48 bytes) will output 4 bytes for every 3 +bytes of input. If the data length is not divisible by 3 then a full 4 bytes is +still output for the final 1 or 2 bytes of input. Similarly a newline character +will also be output. + +EVP_EncodeInit() initialises B for the start of a new encoding operation. + +EVP_EncodeUpdate() encode B bytes of data found in the buffer pointed to by +B. The output is stored in the buffer B and the number of bytes output +is stored in B<*outl>. It is the caller's responsibility to ensure that the +buffer at B is sufficiently large to accommodate the output data. Only full +blocks of data (48 bytes) will be immediately processed and output by this +function. Any remainder is held in the B object and will be processed by a +subsequent call to EVP_EncodeUpdate() or EVP_EncodeFinal(). To calculate the +required size of the output buffer add together the value of B with the +amount of unprocessed data held in B and divide the result by 48 (ignore +any remainder). This gives the number of blocks of data that will be processed. +Ensure the output buffer contains 65 bytes of storage for each block, plus an +additional byte for a NUL terminator. EVP_EncodeUpdate() may be called +repeatedly to process large amounts of input data. In the event of an error +EVP_EncodeUpdate() will set B<*outl> to 0. + +EVP_EncodeFinal() must be called at the end of an encoding operation. It will +process any partial block of data remaining in the B object. The output +data will be stored in B and the length of the data written will be stored +in B<*outl>. It is the caller's responsibility to ensure that B is +sufficiently large to accommodate the output data which will never be more than +65 bytes plus an additional NUL terminator (i.e. 66 bytes in total). + +EVP_EncodeBlock() encodes a full block of input data in B and of length +B and stores it in B. For every 3 bytes of input provided 4 bytes of +output data will be produced. If B is not divisible by 3 then the block is +encoded as a final block of data and the output is padded such that it is always +divisible by 4. Additionally a NUL terminator character will be added. For +example if 16 bytes of input data is provided then 24 bytes of encoded data is +created plus 1 byte for a NUL terminator (i.e. 25 bytes in total). The length of +the data generated I the NUL terminator is returned from the function. + +EVP_DecodeInit() initialises B for the start of a new decoding operation. + +EVP_DecodeUpdate() decodes B characters of data found in the buffer pointed +to by B. The output is stored in the buffer B and the number of bytes +output is stored in B<*outl>. It is the caller's responsibility to ensure that +the buffer at B is sufficiently large to accommodate the output data. This +function will attempt to decode as much data as possible in 4 byte chunks. Any +whitespace, newline or carriage return characters are ignored. Any partial chunk +of unprocessed data (1, 2 or 3 bytes) that remains at the end will be held in +the B object and processed by a subsequent call to EVP_DecodeUpdate(). If +any illegal base 64 characters are encountered or if the base 64 padding +character "=" is encountered in the middle of the data then the function returns +-1 to indicate an error. A return value of 0 or 1 indicates successful +processing of the data. A return value of 0 additionally indicates that the last +input data characters processed included the base 64 padding character "=" and +therefore no more non-padding character data is expected to be processed. For +every 4 valid base 64 bytes processed (ignoring whitespace, carriage returns and +line feeds), 3 bytes of binary output data will be produced (or less at the end +of the data where the padding character "=" has been used). + +EVP_DecodeFinal() must be called at the end of a decoding operation. If there +is any unprocessed data still in B then the input data must not have been +a multiple of 4 and therefore an error has occurred. The function will return -1 +in this case. Otherwise the function returns 1 on success. + +EVP_DecodeBlock() will decode the block of B characters of base 64 data +contained in B and store the result in B. Any leading whitespace will be +trimmed as will any trailing whitespace, newlines, carriage returns or EOF +characters. After such trimming the length of the data in B must be divisbile +by 4. For every 4 input bytes exactly 3 output bytes will be produced. The +output will be padded with 0 bits if necessary to ensure that the output is +always 3 bytes for every 4 input bytes. This function will return the length of +the data decoded or -1 on error. + +=head1 RETURN VALUES + +EVP_EncodeBlock() returns the number of bytes encoded excluding the NUL +terminator. + +EVP_DecodeUpdate() returns -1 on error and 0 or 1 on success. If 0 is returned *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 3 19:00:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AD2B2C46B for ; Tue, 3 May 2016 19:00:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 227311ED2 for ; Tue, 3 May 2016 19:00:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22d.google.com with SMTP id a17so55990908wme.0 for ; Tue, 03 May 2016 12:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=+hdFUyDloUKzsRfJeaIQmWKMt12y5ujeO4ANZx4vygQ=; b=ECFWE9FtCQJ7oCouupiP2W5LQgCS+nq38Rh+qN7X4C8vgQm+Xjy0LNcT17F1aGGDXj JOEIJu4EpIsnFnaEiuOIYd7R4CrOjYmdYHojuIJNH/v3yRue9JghPXCG6bkfC3mr0spZ NGUDIqT1jGzGn3Rq+TeDdSg6A3hllB9ZuS3A0HmliCsD2ySwJtxoST96LDUHLe9cuCIK P7vtvncH2Zpxk4zIbVQ3tBXcoxQP0s+Ucc3IeIVakRgNNpl6JsmDaAVmCX84yTCKh4Sb uUFS0FGUpHA2UtOsWHCvMrpygKClyc4HOMzMjpd0og5Olb36FWNwZuNjFQGwPgotNgKe XarA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=+hdFUyDloUKzsRfJeaIQmWKMt12y5ujeO4ANZx4vygQ=; b=JZk3a1fHhYUwxLWf+dTyIWVRQsLcVl7mVHjnC/pV+CsalPoQKCWqTJDwEDIpzf0p3A HjjoKOeVod3a8zz2gW8KJ7Obk299qa2n7NssRCNZEVbXCy1ef0EJZ5+tJy7j/pXBtU5j WH1PX2WDLh2tV6GulQ+qfhzyvqb+ha08dxeokScdZB+8umVpaO2scjxEelez8OeoEfTq oSL8Onow34Xu34vdNHlkOEdjI0RcZQMXqRw58voLzNAhSIHcUwlIS+3oWsbSM0FCVmPC 09nR6/CLZeXSELwgLfutYF1YrNFrZVQJaUyEKuV0QWxcINhM8vUkp6j8wREo/bhNlU5G hUZw== X-Gm-Message-State: AOPr4FXPC2ARbDziE/bE4deAXQdDfO781qmjo93qXTrfQrqpNjNZ1hqhSyW2TrQ0KUi+1WVldV/7YWY/zObyOkJC MIME-Version: 1.0 X-Received: by 10.194.184.38 with SMTP id er6mr4354106wjc.93.1462302010314; Tue, 03 May 2016 12:00:10 -0700 (PDT) Received: by 10.194.30.35 with HTTP; Tue, 3 May 2016 12:00:10 -0700 (PDT) In-Reply-To: <201604262059.u3QKxLDl045059@repo.freebsd.org> References: <201604262059.u3QKxLDl045059@repo.freebsd.org> Date: Tue, 3 May 2016 21:00:10 +0200 Message-ID: Subject: Re: svn commit: r298665 - head/sys/dev/aacraid From: Oliver Pinter To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 19:00:12 -0000 On 4/26/16, Conrad E. Meyer wrote: > Author: cem > Date: Tue Apr 26 20:59:21 2016 > New Revision: 298665 > URL: https://svnweb.freebsd.org/changeset/base/298665 > > Log: > aacraid(4): Fix some mostly trivial buffer overruns > > strcpy(3) emits a trailing nul byte, trampling fields after the intended > destination. Instead, use strncpy(3), intentionally leaving these fields > not nul-terminated. > > Reported by: Coverity > CIDs: 1031024, 1305463, 1305494, 1305545 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/aacraid/aacraid_cam.c > > Modified: head/sys/dev/aacraid/aacraid_cam.c > ============================================================================== > --- head/sys/dev/aacraid/aacraid_cam.c Tue Apr 26 20:36:32 2016 (r298664) > +++ head/sys/dev/aacraid/aacraid_cam.c Tue Apr 26 20:59:21 2016 (r298665) > @@ -568,9 +568,11 @@ aac_container_special_command(struct cam > p->additional_length = 31; > p->flags = SID_WBus16|SID_Sync|SID_CmdQue; > /* OEM Vendor defines */ > - strcpy(p->vendor,"Adaptec "); > - strcpy(p->product,"Array "); > - strcpy(p->revision,"V1.0"); > + strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); > + strncpy(p->product, "Array ", > + sizeof(p->product)); > + strncpy(p->revision, "V1.0", > + sizeof(p->revision)); strlcpy instead or adjust the p->vendors size? New defect(s) Reported-by: Coverity Scan Showing 4 of 4 defect(s) ** CID 125792: (BUFFER_SIZE) /sys/dev/aacraid/aacraid_cam.c: 574 in aac_container_special_command() /sys/dev/aacraid/aacraid_cam.c: 576 in aac_container_special_command() /sys/dev/aacraid/aacraid_cam.c: 573 in aac_container_special_command() ________________________________________________________________________________________________________ *** CID 125792: (BUFFER_SIZE) /sys/dev/aacraid/aacraid_cam.c: 574 in aac_container_special_command() 568 p->response_format = 2; 569 if (ccb->csio.dxfer_len >= 36) { 570 p->additional_length = 31; 571 p->flags = SID_WBus16|SID_Sync|SID_CmdQue; 572 /* OEM Vendor defines */ 573 strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); >>> CID 125792: (BUFFER_SIZE) >>> Calling strncpy with a source string whose length (16 chars) is greater than or equal to the size argument (16) will fail to null-terminate "p->product". 574 strncpy(p->product, "Array ", 575 sizeof(p->product)); 576 strncpy(p->revision, "V1.0", 577 sizeof(p->revision)); 578 } 579 } else { /sys/dev/aacraid/aacraid_cam.c: 576 in aac_container_special_command() 570 p->additional_length = 31; 571 p->flags = SID_WBus16|SID_Sync|SID_CmdQue; 572 /* OEM Vendor defines */ 573 strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); 574 strncpy(p->product, "Array ", 575 sizeof(p->product)); >>> CID 125792: (BUFFER_SIZE) >>> Calling strncpy with a source string whose length (4 chars) is greater than or equal to the size argument (4) will fail to null-terminate "p->revision". 576 strncpy(p->revision, "V1.0", 577 sizeof(p->revision)); 578 } 579 } else { 580 if (inq->page_code == SVPD_SUPPORTED_PAGE_LIST) { 581 struct scsi_vpd_supported_page_list *p = /sys/dev/aacraid/aacraid_cam.c: 573 in aac_container_special_command() 567 p->version = SCSI_REV_SPC2; 568 p->response_format = 2; 569 if (ccb->csio.dxfer_len >= 36) { 570 p->additional_length = 31; 571 p->flags = SID_WBus16|SID_Sync|SID_CmdQue; 572 /* OEM Vendor defines */ >>> CID 125792: (BUFFER_SIZE) >>> Calling strncpy with a source string whose length (8 chars) is greater than or equal to the size argument (8) will fail to null-terminate "p->vendor". 573 strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); 574 strncpy(p->product, "Array ", 575 sizeof(p->product)); 576 strncpy(p->revision, "V1.0", 577 sizeof(p->revision)); 578 } > } > } else { > if (inq->page_code == SVPD_SUPPORTED_PAGE_LIST) { > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Tue May 3 19:37:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B55B2CD65; Tue, 3 May 2016 19:37:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840BE170F; Tue, 3 May 2016 19:37:26 +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 u43JbPL6058737; Tue, 3 May 2016 19:37:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43JbPDf058736; Tue, 3 May 2016 19:37:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605031937.u43JbPDf058736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 May 2016 19:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299000 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 19:37:26 -0000 Author: jhb Date: Tue May 3 19:37:25 2016 New Revision: 299000 URL: https://svnweb.freebsd.org/changeset/base/299000 Log: Use the correct location of the SRIOV capability when enabling ARI. While here, check if ARI was enabled by re-reading the config register after writing it and return an error if the write fails. Reviewed by: rstone, vangyzen Modified: head/sys/dev/pci/pci_iov.c Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Tue May 3 18:54:20 2016 (r298999) +++ head/sys/dev/pci/pci_iov.c Tue May 3 19:37:25 2016 (r299000) @@ -442,6 +442,7 @@ pci_iov_set_ari(device_t bus) } } } + free(devlist, M_TEMP); /* * If we called this function some device must have the SR-IOV @@ -451,10 +452,14 @@ pci_iov_set_ari(device_t bus) ("Could not find child of %s with SR-IOV capability", device_get_nameunit(bus))); - iov_ctl = pci_read_config(lowest, iov_pos + PCIR_SRIOV_CTL, 2); + iov_ctl = pci_read_config(lowest, lowest_pos + PCIR_SRIOV_CTL, 2); iov_ctl |= PCIM_SRIOV_ARI_EN; - pci_write_config(lowest, iov_pos + PCIR_SRIOV_CTL, iov_ctl, 2); - free(devlist, M_TEMP); + pci_write_config(lowest, lowest_pos + PCIR_SRIOV_CTL, iov_ctl, 2); + if ((pci_read_config(lowest, lowest_pos + PCIR_SRIOV_CTL, 2) & + PCIM_SRIOV_ARI_EN) == 0) { + device_printf(lowest, "failed to enable ARI\n"); + return (ENXIO); + } return (0); } From owner-svn-src-all@freebsd.org Tue May 3 19:43:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10767B2C06B; Tue, 3 May 2016 19:43:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1A011F0B; Tue, 3 May 2016 19:42:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43Jgwm6061711; Tue, 3 May 2016 19:42:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43Jgw5n061710; Tue, 3 May 2016 19:42:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605031942.u43Jgw5n061710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 19:42: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: r299001 - stable/10/sys/cddl/dev/sdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 19:43:00 -0000 Author: markj Date: Tue May 3 19:42:58 2016 New Revision: 299001 URL: https://svnweb.freebsd.org/changeset/base/299001 Log: MFC r297771: Initialize SDT probes during SI_SUB_DTRACE_PROVIDER. Modified: stable/10/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/10/sys/cddl/dev/sdt/sdt.c Tue May 3 19:37:25 2016 (r299000) +++ stable/10/sys/cddl/dev/sdt/sdt.c Tue May 3 19:42:58 2016 (r299001) @@ -381,28 +381,20 @@ sdt_unload() static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; switch (type) { case MOD_LOAD: - sdt_load(); - break; - case MOD_UNLOAD: - error = sdt_unload(); - break; - case MOD_SHUTDOWN: - break; - + return (0); default: - error = EOPNOTSUPP; - break; + return (EOPNOTSUPP); } - - return (error); } +SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); +SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); + DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); From owner-svn-src-all@freebsd.org Tue May 3 19:45:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E8A2B2C109; Tue, 3 May 2016 19:45:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2C4010D2; Tue, 3 May 2016 19:45:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43JjPnb061874; Tue, 3 May 2016 19:45:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43JjODt061871; Tue, 3 May 2016 19:45:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605031945.u43JjODt061871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 3 May 2016 19:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299002 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 19:45:26 -0000 Author: jhb Date: Tue May 3 19:45:24 2016 New Revision: 299002 URL: https://svnweb.freebsd.org/changeset/base/299002 Log: Save and restore SRIOV-related config registers. Save the value of the IOV control and page size registers and restore them (along with the VF count) in pci_cfg_save/pci_cfg_restore. This ensures ARI remains enabled if a PF driver resets itself during the PCI_IOV_INIT callback. This might also properly restore SRIOV state across suspend/resume. Reviewed by: rstone, vangyzen Differential Revision: https://reviews.freebsd.org/D6192 Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_private.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue May 3 19:42:58 2016 (r299001) +++ head/sys/dev/pci/pci.c Tue May 3 19:45:24 2016 (r299002) @@ -5643,6 +5643,10 @@ pci_cfg_restore(device_t dev, struct pci pci_resume_msi(dev); if (dinfo->cfg.msix.msix_location != 0) pci_resume_msix(dev); + + if (dinfo->cfg.iov != NULL) + pci_iov_cfg_restore(dev, dinfo); + } static void @@ -5755,6 +5759,9 @@ pci_cfg_save(device_t dev, struct pci_de if (dinfo->cfg.pcix.pcix_location != 0) pci_cfg_save_pcix(dev, dinfo); + if (dinfo->cfg.iov != NULL) + pci_iov_cfg_save(dev, dinfo); + /* * don't set the state for display devices, base peripherals and * memory devices since bad things happen when they are powered down. Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Tue May 3 19:42:58 2016 (r299001) +++ head/sys/dev/pci/pci_iov.c Tue May 3 19:45:24 2016 (r299002) @@ -770,6 +770,29 @@ out: return (error); } +void +pci_iov_cfg_restore(device_t dev, struct pci_devinfo *dinfo) +{ + struct pcicfg_iov *iov; + + iov = dinfo->cfg.iov; + + IOV_WRITE(dinfo, PCIR_SRIOV_PAGE_SIZE, iov->iov_page_size, 4); + IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, iov->iov_num_vfs, 2); + IOV_WRITE(dinfo, PCIR_SRIOV_CTL, iov->iov_ctl, 2); +} + +void +pci_iov_cfg_save(device_t dev, struct pci_devinfo *dinfo) +{ + struct pcicfg_iov *iov; + + iov = dinfo->cfg.iov; + + iov->iov_page_size = IOV_READ(dinfo, PCIR_SRIOV_PAGE_SIZE, 4); + iov->iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2); +} + /* Return true if child is a VF of the given PF. */ static int pci_iov_is_child_vf(struct pcicfg_iov *pf, device_t child) Modified: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- head/sys/dev/pci/pci_iov_private.h Tue May 3 19:42:58 2016 (r299001) +++ head/sys/dev/pci/pci_iov_private.h Tue May 3 19:45:24 2016 (r299002) @@ -47,10 +47,16 @@ struct pcicfg_iov { int iov_pos; int iov_num_vfs; uint32_t iov_flags; + + uint16_t iov_ctl; + uint32_t iov_page_size; }; #define IOV_RMAN_INITED 0x0001 #define IOV_BUSY 0x0002 +void pci_iov_cfg_restore(device_t dev, struct pci_devinfo *dinfo); +void pci_iov_cfg_save(device_t dev, struct pci_devinfo *dinfo); + #endif From owner-svn-src-all@freebsd.org Tue May 3 20:05:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F4CAB2C665; Tue, 3 May 2016 20:05:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) (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 506E51137; Tue, 3 May 2016 20:05:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f49.google.com with SMTP id v145so40515358oie.0; Tue, 03 May 2016 13:05:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=lu8sunQfc7hBRVREYRk81LmrmwTF+/t6h38nkCLJKGo=; b=L1nw0yuLD1AbDvWs6HC9XRUKuZX2uWYpNCvEVR8vCIf6KGe27td8T440pEHm256N0V oG6YJ5bSn/9yupxGEuM/4xWbNsBKl7p88dT2nfdY/h0+oIH9MuX5rtjNy49AMHJItLiW /l7bm6C3SDL06f8U5ehIiF8d8XsaAsXdj8spvnB/WCtU/zaHXiFoJ0qbjGImKdSqJunN UXAZW3pTjwpbPoZoR6m3Y9KvOg3WxLTCrAt0fsNiMfzHll06OKZYu7qmbgdUkiVvX6Ov amQKmMNhj45U4vpqY3h51LrvRN8eHWrYXoFgcZohIfft2g2vT28w+t+HV8qDSi3jNU8y hcrQ== X-Gm-Message-State: AOPr4FXNdDIW9jQtbIAQNekB3k8JS0FcQ105gclWFLdy37eIIIQ/F66+VW1xIoQLhfZ/bg== X-Received: by 10.202.241.87 with SMTP id p84mr2375352oih.48.1462304645265; Tue, 03 May 2016 12:44:05 -0700 (PDT) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id a34sm23116otb.1.2016.05.03.12.44.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 12:44:05 -0700 (PDT) Received: by mail-oi0-f51.google.com with SMTP id v145so39805201oie.0; Tue, 03 May 2016 12:44:04 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.86.79 with SMTP id k76mr2322607oib.22.1462304644667; Tue, 03 May 2016 12:44:04 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 3 May 2016 12:44:04 -0700 (PDT) In-Reply-To: References: <201604262059.u3QKxLDl045059@repo.freebsd.org> Date: Tue, 3 May 2016 12:44:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298665 - head/sys/dev/aacraid From: Conrad Meyer To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 20:05:48 -0000 On Tue, May 3, 2016 at 12:00 PM, Oliver Pinter wrote: > strlcpy instead or adjust the p->vendors size? Neither. The buffer is intentionally not nul-terminated. The coverity reports are false positives. Conrad From owner-svn-src-all@freebsd.org Tue May 3 20:08:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7A61B2C738; Tue, 3 May 2016 20:08:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755401313; Tue, 3 May 2016 20:08:06 +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 u43K85KH067827; Tue, 3 May 2016 20:08:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43K85Fp067823; Tue, 3 May 2016 20:08:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605032008.u43K85Fp067823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 20:08: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: r299003 - in stable/10/sys/cddl/contrib/opensolaris/uts: common/dtrace common/sys intel/dtrace powerpc/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 20:08:06 -0000 Author: markj Date: Tue May 3 20:08:05 2016 New Revision: 299003 URL: https://svnweb.freebsd.org/changeset/base/299003 Log: MFC r296479: Fix fasttrap tracepoint locking. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue May 3 20:08:05 2016 (r299003) @@ -63,14 +63,16 @@ #ifndef illumos #include #include +#include #include #include #include + #include #include #include #include -#include + #include #endif @@ -225,7 +227,7 @@ static void fasttrap_thread_dtor(void *, #define FASTTRAP_PROCS_INDEX(pid) ((pid) & fasttrap_procs.fth_mask) #ifndef illumos -static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +struct rmlock fasttrap_tp_lock; static eventhandler_tag fasttrap_thread_dtor_tag; #endif @@ -440,10 +442,15 @@ fasttrap_mod_barrier(uint64_t gen) fasttrap_mod_gen++; +#ifdef illumos CPU_FOREACH(i) { mutex_enter(&fasttrap_cpuc_pid_lock[i]); mutex_exit(&fasttrap_cpuc_pid_lock[i]); } +#else + rm_wlock(&fasttrap_tp_lock); + rm_wunlock(&fasttrap_tp_lock); +#endif } /* @@ -2565,10 +2572,7 @@ fasttrap_load(void) mutex_init(&fasttrap_procs.fth_table[i].ftb_mtx, "processes bucket mtx", MUTEX_DEFAULT, NULL); - CPU_FOREACH(i) { - mutex_init(&fasttrap_cpuc_pid_lock[i], "fasttrap barrier", - MUTEX_DEFAULT, NULL); - } + rm_init(&fasttrap_tp_lock, "fasttrap tracepoint"); /* * This event handler must run before kdtrace_thread_dtor() since it @@ -2701,9 +2705,7 @@ fasttrap_unload(void) #ifndef illumos destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); - CPU_FOREACH(i) { - mutex_destroy(&fasttrap_cpuc_pid_lock[i]); - } + rm_destroy(&fasttrap_tp_lock); #endif return (0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue May 3 20:08:05 2016 (r299003) @@ -206,6 +206,10 @@ extern fasttrap_scrspace_t *fasttrap_scr extern dtrace_id_t fasttrap_probe_id; extern fasttrap_hash_t fasttrap_tpoints; +#ifndef illumos +extern struct rmlock fasttrap_tp_lock; +#endif + #define FASTTRAP_TPOINTS_INDEX(pid, pc) \ (((pc) / sizeof (fasttrap_instr_t) + (pid)) & fasttrap_tpoints.fth_mask) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue May 3 20:08:05 2016 (r299003) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -749,11 +750,13 @@ fasttrap_return_common(struct reg *rp, u fasttrap_id_t *id; #ifdef illumos kmutex_t *pid_mtx; -#endif -#ifdef illumos pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#else + struct rm_priotracker tracker; + + rm_rlock(&fasttrap_tp_lock, &tracker); #endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -771,6 +774,8 @@ fasttrap_return_common(struct reg *rp, u if (tp == NULL) { #ifdef illumos mutex_exit(pid_mtx); +#else + rm_runlock(&fasttrap_tp_lock, &tracker); #endif return; } @@ -794,6 +799,8 @@ fasttrap_return_common(struct reg *rp, u #ifdef illumos mutex_exit(pid_mtx); +#else + rm_runlock(&fasttrap_tp_lock, &tracker); #endif } @@ -1002,6 +1009,7 @@ fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; #ifndef illumos + struct rm_priotracker tracker; proc_t *pp; #endif uintptr_t pc = rp->r_rip - 1; @@ -1061,8 +1069,7 @@ fasttrap_pid_probe(struct reg *rp) sx_sunlock(&proctree_lock); pp = NULL; - PROC_LOCK(p); - _PHOLD(p); + rm_rlock(&fasttrap_tp_lock, &tracker); #endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -1085,8 +1092,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef illumos mutex_exit(pid_mtx); #else - _PRELE(p); - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); #endif return (-1); } @@ -1212,7 +1218,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef illumos mutex_exit(pid_mtx); #else - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); #endif tp = &tp_local; @@ -1825,7 +1831,6 @@ done: #ifndef illumos PROC_LOCK(p); proc_write_regs(curthread, rp); - _PRELE(p); PROC_UNLOCK(p); #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Tue May 3 19:45:24 2016 (r299002) +++ stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Tue May 3 20:08:05 2016 (r299003) @@ -33,6 +33,7 @@ #include #include #include +#include #include #define OP(x) ((x) >> 26) @@ -302,10 +303,12 @@ static void fasttrap_return_common(struct reg *rp, uintptr_t pc, pid_t pid, uintptr_t new_pc) { + struct rm_priotracker tracker; fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; + rm_rlock(&fasttrap_tp_lock, &tracker); bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -320,6 +323,7 @@ fasttrap_return_common(struct reg *rp, u * is not essential to the correct execution of the process. */ if (tp == NULL) { + rm_runlock(&fasttrap_tp_lock, &tracker); return; } @@ -337,6 +341,7 @@ fasttrap_return_common(struct reg *rp, u pc - id->fti_probe->ftp_faddr, rp->fixreg[3], rp->fixreg[4], 0, 0); } + rm_runlock(&fasttrap_tp_lock, &tracker); } @@ -365,6 +370,7 @@ fasttrap_branch_taken(int bo, int bi, st int fasttrap_pid_probe(struct reg *rp) { + struct rm_priotracker tracker; proc_t *p = curproc; uintptr_t pc = rp->pc; uintptr_t new_pc = 0; @@ -395,8 +401,7 @@ fasttrap_pid_probe(struct reg *rp) curthread->t_dtrace_scrpc = 0; curthread->t_dtrace_astpc = 0; - - PROC_LOCK(p); + rm_rlock(&fasttrap_tp_lock, &tracker); pid = p->p_pid; bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -415,7 +420,7 @@ fasttrap_pid_probe(struct reg *rp) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); return (-1); } @@ -469,7 +474,7 @@ fasttrap_pid_probe(struct reg *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; - PROC_UNLOCK(p); + rm_runlock(&fasttrap_tp_lock, &tracker); tp = &tp_local; /* From owner-svn-src-all@freebsd.org Tue May 3 20:14:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E34AFB2C979; Tue, 3 May 2016 20:14:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B26591A86; Tue, 3 May 2016 20:14:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43KE4hq070659; Tue, 3 May 2016 20:14:04 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43KE4w0070658; Tue, 3 May 2016 20:14:04 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605032014.u43KE4w0070658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 3 May 2016 20:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299004 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 20:14:06 -0000 Author: vangyzen Date: Tue May 3 20:14:04 2016 New Revision: 299004 URL: https://svnweb.freebsd.org/changeset/base/299004 Log: Work around (ignore) broken SRAT tables Instead of panicking when parsing an invalid ACPI SRAT table, just ignore it, effectively disabling NUMA. https://lists.freebsd.org/pipermail/freebsd-current/2016-May/060984.html Reported and tested by: Bill O'Hanlon (bill.ohanlon at gmail.com) Reviewed by: jhb MFC after: 1 week Relnotes: If dmesg shows "SRAT: Duplicate local APIC ID", try updating your BIOS to fix NUMA support. Sponsored by: Dell Inc. Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Tue May 3 20:08:05 2016 (r299003) +++ head/sys/x86/acpica/srat.c Tue May 3 20:14:04 2016 (r299004) @@ -201,8 +201,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) break; - KASSERT(!cpus[cpu->ApicId].enabled, - ("Duplicate local APIC ID %u", cpu->ApicId)); + if (cpus[cpu->ApicId].enabled) { + printf("SRAT: Duplicate local APIC ID %u\n", + cpu->ApicId); + *(int *)arg = ENXIO; + break; + } cpus[cpu->ApicId].domain = domain; cpus[cpu->ApicId].enabled = 1; break; From owner-svn-src-all@freebsd.org Tue May 3 20:29:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F2CB2CD19 for ; Tue, 3 May 2016 20:29:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56560148D for ; Tue, 3 May 2016 20:29:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id f89so34662041ioi.0 for ; Tue, 03 May 2016 13:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=FEfc2Zfku7M3jxiqVVth1/5/NIRJXWkoI0IrJkkXUHY=; b=WWueuUyaZqza1wMTJKE7n39v9RXpFHqhBljoud79A1zyOQPvp7TqK4mJc04+mJcs2j 9mml+s0+k3Z1w8l1vn8+Vx/e3Y0Uvn0IXVX2bxfJPg4WKBzvLas+87yQFmU+VkxLwjYn tEIrmxKHJmohlwWuvOK4pyWCEwRw0iCXOPGYMUPYOUT8as6NeBgexMcEO4yaLa9IsDaq rvobx81xAoIEdb5yrouzs26NfeBUs5pq0A65pAZgQlIdzRnMO2Mb+FPJWLXZ3r7ZEuwf UrWXbQrBQBJKIPpxkpyi4DdXRpEiRQG0dq+WcYvGaJ5O7wbGjYtCJ0cx0OFN5Hqs0tyQ wBvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=FEfc2Zfku7M3jxiqVVth1/5/NIRJXWkoI0IrJkkXUHY=; b=cjqllA9MhZ7ZRIMQQxuyiMANpbYL+DK7yuNQvQmoR1s0WlAfcLwqkDUme25ONNgE6m BpUgYR4jgCwsQq3w2G8tzdqT7JGyP1wK9X0KCo9eRowWJupVVult9RrcCV9Ql8Tzf5WF x8WRk//qyY/+X05GHZ+yF4kr0MLSTgZBHPLWazc69TwMnHX2MTedpuhAatw2zx58vwzH 4/GTprKKmdFuHpWX7HvW6GTjJ5rcvsjguYJQGnXNZKZLJO85DLMGHJlT5HN6o+QgGim2 kfXrGvocWBlrFE4L0bxHsBO45OInr3emtfd38in7GlVIQ0NAOKxCtTK3hc3AoH9DCVvD gBng== X-Gm-Message-State: AOPr4FVmFfzOP+I215fM+bmbzpkCI9u3WMoLT6s0Wj3GJMY5VyHYULbwUQU4g6X21uBwiA== X-Received: by 10.107.134.195 with SMTP id q64mr5945583ioi.25.1462307354444; Tue, 03 May 2016 13:29:14 -0700 (PDT) Received: from mac-wired.nflx.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id i14sm98494iod.34.2016.05.03.13.29.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 May 2016 13:29:13 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r298665 - head/sys/dev/aacraid Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E1A310D5-E2E5-4A5C-BC80-4BEA56058EDA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: Date: Tue, 3 May 2016 14:29:09 -0600 Cc: Oliver Pinter , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201604262059.u3QKxLDl045059@repo.freebsd.org> To: cem@FreeBSD.org X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 20:29:15 -0000 --Apple-Mail=_E1A310D5-E2E5-4A5C-BC80-4BEA56058EDA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 3, 2016, at 1:44 PM, Conrad Meyer wrote: >=20 > On Tue, May 3, 2016 at 12:00 PM, Oliver Pinter > wrote: >> strlcpy instead or adjust the p->vendors size? >=20 > Neither. The buffer is intentionally not nul-terminated. The > coverity reports are false positives. Then wouldn=E2=80=99t memcmp be better? Warner --Apple-Mail=_E1A310D5-E2E5-4A5C-BC80-4BEA56058EDA 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 iQIcBAEBCgAGBQJXKQoVAAoJEGwc0Sh9sBEAStgQAM8Gx4YYrJiIRBfXfgQdg+/T /gQGH5nQZ52BD8G9qdZ0qHL9yahhQ3kg+X5qJ3+9d+VXclhHiFRSF2/56h1OXxPL RiTsO1L3zt9yYcsyMtHeNXnLFty5HUIwmgPV1hkT+gmgCLFcrin98Qy+DwVvq+Fp NqB47EBFTGiXyht8KoEwWOJNcVAKPgzrrpyCupGjrTw86qZMbz+3n5MrVVjg3cRk a00vkcYA8gpk2IeF/bjXtyLRFMzwrq7NiO84WCxqyOkq1LjHBLX7InTJ6xYJCBK/ pJu2LFvblDG3nB025HGjScW+8d1zsjyMTnsRVbsa5ja7vVYMjOPleQFCVMsGav8f n9PWu+XKMsiNgszm/PjxQzQm9H6wx8QtxVB1V5L3/NZiSFBHZT1GOoaalLvW9KvU eH6EbnTomGgPsHVC7gdNeDwCI/qJo7U7iCwgLcbj+9tLulijayueWodGbm2zXyDn W1yStn7SMRR3lB3kY2FC1GnBqa/2vmsEfKxPr0HZATUnoVVv1bwOa2dGThmC9lQ3 ULCJz7s8n9ELMcgaeMIyVf9P79kCDqMC0Mp8MEPXvUMPL5XiMh5fVBc/wRIg8BI5 KEMEcnba9qgSlqlWJ7LGdc8sKYMj4aG9ca5VJnLLKBUw22kVFEz5TAIADeg+UPfw /Z8xFhCCx4rZVSqC4cgW =EMtG -----END PGP SIGNATURE----- --Apple-Mail=_E1A310D5-E2E5-4A5C-BC80-4BEA56058EDA-- From owner-svn-src-all@freebsd.org Tue May 3 21:27:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E3CB2CCB4; Tue, 3 May 2016 21:27:18 +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 296881A2B; Tue, 3 May 2016 21:27:18 +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 u43LRHt5092560; Tue, 3 May 2016 21:27:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43LRH0i092559; Tue, 3 May 2016 21:27:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605032127.u43LRH0i092559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 3 May 2016 21:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299005 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 21:27:18 -0000 Author: bapt Date: Tue May 3 21:27:17 2016 New Revision: 299005 URL: https://svnweb.freebsd.org/changeset/base/299005 Log: Print the fchmodat mode in human readable fashion MFC after: 1 week Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue May 3 20:14:04 2016 (r299004) +++ head/usr.bin/kdump/kdump.c Tue May 3 21:27:17 2016 (r299005) @@ -806,6 +806,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_chmod: case SYS_fchmod: case SYS_lchmod: + case SYS_fchmodat: print_number(ip, narg, c); putchar(','); modename(*ip); From owner-svn-src-all@freebsd.org Tue May 3 21:51:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C82B2C0E2; Tue, 3 May 2016 21:51:53 +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 A477C1655; Tue, 3 May 2016 21:51:53 +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 u43LpqTA001346; Tue, 3 May 2016 21:51:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43LpqAL001343; Tue, 3 May 2016 21:51:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032151.u43LpqAL001343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 21:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299006 - head/sys/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 21:51:53 -0000 Author: pfg Date: Tue May 3 21:51:52 2016 New Revision: 299006 URL: https://svnweb.freebsd.org/changeset/base/299006 Log: sys/isa: minor spelling fixes. No functional change. Modified: head/sys/isa/isa_common.h head/sys/isa/pnp.c head/sys/isa/pnpparse.c Modified: head/sys/isa/isa_common.h ============================================================================== --- head/sys/isa/isa_common.h Tue May 3 21:27:17 2016 (r299005) +++ head/sys/isa/isa_common.h Tue May 3 21:51:52 2016 (r299006) @@ -65,7 +65,7 @@ struct isa_device { #define DEVTOISA(dev) ((struct isa_device *) device_get_ivars(dev)) /* - * These functions are architecture dependant. + * These functions are architecture dependent. */ extern void isa_init(device_t dev); extern struct resource *isa_alloc_resource(device_t bus, device_t child, Modified: head/sys/isa/pnp.c ============================================================================== --- head/sys/isa/pnp.c Tue May 3 21:27:17 2016 (r299005) +++ head/sys/isa/pnp.c Tue May 3 21:51:52 2016 (r299006) @@ -450,7 +450,7 @@ pnp_create_devices(device_t parent, pnp_ if (dev) { /* * This is an optional device - * indentifier string. Skipt it + * identifier string. Skip it * for now. */ continue; Modified: head/sys/isa/pnpparse.c ============================================================================== --- head/sys/isa/pnpparse.c Tue May 3 21:27:17 2016 (r299005) +++ head/sys/isa/pnpparse.c Tue May 3 21:51:52 2016 (r299006) @@ -499,7 +499,7 @@ pnp_parse_resources(device_t dev, u_char /* * Back to the common part; clear it * as its contents has already been copied - * to each dependant. + * to each dependent. */ config = &configs[0]; bzero(config, sizeof(*config)); From owner-svn-src-all@freebsd.org Tue May 3 21:53:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4FDEB2C183; Tue, 3 May 2016 21:53:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F577199A; Tue, 3 May 2016 21:53:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u43LrmB5095390 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 May 2016 14:53:48 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u43LrmEO095389; Tue, 3 May 2016 14:53:48 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 May 2016 14:53:48 -0700 From: Gleb Smirnoff To: Conrad Meyer Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r297897 - in head/usr.bin: . resizewin Message-ID: <20160503215348.GC1369@FreeBSD.org> References: <201604130030.u3D0UggB007871@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 21:53:49 -0000 Conrad, On Tue, Apr 12, 2016 at 05:42:54PM -0700, Conrad Meyer wrote: C> On Tue, Apr 12, 2016 at 5:30 PM, Conrad E. Meyer wrote: C> > Author: cem C> > Date: Wed Apr 13 00:30:42 2016 C> > New Revision: 297897 C> > URL: https://svnweb.freebsd.org/changeset/base/297897 C> > C> > Log: C> > Add a small tool, resizewin(1), to query terminal for window size C> C> Whoops. The commit message should have included this blurb from the C> phabricator review: C> C> This tool is a smaller, less featured version of resize from the xterm port. C> C> It's very useful when accessing systems via serial console that C> don't run X (e.g. dev boxes). Are there any good reasons not to call it resize then? Those who have xterm installed would have it overriden with /usr/local/bin/resize. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue May 3 22:01:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E261B2C311; Tue, 3 May 2016 22:01:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B41E1E56; Tue, 3 May 2016 22:01:49 +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 u43M1mQ4004835; Tue, 3 May 2016 22:01:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43M1mN0004830; Tue, 3 May 2016 22:01:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032201.u43M1mN0004830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 22:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299007 - in head: . sys/conf sys/modules/igb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:01:49 -0000 Author: pfg Date: Tue May 3 22:01:48 2016 New Revision: 299007 URL: https://svnweb.freebsd.org/changeset/base/299007 Log: Misc. build: minor spelling fixes. No functional change. Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/UPDATING head/sys/conf/options head/sys/modules/igb/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 3 21:51:52 2016 (r299006) +++ head/Makefile.inc1 Tue May 3 22:01:48 2016 (r299007) @@ -923,7 +923,7 @@ distributeworld installworld stageworld: .for dist in base ${EXTRA_DISTRIBUTIONS} @# For each file that exists in this dist, print the corresponding @# line from the METALOG. This relies on the fact that - @# a line containing only the filename will sort immediatly before + @# a line containing only the filename will sort immediately before @# the relevant mtree line. cd ${DESTDIR}/${DISTDIR}; \ find ./${dist} | sort -u ${METALOG} - | \ @@ -933,7 +933,7 @@ distributeworld installworld stageworld: .for dist in ${DEBUG_DISTRIBUTIONS} @# For each file that exists in this dist, print the corresponding @# line from the METALOG. This relies on the fact that - @# a line containing only the filename will sort immediatly before + @# a line containing only the filename will sort immediately before @# the relevant mtree line. cd ${DESTDIR}/${DISTDIR}; \ find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \ Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue May 3 21:51:52 2016 (r299006) +++ head/ObsoleteFiles.inc Tue May 3 22:01:48 2016 (r299007) @@ -22,7 +22,7 @@ # grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ # sort | uniq -d # -# To find regular duplicates not dependant on optional components, you can +# To find regular duplicates not dependent on optional components, you can # also use something that will not give you false positives, e.g.: # for t in `make -V TARGETS universe`; do # __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ @@ -3773,7 +3773,7 @@ OLD_FILES+=usr/include/sys/_elf_solaris. OLD_FILES+=usr/share/man/man3/pmc_x86_get_msr.3.gz # 20071108: Removed very crunch OLDCARD support file OLD_FILES+=etc/defaults/pccard.conf -# 20071025: rc.d/nfslocking superceeded by rc.d/lockd and rc.d/statd +# 20071025: rc.d/nfslocking superseded by rc.d/lockd and rc.d/statd OLD_FILES+=etc/rc.d/nfslocking # 20070930: rename of cached to nscd OLD_FILES+=etc/cached.conf Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 3 21:51:52 2016 (r299006) +++ head/UPDATING Tue May 3 22:01:48 2016 (r299007) @@ -905,7 +905,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 WITH_ICONV has been split into two feature sets. WITH_ICONV now enables just the iconv* functionality and is now on by default. WITH_LIBICONV_COMPAT enables the libiconv api and link time - compatability. Set WITHOUT_ICONV to build the old way. + compatibility. Set WITHOUT_ICONV to build the old way. If you have been using WITH_ICONV before, you will very likely need to turn on WITH_LIBICONV_COMPAT. Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 3 21:51:52 2016 (r299006) +++ head/sys/conf/options Tue May 3 22:01:48 2016 (r299007) @@ -822,7 +822,7 @@ ATH_KTR_INTR_DEBUG opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h # XXX For now, this breaks non-AR9130 chipsets, so only use it -# XXX when actually targetting AR9130. +# XXX when actually targeting AR9130. AH_SUPPORT_AR9130 opt_ah.h # This is required for AR933x SoC support Modified: head/sys/modules/igb/Makefile ============================================================================== --- head/sys/modules/igb/Makefile Tue May 3 21:51:52 2016 (r299006) +++ head/sys/modules/igb/Makefile Tue May 3 22:01:48 2016 (r299007) @@ -17,7 +17,7 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 - # IGB_LEGACY_TX will override the stack if_transmit path and # instead use the older if_start non-multiqueue capable interface. -# This might be desireable for testing, or to enable the use of +# This might be desirable for testing, or to enable the use of # ALTQ. #CFLAGS += -DIGB_LEGACY_TX From owner-svn-src-all@freebsd.org Tue May 3 22:05:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F575B2C451; Tue, 3 May 2016 22:05:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F8F81154; Tue, 3 May 2016 22:05:04 +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 u43M53Qo004979; Tue, 3 May 2016 22:05:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43M53kh004978; Tue, 3 May 2016 22:05:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032205.u43M53kh004978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 22:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299008 - head/sys/kgssapi/krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:05:04 -0000 Author: pfg Date: Tue May 3 22:05:03 2016 New Revision: 299008 URL: https://svnweb.freebsd.org/changeset/base/299008 Log: kgssapi: insignificant spelling fix. No functional change. Modified: head/sys/kgssapi/krb5/krb5_mech.c Modified: head/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- head/sys/kgssapi/krb5/krb5_mech.c Tue May 3 22:01:48 2016 (r299007) +++ head/sys/kgssapi/krb5/krb5_mech.c Tue May 3 22:05:03 2016 (r299008) @@ -1339,7 +1339,7 @@ krb5_wrap_old(struct krb5_context *kc, i * SND_SEQ: * * Take the four bytes of the sequence number least - * significant first (most signficant first for ARCFOUR) + * significant first (most significant first for ARCFOUR) * followed by four bytes of direction marker (zero for * initiator and 0xff for acceptor). Encrypt that data using * the SGN_CKSUM as IV. From owner-svn-src-all@freebsd.org Tue May 3 22:07:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E76FB2C4C5; Tue, 3 May 2016 22:07:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E3B12CD; Tue, 3 May 2016 22:07:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43M7JuL005095; Tue, 3 May 2016 22:07:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43M7IZ5005090; Tue, 3 May 2016 22:07:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032207.u43M7IZ5005090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 22:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299009 - in head/sys/amd64/vmm: . amd intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:07:20 -0000 Author: pfg Date: Tue May 3 22:07:18 2016 New Revision: 299009 URL: https://svnweb.freebsd.org/changeset/base/299009 Log: vmm(4): Small spelling fixes. Reviewed by: grehan Modified: head/sys/amd64/vmm/amd/vmcb.h head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_stat.c Modified: head/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.h Tue May 3 22:05:03 2016 (r299008) +++ head/sys/amd64/vmm/amd/vmcb.h Tue May 3 22:07:18 2016 (r299009) @@ -313,7 +313,7 @@ struct vmcb_state { uint64_t br_to; uint64_t int_from; uint64_t int_to; - uint8_t pad7[0x968]; /* Reserved upto end of VMCB */ + uint8_t pad7[0x968]; /* Reserved up to end of VMCB */ } __attribute__ ((__packed__)); CTASSERT(sizeof(struct vmcb_state) == 0xC00); Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue May 3 22:05:03 2016 (r299008) +++ head/sys/amd64/vmm/intel/vtd.c Tue May 3 22:07:18 2016 (r299009) @@ -463,7 +463,7 @@ vtd_update_mapping(void *arg, vm_paddr_t panic("vtd_create_mapping: unaligned len 0x%0lx", len); /* - * Compute the size of the mapping that we can accomodate. + * Compute the size of the mapping that we can accommodate. * * This is based on three factors: * - supported super page size Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Tue May 3 22:05:03 2016 (r299008) +++ head/sys/amd64/vmm/io/vlapic.c Tue May 3 22:07:18 2016 (r299009) @@ -841,7 +841,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t } else { /* * In the "Flat Model" the MDA is interpreted as an 8-bit wide - * bitmask. This model is only avilable in the xAPIC mode. + * bitmask. This model is only available in the xAPIC mode. */ mda_flat_ldest = dest & 0xff; Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 3 22:05:03 2016 (r299008) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 3 22:07:18 2016 (r299009) @@ -1232,7 +1232,7 @@ emulate_stack_op(void *vm, int vcpuid, u size = vie->opsize_override ? 2 : 8; } else { /* - * In protected or compability mode the 'B' flag in the + * In protected or compatibility mode the 'B' flag in the * stack-segment descriptor determines the size of the * stack pointer. */ Modified: head/sys/amd64/vmm/vmm_stat.c ============================================================================== --- head/sys/amd64/vmm/vmm_stat.c Tue May 3 22:05:03 2016 (r299008) +++ head/sys/amd64/vmm/vmm_stat.c Tue May 3 22:07:18 2016 (r299009) @@ -69,7 +69,7 @@ vmm_stat_register(void *arg) return; if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) { - printf("Cannot accomodate vmm stat type \"%s\"!\n", vst->desc); + printf("Cannot accommodate vmm stat type \"%s\"!\n", vst->desc); return; } From owner-svn-src-all@freebsd.org Tue May 3 22:13:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF74B2C67D; Tue, 3 May 2016 22:13:06 +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 A716E1968; Tue, 3 May 2016 22:13:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u43MD523008057; Tue, 3 May 2016 22:13:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43MD5AW008048; Tue, 3 May 2016 22:13:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032213.u43MD5AW008048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 22:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299010 - in head/sys/amd64: acpica amd64 conf include linux linux32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:13:06 -0000 Author: pfg Date: Tue May 3 22:13:04 2016 New Revision: 299010 URL: https://svnweb.freebsd.org/changeset/base/299010 Log: sys/amd64: Small spelling fixes. No functional change. Modified: head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/amd64/atomic.c head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/mpboot.S head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/amd64/include/vmm.h head/sys/amd64/linux/linux_machdep.c head/sys/amd64/linux32/linux32_machdep.c Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/acpica/acpi_wakecode.S Tue May 3 22:13:04 2016 (r299010) @@ -179,7 +179,7 @@ wakeup_32: * Finally, switch to long bit mode by enabling paging. We have * to be very careful here because all the segmentation disappears * out from underneath us. The spec says we can depend on the - * subsequent pipelined branch to execute, but *only if* everthing + * subsequent pipelined branch to execute, but *only if* everything * is still identity mapped. If any mappings change, the pipeline * will flush. */ @@ -188,7 +188,7 @@ wakeup_32: mov %eax, %cr0 /* - * At this point paging is enabled, and we are in "compatability" mode. + * At this point paging is enabled, and we are in "compatibility" mode. * We do another far jump to reload %cs with the 64 bit selector. * %cr3 points to a 4-level page table page. * We cannot yet jump all the way to the kernel because we can only Modified: head/sys/amd64/amd64/atomic.c ============================================================================== --- head/sys/amd64/amd64/atomic.c Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/amd64/atomic.c Tue May 3 22:13:04 2016 (r299010) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -/* This file creates publically callable functions to perform various +/* This file creates publicly callable functions to perform various * simple arithmetic on memory which is atomic in the presence of * interrupts and multiple processors. */ Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/amd64/exception.S Tue May 3 22:13:04 2016 (r299010) @@ -427,7 +427,7 @@ IDTVEC(fast_syscall) /* * Here for CYA insurance, in case a "syscall" instruction gets - * issued from 32 bit compatability mode. MSR_CSTAR has to point + * issued from 32 bit compatibility mode. MSR_CSTAR has to point * to *something* if EFER_SCE is enabled. */ IDTVEC(fast_syscall32) Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/amd64/mpboot.S Tue May 3 22:13:04 2016 (r299010) @@ -121,7 +121,7 @@ protmode: * Finally, switch to long bit mode by enabling paging. We have * to be very careful here because all the segmentation disappears * out from underneath us. The spec says we can depend on the - * subsequent pipelined branch to execute, but *only if* everthing + * subsequent pipelined branch to execute, but *only if* everything * is still identity mapped. If any mappings change, the pipeline * will flush. */ @@ -130,7 +130,7 @@ protmode: mov %eax, %cr0 /* - * At this point paging is enabled, and we are in "compatability" mode. + * At this point paging is enabled, and we are in "compatibility" mode. * We do another far jump to reload %cs with the 64 bit selector. * %cr3 points to a 4-level page table page. * We cannot yet jump all the way to the kernel because we can only Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/conf/GENERIC Tue May 3 22:13:04 2016 (r299010) @@ -349,7 +349,7 @@ device virtio_blk # VirtIO Block devic device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers and enchancement support +# HyperV drivers and enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/conf/NOTES Tue May 3 22:13:04 2016 (r299010) @@ -509,7 +509,7 @@ device virtio_balloon # VirtIO Memory B device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device -# Microsoft Hyper-V enchancement support +# Microsoft Hyper-V enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/include/vmm.h Tue May 3 22:13:04 2016 (r299010) @@ -377,7 +377,7 @@ struct vm_copyinfo { * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for * a copyin or PROT_WRITE for a copyout. * - * retval is_fault Intepretation + * retval is_fault Interpretation * 0 0 Success * 0 1 An exception was injected into the guest * EFAULT N/A Unrecoverable error Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/linux/linux_machdep.c Tue May 3 22:13:04 2016 (r299010) @@ -212,7 +212,7 @@ linux_mmap2(struct thread *td, struct li /* * The Linux MAP_GROWSDOWN option does not limit auto * growth of the region. Linux mmap with this option - * takes as addr the inital BOS, and as len, the initial + * takes as addr the initial BOS, and as len, the initial * region size. It can then grow down from addr without * limit. However, Linux threads has an implicit internal * limit to stack size of STACK_SIZE. Its just not Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue May 3 22:07:18 2016 (r299009) +++ head/sys/amd64/linux32/linux32_machdep.c Tue May 3 22:13:04 2016 (r299010) @@ -576,7 +576,7 @@ linux_mmap_common(struct thread *td, l_u /* * The Linux MAP_GROWSDOWN option does not limit auto * growth of the region. Linux mmap with this option - * takes as addr the inital BOS, and as len, the initial + * takes as addr the initial BOS, and as len, the initial * region size. It can then grow down from addr without * limit. However, Linux threads has an implicit internal * limit to stack size of STACK_SIZE. Its just not From owner-svn-src-all@freebsd.org Tue May 3 22:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9CCFB2C848; Tue, 3 May 2016 22:20:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAEBF1BEA; Tue, 3 May 2016 22:20:56 +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 u43MKtvN008349; Tue, 3 May 2016 22:20:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43MKtGq008348; Tue, 3 May 2016 22:20:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605032220.u43MKtGq008348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 3 May 2016 22:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299011 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:20:57 -0000 Author: pfg Date: Tue May 3 22:20:55 2016 New Revision: 299011 URL: https://svnweb.freebsd.org/changeset/base/299011 Log: pmcstudy.8: minor "efficiency" fix. No functional change. Modified: head/usr.sbin/pmcstudy/pmcstudy.8 Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Tue May 3 22:13:04 2016 (r299010) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Tue May 3 22:20:55 2016 (r299011) @@ -122,7 +122,7 @@ Add (+), Subtract (-), Divide (/) and Multiplication (*) are supported. You may also introduce constant numbers. -For example you can do a standard efficency +For example you can do a standard efficiency test like .Fl E "UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)". From owner-svn-src-all@freebsd.org Tue May 3 22:23:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3FF3B2C8C6; Tue, 3 May 2016 22:23:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (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 B34AB1F69; Tue, 3 May 2016 22:23:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f52.google.com with SMTP id x19so44553443oix.2; Tue, 03 May 2016 15:23:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=wIOWMTd8VJx7nmpKGTFInxrtBqcsckiH7koSbJjZxXA=; b=bYtkgXucUGtKOzjFI4kfdzy8z63i8ifq+dJ5nfmxe9PWhdzm/X6ND7XNR4H8pj7PDq 1kxlOH7XV2wh2uXvMXF967U90jZb2CW3zR7O4Qunt7eJ8NDojgEereYD1Rnh+BZxqz/k SS6YPSP0HDzmK9z6o4gvj9EmDKPRnOnAaH9RMDk+UJOq3kR+5E76uPEpzdbHboyhgGkS 4ktxWGjBkhLQJoeSS3MGOUv5WehYS/d16OUW8mR6ivNFpI4nN39419YIrvv2abPBscZ5 d7WDHvbyY42WZphDtrftE4OSmBQurtpBsDunY+7C6mrqPdR7wL7ip/vqJSRL317BiI/1 iGUg== X-Gm-Message-State: AOPr4FV3aiMgcFqTI4k8WqWENNuZIZqKn/oFD4TiU2qSi1Iap8b8si4xUgunNTaRa0/QQw== X-Received: by 10.157.41.74 with SMTP id d68mr2536759otb.65.1462307932108; Tue, 03 May 2016 13:38:52 -0700 (PDT) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id x4sm107262obs.0.2016.05.03.13.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 13:38:51 -0700 (PDT) Received: by mail-oi0-f43.google.com with SMTP id x201so41585090oif.3; Tue, 03 May 2016 13:38:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.20.217 with SMTP id r25mr2561449otr.72.1462307931474; Tue, 03 May 2016 13:38:51 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 3 May 2016 13:38:51 -0700 (PDT) In-Reply-To: References: <201604262059.u3QKxLDl045059@repo.freebsd.org> Date: Tue, 3 May 2016 13:38:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298665 - head/sys/dev/aacraid From: Conrad Meyer To: Warner Losh Cc: Oliver Pinter , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:23:06 -0000 On Tue, May 3, 2016 at 1:29 PM, Warner Losh wrote: > >> On May 3, 2016, at 1:44 PM, Conrad Meyer wrote: >> >> On Tue, May 3, 2016 at 12:00 PM, Oliver Pinter >> wrote: >>> strlcpy instead or adjust the p->vendors size? >> >> Neither. The buffer is intentionally not nul-terminated. The >> coverity reports are false positives. > > Then wouldn=E2=80=99t memcmp be better? No, memcmp doesn't do anything like strncpy. memcpy wouldn't hurt but I don't see any reason to change it. Conrad From owner-svn-src-all@freebsd.org Tue May 3 22:28:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61131B2CA7E; Tue, 3 May 2016 22:28:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) (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 31D2911EF; Tue, 3 May 2016 22:28:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f67.google.com with SMTP id d139so5041650oig.1; Tue, 03 May 2016 15:28:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=7384b50Br17FcAeWbE8qZPiqPEuY8TKdS7+CMd5wJjw=; b=IN53RRGVeQffl3+9mlCtV8q4kGR8BW0FRh1lxHx8g6QrRFUmMfBgIhoYuiw9UsWxA3 CmgaUAVKILN4bXmuVjiRQ6v0PmSzD/d7msayxhIx6AgHmKV+Iug2kuUL/9JVKHofWz7j i1s7nRDdka5HCiEgBbRcszqXzi5G2C3vs2NR5aKzWPBykHds/Xud6Z3MsVbad+kVjry1 3Kdt/BNq0WZaoHCn7/BzXiQGPdIKqhJLzVC8AreRZTZg+kJfTZ1htipuwK/ewIkYqCw1 C2JQQfYo/ywZJ72l4Fj6eMWWhhjZoeGXx+C1VFyGKNSGGWceqp1R7aQcRxiv7/Hz0AwV lU9A== X-Gm-Message-State: AOPr4FX5AhKDsQnZerfXNDSHCayKhKpX2zwJPmNcAUz+oXF0THo/BwRCgl0cgSwCJLNGOQ== X-Received: by 10.202.97.69 with SMTP id v66mr2341147oib.172.1462314493807; Tue, 03 May 2016 15:28:13 -0700 (PDT) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id dl17sm279333obc.9.2016.05.03.15.28.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 15:28:13 -0700 (PDT) Received: by mail-oi0-f44.google.com with SMTP id x19so44677269oix.2; Tue, 03 May 2016 15:28:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.215.86 with SMTP id o83mr2431061oig.55.1462314493281; Tue, 03 May 2016 15:28:13 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 3 May 2016 15:28:13 -0700 (PDT) In-Reply-To: <20160503215348.GC1369@FreeBSD.org> References: <201604130030.u3D0UggB007871@repo.freebsd.org> <20160503215348.GC1369@FreeBSD.org> Date: Tue, 3 May 2016 15:28:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297897 - in head/usr.bin: . resizewin From: Conrad Meyer To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, darius@dons.net.au Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:28:20 -0000 On Tue, May 3, 2016 at 2:53 PM, Gleb Smirnoff wrote: > On Tue, Apr 12, 2016 at 05:42:54PM -0700, Conrad Meyer wrote: > C> On Tue, Apr 12, 2016 at 5:30 PM, Conrad E. Meyer wrote: > C> > Log: > C> > Add a small tool, resizewin(1), to query terminal for window size > C> > C> Whoops. The commit message should have included this blurb from the > C> phabricator review: > C> > C> This tool is a smaller, less featured version of resize from the xterm port. > C> > C> It's very useful when accessing systems via serial console that > C> don't run X (e.g. dev boxes). > > Are there any good reasons not to call it resize then? Those who have > xterm installed would have it overriden with /usr/local/bin/resize. Hi, I don't think it's a good idea to name different binaries the same thing and rely on PATH ordering to pick the right one. And it would introduce a conflict for LOCALBASE=/usr. Best, Conrad From owner-svn-src-all@freebsd.org Tue May 3 22:45:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E35B2CDE1; Tue, 3 May 2016 22:45:01 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by mx1.freebsd.org (Postfix) with ESMTP id 415331C6A; Tue, 3 May 2016 22:44:59 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-77-5.lns21.adl6.internode.on.net (HELO midget.dons.net.au) ([14.2.77.5]) by ipmail06.adl6.internode.on.net with ESMTP; 04 May 2016 08:09:48 +0930 Received: from [10.204.186.107] ([120.20.183.106]) (authenticated bits=0) by midget.dons.net.au (8.15.1/8.14.9) with ESMTPSA id u43MdeB3084231 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 May 2016 08:09:47 +0930 (CST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: Host [120.20.183.106] claimed to be [10.204.186.107] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r297897 - in head/usr.bin: . resizewin From: "Daniel O'Connor" X-Mailer: iPhone Mail (13E238) In-Reply-To: Date: Wed, 4 May 2016 08:09:35 +0930 Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4B76AE63-52CA-4E2D-B35C-31EF8A195789@dons.net.au> References: <201604130030.u3D0UggB007871@repo.freebsd.org> <20160503215348.GC1369@FreeBSD.org> To: cem@FreeBSD.org X-Spam-Score: -0.857 () BAYES_00,HELO_MISC_IP,RDNS_NONE X-Scanned-By: MIMEDefang 2.75 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 22:45:01 -0000 Also, it's not functionally identical to the xterm version which could cause= an issue for some users. -- Daniel O'Connor "The nice thing about standards is there are so many to choose from." - Andrew Tanenbaum > On 4 May 2016, at 07:58, Conrad Meyer wrote: >=20 >> On Tue, May 3, 2016 at 2:53 PM, Gleb Smirnoff wrote= : >> On Tue, Apr 12, 2016 at 05:42:54PM -0700, Conrad Meyer wrote: >> C> On Tue, Apr 12, 2016 at 5:30 PM, Conrad E. Meyer wro= te: >> C> > Log: >> C> > Add a small tool, resizewin(1), to query terminal for window size >> C> >> C> Whoops. The commit message should have included this blurb from the >> C> phabricator review: >> C> >> C> This tool is a smaller, less featured version of resize from the x= term port. >> C> >> C> It's very useful when accessing systems via serial console that >> C> don't run X (e.g. dev boxes). >>=20 >> Are there any good reasons not to call it resize then? Those who have >> xterm installed would have it overriden with /usr/local/bin/resize. >=20 > Hi, >=20 > I don't think it's a good idea to name different binaries the same > thing and rely on PATH ordering to pick the right one. And it would > introduce a conflict for LOCALBASE=3D/usr. >=20 > Best, > Conrad From owner-svn-src-all@freebsd.org Tue May 3 23:03:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60263B2C25D; Tue, 3 May 2016 23:03:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1821816; Tue, 3 May 2016 23:03:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u43N3a8s095721 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 May 2016 16:03:37 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u43N3auS095720; Tue, 3 May 2016 16:03:36 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 May 2016 16:03:36 -0700 From: Gleb Smirnoff To: Michael Tuexen Cc: Ian Lepore , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r298187 - head/sys/netinet Message-ID: <20160503230336.GD1369@FreeBSD.org> References: <201604180638.u3I6cs5P043229@repo.freebsd.org> <1460992087.52955.47.camel@freebsd.org> <0BC0F7D1-9523-4FE6-A6ED-57372CC80206@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0BC0F7D1-9523-4FE6-A6ED-57372CC80206@freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 23:03:38 -0000 Michael, On Mon, Apr 18, 2016 at 06:56:29PM +0200, Michael Tuexen wrote: M> > On Mon, 2016-04-18 at 06:38 +0000, Michael Tuexen wrote: M> >> Author: tuexen M> >> Date: Mon Apr 18 06:38:53 2016 M> >> New Revision: 298187 M> >> URL: https://svnweb.freebsd.org/changeset/base/298187 M> >> M> >> Log: M> >> Don't use anonymous unions. M> >> M> > M> > Why not? This is one of those commit messages that really needs to say M> Because the same code is used in a userland SCTP stack and that M> uses C99. Anonymous unions are introduced in C11. That's why. This explanation of course emerges next question :) Why don't enable C11 when compiling the userland SCTP stack? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue May 3 23:46:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E450CB2CCA1; Tue, 3 May 2016 23:46:02 +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 A5FC71E13; Tue, 3 May 2016 23:46:02 +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 u43Nk1bd035299; Tue, 3 May 2016 23:46:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43Nk19F035296; Tue, 3 May 2016 23:46:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605032346.u43Nk19F035296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 May 2016 23:46: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: r299014 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 23:46:03 -0000 Author: markj Date: Tue May 3 23:46:01 2016 New Revision: 299014 URL: https://svnweb.freebsd.org/changeset/base/299014 Log: MFC r295575, r295576, r295578, r295579, r295580: Various NDP cleanups. No functional change intended. Modified: stable/10/sys/netinet6/nd6.c stable/10/sys/netinet6/nd6_nbr.c stable/10/sys/netinet6/nd6_rtr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6.c Tue May 3 23:46:01 2016 (r299014) @@ -112,11 +112,6 @@ VNET_DEFINE(int, nd6_debug) = 1; VNET_DEFINE(int, nd6_debug) = 0; #endif -/* for debugging? */ -#if 0 -static int nd6_inuse, nd6_allocated; -#endif - VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); @@ -175,7 +170,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); + nd = malloc(sizeof(*nd), M_IP6NDP, M_WAITOK | M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; @@ -2182,7 +2177,6 @@ clear_llinfo_pqueue(struct llentry *ln) } ln->la_hold = NULL; - return; } static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS); Modified: stable/10/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/10/sys/netinet6/nd6_nbr.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6_nbr.c Tue May 3 23:46:01 2016 (r299014) @@ -623,7 +623,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con RTFREE(ro.ro_rt); } m_freem(m); - return; } #ifndef BURN_BRIDGES @@ -901,12 +900,6 @@ nd6_na_input(struct mbuf *m, int off, in in6 = &L3_ADDR_SIN6(ln)->sin6_addr; - /* - * Lock to protect the default router list. - * XXX: this might be unnecessary, since this function - * is only called under the network software interrupt - * context. However, we keep it just for safety. - */ dr = defrouter_lookup(in6, ln->lle_tbl->llt_ifp); if (dr) defrtrlist_del(dr); @@ -1127,7 +1120,6 @@ nd6_na_output_fib(struct ifnet *ifp, con RTFREE(ro.ro_rt); } m_freem(m); - return; } #ifndef BURN_BRIDGES Modified: stable/10/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/10/sys/netinet6/nd6_rtr.c Tue May 3 23:39:41 2016 (r299013) +++ stable/10/sys/netinet6/nd6_rtr.c Tue May 3 23:46:01 2016 (r299014) @@ -501,7 +501,6 @@ defrouter_addreq(struct nd_defrouter *ne } if (error == 0) new->installed = 1; - return; } struct nd_defrouter * @@ -700,8 +699,6 @@ defrouter_select(void) defrouter_delreq(installed_dr); defrouter_addreq(selected_dr); } - - return; } /* @@ -735,53 +732,47 @@ static struct nd_defrouter * defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; + int oldpref; if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) { /* entry exists */ if (new->rtlifetime == 0) { defrtrlist_del(dr); - dr = NULL; - } else { - int oldpref = rtpref(dr); + return (NULL); + } - /* override */ - dr->flags = new->flags; /* xxx flag check */ - dr->rtlifetime = new->rtlifetime; - dr->expire = new->expire; + oldpref = rtpref(dr); - /* - * If the preference does not change, there's no need - * to sort the entries. Also make sure the selected - * router is still installed in the kernel. - */ - if (dr->installed && rtpref(new) == oldpref) - return (dr); + /* override */ + dr->flags = new->flags; /* xxx flag check */ + dr->rtlifetime = new->rtlifetime; + dr->expire = new->expire; - /* - * preferred router may be changed, so relocate - * this router. - * XXX: calling TAILQ_REMOVE directly is a bad manner. - * However, since defrtrlist_del() has many side - * effects, we intentionally do so here. - * defrouter_select() below will handle routing - * changes later. - */ - TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); - n = dr; - goto insert; - } - return (dr); + /* + * If the preference does not change, there's no need + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. + */ + if (dr->installed && rtpref(new) == oldpref) + return (dr); + + /* + * The preferred router may have changed, so relocate this + * router. + */ + TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + n = dr; + goto insert; } /* entry does not exist */ if (new->rtlifetime == 0) return (NULL); - n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT); + n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); if (n == NULL) return (NULL); - bzero(n, sizeof(*n)); - *n = *new; + memcpy(n, new, sizeof(*n)); insert: /* @@ -824,10 +815,9 @@ pfxrtr_add(struct nd_prefix *pr, struct { struct nd_pfxrouter *new; - new = (struct nd_pfxrouter *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) return; - bzero(new, sizeof(*new)); new->router = dr; LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); @@ -868,10 +858,9 @@ nd6_prelist_add(struct nd_prefixctl *pr, int i; char ip6buf[INET6_ADDRSTRLEN]; - new = (struct nd_prefix *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT); + new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) - return(ENOMEM); - bzero(new, sizeof(*new)); + return (ENOMEM); new->ndpr_ifp = pr->ndpr_ifp; new->ndpr_prefix = pr->ndpr_prefix; new->ndpr_plen = pr->ndpr_plen; From owner-svn-src-all@freebsd.org Tue May 3 23:56:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA30B2CF5C; Tue, 3 May 2016 23:56: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 4D4C813B4; Tue, 3 May 2016 23:56: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 u43Nuqtp038377; Tue, 3 May 2016 23:56:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u43NuqHZ038376; Tue, 3 May 2016 23:56:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605032356.u43NuqHZ038376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 3 May 2016 23:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299015 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 03 May 2016 23:56:53 -0000 Author: ngie Date: Tue May 3 23:56:52 2016 New Revision: 299015 URL: https://svnweb.freebsd.org/changeset/base/299015 Log: Use DEVMETHOD_END ({ NULL, NULL }) instead of hardcoding { 0, 0 } Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue May 3 23:46:01 2016 (r299014) +++ head/sys/dev/ioat/ioat.c Tue May 3 23:56:52 2016 (r299015) @@ -135,7 +135,7 @@ static device_method_t ioat_pci_methods[ DEVMETHOD(device_probe, ioat_probe), DEVMETHOD(device_attach, ioat_attach), DEVMETHOD(device_detach, ioat_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ioat_pci_driver = { From owner-svn-src-all@freebsd.org Wed May 4 00:01:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4CCB2B257 for ; Wed, 4 May 2016 00:01:49 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F88519B8 for ; Wed, 4 May 2016 00:01:49 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: by mail-yw0-x234.google.com with SMTP id g133so48145507ywb.2 for ; Tue, 03 May 2016 17:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fud-org-nz.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=dtQ7PeX6P2NoCLGV+kEhG2WIIypT+4/XTSCCC03RcHU=; b=R/M194svn3Hfxh9umn6sYQxEBGACxSipWxFAH0f4EZ1mLHDsKUm14exmUs9SQhMMNs FuL/DQEy1VxDi2tnSs3FeKdqLheRM3bIPNUM6gyn0DUaM2NDrAzUpo3kNWQAmM3kAZfX CDhn2BnrvW7CxVkzLjk9cNRcrb9OsURY5ZI7SytB+c2toyrg9N80CwpMc1EGhU5kwxJl /VN/N+n3LYSs2/IAFg8BaXa+Wtlgd5CE/+RESz/YXdoK+XJz4pRxs/ydgohJcgZhj6L4 kJ0FgTa+/KgVCPoi8hKAAEDpwAn8g6aAKGLDo8vy9E6zW2tKwybmMK3S5FoXxCjZcAlf vnbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=dtQ7PeX6P2NoCLGV+kEhG2WIIypT+4/XTSCCC03RcHU=; b=a8hvSCV/etAf+XJJ7ndhmEzBEp4uqf8Au8UJBdtPMdtzdszioDaw81n4GoYX+uX+4P RampE3XexsyWVhgHxXQ/skMi31hQZNMrXdv0co0L6df0oksxHre3O4aX/DpNkXfDujAQ ZAjrnQLSsg27A9BNTAIOR46GidRqxKyzAoWJ3bAxMKqgdjBxz5lngc2PPN/8DR+myNaA H0jy7o/Oc9uOUTBj2cSesFkZiyR2JvG9jTrTaki0njQigEXZykiwOOSMVV9OMhbKNkoL irzQyX6cAkeAPA9K2LlXl4XlsmGDSmDYoTEw7+Nn5IETHb2ClP758Lnfwok0OjqaxtsC odTA== X-Gm-Message-State: AOPr4FUo0ckS5MgTAuboCOaKiPvlROxbCq2pkOYoOg8aoCOFBUpPSvQrGNq9dYFW36Er2G3/cjmyniPTXfDLsg== MIME-Version: 1.0 X-Received: by 10.37.35.214 with SMTP id j205mr3083625ybj.178.1462320108377; Tue, 03 May 2016 17:01:48 -0700 (PDT) Received: by 10.129.125.193 with HTTP; Tue, 3 May 2016 17:01:48 -0700 (PDT) In-Reply-To: <201604281327.u3SDRCIa035707@repo.freebsd.org> References: <201604281327.u3SDRCIa035707@repo.freebsd.org> Date: Wed, 4 May 2016 12:01:48 +1200 Message-ID: Subject: Re: svn commit: r298743 - in head/sys/netinet: . tcp_stacks From: Andrew Thompson To: Randall Stewart Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:01:49 -0000 On 29 April 2016 at 01:27, Randall Stewart wrote: > Author: rrs > Date: Thu Apr 28 13:27:12 2016 > New Revision: 298743 > URL: https://svnweb.freebsd.org/changeset/base/298743 > > Log: > This cleans up the timers code in TCP to start using the new > async_drain functionality. This as been tested in NF as well as > by Verisign. Still to do in here is to remove all the old flags. They > are currently left being maintained but probably are no longer needed. > > Sponsored by: Netflix Inc. > Differential Revision: http://reviews.freebsd.org/D5924 > > Modified: > head/sys/netinet/tcp_stacks/fastpath.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_timer.c > head/sys/netinet/tcp_timer.h > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:00:40 2016 > (r298742) > +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:27:12 2016 > (r298743) > @@ -2386,7 +2386,6 @@ struct tcp_function_block __tcp_fastslow > NULL, > NULL, > NULL, > - NULL, > 0, > 0 > > @@ -2403,7 +2402,6 @@ struct tcp_function_block __tcp_fastack > NULL, > NULL, > NULL, > - NULL, > 0, > 0 > }; > Is there a reason not to use named struct initialisers here? It is self-describing and also does not require the nulls to be set. ie { .tfb_tcp_output = tcp_output , ... } cheers, Andrew From owner-svn-src-all@freebsd.org Wed May 4 00:06:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D428B2B422 for ; Wed, 4 May 2016 00:06:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAD141CA4 for ; Wed, 4 May 2016 00:06:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x231.google.com with SMTP id bi2so132549136igb.0 for ; Tue, 03 May 2016 17:06: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:date:message-id:subject :from:to:cc; bh=Yr8S+b+m3bBpp4ASaDJz0IzUrLf2X5xKMVBPcVYVNsA=; b=eocq6HiQeM7qfwx49W1TSPUjSMKBwoHtUaEuF8TRAYFhBYhn4pqGtZUZNXNctbFgTx DwJQQ4b5mn8K1rNE7xpzU2jaZvUhGHzllZC9oh8puIBoUHWqaKzMrNZQ1rD6TcQ4aUmJ bq0llS2Y44kZu+vwY2nDIqFToeAxFG4lTgaK+K1ngcGTxtkMau77aVy3l/PnR6LNhZnl 3t0HMzPqb93u3gXXfQH9tdGeFCDZB8pxsXsAYwwiYeLWNkTQaHa5H4vQw8Ik0M7eZtRI l0+gKq+/MkltaVtMVDkFNHOFRked1GNKU8rIko0oo3yyvFMRHwvhSMUv0WFlCNLDCBpO fKUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Yr8S+b+m3bBpp4ASaDJz0IzUrLf2X5xKMVBPcVYVNsA=; b=Zs5pCk+Kc5OUDHvlbbCm0wJgztjszs3WiIYoaZKmV57/ZY48jle8nX9oRvvwAEM34A jCuGtefPCodbt/3QmPEYCvhqse8XGBt2J2U0OwDZfS7X1bvmM0mULd1kUE68aDVklfn9 zCTwrdtVACU9KcTNIEhxWCdHqqswnIuZNVl3EHavOgE7USaW6SRtge12261sDZhbtCck kjK+gexPLFJVAEFsDD3ha8Is6cNlaRJJ38JQ7lrcmD4sxt2bH+4XpuWLk+6yhBHiaCKV 83o17QloyNGpWSi6pAU2K4ENJHGzj4FYkocHfWYjyQLvotBfZb9jsKL5X8GeIn98UY9c TWaw== X-Gm-Message-State: AOPr4FWyBY+A6Ep3fvkAETAxQomXiz3sjl/A2stlPavNktki3IEQTcYjjviJvksbh0tldUheOKIVfG70lMItkQ== MIME-Version: 1.0 X-Received: by 10.50.160.195 with SMTP id xm3mr6959907igb.12.1462320365266; Tue, 03 May 2016 17:06:05 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.68 with HTTP; Tue, 3 May 2016 17:06:05 -0700 (PDT) X-Originating-IP: [2607:fb90:1907:756c:0:46:b68d:5a01] Received: by 10.79.75.68 with HTTP; Tue, 3 May 2016 17:06:05 -0700 (PDT) In-Reply-To: References: <201604262059.u3QKxLDl045059@repo.freebsd.org> Date: Tue, 3 May 2016 18:06:05 -0600 X-Google-Sender-Auth: 9wqOyP2KdL-SLM2IjbHxVY2XPZs Message-ID: Subject: Re: svn commit: r298665 - head/sys/dev/aacraid From: Warner Losh To: "Conrad E. Meyer" Cc: src-committers , svn-src-head@freebsd.org, Oliver Pinter , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:06:06 -0000 On May 3, 2016 2:38 PM, "Conrad Meyer" wrote: > > On Tue, May 3, 2016 at 1:29 PM, Warner Losh wrote: > > > >> On May 3, 2016, at 1:44 PM, Conrad Meyer wrote: > >> > >> On Tue, May 3, 2016 at 12:00 PM, Oliver Pinter > >> wrote: > >>> strlcpy instead or adjust the p->vendors size? > >> > >> Neither. The buffer is intentionally not nul-terminated. The > >> coverity reports are false positives. > > > > Then wouldn=E2=80=99t memcmp be better? > > No, memcmp doesn't do anything like strncpy. memcpy wouldn't hurt but > I don't see any reason to change it. It just sounded like these were fixed length fields with no NULs ever. Memcpy would convey that to the reader. But you're right. It isn't a huge thing. Warner > Conrad From owner-svn-src-all@freebsd.org Wed May 4 00:14:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A8AB2B665; Wed, 4 May 2016 00:14: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 BEFB910D1; Wed, 4 May 2016 00:14: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 u440Eocc044343; Wed, 4 May 2016 00:14:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440Eokb044340; Wed, 4 May 2016 00:14:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040014.u440Eokb044340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:14: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: r299016 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:14:52 -0000 Author: ngie Date: Wed May 4 00:14:50 2016 New Revision: 299016 URL: https://svnweb.freebsd.org/changeset/base/299016 Log: MFC r298451,r298452,r298507,r298750: r298451: Don't use `entry` after free in the "already in lists" case Return with 0 as it isn't an error. CID: 1006085 Obtained from: Isilon OneFS (part of r493633) r298452: Don't try to free `string` (stack allocated char[]) Fix minor style with warnx call while in the neighborhood CID: 1009683 r298507: Fix looking for "UTC" at start of ptr by using strnmp instead of improperly unrolled equivalent CID: 1347118 r298750: Use a better idiom for finding UTC prefixed timezones Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed May 4 00:14:50 2016 (r299016) @@ -693,6 +693,7 @@ snmp_import_table(struct snmp_toolinfo * /* Same entry already present in lists. */ free(entry->string); free(entry); + return (0); } (void) snmp_import_update_table(ENTRY_INDEX, entry); Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed May 4 00:14:50 2016 (r299016) @@ -338,8 +338,9 @@ static char * snmp_date2asn_oid(char *str, struct asn_oid *oid) { char *endptr, *ptr; - uint32_t v; + static const char UTC[3] = "UTC"; int32_t saved_errno; + uint32_t v; if (snmp_suboid_append(oid, (asn_subid_t) SNMP_DATETIME_OCTETS) < 0) return (NULL); @@ -440,8 +441,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C') - ptr += 3; + if (strncmp(ptr, UTC, sizeof(UTC)) == 0) + ptr += sizeof(UTC); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Tue May 3 23:56:52 2016 (r299015) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed May 4 00:14:50 2016 (r299016) @@ -1079,10 +1079,9 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s strlcpy(string, str, i + 1); string[i] = '\0'; if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) { - warnx("Unknown string - %s",string); + warnx("Unknown string - %s", string); return (NULL); } - free(string); } asn_append_oid(oid, &(obj.val.var)); From owner-svn-src-all@freebsd.org Wed May 4 00:19:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D364B2B774; Wed, 4 May 2016 00:19: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 3A011127F; Wed, 4 May 2016 00:19: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 u440JldS044558; Wed, 4 May 2016 00:19:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440Jlb3044555; Wed, 4 May 2016 00:19:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040019.u440Jlb3044555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299017 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:19:48 -0000 Author: ngie Date: Wed May 4 00:19:46 2016 New Revision: 299017 URL: https://svnweb.freebsd.org/changeset/base/299017 Log: MFstable/10 r299016: MFC r298451,r298452,r298507,r298750: r298451: Don't use `entry` after free in the "already in lists" case Return with 0 as it isn't an error. CID: 1006085 Obtained from: Isilon OneFS (part of r493633) r298452: Don't try to free `string` (stack allocated char[]) Fix minor style with warnx call while in the neighborhood CID: 1009683 r298507: Fix looking for "UTC" at start of ptr by using strnmp instead of improperly unrolled equivalent CID: 1347118 r298750: Use a better idiom for finding UTC prefixed timezones Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed May 4 00:14:50 2016 (r299016) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed May 4 00:19:46 2016 (r299017) @@ -693,6 +693,7 @@ snmp_import_table(struct snmp_toolinfo * /* Same entry already present in lists. */ free(entry->string); free(entry); + return (0); } (void) snmp_import_update_table(ENTRY_INDEX, entry); Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed May 4 00:14:50 2016 (r299016) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed May 4 00:19:46 2016 (r299017) @@ -338,8 +338,9 @@ static char * snmp_date2asn_oid(char *str, struct asn_oid *oid) { char *endptr, *ptr; - uint32_t v; + static const char UTC[3] = "UTC"; int32_t saved_errno; + uint32_t v; if (snmp_suboid_append(oid, (asn_subid_t) SNMP_DATETIME_OCTETS) < 0) return (NULL); @@ -440,8 +441,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C') - ptr += 3; + if (strncmp(ptr, UTC, sizeof(UTC)) == 0) + ptr += sizeof(UTC); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed May 4 00:14:50 2016 (r299016) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed May 4 00:19:46 2016 (r299017) @@ -1078,10 +1078,9 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s strlcpy(string, str, i + 1); string[i] = '\0'; if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) { - warnx("Unknown string - %s",string); + warnx("Unknown string - %s", string); return (NULL); } - free(string); } asn_append_oid(oid, &(obj.val.var)); From owner-svn-src-all@freebsd.org Wed May 4 00:25:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AFA7B2B8D0; Wed, 4 May 2016 00:25: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 EBA26178D; Wed, 4 May 2016 00:25: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 u440PL7S047415; Wed, 4 May 2016 00:25:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440PKvZ047412; Wed, 4 May 2016 00:25:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040025.u440PKvZ047412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299018 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:25:22 -0000 Author: ngie Date: Wed May 4 00:25:20 2016 New Revision: 299018 URL: https://svnweb.freebsd.org/changeset/base/299018 Log: MFC r298448,r298464: r298448: Don't leak `string` in parse_define(..) when a macro has been found and the parser token != TOK_ASSIGN CID: 1007187, 1007188 Obtained from: Isilon OneFS (part of r445479) r298464: Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with the rest of the users in the file No functional change Modified: stable/10/contrib/bsnmp/snmpd/config.c stable/10/contrib/bsnmp/snmpd/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/config.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/config.c Wed May 4 00:19:46 2016 (r299017) +++ stable/10/contrib/bsnmp/snmpd/config.c Wed May 4 00:25:20 2016 (r299018) @@ -1150,7 +1150,8 @@ parse_define(const char *varname) free(m->value); m->value = string; m->length = length; - } + } else + free(string); } token = TOK_EOL; Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Wed May 4 00:19:46 2016 (r299017) +++ stable/10/contrib/bsnmp/snmpd/main.c Wed May 4 00:25:20 2016 (r299018) @@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen if ((uuser = (struct usm_user *)malloc(sizeof(*uuser))) == NULL) return (NULL); - memset(uuser, 0, sizeof(struct usm_user)); + memset(uuser, 0, sizeof(*uuser)); strlcpy(uuser->suser.sec_name, uname, SNMP_ADM_STR32_SIZ); memcpy(uuser->user_engine_id, eid, elen); uuser->user_engine_len = elen; From owner-svn-src-all@freebsd.org Wed May 4 00:26:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF71B2B98A; Wed, 4 May 2016 00:26: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 E24C91954; Wed, 4 May 2016 00:26: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 u440QmEm047528; Wed, 4 May 2016 00:26:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440QmmJ047526; Wed, 4 May 2016 00:26:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040026.u440QmmJ047526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299019 - stable/9/contrib/bsnmp/snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:26:49 -0000 Author: ngie Date: Wed May 4 00:26:47 2016 New Revision: 299019 URL: https://svnweb.freebsd.org/changeset/base/299019 Log: MFstable/10 r299018: MFC r298448,r298464: r298448: Don't leak `string` in parse_define(..) when a macro has been found and the parser token != TOK_ASSIGN CID: 1007187, 1007188 Obtained from: Isilon OneFS (part of r445479) r298464: Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with the rest of the users in the file No functional change Modified: stable/9/contrib/bsnmp/snmpd/config.c stable/9/contrib/bsnmp/snmpd/main.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/snmpd/config.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/config.c Wed May 4 00:25:20 2016 (r299018) +++ stable/9/contrib/bsnmp/snmpd/config.c Wed May 4 00:26:47 2016 (r299019) @@ -1150,7 +1150,8 @@ parse_define(const char *varname) free(m->value); m->value = string; m->length = length; - } + } else + free(string); } token = TOK_EOL; Modified: stable/9/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/main.c Wed May 4 00:25:20 2016 (r299018) +++ stable/9/contrib/bsnmp/snmpd/main.c Wed May 4 00:26:47 2016 (r299019) @@ -2813,7 +2813,7 @@ usm_new_user(uint8_t *eid, uint32_t elen if ((uuser = (struct usm_user *)malloc(sizeof(*uuser))) == NULL) return (NULL); - memset(uuser, 0, sizeof(struct usm_user)); + memset(uuser, 0, sizeof(*uuser)); strlcpy(uuser->suser.sec_name, uname, SNMP_ADM_STR32_SIZ); memcpy(uuser->user_engine_id, eid, elen); uuser->user_engine_len = elen; From owner-svn-src-all@freebsd.org Wed May 4 00:29:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C132B2BA7E; Wed, 4 May 2016 00:29: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 3C1DA1BE3; Wed, 4 May 2016 00:29: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 u440T5eU047678; Wed, 4 May 2016 00:29:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440T5or047677; Wed, 4 May 2016 00:29:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040029.u440T5or047677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:29: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: r299020 - stable/10/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:29:06 -0000 Author: ngie Date: Wed May 4 00:29:05 2016 New Revision: 299020 URL: https://svnweb.freebsd.org/changeset/base/299020 Log: MFC r298368,r298660: r298368: Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c Ensure opening /dev/zero succeeds. Abort the test if it doesn't. Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero" CID: 1251410 r298660: Fix up r298368 Remove the semicolon accidentally added after the new conditional that tests that /dev/zero is opened successfully. CID: 1354980 Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed May 4 00:26:47 2016 (r299019) +++ stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c Wed May 4 00:29:05 2016 (r299020) @@ -38,6 +38,7 @@ __RCSID("$NetBSD: h_read.c,v 1.1 2010/12 #ifdef __FreeBSD__ #include +#include int main(int argc, char *argv[]) @@ -46,7 +47,8 @@ main(int argc, char *argv[]) int fd, n; size_t len = atoi(argv[1]); - fd = open("/dev/zero", O_RDONLY); + if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1) + abort(); if ((n = read(fd, b, len)) == -1) abort(); (void)printf("%s\n", b); From owner-svn-src-all@freebsd.org Wed May 4 00:30:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC2BB2BB30; Wed, 4 May 2016 00:30: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 C2E391D99; Wed, 4 May 2016 00:30: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 u440UaYJ047810; Wed, 4 May 2016 00:30:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440UaUQ047808; Wed, 4 May 2016 00:30:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040030.u440UaUQ047808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:30: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: r299021 - stable/10/lib/libc/tests/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:30:38 -0000 Author: ngie Date: Wed May 4 00:30:36 2016 New Revision: 299021 URL: https://svnweb.freebsd.org/changeset/base/299021 Log: MFC r298311,r298312: r298311: Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 r298312: Fix double fclose of `fp1` when freopen fails freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525 Modified: stable/10/lib/libc/tests/stdio/fmemopen2_test.c stable/10/lib/libc/tests/stdio/freopen_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/fmemopen2_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/fmemopen2_test.c Wed May 4 00:29:05 2016 (r299020) +++ stable/10/lib/libc/tests/stdio/fmemopen2_test.c Wed May 4 00:30:36 2016 (r299021) @@ -249,12 +249,14 @@ ATF_TC_BODY(test_append_binary_pos, tc) FILE *fp; fp = fmemopen(NULL, 16, "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); /* Make sure that a pre-allocated buffer behaves correctly. */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); + ATF_REQUIRE(fp != NULL); ATF_REQUIRE(ftell(fp) == strlen(buf)); fclose(fp); } Modified: stable/10/lib/libc/tests/stdio/freopen_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/freopen_test.c Wed May 4 00:29:05 2016 (r299020) +++ stable/10/lib/libc/tests/stdio/freopen_test.c Wed May 4 00:30:36 2016 (r299021) @@ -48,7 +48,6 @@ runtest(const char *fname1, const char * "fopen(\"%s\", \"%s\") failed; errno=%d", fname1, mode1, errno); fp2 = freopen(fname2, mode2, fp1); if (fp2 == NULL) { - fclose(fp1); ATF_REQUIRE_MSG(success == false, "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) succeeded " "unexpectedly", fname2_print, mode2, fname1, mode1); From owner-svn-src-all@freebsd.org Wed May 4 00:34:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA31B2BC85; Wed, 4 May 2016 00:34: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 2DBB5117D; Wed, 4 May 2016 00:34: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 u440YjJ0050656; Wed, 4 May 2016 00:34:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440YjQi050655; Wed, 4 May 2016 00:34:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040034.u440YjQi050655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:34: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: r299022 - stable/10/contrib/bsnmp/gensnmptree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:34:46 -0000 Author: ngie Date: Wed May 4 00:34:45 2016 New Revision: 299022 URL: https://svnweb.freebsd.org/changeset/base/299022 Log: MFC r298450: Simplify always evaluated branch (`e != NULL`) - xalloc(..) ensures that e will be non-null via malloc + err. - `e` is already dereferenced above, so logically it's impossible to hit the lower test without crashing if it was indeed NULL. CID: 1007408 Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:30:36 2016 (r299021) +++ stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:34:45 2016 (r299022) @@ -743,10 +743,8 @@ parse_type(enum tok *tok, struct type *t report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) report("need string in ENUM/BITS"); - if (e != NULL) { - e->name = savetok(); - TAILQ_INSERT_TAIL(&t->enums, e, link); - } + e->name = savetok(); + TAILQ_INSERT_TAIL(&t->enums, e, link); if ((*tok = gettoken()) == TOK_EOF) report("unexpected EOF in ENUM/BITS"); } while (*tok != ')'); From owner-svn-src-all@freebsd.org Wed May 4 00:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA68DB2BD11; Wed, 4 May 2016 00: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 97D04135B; Wed, 4 May 2016 00: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 u440ZfVa050756; Wed, 4 May 2016 00:35:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440ZfWu050755; Wed, 4 May 2016 00:35:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040035.u440ZfWu050755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299023 - stable/9/contrib/bsnmp/gensnmptree X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:35:42 -0000 Author: ngie Date: Wed May 4 00:35:41 2016 New Revision: 299023 URL: https://svnweb.freebsd.org/changeset/base/299023 Log: MFstable/10 r299022: MFC r298450: Simplify always evaluated branch (`e != NULL`) - xalloc(..) ensures that e will be non-null via malloc + err. - `e` is already dereferenced above, so logically it's impossible to hit the lower test without crashing if it was indeed NULL. CID: 1007408 Modified: stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:34:45 2016 (r299022) +++ stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 4 00:35:41 2016 (r299023) @@ -743,10 +743,8 @@ parse_type(enum tok *tok, struct type *t report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) report("need string in ENUM/BITS"); - if (e != NULL) { - e->name = savetok(); - TAILQ_INSERT_TAIL(&t->enums, e, link); - } + e->name = savetok(); + TAILQ_INSERT_TAIL(&t->enums, e, link); if ((*tok = gettoken()) == TOK_EOF) report("unexpected EOF in ENUM/BITS"); } while (*tok != ')'); From owner-svn-src-all@freebsd.org Wed May 4 00:39:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC2FB2BE22; Wed, 4 May 2016 00:39: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 DA92E1676; Wed, 4 May 2016 00:39: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 u440d4JB050939; Wed, 4 May 2016 00:39:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u440d4F5050938; Wed, 4 May 2016 00:39:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040039.u440d4F5050938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 00:39: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: r299024 - stable/10/lib/libcam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 00:39:05 -0000 Author: ngie Date: Wed May 4 00:39:03 2016 New Revision: 299024 URL: https://svnweb.freebsd.org/changeset/base/299024 Log: MFC r298753: Fix va_list handling - Add missing va_end's after corresponding va_start's to cleanup state - Eliminate questionable bzero'ing of va_list passed in to do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..) and csio_{de,en}code_visit(..). Make va_list a pointer instead and pass NULL into the underlying functions to handler this in a portable way. - Do some minor style(9) clean up in affected functions. CID: 1018500-1018503 Modified: stable/10/lib/libcam/scsi_cmdparse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/scsi_cmdparse.c ============================================================================== --- stable/10/lib/libcam/scsi_cmdparse.c Wed May 4 00:35:41 2016 (r299023) +++ stable/10/lib/libcam/scsi_cmdparse.c Wed May 4 00:39:03 2016 (r299024) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); static int do_buff_decode(u_int8_t *databuf, size_t len, void (*arg_put)(void *, int , void *, int, char *), - void *puthook, const char *fmt, va_list ap) + void *puthook, const char *fmt, va_list *ap) { int assigned = 0; int width; @@ -128,7 +128,7 @@ do_buff_decode(u_int8_t *databuf, size_t (void *)((long)(ARG)), width, \ field_name); \ else \ - *(va_arg(ap, int *)) = (ARG); \ + *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ } \ field_name[0] = 0; \ @@ -255,7 +255,7 @@ do_buff_decode(u_int8_t *databuf, size_t databuf, width, field_name); else { char *dest; - dest = va_arg(ap, char *); + dest = va_arg(*ap, char *); bcopy(databuf, dest, width); if (letter == 'z') { char *p; @@ -287,7 +287,7 @@ do_buff_decode(u_int8_t *databuf, size_t * can't have a variable seek when you are using * "arg_put". */ - width = (arg_put) ? 0 : va_arg(ap, int); + width = (arg_put) ? 0 : va_arg(*ap, int); fmt++; } else { width = strtol(fmt, &intendp, 10); @@ -539,7 +539,7 @@ next_field(const char **pp, char *fmt, i static int do_encode(u_char *buff, size_t vec_max, size_t *used, int (*arg_get)(void *, char *), void *gethook, const char *fmt, - va_list ap) + va_list *ap) { int ind; int shift; @@ -564,7 +564,7 @@ do_encode(u_char *buff, size_t vec_max, else value = arg_get ? (*arg_get)(gethook, field_name) : - va_arg(ap, int); + va_arg(*ap, int); } #if 0 @@ -662,11 +662,16 @@ int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - 0, 0, fmt, ap)); + retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0, + fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -674,29 +679,31 @@ csio_decode_visit(struct ccb_scsiio *csi void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without * the arg_put function. */ if (arg_put == NULL) - return(-1); - - bzero(&ap, sizeof(ap)); + return (-1); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - arg_put, puthook, fmt, ap)); + return (do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, + arg_put, puthook, fmt, NULL)); } int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(buff, len, 0, 0, fmt, ap)); + retval = do_buff_decode(buff, len, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -704,7 +711,6 @@ buff_decode_visit(u_int8_t *buff, size_t void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without @@ -713,9 +719,7 @@ buff_decode_visit(u_int8_t *buff, size_t if (arg_put == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_buff_decode(buff, len, arg_put, puthook, fmt, ap)); + return (do_buff_decode(buff, len, arg_put, puthook, fmt, NULL)); } /* @@ -732,15 +736,15 @@ csio_build(struct ccb_scsiio *csio, u_in va_list ap; if (csio == NULL) - return(0); + return (0); bzero(csio, sizeof(struct ccb_scsiio)); va_start(ap, cmd_spec); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, NULL, NULL, cmd_spec, ap)) == -1) - return(retval); + &cmdlen, NULL, NULL, cmd_spec, &ap)) == -1) + goto done; cam_fill_csio(csio, /* retries */ retry_count, @@ -753,7 +757,10 @@ csio_build(struct ccb_scsiio *csio, u_in /* cdb_len */ cmdlen, /* timeout */ timeout ? timeout : 5000); - return(retval); +done: + va_end(ap); + + return (retval); } int @@ -762,7 +769,6 @@ csio_build_visit(struct ccb_scsiio *csio int timeout, const char *cmd_spec, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; size_t cmdlen; int retval; @@ -776,12 +782,10 @@ csio_build_visit(struct ccb_scsiio *csio if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - bzero(csio, sizeof(struct ccb_scsiio)); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, arg_get, gethook, cmd_spec, ap)) == -1) + &cmdlen, arg_get, gethook, cmd_spec, NULL)) == -1) return(retval); cam_fill_csio(csio, @@ -802,20 +806,24 @@ int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; if (csio == NULL) - return(0); + return (0); va_start(ap, fmt); - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, ap)); + retval = do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -824,16 +832,13 @@ buff_encode_visit(u_int8_t *buff, size_t if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(buff, len, 0, arg_get, gethook, fmt, ap)); + return (do_encode(buff, len, 0, arg_get, gethook, fmt, NULL)); } int csio_encode_visit(struct ccb_scsiio *csio, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -842,8 +847,6 @@ csio_encode_visit(struct ccb_scsiio *csi if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, - gethook, fmt, ap)); + return (do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, + gethook, fmt, NULL)); } From owner-svn-src-all@freebsd.org Wed May 4 01:29:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418C0B2ABCC; Wed, 4 May 2016 01:29:01 +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 107371036; Wed, 4 May 2016 01:29:00 +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 u441T0Q8065920; Wed, 4 May 2016 01:29:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u441T0vn065919; Wed, 4 May 2016 01:29:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040129.u441T0vn065919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 01:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299028 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 01:29:01 -0000 Author: adrian Date: Wed May 4 01:29:00 2016 New Revision: 299028 URL: https://svnweb.freebsd.org/changeset/base/299028 Log: [bwn] ensure the fallback rate stays in the same PHY mode. Falling back from 6MB OFDM to 5MB CCK (a) may not work well in the 11bg PHYs, (b) won't work at all if you're 11g only, and (c) plainly won't work for the 11a PHY. So, don't do that! Tested: * BCM4312 802.11b/g Wireless, STA mode WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed May 4 01:28:10 2016 (r299027) +++ head/sys/dev/bwn/if_bwn.c Wed May 4 01:29:00 2016 (r299028) @@ -5958,10 +5958,16 @@ bwn_antenna_sanitize(struct bwn_mac *mac return (n); } +/* + * Return a fallback rate for the given rate. + * + * Note: Don't fall back from OFDM to CCK. + */ static uint8_t bwn_get_fbrate(uint8_t bitrate) { switch (bitrate) { + /* CCK */ case BWN_CCK_RATE_1MB: return (BWN_CCK_RATE_1MB); case BWN_CCK_RATE_2MB: @@ -5970,8 +5976,10 @@ bwn_get_fbrate(uint8_t bitrate) return (BWN_CCK_RATE_2MB); case BWN_CCK_RATE_11MB: return (BWN_CCK_RATE_5MB); + + /* OFDM */ case BWN_OFDM_RATE_6MB: - return (BWN_CCK_RATE_5MB); + return (BWN_OFDM_RATE_6MB); case BWN_OFDM_RATE_9MB: return (BWN_OFDM_RATE_6MB); case BWN_OFDM_RATE_12MB: From owner-svn-src-all@freebsd.org Wed May 4 01:36:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87440B2AE2B; Wed, 4 May 2016 01:36:20 +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 481BC18BF; Wed, 4 May 2016 01:36:20 +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 u441aJjn069041; Wed, 4 May 2016 01:36:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u441aJs3069040; Wed, 4 May 2016 01:36:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040136.u441aJs3069040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 01:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299032 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 01:36:20 -0000 Author: adrian Date: Wed May 4 01:36:19 2016 New Revision: 299032 URL: https://svnweb.freebsd.org/changeset/base/299032 Log: [bwn] accurately(ish) account transmit/recieve failures for rate control. I noticed that it'd associate fine, but it'd quickly stop exchanging traffic. Receive was okay, but transmit just failed. Then I went "wlandebug +rate". I discovered it started at 36M OFDM, and then quickly rose to 54M, which then showed 0% transmit success. Then, I dug into how the completion path works. We are reading 'ack=0' in the TX status side, so .. then I discovered we were only processing the TX completion status /if/ ack=1. So, we'd only ever count successes; we'd never count failures, and thus the rate control code thought everything was a-ok. We also have to set retrycnt to something non-zero so it indeed does bring the rate down upon failure. So: * Delete the rate control completion code from the tx completion routine, it's just duplicate and never worked. Putting it behind 'if (status->ack) was pointless. * Move it to the PIO and DMA completion routines which actually do free the node reference and mbuf. We know at that point what the status is, so do it there. * Fake a retrycnt of 1 for now, so we at least count failures. Also: * Start adding comments about weird stuff I find with rate selection. In this instance, we shouldn't be selecting a fallback rate that doesn't match the currently configured mode (11a, 11b, 11g, etc.) This isn't perfect - AMRR does try 54mbit and takes a few packets before it figures out it's a bad idea - but it's better than nothing. This makes the bwn(4) driver actually useful for the first time since I've tried using it - and that dates back to 2011. I've resisted successfully until now. Tested: * Broadcom BCM4312 802.11b/g Wireless, STA mode WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2) TODO: * See if the fallback rate actually /is/ working * Question my own sanity over touching this driver in the first place. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed May 4 01:31:00 2016 (r299031) +++ head/sys/dev/bwn/if_bwn.c Wed May 4 01:36:19 2016 (r299032) @@ -5132,16 +5132,8 @@ bwn_dma_rxeof(struct bwn_dma_ring *dr, i static void bwn_handle_txeof(struct bwn_mac *mac, const struct bwn_txstatus *status) { - struct bwn_dma_ring *dr; - struct bwn_dmadesc_generic *desc; - struct bwn_dmadesc_meta *meta; - struct bwn_pio_txqueue *tq; - struct bwn_pio_txpkt *tp = NULL; struct bwn_softc *sc = mac->mac_sc; struct bwn_stats *stats = &mac->mac_stats; - struct ieee80211_node *ni; - struct ieee80211vap *vap; - int retrycnt = 0, slot; BWN_ASSERT_LOCKED(mac->mac_sc); @@ -5157,46 +5149,8 @@ bwn_handle_txeof(struct bwn_mac *mac, co } if (mac->mac_flags & BWN_MAC_FLAG_DMA) { - if (status->ack) { - dr = bwn_dma_parse_cookie(mac, status, - status->cookie, &slot); - if (dr == NULL) { - device_printf(sc->sc_dev, - "failed to parse cookie\n"); - return; - } - while (1) { - dr->getdesc(dr, slot, &desc, &meta); - if (meta->mt_islast) { - ni = meta->mt_ni; - vap = ni->ni_vap; - ieee80211_ratectl_tx_complete(vap, ni, - status->ack ? - IEEE80211_RATECTL_TX_SUCCESS : - IEEE80211_RATECTL_TX_FAILURE, - &retrycnt, 0); - break; - } - slot = bwn_dma_nextslot(dr, slot); - } - } bwn_dma_handle_txeof(mac, status); } else { - if (status->ack) { - tq = bwn_pio_parse_cookie(mac, status->cookie, &tp); - if (tq == NULL) { - device_printf(sc->sc_dev, - "failed to parse cookie\n"); - return; - } - ni = tp->tp_ni; - vap = ni->ni_vap; - ieee80211_ratectl_tx_complete(vap, ni, - status->ack ? - IEEE80211_RATECTL_TX_SUCCESS : - IEEE80211_RATECTL_TX_FAILURE, - &retrycnt, 0); - } bwn_pio_handle_txeof(mac, status); } @@ -5538,6 +5492,7 @@ bwn_dma_handle_txeof(struct bwn_mac *mac struct bwn_dmadesc_meta *meta; struct bwn_softc *sc = mac->mac_sc; int slot; + int retrycnt = 0; BWN_ASSERT_LOCKED(sc); @@ -5562,6 +5517,16 @@ bwn_dma_handle_txeof(struct bwn_mac *mac KASSERT(meta->mt_m != NULL, ("%s:%d: fail", __func__, __LINE__)); + /* XXX */ + if (status->ack == 0) + retrycnt = 1; + else + retrycnt = 0; + ieee80211_ratectl_tx_complete(meta->mt_ni->ni_vap, meta->mt_ni, + status->ack ? + IEEE80211_RATECTL_TX_SUCCESS : + IEEE80211_RATECTL_TX_FAILURE, + &retrycnt, 0); ieee80211_tx_complete(meta->mt_ni, meta->mt_m, 0); meta->mt_ni = NULL; meta->mt_m = NULL; @@ -5589,6 +5554,7 @@ bwn_pio_handle_txeof(struct bwn_mac *mac struct bwn_pio_txqueue *tq; struct bwn_pio_txpkt *tp = NULL; struct bwn_softc *sc = mac->mac_sc; + int retrycnt = 0; BWN_ASSERT_LOCKED(sc); @@ -5604,6 +5570,18 @@ bwn_pio_handle_txeof(struct bwn_mac *mac * Do any tx complete callback. Note this must * be done before releasing the node reference. */ + + /* XXX */ + if (status->ack == 0) + retrycnt = 1; + else + retrycnt = 0; + ieee80211_ratectl_tx_complete(tp->tp_ni->ni_vap, tp->tp_ni, + status->ack ? + IEEE80211_RATECTL_TX_SUCCESS : + IEEE80211_RATECTL_TX_FAILURE, + &retrycnt, 0); + if (tp->tp_m->m_flags & M_TXCB) ieee80211_process_callback(tp->tp_ni, tp->tp_m, 0); ieee80211_free_node(tp->tp_ni); @@ -5751,6 +5729,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) rate = rate_fb = tp->ucastrate; else { + /* XXX TODO: don't fall back to CCK rates for OFDM */ rix = ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; @@ -5763,6 +5742,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc sc->sc_tx_rate = rate; + /* Note: this maps the select ieee80211 rate to hardware rate */ rate = bwn_ieeerate2hwrate(sc, rate); rate_fb = bwn_ieeerate2hwrate(sc, rate_fb); @@ -5771,6 +5751,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc bcopy(wh->i_fc, txhdr->macfc, sizeof(txhdr->macfc)); bcopy(wh->i_addr1, txhdr->addr1, IEEE80211_ADDR_LEN); + /* XXX rate/rate_fb is the hardware rate */ if ((rate_fb == rate) || (*(u_int16_t *)wh->i_dur & htole16(0x8000)) || (*(u_int16_t *)wh->i_dur == htole16(0))) @@ -5792,6 +5773,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc txhdr->chan = phy->chan; phyctl |= (BWN_ISOFDMRATE(rate)) ? BWN_TX_PHY_ENC_OFDM : BWN_TX_PHY_ENC_CCK; + /* XXX preamble? obey net80211 */ if (isshort && (rate == BWN_CCK_RATE_2MB || rate == BWN_CCK_RATE_5MB || rate == BWN_CCK_RATE_11MB)) phyctl |= BWN_TX_PHY_SHORTPRMBL; @@ -5828,9 +5810,11 @@ bwn_set_txhdr(struct bwn_mac *mac, struc if (ic->ic_flags & IEEE80211_F_USEPROT) { /* XXX RTS rate is always 1MB??? */ + /* XXX TODO: don't fall back to CCK rates for OFDM */ rts_rate = BWN_CCK_RATE_1MB; rts_rate_fb = bwn_get_fbrate(rts_rate); + /* XXX 'rate' here is hardware rate now, not the net80211 rate */ protdur = ieee80211_compute_duration(ic->ic_rt, m->m_pkthdr.len, rate, isshort) + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); @@ -5851,6 +5835,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc rts = (struct ieee80211_frame_rts *)(BWN_ISOLDFMT(mac) ? (txhdr->body.old.rts_frame) : (txhdr->body.new.rts_frame)); + /* XXX rate/rate_fb is the hardware rate */ protdur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); mprot = ieee80211_alloc_rts(ic, wh->i_addr1, From owner-svn-src-all@freebsd.org Wed May 4 01:43:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDEAAB2AFFC; Wed, 4 May 2016 01:43:08 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2BF1D17; Wed, 4 May 2016 01:43:08 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u441h7D1071872; Wed, 4 May 2016 01:43:07 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u441h7No071871; Wed, 4 May 2016 01:43:07 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201605040143.u441h7No071871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 4 May 2016 01:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299033 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 01:43:09 -0000 Author: araujo Date: Wed May 4 01:43:07 2016 New Revision: 299033 URL: https://svnweb.freebsd.org/changeset/base/299033 Log: Use imin() macro from sys/libkern.h. MFC after: 2 weeks. Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Wed May 4 01:36:19 2016 (r299032) +++ head/sys/dev/hptiop/hptiop.c Wed May 4 01:43:07 2016 (r299033) @@ -1241,7 +1241,7 @@ static int hptiop_post_ioctl_command_mv( req->header.result = IOP_RESULT_PENDING; req->header.flags = IOP_REQUEST_FLAG_OUTPUT_CONTEXT; size = req->header.size >> 8; - size = size > 3 ? 3 : size; + size = imin(3, size); req_phy = hba->ctlcfgcmd_phy | MVIOP_MU_QUEUE_ADDR_HOST_BIT | size; hptiop_mv_inbound_write(req_phy, hba); @@ -2561,7 +2561,7 @@ static void hptiop_post_req_mv(struct hp size = req->header.size >> 8; hptiop_mv_inbound_write(req_phy | MVIOP_MU_QUEUE_ADDR_HOST_BIT - | (size > 3 ? 3 : size), hba); + | imin(3, size), hba); } static void hptiop_post_req_mvfrey(struct hpt_iop_hba *hba, From owner-svn-src-all@freebsd.org Wed May 4 01:56:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A16B2C448; Wed, 4 May 2016 01:56:39 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512BF1714; Wed, 4 May 2016 01:56:39 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u441ubj0075626; Wed, 4 May 2016 01:56:37 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u441ubHa075625; Wed, 4 May 2016 01:56:37 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201605040156.u441ubHa075625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 4 May 2016 01:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299034 - head/sys/dev/nvram2env X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 01:56:39 -0000 Author: kan Date: Wed May 4 01:56:37 2016 New Revision: 299034 URL: https://svnweb.freebsd.org/changeset/base/299034 Log: Fix nvram2env after bus_space_fdt removal. The generic bus space does the mapping now, no need to pre-translate phys addresses to KSEG1 anymore. Submitted by: Hiroki Mori Modified: head/sys/dev/nvram2env/nvram2env.c Modified: head/sys/dev/nvram2env/nvram2env.c ============================================================================== --- head/sys/dev/nvram2env/nvram2env.c Wed May 4 01:43:07 2016 (r299033) +++ head/sys/dev/nvram2env/nvram2env.c Wed May 4 01:56:37 2016 (r299034) @@ -127,7 +127,7 @@ nvram2env_probe(device_t dev) ivar == 0) continue; - sc->addr = MIPS_PHYS_TO_KSEG1(ivar); + sc->addr = ivar; if (bootverbose) device_printf(dev, "base=0x%08x sig=0x%08x " From owner-svn-src-all@freebsd.org Wed May 4 02:06:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D0BB2C661; Wed, 4 May 2016 02:06:47 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92E2C1D2F; Wed, 4 May 2016 02:06:47 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4426k51078824; Wed, 4 May 2016 02:06:46 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4426kbG078823; Wed, 4 May 2016 02:06:46 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605040206.u4426kbG078823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 4 May 2016 02:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299035 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 02:06:47 -0000 Author: vangyzen Date: Wed May 4 02:06:46 2016 New Revision: 299035 URL: https://svnweb.freebsd.org/changeset/base/299035 Log: sh: Handle empty hostname and $PWD when building prompt If the hostname is empty and \h is used in $PS1, the remainder of the prompt following \h will be empty. Likewise for $PWD and \w. Fix it. Reviewed by: jilles MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6188 Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed May 4 01:56:37 2016 (r299034) +++ head/bin/sh/parser.c Wed May 4 02:06:46 2016 (r299035) @@ -2014,8 +2014,9 @@ getprompt(void *unused __unused) gethostname(&ps[i], PROMPTLEN - i); /* Skip to end of hostname. */ trim = (*fmt == 'h') ? '.' : '\0'; - while ((ps[i+1] != '\0') && (ps[i+1] != trim)) + while ((ps[i] != '\0') && (ps[i] != trim)) i++; + --i; break; /* @@ -2027,7 +2028,7 @@ getprompt(void *unused __unused) case 'W': case 'w': pwd = lookupvar("PWD"); - if (pwd == NULL) + if (pwd == NULL || *pwd == '\0') pwd = "?"; if (*fmt == 'W' && *pwd == '/' && pwd[1] != '\0') From owner-svn-src-all@freebsd.org Wed May 4 02:11:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E713B2C815; Wed, 4 May 2016 02:11:46 +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 253791FAC; Wed, 4 May 2016 02:11:46 +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 u442Bjal081628; Wed, 4 May 2016 02:11:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u442BjO0081627; Wed, 4 May 2016 02:11:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040211.u442BjO0081627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 02:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299036 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 02:11:46 -0000 Author: adrian Date: Wed May 4 02:11:45 2016 New Revision: 299036 URL: https://svnweb.freebsd.org/changeset/base/299036 Log: [bwn] fix rate control feedback. * Add a debug print for the xmit completion status fields. Yes, I like staring at a stream of DWORDS. * Set the retrycnt to the number of full frame retries for now; I'll figure out how to factor rts/cts failures into it when I figure out what the difference is. It's -1 because it's not "retries", it's "tries". It now passes the youtube test. Tested: * BCM4312, STA mode Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed May 4 02:06:46 2016 (r299035) +++ head/sys/dev/bwn/if_bwn.c Wed May 4 02:11:45 2016 (r299036) @@ -4942,6 +4942,12 @@ bwn_intr_txeof(struct bwn_mac *mac) break; stat1 = BWN_READ_4(mac, BWN_XMITSTAT_1); + DPRINTF(mac->mac_sc, BWN_DEBUG_XMIT, + "%s: stat0=0x%08x, stat1=0x%08x\n", + __func__, + stat0, + stat1); + stat.cookie = (stat0 >> 16); stat.seq = (stat1 & 0x0000ffff); stat.phy_stat = ((stat1 & 0x00ff0000) >> 16); @@ -5517,11 +5523,8 @@ bwn_dma_handle_txeof(struct bwn_mac *mac KASSERT(meta->mt_m != NULL, ("%s:%d: fail", __func__, __LINE__)); - /* XXX */ - if (status->ack == 0) - retrycnt = 1; - else - retrycnt = 0; + /* Just count full frame retries for now */ + retrycnt = status->framecnt - 1; ieee80211_ratectl_tx_complete(meta->mt_ni->ni_vap, meta->mt_ni, status->ack ? IEEE80211_RATECTL_TX_SUCCESS : @@ -5571,11 +5574,8 @@ bwn_pio_handle_txeof(struct bwn_mac *mac * be done before releasing the node reference. */ - /* XXX */ - if (status->ack == 0) - retrycnt = 1; - else - retrycnt = 0; + /* Just count full frame retries for now */ + retrycnt = status->framecnt - 1; ieee80211_ratectl_tx_complete(tp->tp_ni->ni_vap, tp->tp_ni, status->ack ? IEEE80211_RATECTL_TX_SUCCESS : From owner-svn-src-all@freebsd.org Wed May 4 03:07:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95ADB2C513; Wed, 4 May 2016 03:07:53 +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 81A7D1278; Wed, 4 May 2016 03:07:53 +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 u4437q5f097599; Wed, 4 May 2016 03:07:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4437qSc097598; Wed, 4 May 2016 03:07:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605040307.u4437qSc097598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 4 May 2016 03:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299040 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 03:07:53 -0000 Author: sephe Date: Wed May 4 03:07:52 2016 New Revision: 299040 URL: https://svnweb.freebsd.org/changeset/base/299040 Log: kern: Factor out function to convert hash flags to malloc(9) flags Suggested by: jhb Reviewed by: jhb, kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6184 Modified: head/sys/kern/subr_hash.c Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Wed May 4 02:23:14 2016 (r299039) +++ head/sys/kern/subr_hash.c Wed May 4 03:07:52 2016 (r299040) @@ -41,6 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include +static __inline int +hash_mflags(int flags) +{ + + return ((flags & HASH_NOWAIT) ? M_NOWAIT : M_WAITOK); +} + /* * General routine to allocate a hash table with control of memory flags. */ @@ -61,13 +68,8 @@ hashinit_flags(int elements, struct mall continue; hashsize >>= 1; - if (flags & HASH_NOWAIT) - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), - type, M_NOWAIT); - else - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), - type, M_WAITOK); - + hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, + hash_mflags(flags)); if (hashtbl != NULL) { for (i = 0; i < hashsize; i++) LIST_INIT(&hashtbl[i]); @@ -112,7 +114,7 @@ phashinit_flags(int elements, struct mal { long hashsize; LIST_HEAD(generic, generic) *hashtbl; - int i, m_flags; + int i; KASSERT(elements > 0, ("%s: bad elements", __func__)); /* Exactly one of HASH_WAITOK and HASH_NOWAIT must be set. */ @@ -127,8 +129,8 @@ phashinit_flags(int elements, struct mal } hashsize = primes[i - 1]; - m_flags = (flags & HASH_NOWAIT) ? M_NOWAIT : M_WAITOK; - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, m_flags); + hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, + hash_mflags(flags)); if (hashtbl == NULL) return (NULL); From owner-svn-src-all@freebsd.org Wed May 4 03:13:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB200B2C697; Wed, 4 May 2016 03:13:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88D0A1889; Wed, 4 May 2016 03:13:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u443DmRW000640; Wed, 4 May 2016 03:13:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u443Dmkm000639; Wed, 4 May 2016 03:13:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605040313.u443Dmkm000639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 4 May 2016 03:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299041 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 03:13:49 -0000 Author: bdrewery Date: Wed May 4 03:13:48 2016 New Revision: 299041 URL: https://svnweb.freebsd.org/changeset/base/299041 Log: DIRDEPS_BUILD: Exclude secure/lib* libraries for host builds. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Wed May 4 03:07:52 2016 (r299040) +++ head/share/mk/local.dirdeps.mk Wed May 4 03:13:48 2016 (r299041) @@ -42,6 +42,7 @@ DIRDEPS_FILTER.host = \ Nlib/[mn]* \ Ngnu/lib/csu* \ Ngnu/lib/lib[a-r]* \ + Nsecure/lib* \ Nusr.bin/xinstall* \ From owner-svn-src-all@freebsd.org Wed May 4 03:14:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC78B2C6EA; Wed, 4 May 2016 03:14:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDA561A37; Wed, 4 May 2016 03:14:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u443EYvw000708; Wed, 4 May 2016 03:14:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u443EYrh000707; Wed, 4 May 2016 03:14:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605040314.u443EYrh000707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 4 May 2016 03:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299042 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 03:14:36 -0000 Author: bdrewery Date: Wed May 4 03:14:34 2016 New Revision: 299042 URL: https://svnweb.freebsd.org/changeset/base/299042 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/mkuzip/Makefile.depend Modified: head/usr.bin/mkuzip/Makefile.depend ============================================================================== --- head/usr.bin/mkuzip/Makefile.depend Wed May 4 03:13:48 2016 (r299041) +++ head/usr.bin/mkuzip/Makefile.depend Wed May 4 03:14:34 2016 (r299042) @@ -13,6 +13,7 @@ DIRDEPS = \ lib/libmd \ lib/libthr \ lib/libz \ + lib/msun \ .include From owner-svn-src-all@freebsd.org Wed May 4 05:55:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A9A6B2C94F; Wed, 4 May 2016 05:55:18 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 742401E27; Wed, 4 May 2016 05:55:17 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id n129so8309951wmn.1; Tue, 03 May 2016 22:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+esITPc6HwaczK3Us7vEh73e6ABu7DTyNeWA4f713rk=; b=HFw/Btm+5QjykiI4ANsJo5nr1Rh2itU2KH7S+mxaKvRJ7OTgmgZ8bSdoeW//GmtyaD w9vmE3O49o5OV8gfn1c/Fn2ameZYjyb1dmQZ/TYhP8EckFqa2sbUd/UNJHV/atP++GBs ZJ64FmoyBjMDXtYs6UQjFRB01yRSyCaGbXBUINQo8viGAvPcIMOWHIE5rO/A3yW9JVG0 cAiPux33oZXLQH3gF/wZWwyeH4yHTWCWhxm3+ECU6nSGppfD4otZPd3UuArHwWvDp4nq q3kOy1mm8dzjB7PsLBz5nULrxCuNdEWUaOu64WWLp8I+B0nZeERpB6/38eS5HruO6dZW Bcmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+esITPc6HwaczK3Us7vEh73e6ABu7DTyNeWA4f713rk=; b=K1qr5tmwbzPB/li1yTz4akkP5GYyCdKiLldrma4P0EYk5domlGj6Yem4qs4zpqgf2u YXHCjrBClX3BGELcy2jkVa3KXF6oJ7jSmy7TK/NQzr2et4dpq0fm2Yy6fbLVogb1FsWs ZRKiXgsOv+7tCDyczJJS8hVvj601cK6PeQHNPyCNscUe8jT/FEQKnvyDI/TcRM3HLuOI Fujog5Ykz2DhZWqnOJjm+84ViHlvVLSujDu3viItBBjLvo/y2bG1sXMuOsBgAi23EatX G3jgS/HS/83/Ft7aowjbAa0r7/KXPxH9IhLtMwaN+/Kjf4+Y20Ymoxu+Fsw3phGjn8e5 01Cw== X-Gm-Message-State: AOPr4FUx1fmX5R9Ecqs1NL7Xw7U4RCVlefSAbaVV/VxSwnETgMpBOuSl4XfIVk5zxsxOc6tcCMlZNuX/XPeyyA== X-Received: by 10.194.234.167 with SMTP id uf7mr6545806wjc.122.1462341315997; Tue, 03 May 2016 22:55:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.43.193 with HTTP; Tue, 3 May 2016 22:54:46 -0700 (PDT) In-Reply-To: <201604292327.u3TNRFVt067723@repo.freebsd.org> References: <201604292327.u3TNRFVt067723@repo.freebsd.org> From: Kamil Czekirda Date: Wed, 4 May 2016 07:54:46 +0200 Message-ID: Subject: Re: svn commit: r298823 - in head: gnu/usr.bin gnu/usr.bin/sdiff usr.bin usr.bin/sdiff usr.bin/sdiff/tests To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 05:55:18 -0000 Hi, make ftp stops here since r298823: ===> usr.bin/sdiff/tests (distribute) cd /usr/src/usr.bin/sdiff/tests; make install -DNO_SUBDIR DESTDIR=/usr/src/release/dist/tests SHARED=copies install -o root -g wheel -m 555 sdiff /usr/src/release/dist/tests/usr/tests/usr.bin/sdiff/sdiff install: /usr/src/release/dist/tests/usr/tests/usr.bin/sdiff/sdiff: No such file or directory *** Error code 71 Stop. make[8]: stopped in /usr/src/usr.bin/sdiff/tests *** Error code 1 Stop. make[7]: stopped in /usr/src/usr.bin/sdiff/tests *** Error code 1 Stop. make[6]: stopped in /usr/src/usr.bin/sdiff *** Error code 1 Stop. make[5]: stopped in /usr/src/usr.bin *** Error code 1 Stop. make[4]: stopped in /usr/src *** Error code 1 Stop. make[3]: stopped in /usr/src *** Error code 1 Stop. make[2]: stopped in /usr/src *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src/release 2016-04-30 1:27 GMT+02:00 Baptiste Daroussin : > Author: bapt > Date: Fri Apr 29 23:27:15 2016 > New Revision: 298823 > URL: https://svnweb.freebsd.org/changeset/base/298823 > > Log: > import sdiff(1) from GSoC 2012 > > Import sdiff(1) from the diff version written by Raymond Lai, > improved during GSoC 2012 by Jesse Hagewood. > > Compared to the version done in during that summer of code: > - Remove the zlib frontend: zsdiff > - Compatible output (column size and separators) with GNU sdiff > > Compared to GNU sdiff in ports: > - The only difference is padding using spaces vs tabs > > Compared to OpenBSD and NetBSD import: > - Implement missing options (including long options) from GNU sdiff > - Improved support for the edition mode (signal handling) > - Output visually compatible with GNU sdiff: size of columns > > While here import regression tests from NetBSD adapted to fit the output > as > expected by GNU sdiff > > Reviewed by: emaste (in part) > Obtained from: OpenBSD, NetBSD, GSoC 2012 > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D5981 > Differential Revision: https://reviews.freebsd.org/D6032 (diff > with NetBSD version) > Differential Revision: https://reviews.freebsd.org/D6033 (diff > with OpenBSD version) > > Added: > head/usr.bin/sdiff/ > head/usr.bin/sdiff/Makefile (contents, props changed) > head/usr.bin/sdiff/common.c (contents, props changed) > head/usr.bin/sdiff/common.h (contents, props changed) > head/usr.bin/sdiff/edit.c (contents, props changed) > head/usr.bin/sdiff/extern.h (contents, props changed) > head/usr.bin/sdiff/sdiff.1 (contents, props changed) > head/usr.bin/sdiff/sdiff.c (contents, props changed) > head/usr.bin/sdiff/tests/ > head/usr.bin/sdiff/tests/Makefile (contents, props changed) > head/usr.bin/sdiff/tests/d_dot.in (contents, props changed) > head/usr.bin/sdiff/tests/d_flags_l.out (contents, props changed) > head/usr.bin/sdiff/tests/d_flags_s.out (contents, props changed) > head/usr.bin/sdiff/tests/d_flags_w.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_a1.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_a2.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_b1.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_b2.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_c1.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_c2.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_d1.out (contents, props changed) > head/usr.bin/sdiff/tests/d_iflags_d2.out (contents, props changed) > head/usr.bin/sdiff/tests/d_input1 (contents, props changed) > head/usr.bin/sdiff/tests/d_input2 (contents, props changed) > head/usr.bin/sdiff/tests/d_oneline.in (contents, props changed) > head/usr.bin/sdiff/tests/d_oneline_a.out (contents, props changed) > head/usr.bin/sdiff/tests/d_oneline_b.out (contents, props changed) > head/usr.bin/sdiff/tests/d_same.out (contents, props changed) > head/usr.bin/sdiff/tests/d_short.out (contents, props changed) > head/usr.bin/sdiff/tests/d_tabends.in (contents, props changed) > head/usr.bin/sdiff/tests/d_tabends_a.out (contents, props changed) > head/usr.bin/sdiff/tests/d_tabends_b.out (contents, props changed) > head/usr.bin/sdiff/tests/d_tabends_c.out (contents, props changed) > head/usr.bin/sdiff/tests/d_tabs.out (contents, props changed) > head/usr.bin/sdiff/tests/d_tabs1.in (contents, props changed) > head/usr.bin/sdiff/tests/d_tabs2.in (contents, props changed) > head/usr.bin/sdiff/tests/sdiff.sh (contents, props changed) > Deleted: > head/gnu/usr.bin/sdiff/ > Modified: > head/gnu/usr.bin/Makefile > head/usr.bin/Makefile > > Modified: head/gnu/usr.bin/Makefile > > ============================================================================== > --- head/gnu/usr.bin/Makefile Fri Apr 29 22:43:11 2016 (r298822) > +++ head/gnu/usr.bin/Makefile Fri Apr 29 23:27:15 2016 (r298823) > @@ -13,7 +13,6 @@ SUBDIR= ${_binutils} \ > grep \ > ${_groff} \ > ${_rcs} \ > - sdiff \ > ${_tests} > > SUBDIR_DEPEND_gdb= ${_binutils} > > Modified: head/usr.bin/Makefile > > ============================================================================== > --- head/usr.bin/Makefile Fri Apr 29 22:43:11 2016 (r298822) > +++ head/usr.bin/Makefile Fri Apr 29 23:27:15 2016 (r298823) > @@ -134,6 +134,7 @@ SUBDIR= alias \ > rusers \ > rwall \ > script \ > + sdiff \ > sed \ > send-pr \ > seq \ > > Added: head/usr.bin/sdiff/Makefile > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/Makefile Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,16 @@ > +# $FreeBSD$ > + > +.include > + > +PROG= sdiff > +SRCS= common.c edit.c sdiff.c > +WARNS= 3 > + > +LIBADD= util > +MAN1= sdiff.1 > + > +.if ${MK_TESTS} != "no" > +SUBDIR+= tests > +.endif > + > +.include > > Added: head/usr.bin/sdiff/common.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/common.c Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,24 @@ > +/* $OpenBSD: common.c,v 1.4 2006/05/25 03:20:32 ray Exp $ */ > + > +/* > + * Written by Raymond Lai . > + * Public domain. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > + > +#include "common.h" > + > +void > +cleanup(const char *filename) > +{ > + > + if (unlink(filename)) > + err(2, "could not delete: %s", filename); > + exit(2); > +} > > Added: head/usr.bin/sdiff/common.h > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/common.h Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,9 @@ > +/* $OpenBSD: common.h,v 1.2 2006/05/25 03:20:32 ray Exp $ */ > +/* $FreeBSD$ */ > + > +/* > + * Written by Raymond Lai . > + * Public domain. > + */ > + > +void cleanup(const char *) __dead2; > > Added: head/usr.bin/sdiff/edit.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/edit.c Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,209 @@ > +/* $OpenBSD: edit.c,v 1.19 2009/06/07 13:29:50 ray Exp $ */ > + > +/* > + * Written by Raymond Lai . > + * Public domain. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "common.h" > +#include "extern.h" > + > +int editit(const char *); > + > +/* > + * Execute an editor on the specified pathname, which is interpreted > + * from the shell. This means flags may be included. > + * > + * Returns -1 on error, or the exit value on success. > + */ > +int > +editit(const char *pathname) > +{ > + char *argp[] = {"sh", "-c", NULL, NULL}, *ed, *p; > + sig_t sighup, sigint, sigquit, sigchld; > + pid_t pid; > + int saved_errno, st, ret = -1; > + > + ed = getenv("VISUAL"); > + if (ed == NULL || ed[0] == '\0') > + ed = getenv("EDITOR"); > + if (ed == NULL || ed[0] == '\0') > + ed = _PATH_VI; > + if (asprintf(&p, "%s %s", ed, pathname) == -1) > + return (-1); > + argp[2] = p; > + > + sighup = signal(SIGHUP, SIG_IGN); > + sigint = signal(SIGINT, SIG_IGN); > + sigquit = signal(SIGQUIT, SIG_IGN); > + sigchld = signal(SIGCHLD, SIG_DFL); > + if ((pid = fork()) == -1) > + goto fail; > + if (pid == 0) { > + execv(_PATH_BSHELL, argp); > + _exit(127); > + } > + while (waitpid(pid, &st, 0) == -1) > + if (errno != EINTR) > + goto fail; > + if (!WIFEXITED(st)) > + errno = EINTR; > + else > + ret = WEXITSTATUS(st); > + > + fail: > + saved_errno = errno; > + (void)signal(SIGHUP, sighup); > + (void)signal(SIGINT, sigint); > + (void)signal(SIGQUIT, sigquit); > + (void)signal(SIGCHLD, sigchld); > + free(p); > + errno = saved_errno; > + return (ret); > +} > + > +/* > + * Parse edit command. Returns 0 on success, -1 on error. > + */ > +int > +eparse(const char *cmd, const char *left, const char *right) > +{ > + FILE *file; > + size_t nread; > + int fd; > + char *filename; > + char buf[BUFSIZ], *text; > + > + /* Skip whitespace. */ > + while (isspace(*cmd)) > + ++cmd; > + > + text = NULL; > + switch (*cmd) { > + case '\0': > + /* Edit empty file. */ > + break; > + > + case 'b': > + /* Both strings. */ > + if (left == NULL) > + goto RIGHT; > + if (right == NULL) > + goto LEFT; > + > + /* Neither column is blank, so print both. */ > + if (asprintf(&text, "%s\n%s\n", left, right) == -1) > + err(2, "could not allocate memory"); > + break; > + > + case 'l': > +LEFT: > + /* Skip if there is no left column. */ > + if (left == NULL) > + break; > + > + if (asprintf(&text, "%s\n", left) == -1) > + err(2, "could not allocate memory"); > + > + break; > + > + case 'r': > +RIGHT: > + /* Skip if there is no right column. */ > + if (right == NULL) > + break; > + > + if (asprintf(&text, "%s\n", right) == -1) > + err(2, "could not allocate memory"); > + > + break; > + > + default: > + return (-1); > + } > + > + /* Create temp file. */ > + if (asprintf(&filename, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) > + err(2, "asprintf"); > + if ((fd = mkstemp(filename)) == -1) > + err(2, "mkstemp"); > + if (text != NULL) { > + size_t len; > + ssize_t nwritten; > + > + len = strlen(text); > + if ((nwritten = write(fd, text, len)) == -1 || > + (size_t)nwritten != len) { > + warn("error writing to temp file"); > + cleanup(filename); > + } > + } > + close(fd); > + > + /* text is no longer used. */ > + free(text); > + > + /* Edit temp file. */ > + if (editit(filename) == -1) { > + warn("error editing %s", filename); > + cleanup(filename); > + } > + > + /* Open temporary file. */ > + if (!(file = fopen(filename, "r"))) { > + warn("could not open edited file: %s", filename); > + cleanup(filename); > + } > + > + /* Copy temporary file contents to output file. */ > + for (nread = sizeof(buf); nread == sizeof(buf);) { > + size_t nwritten; > + > + nread = fread(buf, sizeof(*buf), sizeof(buf), file); > + /* Test for error or end of file. */ > + if (nread != sizeof(buf) && > + (ferror(file) || !feof(file))) { > + warnx("error reading edited file: %s", filename); > + cleanup(filename); > + } > + > + /* > + * If we have nothing to read, break out of loop > + * instead of writing nothing. > + */ > + if (!nread) > + break; > + > + /* Write data we just read. */ > + nwritten = fwrite(buf, sizeof(*buf), nread, outfp); > + if (nwritten != nread) { > + warnx("error writing to output file"); > + cleanup(filename); > + } > + } > + > + /* We've reached the end of the temporary file, so remove it. */ > + if (unlink(filename)) > + warn("could not delete: %s", filename); > + fclose(file); > + > + free(filename); > + > + return (0); > +} > > Added: head/usr.bin/sdiff/extern.h > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/extern.h Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,12 @@ > +/* $OpenBSD: extern.h,v 1.5 2009/06/07 13:29:50 ray Exp $ */ > +/* $FreeBSD$ */ > + > +/* > + * Written by Raymond Lai . > + * Public domain. > + */ > + > +extern FILE *outfp; /* file to save changes to */ > +extern const char *tmpdir; > + > +int eparse(const char *, const char *, const char *); > > Added: head/usr.bin/sdiff/sdiff.1 > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/sdiff.1 Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,174 @@ > +.\" $FreeBSD$ > +.\" $OpenBSD: sdiff.1,v 1.15 2007/06/29 14:48:07 jmc Exp $ > +.\" > +.\" Written by Raymond Lai . > +.\" Public domain. > +.\" > +.Dd $Mdocdate: July 5 2012 $ > +.Dt SDIFF 1 > +.Os > +.Sh NAME > +.Nm sdiff > +.Nd side-by-side diff > +.Sh SYNOPSIS > +.Nm > +.Op Fl abdilstW > +.Op Fl I Ar regexp > +.Op Fl o Ar outfile > +.Op Fl w Ar width > +.Ar file1 > +.Ar file2 > +.Sh DESCRIPTION > +.Nm > +displays two files side by side, > +with any differences between the two highlighted as follows: > +new lines are marked with > +.Sq \*(Gt ; > +deleted lines are marked with > +.Sq \*(Lt ; > +and changed lines are marked with > +.Sq \*(Ba . > +.Pp > +.Nm > +can also be used to interactively merge two files, > +prompting at each set of differences. > +See the > +.Fl o > +option for an explanation. > +.Pp > +The options are: > +.Bl -tag -width Ds > +.It Fl l -left-column > +Only print the left column for identical lines. > +.It Fl o -output Ar outfile > +Interactively merge > +.Ar file1 > +and > +.Ar file2 > +into > +.Ar outfile . > +In this mode, the user is prompted for each set of differences. > +See > +.Ev EDITOR > +and > +.Ev VISUAL , > +below, > +for details of which editor, if any, is invoked. > +.Pp > +The commands are as follows: > +.Bl -tag -width Ds > +.It Cm l | 1 > +Choose left set of diffs. > +.It Cm r | 2 > +Choose right set of diffs. > +.It Cm s > +Silent mode \(en identical lines are not printed. > +.It Cm v > +Verbose mode \(en identical lines are printed. > +.It Cm e > +Start editing an empty file, which will be merged into > +.Ar outfile > +upon exiting the editor. > +.It Cm e Cm l > +Start editing file with left set of diffs. > +.It Cm e Cm r > +Start editing file with right set of diffs. > +.It Cm e Cm b > +Start editing file with both sets of diffs. > +.It Cm q > +Quit > +.Nm . > +.El > +.It Fl s -suppress-common-lines > +Skip identical lines. > +.It Fl w -width Ar width > +Print a maximum of > +.Ar width > +characters on each line. > +The default is 130 characters. > +.El > +.Pp > +Options passed to > +.Xr diff 1 > +are: > +.Bl -tag -width Ds > +.It Fl a -text > +Treat > +.Ar file1 > +and > +.Ar file2 > +as text files. > +.It Fl b -ignore-space-change > +Ignore trailing blank spaces. > +.It Fl d -minimal > +Minimize diff size. > +.It Fl I -ignore-matching-lines Ar regexp > +Ignore line changes matching > +.Ar regexp . > +All lines in the change must match > +.Ar regexp > +for the change to be ignored. > +.It Fl i -ignore-case > +Do a case-insensitive comparison. > +.It Fl t -expand-tabs > +Expand tabs to spaces. > +.It Fl W -ignore-all-space > +Ignore all spaces. > +.It Fl B -ignore-blank-lines > +Ignore blank lines. > +.It Fl E -ignore-tab-expansion > +Treat tabs and eight spaces as the same. > +.It Fl t -ignore-tabs > +Ignore tabs. > +.It Fl H -speed-large-files > +Assume scattered small changes in a large file. > +.It Fl -ignore-file-name-case > +Ignore the case of file names. > +.It Fl -no-ignore-file-name-case > +Do not ignore file name case. > +.It Fl -strip-trailing-cr > +Skip identical lines. > +.It Fl -tabsize Ar NUM > +Change the size of tabs (default is 8.) > +.El > +.Sh ENVIRONMENT > +.Bl -tag -width Ds > +.It Ev EDITOR , VISUAL > +Specifies an editor to use with the > +.Fl o > +option. > +If both > +.Ev EDITOR > +and > +.Ev VISUAL > +are set, > +.Ev VISUAL > +takes precedence. > +If neither > +.Ev EDITOR > +nor > +.Ev VISUAL > +are set, > +the default is > +.Xr vi 1 . > +.It Ev TMPDIR > +Specifies a directory for temporary files to be created. > +The default is > +.Pa /tmp . > +.El > +.Sh SEE ALSO > +.Xr cmp 1 , > +.Xr diff 1 , > +.Xr diff3 1 , > +.Xr vi 1 , > +.Xr re_format 7 > +.Sh AUTHORS > +.Nm > +was written from scratch for the public domain by > +.An Ray Lai Aq ray@cyth.net . > +.Sh CAVEATS > +.Pp > +Tabs are treated as anywhere from one to eight characters wide, > +depending on the current column. > +Terminals that treat tabs as eight characters wide will look best. > + > > Added: head/usr.bin/sdiff/sdiff.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/sdiff/sdiff.c Fri Apr 29 23:27:15 2016 (r298823) > @@ -0,0 +1,1184 @@ > +/* $OpenBSD: sdiff.c,v 1.36 2015/12/29 19:04:46 gsoares Exp $ */ > + > +/* > + * Written by Raymond Lai . > + * Public domain. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "common.h" > +#include "extern.h" > + > +#define DIFF_PATH "/usr/bin/diff" > + > +#define WIDTH 126 > +/* > + * Each column must be at least one character wide, plus three > + * characters between the columns (space, [<|>], space). > + */ > +#define WIDTH_MIN 5 > + > +/* 3 kilobytes of chars */ > +#define MAX_CHECK 768 > + > +/* A single diff line. */ > +struct diffline { > + STAILQ_ENTRY(diffline) diffentries; > + char *left; > + char div; > + char *right; > +}; > + > +static void astrcat(char **, const char *); > +static void enqueue(char *, char, char *); > +static char *mktmpcpy(const char *); > +static int istextfile(FILE *); > +static void binexec(char *, char *, char *) __dead2; > +static void freediff(struct diffline *); > +static void int_usage(void); > +static int parsecmd(FILE *, FILE *, FILE *); > +static void printa(FILE *, size_t); > +static void printc(FILE *, size_t, FILE *, size_t); > +static void printcol(const char *, size_t *, const size_t); > +static void printd(FILE *, size_t); > +static void println(const char *, const char, const char *); > +static void processq(void); > +static void prompt(const char *, const char *); > +static void usage(void) __dead2; > +static char *xfgets(FILE *); > + > +static STAILQ_HEAD(, diffline) diffhead = > STAILQ_HEAD_INITIALIZER(diffhead); > +static size_t line_width; /* width of a line (two columns and > divider) */ > +static size_t width; /* width of each column */ > +static size_t file1ln, file2ln; /* line number of file1 and file2 > */ > +static int Iflag = 0; /* ignore sets matching regexp */ > +static int lflag; /* print only left column for identical > lines */ > +static int sflag; /* skip identical lines */ > +FILE *outfp; /* file to save changes to */ > +const char *tmpdir; /* TMPDIR or /tmp */ > + > +enum { > + HELP_OPT = CHAR_MAX + 1, > + NORMAL_OPT, > + FCASE_SENSITIVE_OPT, > + FCASE_IGNORE_OPT, > + FROMFILE_OPT, > + TOFILE_OPT, > + UNIDIR_OPT, > + STRIPCR_OPT, > + HORIZ_OPT, > + LEFTC_OPT, > + SUPCL_OPT, > + LF_OPT, > + /* the following groupings must be in sequence */ > + OLDGF_OPT, > + NEWGF_OPT, > + UNCGF_OPT, > + CHGF_OPT, > + OLDLF_OPT, > + NEWLF_OPT, > + UNCLF_OPT, > + /* end order-sensitive enums */ > + TSIZE_OPT, > + HLINES_OPT, > + LFILES_OPT, > + DIFFPROG_OPT, > + PIPE_FD, > + /* pid from the diff parent (if applicable) */ > + DIFF_PID, > + > + NOOP_OPT, > +}; > + > +static struct option longopts[] = { > + /* options only processed in sdiff */ > + { "left-column", no_argument, NULL, > LEFTC_OPT }, > + { "suppress-common-lines", no_argument, NULL, > 's' }, > + { "width", required_argument, NULL, > 'w' }, > + > + { "output", required_argument, NULL, > 'o' }, > + { "diff-program", required_argument, NULL, > DIFFPROG_OPT }, > + > + { "pipe-fd", required_argument, NULL, > PIPE_FD }, > + { "diff-pid", required_argument, NULL, > DIFF_PID }, > + /* Options processed by diff. */ > + { "ignore-file-name-case", no_argument, NULL, > FCASE_IGNORE_OPT }, > + { "no-ignore-file-name-case", no_argument, NULL, > FCASE_SENSITIVE_OPT }, > + { "strip-trailing-cr", no_argument, NULL, > STRIPCR_OPT }, > + { "tabsize", required_argument, NULL, > TSIZE_OPT }, > + { "help", no_argument, NULL, > HELP_OPT }, > + { "text", no_argument, NULL, > 'a' }, > + { "ignore-blank-lines", no_argument, NULL, > 'B' }, > + { "ignore-space-change", no_argument, NULL, > 'b' }, > + { "minimal", no_argument, NULL, > 'd' }, > + { "ignore-tab-expansion", no_argument, NULL, > 'E' }, > + { "ignore-matching-lines", required_argument, NULL, > 'I' }, > + { "ignore-case", no_argument, NULL, > 'i' }, > + { "expand-tabs", no_argument, NULL, > 't' }, > + { "speed-large-files", no_argument, NULL, > 'H' }, > + { "ignore-all-space", no_argument, NULL, > 'W' }, > + > + { NULL, 0, NULL, > '\0'} > +}; > + > +static const char *help_msg[] = { > + "\nusage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] > file1 file2\n", > + "\t-l, --left-column, Only print the left column for identical > lines.", > + "\t-o OUTFILE, --output=OUTFILE, nteractively merge file1 and > file2 into outfile.", > + "\t-s, --suppress-common-lines, Skip identical lines.", > + "\t-w WIDTH, --width=WIDTH, Print a maximum of WIDTH characters on > each line.", > + "\tOptions passed to diff(1) are:", > + "\t\t-a, --text, Treat file1 and file2 as text files.", > + "\t\t-b, --ignore-trailing-cr, Ignore trailing blank spaces.", > + "\t\t-d, --minimal, Minimize diff size.", > + "\t\t-I RE, --ignore-matching-lines=RE, Ignore changes whose line > matches RE.", > + "\t\t-i, --ignore-case, Do a case-insensitive comparison.", > + "\t\t-t, --expand-tabs Expand tabs to spaces.", > + "\t\t-W, --ignore-all-spaces, Ignore all spaces.", > + "\t\t--speed-large-files, Assume large file with scattered > changes.", > + "\t\t--strip-trailing-cr, Strip trailing carriage return.", > + "\t\t--ignore-file-name-case, Ignore case of file names.", > + "\t\t--no-ignore-file-name-case, Do not ignore file name case", > + "\t\t--tabsize NUM, Change size of tabs (default 8.)", > + > + NULL, > +}; > + > +/* > + * Create temporary file if source_file is not a regular file. > + * Returns temporary file name if one was malloced, NULL if unnecessary. > + */ > +static char * > +mktmpcpy(const char *source_file) > +{ > + struct stat sb; > + ssize_t rcount; > + int ifd, ofd; > + u_char buf[BUFSIZ]; > + char *target_file; > + > + /* Open input and output. */ > + ifd = open(source_file, O_RDONLY, 0); > + /* File was opened successfully. */ > + if (ifd != -1) { > + if (fstat(ifd, &sb) == -1) > + err(2, "error getting file status from %s", > source_file); > + > + /* Regular file. */ > + if (S_ISREG(sb.st_mode)) { > + close(ifd); > + return (NULL); > + } > + } else { > + /* If ``-'' does not exist the user meant stdin. */ > + if (errno == ENOENT && strcmp(source_file, "-") == 0) > + ifd = STDIN_FILENO; > + else > + err(2, "error opening %s", source_file); > + } > + > + /* Not a regular file, so copy input into temporary file. */ > + if (asprintf(&target_file, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) > + err(2, "asprintf"); > + if ((ofd = mkstemp(target_file)) == -1) { > + warn("error opening %s", target_file); > + goto FAIL; > + } > + while ((rcount = read(ifd, buf, sizeof(buf))) != -1 && > + rcount != 0) { > + ssize_t wcount; > + > + wcount = write(ofd, buf, (size_t)rcount); > + if (-1 == wcount || rcount != wcount) { > + warn("error writing to %s", target_file); > + goto FAIL; > + } > + } > + if (rcount == -1) { > + warn("error reading from %s", source_file); > + goto FAIL; > + } > + > + close(ifd); > + close(ofd); > + > + return (target_file); > + > +FAIL: > + unlink(target_file); > + exit(2); > +} > + > +int > +main(int argc, char **argv) > +{ > + FILE *diffpipe=NULL, *file1, *file2; > + size_t diffargc = 0, wflag = WIDTH; > + int ch, fd[2] = {-1}, status; > + pid_t pid=0; pid_t ppid =-1; > + const char *outfile = NULL; > + struct option *popt; > + char **diffargv, *diffprog = DIFF_PATH, *filename1, *filename2, > + *tmp1, *tmp2, *s1, *s2; > + int i; > + > + /* > + * Process diff flags. > + */ > + /* > + * Allocate memory for diff arguments and NULL. > + * Each flag has at most one argument, so doubling argc gives an > + * upper limit of how many diff args can be passed. argv[0], > + * file1, and file2 won't have arguments so doubling them will > + * waste some memory; however we need an extra space for the > + * NULL at the end, so it sort of works out. > + */ > + if (!(diffargv = calloc(argc, sizeof(char **) * 2))) > + err(2, "main"); > + > + /* Add first argument, the program name. */ > + diffargv[diffargc++] = diffprog; > + > + /* create a dynamic string for merging single-switch options */ > + if ( asprintf(&diffargv[diffargc++], "-") < 0 ) > + err(2, "main"); > + > + while ((ch = getopt_long(argc, argv, "aBbdEHI:ilo:stWw:", > + longopts, NULL)) != -1) { > + const char *errstr; > + > + switch (ch) { > + /* only compatible --long-name-form with diff */ > + case FCASE_IGNORE_OPT: > + case FCASE_SENSITIVE_OPT: > + case STRIPCR_OPT: > + case TSIZE_OPT: > + case 'S': > + break; > + /* combine no-arg single switches */ > + case 'a': > + case 'B': > + case 'b': > + case 'd': > + case 'E': > + case 'i': > + case 't': > + case 'H': > + case 'W': > + for(popt = longopts; ch != popt->val && popt->name > != NULL; popt++); > + diffargv[1] = realloc(diffargv[1], sizeof(char) * > strlen(diffargv[1]) + 2); > + /* > + * In diff, the 'W' option is 'w' and the 'w' is > 'W'. > + */ > + if (ch == 'W') > + sprintf(diffargv[1], "%sw", diffargv[1]); > + else > + sprintf(diffargv[1], "%s%c", diffargv[1], > ch); > + break; > + case DIFFPROG_OPT: > + diffargv[0] = diffprog = optarg; > + break; > + case 'I': > + Iflag = 1; > + diffargv[diffargc++] = "-I"; > + diffargv[diffargc++] = optarg; > + break; > + case 'l': > + lflag = 1; > + break; > + case 'o': > + outfile = optarg; > + break; > + case 's': > + sflag = 1; > + break; > + case 'w': > + wflag = strtonum(optarg, WIDTH_MIN, > + INT_MAX, &errstr); > + if (errstr) > + errx(2, "width is %s: %s", errstr, optarg); > + break; > + case DIFF_PID: > + ppid = strtonum(optarg, 0, INT_MAX, &errstr); > + if (errstr) > + errx(2, "diff pid value is %s: %s", > errstr, optarg); > + break; > + case HELP_OPT: > + for (i = 0; help_msg[i] != NULL; i++) > + printf("%s\n", help_msg[i]); > + exit(0); > + break; > + default: > + usage(); > + break; > + } > + } > + > + /* no single switches were used */ > + if (strcmp(diffargv[1], "-") == 0 ) { > + for ( i = 1; i < argc-1; i++) { > + diffargv[i] = diffargv[i+1]; > + } > + diffargv[diffargc-1] = NULL; > + diffargc--; > + } > + > + argc -= optind; > + argv += optind; > + > + if (argc != 2) > + usage(); > + > + if (outfile && (outfp = fopen(outfile, "w")) == NULL) > + err(2, "could not open: %s", optarg); > + > + if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') > + tmpdir = _PATH_TMP; > + > + filename1 = argv[0]; > + filename2 = argv[1]; > + > + /* > + * Create temporary files for diff and sdiff to share if file1 > + * or file2 are not regular files. This allows sdiff and diff > + * to read the same inputs if one or both inputs are stdin. > + * > + * If any temporary files were created, their names would be > + * saved in tmp1 or tmp2. tmp1 should never equal tmp2. > + */ > + tmp1 = tmp2 = NULL; > + /* file1 and file2 are the same, so copy to same temp file. */ > + if (strcmp(filename1, filename2) == 0) { > + if ((tmp1 = mktmpcpy(filename1))) > + filename1 = filename2 = tmp1; > + /* Copy file1 and file2 into separate temp files. */ > + } else { > + if ((tmp1 = mktmpcpy(filename1))) > + filename1 = tmp1; > + if ((tmp2 = mktmpcpy(filename2))) > + filename2 = tmp2; > + } > + > + diffargv[diffargc++] = filename1; > + diffargv[diffargc++] = filename2; > + /* Add NULL to end of array to indicate end of array. */ > + diffargv[diffargc++] = NULL; > + > + /* Subtract column divider and divide by two. */ > + width = (wflag - 3) / 2; > + /* Make sure line_width can fit in size_t. */ > + if (width > (SIZE_MAX - 3) / 2) > + errx(2, "width is too large: %zu", width); > + line_width = width * 2 + 3; > + > + if (ppid == -1 ) { > + if (pipe(fd)) > + err(2, "pipe"); > + > + switch (pid = fork()) { > + case 0: > + /* child */ > + /* We don't read from the pipe. */ > + close(fd[0]); > + if (dup2(fd[1], STDOUT_FILENO) == -1) > + err(2, "child could not duplicate > descriptor"); > + /* Free unused descriptor. */ > + close(fd[1]); > + execvp(diffprog, diffargv); > + err(2, "could not execute diff: %s", diffprog); > + break; > + case -1: > + err(2, "could not fork"); > + break; > + } > + > + /* parent */ > + /* We don't write to the pipe. */ > + close(fd[1]); > + > + /* Open pipe to diff command. */ > + if ((diffpipe = fdopen(fd[0], "r")) == NULL) > + err(2, "could not open diff pipe"); > + } > + if ((file1 = fopen(filename1, "r")) == NULL) > + err(2, "could not open %s", filename1); > + if ((file2 = fopen(filename2, "r")) == NULL) > + err(2, "could not open %s", filename2); > + if (!istextfile(file1) || !istextfile(file2)) { > + /* Close open files and pipe, delete temps */ > + fclose(file1); > + fclose(file2); > + fclose(diffpipe); > + if (tmp1) > + if (unlink(tmp1)) > + warn("Error deleting %s.", tmp1); > + if (tmp2) > + if (unlink(tmp2)) > + warn("Error deleting %s.", tmp2); > + free(tmp1); > + free(tmp2); > + binexec(diffprog, filename1, filename2); > + } > + /* Line numbers start at one. */ > + file1ln = file2ln = 1; > + > + /* Read and parse diff output. */ > + while (parsecmd(diffpipe, file1, file2) != EOF) > + ; > + fclose(diffpipe); > + > + /* Wait for diff to exit. */ > + if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status) || > + WEXITSTATUS(status) >= 2) > + err(2, "diff exited abnormally."); > + > + /* Delete and free unneeded temporary files. */ > + if (tmp1) > + if (unlink(tmp1)) > + warn("Error deleting %s.", tmp1); > + if (tmp2) > + if (unlink(tmp2)) > + warn("Error deleting %s.", tmp2); > + free(tmp1); > + free(tmp2); > + filename1 = filename2 = tmp1 = tmp2 = NULL; > + > + /* No more diffs, so print common lines. */ > + if (lflag) > + while ((s1 = xfgets(file1))) > + enqueue(s1, ' ', NULL); > + else > + for (;;) { > + s1 = xfgets(file1); > + s2 = xfgets(file2); > + if (s1 || s2) > + enqueue(s1, ' ', s2); > + else > + break; > + } > + fclose(file1); > + fclose(file2); > + /* Process unmodified lines. */ > + processq(); > + > + /* Return diff exit status. */ > + return (WEXITSTATUS(status)); > +} > + > +/* > + * When sdiff/zsdiff detects a binary file as input, executes them with > + * diff/zdiff to maintain the same behavior as GNU sdiff with binary > input. > + */ > +static void > +binexec(char *diffprog, char *f1, char *f2) > +{ > + > + char *args[] = {diffprog, f1, f2, (char *) 0}; > + execv(diffprog, args); > + > + /* If execv() fails, sdiff's execution will continue below. */ > + errx(1, "Could not execute diff process.\n"); > +} > + > +/* > + * Checks whether a file appears to be a text file. > + */ > +static int > +istextfile(FILE *f) > +{ > + int i; > + char ch; > + > + if (f == NULL) > + return (1); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Wed May 4 06:22:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC72CB2CE3B; Wed, 4 May 2016 06:22:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9602C1FAA; Wed, 4 May 2016 06:22:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u446MffC058632; Wed, 4 May 2016 06:22:41 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446MftJ058631; Wed, 4 May 2016 06:22:41 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605040622.u446MftJ058631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 4 May 2016 06:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299047 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:22:42 -0000 Author: jkim Date: Wed May 4 06:22:41 2016 New Revision: 299047 URL: https://svnweb.freebsd.org/changeset/base/299047 Log: Fix build without "options PCI_IOV". Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed May 4 06:09:13 2016 (r299046) +++ head/sys/dev/pci/pci.c Wed May 4 06:22:41 2016 (r299047) @@ -5644,9 +5644,10 @@ pci_cfg_restore(device_t dev, struct pci if (dinfo->cfg.msix.msix_location != 0) pci_resume_msix(dev); +#ifdef PCI_IOV if (dinfo->cfg.iov != NULL) pci_iov_cfg_restore(dev, dinfo); - +#endif } static void @@ -5759,8 +5760,10 @@ pci_cfg_save(device_t dev, struct pci_de if (dinfo->cfg.pcix.pcix_location != 0) pci_cfg_save_pcix(dev, dinfo); +#ifdef PCI_IOV if (dinfo->cfg.iov != NULL) pci_iov_cfg_save(dev, dinfo); +#endif /* * don't set the state for display devices, base peripherals and From owner-svn-src-all@freebsd.org Wed May 4 06:23:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9C0B2CE9A; Wed, 4 May 2016 06:23:50 +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 4FD3F113E; Wed, 4 May 2016 06:23:50 +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 u446NnAD058711; Wed, 4 May 2016 06:23:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446NnNX058710; Wed, 4 May 2016 06:23:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040623.u446NnNX058710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 06:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299048 - head/sys/dev/lmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:23:50 -0000 Author: adrian Date: Wed May 4 06:23:49 2016 New Revision: 299048 URL: https://svnweb.freebsd.org/changeset/base/299048 Log: s/struct device */device_t/g Submitted by: kmacy Modified: head/sys/dev/lmc/if_lmc.h Modified: head/sys/dev/lmc/if_lmc.h ============================================================================== --- head/sys/dev/lmc/if_lmc.h Wed May 4 06:22:41 2016 (r299047) +++ head/sys/dev/lmc/if_lmc.h Wed May 4 06:23:49 2016 (r299048) @@ -1092,7 +1092,7 @@ struct softc #endif struct callout callout; /* watchdog needs this */ - struct device *dev; /* base device pointer */ + device_t dev; /* base device pointer */ bus_space_tag_t csr_tag; /* bus_space needs this */ bus_space_handle_t csr_handle;/* bus_space_needs this */ void *irq_cookie; /* bus_teardown_intr needs this */ From owner-svn-src-all@freebsd.org Wed May 4 06:24:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBBE8B2CF0E; Wed, 4 May 2016 06:24:11 +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 898DA12C1; Wed, 4 May 2016 06:24:11 +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 u446OAFE058771; Wed, 4 May 2016 06:24:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446OAOB058770; Wed, 4 May 2016 06:24:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040624.u446OAOB058770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 06:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299049 - head/sys/dev/buslogic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:24:11 -0000 Author: adrian Date: Wed May 4 06:24:10 2016 New Revision: 299049 URL: https://svnweb.freebsd.org/changeset/base/299049 Log: s/struct device */device_t/g Submitted by: kmacy Modified: head/sys/dev/buslogic/btreg.h Modified: head/sys/dev/buslogic/btreg.h ============================================================================== --- head/sys/dev/buslogic/btreg.h Wed May 4 06:23:49 2016 (r299048) +++ head/sys/dev/buslogic/btreg.h Wed May 4 06:24:10 2016 (r299049) @@ -595,7 +595,7 @@ struct sg_map_node { }; struct bt_softc { - struct device *dev; + device_t dev; struct resource *port; struct resource *irq; struct resource *drq; From owner-svn-src-all@freebsd.org Wed May 4 06:24:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33BDFB2CF6A; Wed, 4 May 2016 06:24:53 +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 014B91479; Wed, 4 May 2016 06:24:52 +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 u446OqaS058837; Wed, 4 May 2016 06:24:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446OqeZ058836; Wed, 4 May 2016 06:24:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040624.u446OqeZ058836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 06:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299050 - head/sys/dev/esp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:24:53 -0000 Author: adrian Date: Wed May 4 06:24:51 2016 New Revision: 299050 URL: https://svnweb.freebsd.org/changeset/base/299050 Log: s/struct device */device_t/g Submitted by: kmacy Modified: head/sys/dev/esp/esp_pci.c Modified: head/sys/dev/esp/esp_pci.c ============================================================================== --- head/sys/dev/esp/esp_pci.c Wed May 4 06:24:10 2016 (r299049) +++ head/sys/dev/esp/esp_pci.c Wed May 4 06:24:51 2016 (r299050) @@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$"); struct esp_pci_softc { struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ - struct device *sc_dev; + device_t sc_dev; struct resource *sc_res[2]; #define ESP_PCI_RES_INTR 0 From owner-svn-src-all@freebsd.org Wed May 4 06:25:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB34EB2C011; Wed, 4 May 2016 06:25:13 +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 7C21F170A; Wed, 4 May 2016 06:25:13 +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 u446PCr7058943; Wed, 4 May 2016 06:25:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446PCM8058942; Wed, 4 May 2016 06:25:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040625.u446PCM8058942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 06:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299051 - head/sys/dev/fdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:25:13 -0000 Author: adrian Date: Wed May 4 06:25:12 2016 New Revision: 299051 URL: https://svnweb.freebsd.org/changeset/base/299051 Log: s/struct device */device_t/g Submitted by: kmacy Modified: head/sys/dev/fdc/fdcvar.h Modified: head/sys/dev/fdc/fdcvar.h ============================================================================== --- head/sys/dev/fdc/fdcvar.h Wed May 4 06:24:51 2016 (r299050) +++ head/sys/dev/fdc/fdcvar.h Wed May 4 06:25:12 2016 (r299051) @@ -66,7 +66,7 @@ struct fdc_data { bus_space_handle_t ioh[FDC_MAXREG]; int ioff[FDC_MAXREG]; void *fdc_intr; - struct device *fdc_dev; + device_t fdc_dev; struct mtx fdc_mtx; struct proc *fdc_thread; }; From owner-svn-src-all@freebsd.org Wed May 4 06:26:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40000B2C157; Wed, 4 May 2016 06:26:28 +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 111C71AD3; Wed, 4 May 2016 06:26:27 +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 u446QRl6059223; Wed, 4 May 2016 06:26:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446QR4t059222; Wed, 4 May 2016 06:26:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605040626.u446QR4t059222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 06:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299052 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:26:28 -0000 Author: adrian Date: Wed May 4 06:26:27 2016 New Revision: 299052 URL: https://svnweb.freebsd.org/changeset/base/299052 Log: s/struct device */device_t/g Submitted by: kmacy Modified: head/sys/dev/acpi_support/atk0110.c Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Wed May 4 06:25:12 2016 (r299051) +++ head/sys/dev/acpi_support/atk0110.c Wed May 4 06:26:27 2016 (r299052) @@ -66,7 +66,7 @@ struct aibs_sensor { }; struct aibs_softc { - struct device *sc_dev; + device_t sc_dev; ACPI_HANDLE sc_ah; struct aibs_sensor *sc_asens_volt; From owner-svn-src-all@freebsd.org Wed May 4 06:29:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CCCCB2C1E4; Wed, 4 May 2016 06:29:20 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E337F1D1A; Wed, 4 May 2016 06:29:19 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id a17so74808058wme.0; Tue, 03 May 2016 23:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vPTkWusMstseBNRpca3VZrlKnvWrvy2CTuDr6JPsNO8=; b=aYg25449/nMYmikpPoxiOZH4r+eymAHsUZyVthlqcLbzP39haglUz+0GuA2du9SOAe cDksmL9tZWyfLRUf/uXZnBBg+Ok6AVCrGAq1f4ECr+1cCj1Gp6uw0ecIactcB9OIiZly oS65mVGdjEVI9y+awUfB1vzxyi7aA1nA5Gd9lC1nAtpxXciLXO/c3WW1cHNxFfmBak/7 kcwEXWSevH4po7tuz9VTAS0fN0HsfOCCUZWaoKA/SuGsp4Nr+mm3GKmV8nts/9p2NZM0 cUfDEoOQPsiY3nm0z5TvywnFVQLmSA39dnFF3eYozr/fdVUU347ZjGYMqvhhj5aoCzto mjAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=vPTkWusMstseBNRpca3VZrlKnvWrvy2CTuDr6JPsNO8=; b=cMxkpRtJEjVZoMrOFwg3mHXfwSPQYnihCM/9ARvhyYan5LgyQ2AIwmIPqzaz4b5pZG GJv13DjIa8LrzTZjLrEj9N2785o+yqSrv/y2jaGWQ79V+TammxgMMrEiiDLpm2sWCt5g YLKhBzMSmj3Bb0y6FadyntSbNJCqHOXfbCRIC/gdtsJxE8nKdmwCzQsI/k8/wpkFmK1K XoxDquEZbQ9au3ax8zUFVN0OL5LMvL4FzPhwTAy+1Sa1f2mQuVNuXGZ6XK1t1dIopVV2 nqKOu+BqisuOrG1Alu9dw9tlrqmcbNIrM4jUpdvC1DpyA0QJi16b+AHCzH1MorHCg6Nn 5ILQ== X-Gm-Message-State: AOPr4FUMx6XvKlwKzL7y/kfcdHx2OeujUcVHAcBYZ3popGK1uo+kWsMTtd/yqN16+Lm6FA== X-Received: by 10.194.77.140 with SMTP id s12mr6778468wjw.24.1462343358081; Tue, 03 May 2016 23:29:18 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id c16sm2323562wme.16.2016.05.03.23.29.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 23:29:16 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 4 May 2016 08:29:14 +0200 From: Baptiste Daroussin To: Kamil Czekirda Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r298823 - in head: gnu/usr.bin gnu/usr.bin/sdiff usr.bin usr.bin/sdiff usr.bin/sdiff/tests Message-ID: <20160504062914.GG72982@ivaldir.etoilebsd.net> References: <201604292327.u3TNRFVt067723@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p7qwJlK53pWzbayA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:29:20 -0000 --p7qwJlK53pWzbayA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 04, 2016 at 07:54:46AM +0200, Kamil Czekirda wrote: > Hi, >=20 > make ftp stops here since r298823: >=20 What is the revision you last tested because it is supposed to be fixed by:= r298837 Best regards, Bapt --p7qwJlK53pWzbayA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXKZa6AAoJEGOJi9zxtz5aXWwQALLjhO/S4lgsefz9XOsFRHie nzX4IDMqKh/8Cy7MmZWo/KezixbGvuHR244Bj91NULu6IiNqW1CjUrM170ejKN6h C/TZvc52HFYj0me5N6TxgU+ZqGWKzK9R3K4uS9tEoVwtsSlvEWnqgwJcdXrHqttd OT299zOPxTP6Hp1UxlyfKvCI6CA6Ee8mQOJC3CZYRTiQ5HgTMUlCr/28PGv86wvx IakdTpw18fUQhrEfyFcUnpGGU9d9jNba9o9IrV9q9KNVZgnvCr0JrNtx/sKAjpMP 7tgmxgIQWSsPZVYEGOdZg57Cr3HaMcJmwXBFqqxvK4Om6KyDSOsTcJjN8HfWJ+iJ 3qtVhFbOc9Zejln7JIuW+wFxNzzDg0iQjbSmEGZHTld/ptzUMjJQ9NTfCTx5SbUg Uali9Wi6lb8PbS+4dMO1gs05KWUh1RaBX03zY7s727V7VFlDMh43/paRU6fU3rdA rUSHY0lknCCD3qpnd+h3aMyUtmXv3d6hYO3W44McgsOSgvMNIdXr3hkhqXxmPTOl X0moSjnzZFREaSc6RhAjsMoH5+TQvIhTfREvtyB7H7yK3q/9dQJCZ4l8G6ADSPBo vDtW6oRA63N7NvyNlnlKdI2liGFBfM0fDRvL++dqSqJ0jl2ZA6t8yA/5dUDOXwue bdtvbadwE7e0H1W/G7sd =gLuf -----END PGP SIGNATURE----- --p7qwJlK53pWzbayA-- From owner-svn-src-all@freebsd.org Wed May 4 06:53:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62FC4B2C801; Wed, 4 May 2016 06:53:04 +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 256091A52; Wed, 4 May 2016 06:53:04 +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 u446r3vZ068169; Wed, 4 May 2016 06:53:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u446r2fP068163; Wed, 4 May 2016 06:53:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605040653.u446r2fP068163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 4 May 2016 06:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299053 - in stable/9/crypto/openssl/crypto: asn1 evp x509 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 06:53:04 -0000 Author: delphij Date: Wed May 4 06:53:02 2016 New Revision: 299053 URL: https://svnweb.freebsd.org/changeset/base/299053 Log: Fix several OpenSSL vulnerabilities. Security: CVE-2016-2105, CVE-2016-2106, CVE-2016-2109 Security: CVE-2016-2176 (does not affect FreeBSD) Security: FreeBSD-SA-16:17.openssl Modified: stable/9/crypto/openssl/crypto/asn1/a_type.c stable/9/crypto/openssl/crypto/asn1/tasn_dec.c stable/9/crypto/openssl/crypto/asn1/tasn_enc.c stable/9/crypto/openssl/crypto/evp/encode.c stable/9/crypto/openssl/crypto/evp/evp_enc.c stable/9/crypto/openssl/crypto/x509/x509_obj.c Modified: stable/9/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- stable/9/crypto/openssl/crypto/asn1/a_type.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/asn1/a_type.c Wed May 4 06:53:02 2016 (r299053) @@ -123,9 +123,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: stable/9/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- stable/9/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 06:53:02 2016 (r299053) @@ -901,9 +901,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: stable/9/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- stable/9/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 06:53:02 2016 (r299053) @@ -610,9 +610,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: stable/9/crypto/openssl/crypto/evp/encode.c ============================================================================== --- stable/9/crypto/openssl/crypto/evp/encode.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/evp/encode.c Wed May 4 06:53:02 2016 (r299053) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -134,13 +135,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl == 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -157,7 +158,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -166,6 +167,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: stable/9/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- stable/9/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 06:53:02 2016 (r299053) @@ -166,7 +166,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: stable/9/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- stable/9/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 06:26:27 2016 (r299052) +++ stable/9/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 06:53:02 2016 (r299053) @@ -117,8 +117,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif From owner-svn-src-all@freebsd.org Wed May 4 07:33:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60534B2C1DB; Wed, 4 May 2016 07:33: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 2CF211F79; Wed, 4 May 2016 07:33: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 u447Xw8i080424; Wed, 4 May 2016 07:33:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447XwAK080423; Wed, 4 May 2016 07:33:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040733.u447XwAK080423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:33: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: r299056 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 07:33:59 -0000 Author: ngie Date: Wed May 4 07:33:58 2016 New Revision: 299056 URL: https://svnweb.freebsd.org/changeset/base/299056 Log: MFC r298758: Remove logically impossible test in scsidoinquiry(..) It was already done 4 lines prior and the value of error didn't change CID: 1011236 Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Wed May 4 07:06:48 2016 (r299055) +++ stable/10/sbin/camcontrol/camcontrol.c Wed May 4 07:33:58 2016 (r299056) @@ -814,9 +814,6 @@ scsidoinquiry(struct cam_device *device, if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, retry_count, timeout); - if (error != 0) - return(error); - if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); From owner-svn-src-all@freebsd.org Wed May 4 07:35:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A56B2C265; Wed, 4 May 2016 07:35: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 278B71102; Wed, 4 May 2016 07:35: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 u447Zh9K080570; Wed, 4 May 2016 07:35:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447ZheQ080569; Wed, 4 May 2016 07:35:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040735.u447ZheQ080569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:35: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: r299057 - stable/10/tests/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 07:35:44 -0000 Author: ngie Date: Wed May 4 07:35:43 2016 New Revision: 299057 URL: https://svnweb.freebsd.org/changeset/base/299057 Log: MFC r298301: Fix leaks and test for getpagesize() returning == -1 - close file descriptors after use. - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). CID: 1331374-1331377, 1331653-1331662 Modified: stable/10/tests/sys/vm/mmap_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/vm/mmap_test.c ============================================================================== --- stable/10/tests/sys/vm/mmap_test.c Wed May 4 07:33:58 2016 (r299056) +++ stable/10/tests/sys/vm/mmap_test.c Wed May 4 07:35:43 2016 (r299057) @@ -91,8 +91,10 @@ static void checked_mmap(int prot, int flags, int fd, int error, const char *msg) { void *p; + int pagesize; - p = mmap(NULL, getpagesize(), prot, flags, fd, 0); + ATF_REQUIRE((pagesize = getpagesize()) > 0); + p = mmap(NULL, pagesize, prot, flags, fd, 0); if (p == MAP_FAILED) { if (error == 0) ATF_CHECK_MSG(0, "%s failed with errno %d", msg, @@ -103,18 +105,19 @@ checked_mmap(int prot, int flags, int fd errno, error); } else { ATF_CHECK_MSG(error == 0, "%s succeeded", msg); - munmap(p, getpagesize()); + munmap(p, pagesize); } } ATF_TC_WITHOUT_HEAD(mmap__bad_arguments); ATF_TC_BODY(mmap__bad_arguments, tc) { - int devstatfd, shmfd, zerofd; + int devstatfd, pagesize, shmfd, zerofd; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((devstatfd = open("/dev/devstat", O_RDONLY)) >= 0); ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); - ATF_REQUIRE(ftruncate(shmfd, getpagesize()) == 0); + ATF_REQUIRE(ftruncate(shmfd, pagesize) == 0); ATF_REQUIRE((zerofd = open("/dev/zero", O_RDONLY)) >= 0); /* These should work. */ @@ -179,6 +182,10 @@ ATF_TC_BODY(mmap__bad_arguments, tc) */ checked_mmap(PROT_READ, MAP_PRIVATE, devstatfd, EINVAL, "MAP_PRIVATE of /dev/devstat"); + + close(devstatfd); + close(shmfd); + close(zerofd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_private); @@ -186,22 +193,21 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -211,11 +217,15 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, - 0); + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TC_WITHOUT_HEAD(mmap__dev_zero_shared); @@ -223,22 +233,21 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) { char *p1, *p2, *p3; size_t i; - int fd; + int fd, pagesize; + ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); - p1 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p1 != MAP_FAILED); - p2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p2 != MAP_FAILED); - for (i = 0; i < getpagesize(); i++) + for (i = 0; i < pagesize; i++) ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); - ATF_REQUIRE(memcmp(p1, p2, getpagesize()) == 0); + ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); p1[0] = 1; @@ -248,11 +257,16 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) ATF_REQUIRE(p1[0] == 1); - p3 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, + p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ATF_REQUIRE(p3 != MAP_FAILED); ATF_REQUIRE(p3[0] == 0); + + munmap(p1, pagesize); + munmap(p2, pagesize); + munmap(p3, pagesize); + close(fd); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Wed May 4 07:37:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9731FB2C2F3; Wed, 4 May 2016 07:37: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 58DA5128E; Wed, 4 May 2016 07:37: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 u447b2f0080679; Wed, 4 May 2016 07:37:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447b2r8080678; Wed, 4 May 2016 07:37:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040737.u447b2r8080678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07: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: r299058 - stable/10/tests/sys/posixshm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 07:37:03 -0000 Author: ngie Date: Wed May 4 07:37:02 2016 New Revision: 299058 URL: https://svnweb.freebsd.org/changeset/base/299058 Log: MFC r298304: Fix issues identified by Coverity - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). - Remove intermediate variable for assigning from $TMPDIR if set in the environment to eliminate warnings about pointer conversions with "/tmp", and to mute an invalid buffer overflow concern from Coverity (snprintf and tacking on a NUL terminator was alleviating that concern before). - Remove useless self-test of psize before it's initialized. - Check the return values of getrlimit/setrlimit. Cosmetic changes: - Replace a `(void*)0` with NULL. - Do some minor whitespace clean up. - Remove an unnecessary cast to mmap. - Make all munmap calls use ATF_REQUIRE_MSG instead of using the: > if (munmap(..) == -1) > atf_tc_fail(..) idiom. Employ the new idiom consistently when calling munmap. CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694 Modified: stable/10/tests/sys/posixshm/posixshm_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/posixshm/posixshm_test.c ============================================================================== --- stable/10/tests/sys/posixshm/posixshm_test.c Wed May 4 07:35:43 2016 (r299057) +++ stable/10/tests/sys/posixshm/posixshm_test.c Wed May 4 07:37:02 2016 (r299058) @@ -50,12 +50,9 @@ static char test_path[TEST_PATH_LEN]; static void gen_test_path(void) { - char *tmpdir = getenv("TMPDIR"); - if (tmpdir == NULL) - tmpdir = "/tmp"; - - snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", tmpdir); + snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", + getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); @@ -99,10 +96,12 @@ static int scribble_object(void) { char *page; - int fd; + int fd, pagesize; gen_test_path(); + ATF_REQUIRE(0 < (pagesize = getpagesize())); + fd = shm_open(test_path, O_CREAT|O_EXCL|O_RDWR, 0777); if (fd < 0 && errno == EEXIST) { if (shm_unlink(test_path) < 0) @@ -111,17 +110,16 @@ scribble_object(void) } if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap failed; errno=%d", errno); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); return (fd); } @@ -130,12 +128,13 @@ ATF_TC_WITHOUT_HEAD(remap_object); ATF_TC_BODY(remap_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -143,8 +142,8 @@ ATF_TC_BODY(remap_object, tc) atf_tc_fail("missing data ('%c' != '1')", page[0]); close(fd); - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -154,7 +153,9 @@ ATF_TC_WITHOUT_HEAD(reopen_object); ATF_TC_BODY(reopen_object, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); fd = scribble_object(); close(fd); @@ -163,14 +164,15 @@ ATF_TC_BODY(reopen_object, tc) if (fd < 0) atf_tc_fail("shm_open(2) failed; errno=%d", errno); - page = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, 0); + page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); if (page[0] != '1') atf_tc_fail("missing data ('%c' != '1')", page[0]); - munmap(page, getpagesize()); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); close(fd); ATF_REQUIRE_MSG(shm_unlink(test_path) != -1, "shm_unlink failed; errno=%d", errno); @@ -180,7 +182,9 @@ ATF_TC_WITHOUT_HEAD(readonly_mmap_write) ATF_TC_BODY(readonly_mmap_write, tc) { char *page; - int fd; + int fd, pagesize; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); gen_test_path(); @@ -188,8 +192,7 @@ ATF_TC_BODY(readonly_mmap_write, tc) ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); /* PROT_WRITE should fail with EACCES. */ - page = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page != MAP_FAILED) atf_tc_fail("mmap(PROT_WRITE) succeeded unexpectedly"); @@ -359,49 +362,49 @@ ATF_TC_BODY(object_resize, tc) { pid_t pid; struct stat sb; - char err_buf[1024], *page; - int fd, status; + char *page; + int fd, pagesize, status; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); /* Start off with a size of a single page. */ fd = shm_open(SHM_ANON, O_CREAT|O_RDWR, 0777); if (fd < 0) atf_tc_fail("shm_open failed; errno=%d", errno); - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(1) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(1) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("first resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* Write a '1' to the first byte. */ - page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, - 0); + page = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(1)"); page[0] = '1'; - if (munmap(page, getpagesize()) < 0) - atf_tc_fail("munmap(1) failed; errno=%d", errno); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); /* Grow the object to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("second resize failed (%d != %d)", - (int)sb.st_size, getpagesize() * 2); + (int)sb.st_size, pagesize * 2); /* Check for '1' at the first byte. */ - page = mmap(0, getpagesize() * 2, PROT_READ|PROT_WRITE, MAP_SHARED, - fd, 0); + page = mmap(0, pagesize * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) atf_tc_fail("mmap(2) failed; errno=%d", errno); @@ -409,18 +412,18 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("'%c' != '1'", page[0]); /* Write a '2' at the start of the second page. */ - page[getpagesize()] = '2'; + page[pagesize] = '2'; /* Shrink the object back to 1 page. */ - if (ftruncate(fd, getpagesize()) < 0) + if (ftruncate(fd, pagesize) < 0) atf_tc_fail("ftruncate(3) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(3) failed; errno=%d", errno); - if (sb.st_size != getpagesize()) + if (sb.st_size != pagesize) atf_tc_fail("third resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Fork a child process to make sure the second page is no @@ -435,16 +438,16 @@ ATF_TC_BODY(object_resize, tc) char c; /* Don't generate a core dump. */ - getrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(getrlimit(RLIMIT_CORE, &lim) == 0); lim.rlim_cur = 0; - setrlimit(RLIMIT_CORE, &lim); + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &lim) == 0); /* * The previous ftruncate(2) shrunk the backing object * so that this address is no longer valid, so reading * from it should trigger a SIGSEGV. */ - c = page[getpagesize()]; + c = page[pagesize]; fprintf(stderr, "child: page 1: '%c'\n", c); exit(0); } @@ -456,15 +459,15 @@ ATF_TC_BODY(object_resize, tc) atf_tc_fail("child terminated with status %x", status); /* Grow the object back to 2 pages. */ - if (ftruncate(fd, getpagesize() * 2) < 0) + if (ftruncate(fd, pagesize * 2) < 0) atf_tc_fail("ftruncate(2) failed; errno=%d", errno); if (fstat(fd, &sb) < 0) atf_tc_fail("fstat(2) failed; errno=%d", errno); - if (sb.st_size != getpagesize() * 2) + if (sb.st_size != pagesize * 2) atf_tc_fail("fourth resize failed (%d != %d)", - (int)sb.st_size, getpagesize()); + (int)sb.st_size, pagesize); /* * Note that the mapping at 'page' for the second page is @@ -475,9 +478,9 @@ ATF_TC_BODY(object_resize, tc) * object was shrunk and the new pages when an object are * grown are zero-filled. */ - if (page[getpagesize()] != 0) + if (page[pagesize] != 0) atf_tc_fail("invalid data at %d: %x != 0", - getpagesize(), (int)page[getpagesize()]); + pagesize, (int)page[pagesize]); close(fd); } @@ -524,7 +527,7 @@ ATF_TC_BODY(shm_functionality_across_for scval = sysconf(_SC_PAGESIZE); if (scval == -1 && errno != 0) { atf_tc_fail("sysconf(_SC_PAGESIZE) failed; errno=%d", errno); - } else if (scval <= 0 || (size_t)psize != psize) { + } else if (scval <= 0) { fprintf(stderr, "bogus return from sysconf(_SC_PAGESIZE): %ld", scval); psize = 4096; @@ -542,8 +545,7 @@ ATF_TC_BODY(shm_functionality_across_for ATF_REQUIRE_MSG(ftruncate(desc, (off_t)psize) != -1, "ftruncate failed; errno=%d", errno); - region = mmap((void *)0, psize, PROT_READ | PROT_WRITE, MAP_SHARED, - desc, (off_t)0); + region = mmap(NULL, psize, PROT_READ | PROT_WRITE, MAP_SHARED, desc, 0); ATF_REQUIRE_MSG(region != MAP_FAILED, "mmap failed; errno=%d", errno); memset(region, '\377', psize); @@ -601,6 +603,10 @@ ATF_TC_BODY(shm_functionality_across_for strsignal(WTERMSIG(status))); } } + + ATF_REQUIRE_MSG(munmap(region, psize) == 0, "munmap failed; errno=%d", + errno); + shm_unlink(test_path); } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Wed May 4 07:39:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D217B2C3A5; Wed, 4 May 2016 07:39: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 EE2D31454; Wed, 4 May 2016 07:39: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 u447dO6A080811; Wed, 4 May 2016 07:39:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u447dO12080810; Wed, 4 May 2016 07:39:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605040739.u447dO12080810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 4 May 2016 07:39: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: r299059 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 07:39:25 -0000 Author: ngie Date: Wed May 4 07:39:23 2016 New Revision: 299059 URL: https://svnweb.freebsd.org/changeset/base/299059 Log: MFC r298366: Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c - Ensure socket(2) calls succeed - Don't leak slist allocated by earlier socket(2) call CID: 976773, 1251405 Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:37:02 2016 (r299058) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c Wed May 4 07:39:23 2016 (r299059) @@ -56,6 +56,11 @@ ATF_TC_BODY(connect_low_port, tc) slist = socket(AF_INET, SOCK_STREAM, 0); sd = socket(AF_INET, SOCK_STREAM, 0); +#ifdef __FreeBSD__ + ATF_REQUIRE(sd > 0); + ATF_REQUIRE(slist > 0); +#endif + /* bind listening socket */ memset(&sinlist, 0, sizeof(sinlist)); sinlist.sin_family = AF_INET; @@ -92,6 +97,9 @@ ATF_TC_BODY(connect_low_port, tc) ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX); close(sd); +#ifdef __FreeBSD__ + close(slist); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@freebsd.org Wed May 4 08:18:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A984B2D139; Wed, 4 May 2016 08:18:24 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0391D173E; Wed, 4 May 2016 08:18:24 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [10.225.51.85] (nat-eduroam-st-106.fh-muenster.de [194.95.73.106]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 0FA48721E281E; Wed, 4 May 2016 10:18:20 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r298187 - head/sys/netinet From: Michael Tuexen In-Reply-To: <20160503230336.GD1369@FreeBSD.org> Date: Wed, 4 May 2016 10:18:19 +0200 Cc: Ian Lepore , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3FA0A836-A54A-419E-B910-7B32BF934FF5@freebsd.org> References: <201604180638.u3I6cs5P043229@repo.freebsd.org> <1460992087.52955.47.camel@freebsd.org> <0BC0F7D1-9523-4FE6-A6ED-57372CC80206@freebsd.org> <20160503230336.GD1369@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 08:18:24 -0000 > On 04 May 2016, at 01:03, Gleb Smirnoff wrote: >=20 > Michael, >=20 > On Mon, Apr 18, 2016 at 06:56:29PM +0200, Michael Tuexen wrote: > M> > On Mon, 2016-04-18 at 06:38 +0000, Michael Tuexen wrote: > M> >> Author: tuexen > M> >> Date: Mon Apr 18 06:38:53 2016 > M> >> New Revision: 298187 > M> >> URL: https://svnweb.freebsd.org/changeset/base/298187 > M> >>=20 > M> >> Log: > M> >> Don't use anonymous unions. > M> >>=20 > M> >=20 > M> > Why not? This is one of those commit messages that really needs = to say > M> Because the same code is used in a userland SCTP stack and that > M> uses C99. Anonymous unions are introduced in C11. That's why. >=20 > This explanation of course emerges next question :) > Why don't enable C11 when compiling the userland SCTP stack? Since this is used (meaning compiled) by other projects which have its = own constraints and which I don't control... Best regards Michael >=20 > --=20 > Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed May 4 08:57:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7B2B2DE8F; Wed, 4 May 2016 08:57:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ADA11DFE; Wed, 4 May 2016 08:57:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u448ve14004894; Wed, 4 May 2016 08:57:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u448veDi004893; Wed, 4 May 2016 08:57:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605040857.u448veDi004893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 May 2016 08:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299060 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 08:57:41 -0000 Author: hselasky Date: Wed May 4 08:57:40 2016 New Revision: 299060 URL: https://svnweb.freebsd.org/changeset/base/299060 Log: Extend the UQ_NO_STRINGS quirk to also cover the USB language string descriptor. This fixes enumeration of some older Samsung Galaxy S3 phones. MFC after: 1 week Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed May 4 07:39:23 2016 (r299059) +++ head/sys/dev/usb/usb_device.c Wed May 4 08:57:40 2016 (r299060) @@ -1774,7 +1774,9 @@ usb_alloc_device(device_t parent_dev, st scratch_ptr = udev->scratch.data; - if (udev->ddesc.iManufacturer || + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || udev->ddesc.iProduct || udev->ddesc.iSerialNumber) { /* read out the language ID string */ From owner-svn-src-all@freebsd.org Wed May 4 11:40:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76E92B2CA23; Wed, 4 May 2016 11:40:14 +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 482321720; Wed, 4 May 2016 11:40:14 +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 u44BeDBi053285; Wed, 4 May 2016 11:40:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44BeDNB053284; Wed, 4 May 2016 11:40:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605041140.u44BeDNB053284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 4 May 2016 11:40: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: r299061 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 11:40:14 -0000 Author: avg Date: Wed May 4 11:40:13 2016 New Revision: 299061 URL: https://svnweb.freebsd.org/changeset/base/299061 Log: MFC r297812: zio: align use of "no dump" flag between use_uma and !use_uma cases Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 4 08:57:40 2016 (r299060) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 4 11:40:13 2016 (r299061) @@ -133,11 +133,13 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass boolean_t zio_requeue_io_start_cut_in_line = B_TRUE; +#ifdef illumos #ifdef ZFS_DEBUG int zio_buf_debug_limit = 16384; #else int zio_buf_debug_limit = 0; #endif +#endif void zio_init(void) @@ -159,7 +161,7 @@ zio_init(void) size_t size = (c + 1) << SPA_MINBLOCKSHIFT; size_t p2 = size; size_t align = 0; - size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0; + int cflags = zio_exclude_metadata ? KMC_NODEBUG : 0; while (!ISP2(p2)) p2 &= p2 - 1; From owner-svn-src-all@freebsd.org Wed May 4 11:53:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94913B2CD42; Wed, 4 May 2016 11:53:32 +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 5098F1E60; Wed, 4 May 2016 11:53:32 +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 u44BrVCn058926; Wed, 4 May 2016 11:53:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44BrU15058920; Wed, 4 May 2016 11:53:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605041153.u44BrU15058920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 4 May 2016 11:53:30 +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: r299062 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 11:53:32 -0000 Author: avg Date: Wed May 4 11:53:30 2016 New Revision: 299062 URL: https://svnweb.freebsd.org/changeset/base/299062 Log: MFC r297857: re-enable AMD Topology extension on certain models if disabled by BIOS Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/include/md_var.h stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/i386/include/md_var.h stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/amd64/amd64/mp_machdep.c Wed May 4 11:53:30 2016 (r299062) @@ -682,7 +682,7 @@ init_secondary(void) wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ - intel_fix_cpuid(); + fix_cpuid(); lidt(&r_idt); Modified: stable/10/sys/amd64/include/md_var.h ============================================================================== --- stable/10/sys/amd64/include/md_var.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/amd64/include/md_var.h Wed May 4 11:53:30 2016 (r299062) @@ -112,7 +112,7 @@ void dump_drop_page(vm_paddr_t); void identify_cpu(void); void initializecpu(void); void initializecpucache(void); -bool intel_fix_cpuid(void); +bool fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); int is_physical_memory(vm_paddr_t addr); Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/i386/i386/mp_machdep.c Wed May 4 11:53:30 2016 (r299062) @@ -684,7 +684,7 @@ init_secondary(void) pc->pc_prvspace = pc; pc->pc_curthread = 0; - intel_fix_cpuid(); + fix_cpuid(); gdt_segs[GPRIV_SEL].ssd_base = (int) pc; gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss; Modified: stable/10/sys/i386/include/md_var.h ============================================================================== --- stable/10/sys/i386/include/md_var.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/i386/include/md_var.h Wed May 4 11:53:30 2016 (r299062) @@ -116,7 +116,7 @@ void fillw(int /*u_short*/ pat, void *ba void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); void initializecpu(void); void initializecpucache(void); -bool intel_fix_cpuid(void); +bool fix_cpuid(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/x86/include/specialreg.h Wed May 4 11:53:30 2016 (r299062) @@ -821,6 +821,7 @@ #define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ #define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ #define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Wed May 4 11:40:13 2016 (r299061) +++ stable/10/sys/x86/x86/identcpu.c Wed May 4 11:53:30 2016 (r299062) @@ -1304,23 +1304,22 @@ identify_hypervisor(void) } #endif -/* - * Clear "Limit CPUID Maxval" bit and return true if the caller should - * get the largest standard CPUID function number again if it is set - * from BIOS. It is necessary for probing correct CPU topology later - * and for the correct operation of the AVX-aware userspace. - */ bool -intel_fix_cpuid(void) +fix_cpuid(void) { uint64_t msr; - if (cpu_vendor_id != CPU_VENDOR_INTEL) - return (false); - if ((CPUID_TO_FAMILY(cpu_id) == 0xf && + /* + * Clear "Limit CPUID Maxval" bit and return true if the caller should + * get the largest standard CPUID function number again if it is set + * from BIOS. It is necessary for probing correct CPU topology later + * and for the correct operation of the AVX-aware userspace. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && + ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || (CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) >= 0xe)) { + CPUID_TO_MODEL(cpu_id) >= 0xe))) { msr = rdmsr(MSR_IA32_MISC_ENABLE); if ((msr & IA32_MISC_EN_LIMCPUID) != 0) { msr &= ~IA32_MISC_EN_LIMCPUID; @@ -1328,6 +1327,22 @@ intel_fix_cpuid(void) return (true); } } + + /* + * Re-enable AMD Topology Extension that could be disabled by BIOS + * on some notebook processors. Without the extension it's really + * hard to determine the correct CPU cache topology. + * See BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 15h + * Models 60h-6Fh Processors, Publication # 50742. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x15) { + msr = rdmsr(MSR_EXTFEATURES); + if ((msr & ((uint64_t)1 << 54)) == 0) { + msr |= (uint64_t)1 << 54; + wrmsr(MSR_EXTFEATURES, msr); + return (true); + } + } return (false); } @@ -1367,7 +1382,7 @@ identify_cpu(void) #endif cpu_vendor_id = find_cpu_vendor_id(); - if (intel_fix_cpuid()) { + if (fix_cpuid()) { do_cpuid(0, regs); cpu_high = regs[0]; } From owner-svn-src-all@freebsd.org Wed May 4 12:51:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C282B2B304; Wed, 4 May 2016 12:51:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E845F1D9E; Wed, 4 May 2016 12:51:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44CpSO0075435; Wed, 4 May 2016 12:51:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44CpRD2075433; Wed, 4 May 2016 12:51:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605041251.u44CpRD2075433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 4 May 2016 12:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299063 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 12:51:29 -0000 Author: avos Date: Wed May 4 12:51:27 2016 New Revision: 299063 URL: https://svnweb.freebsd.org/changeset/base/299063 Log: iwn: fix device reset after watchdog timeout. Simple device reset (stop/start) is not enough here; post-init state changes must be applied too. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed May 4 11:53:30 2016 (r299062) +++ head/sys/dev/iwn/if_iwn.c Wed May 4 12:51:27 2016 (r299063) @@ -344,7 +344,6 @@ static void iwn_scan_end(struct ieee8021 static void iwn_set_channel(struct ieee80211com *); static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); -static void iwn_hw_reset(void *, int); #ifdef IWN_DEBUG static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); @@ -677,7 +676,6 @@ iwn_attach(device_t dev) callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc); TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc); TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc); TASK_INIT(&sc->sc_panic_task, 0, iwn_panicked, sc); @@ -1400,7 +1398,6 @@ iwn_detach(device_t dev) iwn_xmit_queue_drain(sc); IWN_UNLOCK(sc); - ieee80211_draintask(&sc->sc_ic, &sc->sc_reinit_task); ieee80211_draintask(&sc->sc_ic, &sc->sc_radioon_task); ieee80211_draintask(&sc->sc_ic, &sc->sc_radiooff_task); iwn_stop(sc); @@ -4972,7 +4969,7 @@ iwn_watchdog(void *arg) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { ic_printf(ic, "device timeout\n"); - ieee80211_runtask(ic, &sc->sc_reinit_task); + ieee80211_restart_all(ic); return; } } @@ -8907,19 +8904,6 @@ iwn_scan_mindwell(struct ieee80211_scan_ { /* NB: don't try to abort scan; wait for firmware to finish */ } - -static void -iwn_hw_reset(void *arg0, int pending) -{ - struct iwn_softc *sc = arg0; - struct ieee80211com *ic = &sc->sc_ic; - - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); - - iwn_stop(sc); - iwn_init(sc); - ieee80211_notify_radio(ic, 1); -} #ifdef IWN_DEBUG #define IWN_DESC(x) case x: return #x Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Wed May 4 11:53:30 2016 (r299062) +++ head/sys/dev/iwn/if_iwnvar.h Wed May 4 12:51:27 2016 (r299063) @@ -304,7 +304,6 @@ struct iwn_softc { int sc_cap_off; /* PCIe Capabilities. */ /* Tasks used by the driver */ - struct task sc_reinit_task; struct task sc_radioon_task; struct task sc_radiooff_task; struct task sc_panic_task; From owner-svn-src-all@freebsd.org Wed May 4 13:49:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C5FB2C27A; Wed, 4 May 2016 13:49:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8487198F; Wed, 4 May 2016 13:49:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44Dmxp5092689; Wed, 4 May 2016 13:48:59 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44Dmxd0092688; Wed, 4 May 2016 13:48:59 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605041348.u44Dmxd0092688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 4 May 2016 13:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299064 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 13:49:01 -0000 Author: royger Date: Wed May 4 13:48:59 2016 New Revision: 299064 URL: https://svnweb.freebsd.org/changeset/base/299064 Log: rtc: fix inverted resolution check The current code in clock_register checks if the newly added clock has a resolution value higher than the current one in order to make it the default, which is wrong. Clocks with a lower resolution value should be better than ones with a higher resolution value, in fact with the current code FreeBSD is always selecting the worse clock. Reviewed by: kib jhb jkim Sponsored by: Citrix Systems R&D MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D6185 Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Wed May 4 12:51:27 2016 (r299063) +++ head/sys/kern/subr_rtc.c Wed May 4 13:48:59 2016 (r299064) @@ -84,7 +84,7 @@ clock_register(device_t dev, long res) / { if (clock_dev != NULL) { - if (clock_res > res) { + if (clock_res <= res) { if (bootverbose) device_printf(dev, "not installed as " "time-of-day clock: clock %s has higher " From owner-svn-src-all@freebsd.org Wed May 4 13:50:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93A58B2C30F; Wed, 4 May 2016 13:50:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64B301B19; Wed, 4 May 2016 13:50:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44DnxLK092768; Wed, 4 May 2016 13:49:59 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44DnxjD092767; Wed, 4 May 2016 13:49:59 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605041349.u44DnxjD092767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 4 May 2016 13:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299065 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 13:50:00 -0000 Author: royger Date: Wed May 4 13:49:59 2016 New Revision: 299065 URL: https://svnweb.freebsd.org/changeset/base/299065 Log: xen/pvclock: set the correct resolution for the Xen PV clock The Xen PV clock has a resolution of 1ns, so set the resolution to the highest one that FreeBSD supports, which is 1us. MFC after: 2 weeks Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Wed May 4 13:48:59 2016 (r299064) +++ head/sys/dev/xen/timer/timer.c Wed May 4 13:49:59 2016 (r299065) @@ -77,7 +77,12 @@ static devclass_t xentimer_devclass; /* Xen timers may fire up to 100us off */ #define XENTIMER_MIN_PERIOD_IN_NSEC 100*NSEC_IN_USEC -#define XENCLOCK_RESOLUTION 1000001 /* ATRTC resolution + 1 */ + +/* + * The real resolution of the PV clock is 1ns, but the highest + * resolution that FreeBSD supports is 1us, so just use that. + */ +#define XENCLOCK_RESOLUTION 1 #define XENTIMER_QUALITY 950 From owner-svn-src-all@freebsd.org Wed May 4 15:00:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4784B2D34F; Wed, 4 May 2016 15:00:51 +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 49F4110C9; Wed, 4 May 2016 15:00:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 878B078173B; Thu, 5 May 2016 01:00:41 +1000 (AEST) Date: Thu, 5 May 2016 01:00:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299064 - head/sys/kern In-Reply-To: <201605041348.u44Dmxd0092688@repo.freebsd.org> Message-ID: <20160505001048.I2920@besplex.bde.org> References: <201605041348.u44Dmxd0092688@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=_pMxRuWrKOeY_rYhkAYA:9 a=hrqDujVZhSk7YVR3:21 a=-PCxF4OOP6Qdloiw: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.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:00:51 -0000 On Wed, 4 May 2016, [UTF-8] Roger Pau Monn=C3=A9 wrote: > Log: > rtc: fix inverted resolution check > > The current code in clock_register checks if the newly added clock has a > resolution value higher than the current one in order to make it the > default, which is wrong. Clocks with a lower resolution value should be > better than ones with a higher resolution value, in fact with the curren= t > code FreeBSD is always selecting the worse clock. > ... > Modified: head/sys/kern/subr_rtc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_rtc.c=09Wed May 4 12:51:27 2016=09(r299063) > +++ head/sys/kern/subr_rtc.c=09Wed May 4 13:48:59 2016=09(r299064) > @@ -84,7 +84,7 @@ clock_register(device_t dev, long res)=09/ > { > > =09if (clock_dev !=3D NULL) { > -=09=09if (clock_res > res) { > +=09=09if (clock_res <=3D res) { > =09=09=09if (bootverbose) > =09=09=09=09device_printf(dev, "not installed as " > =09=09=09=09 "time-of-day clock: clock %s has higher " This and the next message are still sort of backwards, and have an off-by-1 error. It is not incorrect for them to say that the current clock has higher resolution, except for the off-by-1 error. Higher resolution means numerically lower and this now matches the code. But it is confusing. It is better to say that the current clock has finer resolution. The off by 1 error is that the current clock is actually also preferred if it has the same resolution. The wording "finer or equal" is not so good, and neither is "not coarser" Other bugs in these messages: - the first 2 are are obfuscated by splitting them across 3 lines; the third one is only across 2 lines - I think they are misformatted (too long) in the output too - the first message says "not installed", but this function is named clock_register() and third message says it registers, not installs - "removed" in the second message is inconsistent with both "registered" and "installed". Other bugs in the printf()s: - tv_nsec has type long. %09ld format handles this perfectly, but %09jd is used. This requires more verboseness to cast to intmax_t - though %09ld handles nanoseconds perfectly, it is a bogus format since the resolution is only microseconds. - casting tv_sec to intmax_t to print it is excessive. long works on general time_t values until 2038 and is used a lot elsewhere in kern, and here the value is an adjustment that is known to be small. In fact it is 'long res' divided by 2 million, so it is at least 2 million times smaller than needed to print it using %ld. Bruce From owner-svn-src-all@freebsd.org Wed May 4 15:25:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53B46B2D956; Wed, 4 May 2016 15:25:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F15D104D; Wed, 4 May 2016 15:25:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44FPmVB022763; Wed, 4 May 2016 15:25:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44FPlIo022751; Wed, 4 May 2016 15:25:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605041525.u44FPlIo022751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 4 May 2016 15:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r299066 - in releng/10.3: . crypto/openssl/crypto/asn1 crypto/openssl/crypto/evp crypto/openssl/crypto/x509 lib/libc/db/hash sys/cddl/compat/opensolaris/kern sys/conf sys/x86/x86 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:25:49 -0000 Author: delphij Date: Wed May 4 15:25:47 2016 New Revision: 299066 URL: https://svnweb.freebsd.org/changeset/base/299066 Log: Fix multiple OpenSSL vulnerabilitites. [SA-16:17] Fix performance regression in libc hash(3). [EN-16:06] Fix excessive latency in x86 IPI delivery. [EN-16:07] Fix memory leak in ZFS. [EN-16:08] Approved by: so Modified: releng/10.3/UPDATING releng/10.3/crypto/openssl/crypto/asn1/a_type.c releng/10.3/crypto/openssl/crypto/asn1/tasn_dec.c releng/10.3/crypto/openssl/crypto/asn1/tasn_enc.c releng/10.3/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c releng/10.3/crypto/openssl/crypto/evp/encode.c releng/10.3/crypto/openssl/crypto/evp/evp_enc.c releng/10.3/crypto/openssl/crypto/x509/x509_obj.c releng/10.3/lib/libc/db/hash/hash.c releng/10.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c releng/10.3/sys/conf/newvers.sh releng/10.3/sys/x86/x86/local_apic.c Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/UPDATING Wed May 4 15:25:47 2016 (r299066) @@ -16,7 +16,20 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. -20150429 p1 FreeBSD-SA-16:16.ntp +20160504 p2 FreeBSD-SA-16:17.openssl + FreeBSD-EN-16:06.libc + FreeBSD-EN-16:07.ipi + FreeBSD-EN-16:08.zfs + + Fix multiple OpenSSL vulnerabilitites. [SA-16:17] + + Fix performance regression in libc hash(3). [EN-16:06] + + Fix excessive latency in x86 IPI delivery. [EN-16:07] + + Fix memory leak in ZFS. [EN-16:08] + +20160429 p1 FreeBSD-SA-16:16.ntp Fix multiple vulnerabilities of ntp. Modified: releng/10.3/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/asn1/a_type.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:25:47 2016 (r299066) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: releng/10.3/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:25:47 2016 (r299066) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: releng/10.3/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:25:47 2016 (r299066) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: releng/10.3/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 15:25:47 2016 (r299066) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: releng/10.3/crypto/openssl/crypto/evp/encode.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/evp/encode.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/evp/encode.c Wed May 4 15:25:47 2016 (r299066) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -151,13 +152,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -174,7 +175,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -183,6 +184,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: releng/10.3/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:25:47 2016 (r299066) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: releng/10.3/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- releng/10.3/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:25:47 2016 (r299066) @@ -117,8 +117,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif Modified: releng/10.3/lib/libc/db/hash/hash.c ============================================================================== --- releng/10.3/lib/libc/db/hash/hash.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/lib/libc/db/hash/hash.c Wed May 4 15:25:47 2016 (r299066) @@ -423,7 +423,8 @@ hdestroy(HTAB *hashp) free(hashp->tmp_buf); if (hashp->fp != -1) { - (void)_fsync(hashp->fp); + if (hashp->save_file) + (void)_fsync(hashp->fp); (void)_close(hashp->fp); } Modified: releng/10.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- releng/10.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:25:47 2016 (r299066) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); Modified: releng/10.3/sys/conf/newvers.sh ============================================================================== --- releng/10.3/sys/conf/newvers.sh Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/sys/conf/newvers.sh Wed May 4 15:25:47 2016 (r299066) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.3/sys/x86/x86/local_apic.c ============================================================================== --- releng/10.3/sys/x86/x86/local_apic.c Wed May 4 13:49:59 2016 (r299065) +++ releng/10.3/sys/x86/x86/local_apic.c Wed May 4 15:25:47 2016 (r299066) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -158,6 +159,9 @@ volatile lapic_t *lapic; vm_paddr_t lapic_paddr; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +#ifdef SMP +static uint64_t lapic_ipi_wait_mult; +#endif static void lapic_enable(void); static void lapic_resume(struct pic *pic, bool suspend_cancelled); @@ -221,6 +225,9 @@ lvt_mode(struct lapic *la, u_int pin, ui void lapic_init(vm_paddr_t addr) { +#ifdef SMP + uint64_t r, r1, r2, rx; +#endif u_int regs[4]; int i, arat; @@ -275,6 +282,38 @@ lapic_init(vm_paddr_t addr) lapic_et.et_priv = NULL; et_register(&lapic_et); } + +#ifdef SMP +#define LOOPS 1000000 + /* + * Calibrate the busy loop waiting for IPI ack in xAPIC mode. + * lapic_ipi_wait_mult contains the number of iterations which + * approximately delay execution for 1 microsecond (the + * argument to native_lapic_ipi_wait() is in microseconds). + * + * We assume that TSC is present and already measured. + * Possible TSC frequency jumps are irrelevant to the + * calibration loop below, the CPU clock management code is + * not yet started, and we do not enter sleep states. + */ + KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, + ("TSC not initialized")); + r = rdtsc(); + for (rx = 0; rx < LOOPS; rx++) { + (void)lapic->icr_lo; + ia32_pause(); + } + r = rdtsc() - r; + r1 = tsc_freq * LOOPS; + r2 = r * 1000000; + lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; + if (bootverbose) { + printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n", + (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, + (uintmax_t)tsc_freq); + } +#undef LOOPS +#endif /* SMP */ } /* @@ -1381,25 +1420,20 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ int lapic_ipi_wait(int delay) { - int x; - - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic->icr_lo & APIC_DELSTAT_MASK) != APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); - } + uint64_t rx; - for (x = 0; x < delay; x += 5) { + for (rx = 0; delay == -1 || rx < lapic_ipi_wait_mult * delay; rx++) { if ((lapic->icr_lo & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(5); + ia32_pause(); } return (0); } From owner-svn-src-all@freebsd.org Wed May 4 15:26:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7053DB2D9A7; Wed, 4 May 2016 15:26:25 +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 30ACD11A1; Wed, 4 May 2016 15:26:25 +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 u44FQO4c022837; Wed, 4 May 2016 15:26:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44FQNu5022826; Wed, 4 May 2016 15:26:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605041526.u44FQNu5022826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 4 May 2016 15:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r299067 - in releng/10.2: . crypto/openssl/crypto/asn1 crypto/openssl/crypto/evp crypto/openssl/crypto/x509 sys/cddl/compat/opensolaris/kern sys/conf sys/x86/x86 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:26:25 -0000 Author: delphij Date: Wed May 4 15:26:23 2016 New Revision: 299067 URL: https://svnweb.freebsd.org/changeset/base/299067 Log: Fix multiple OpenSSL vulnerabilitites. [SA-16:17] Fix excessive latency in x86 IPI delivery. [EN-16:07] Fix memory leak in ZFS. [EN-16:08] Approved by: so Modified: releng/10.2/UPDATING releng/10.2/crypto/openssl/crypto/asn1/a_type.c releng/10.2/crypto/openssl/crypto/asn1/tasn_dec.c releng/10.2/crypto/openssl/crypto/asn1/tasn_enc.c releng/10.2/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c releng/10.2/crypto/openssl/crypto/evp/encode.c releng/10.2/crypto/openssl/crypto/evp/evp_enc.c releng/10.2/crypto/openssl/crypto/x509/x509_obj.c releng/10.2/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c releng/10.2/sys/conf/newvers.sh releng/10.2/sys/x86/x86/local_apic.c Modified: releng/10.2/UPDATING ============================================================================== --- releng/10.2/UPDATING Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/UPDATING Wed May 4 15:26:23 2016 (r299067) @@ -16,7 +16,17 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. -20150429 p15 FreeBSD-SA-16:16.ntp +20160504 p16 FreeBSD-SA-16:17.openssl + FreeBSD-EN-16:07.ipi + FreeBSD-EN-16:08.zfs + + Fix multiple OpenSSL vulnerabilitites. [SA-16:17] + + Fix excessive latency in x86 IPI delivery. [EN-16:07] + + Fix memory leak in ZFS. [EN-16:08] + +20160429 p15 FreeBSD-SA-16:16.ntp Fix multiple vulnerabilities of ntp. Modified: releng/10.2/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:26:23 2016 (r299067) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: releng/10.2/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:26:23 2016 (r299067) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: releng/10.2/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:26:23 2016 (r299067) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: releng/10.2/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 15:26:23 2016 (r299067) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: releng/10.2/crypto/openssl/crypto/evp/encode.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/evp/encode.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/evp/encode.c Wed May 4 15:26:23 2016 (r299067) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -134,13 +135,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -157,7 +158,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -166,6 +167,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: releng/10.2/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:26:23 2016 (r299067) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: releng/10.2/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- releng/10.2/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:26:23 2016 (r299067) @@ -117,8 +117,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif Modified: releng/10.2/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- releng/10.2/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:26:23 2016 (r299067) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); Modified: releng/10.2/sys/conf/newvers.sh ============================================================================== --- releng/10.2/sys/conf/newvers.sh Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/sys/conf/newvers.sh Wed May 4 15:26:23 2016 (r299067) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.2" -BRANCH="RELEASE-p15" +BRANCH="RELEASE-p16" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.2/sys/x86/x86/local_apic.c ============================================================================== --- releng/10.2/sys/x86/x86/local_apic.c Wed May 4 15:25:47 2016 (r299066) +++ releng/10.2/sys/x86/x86/local_apic.c Wed May 4 15:26:23 2016 (r299067) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -158,6 +159,9 @@ volatile lapic_t *lapic; vm_paddr_t lapic_paddr; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +#ifdef SMP +static uint64_t lapic_ipi_wait_mult; +#endif static void lapic_enable(void); static void lapic_resume(struct pic *pic, bool suspend_cancelled); @@ -221,6 +225,9 @@ lvt_mode(struct lapic *la, u_int pin, ui void lapic_init(vm_paddr_t addr) { +#ifdef SMP + uint64_t r, r1, r2, rx; +#endif u_int regs[4]; int i, arat; @@ -275,6 +282,38 @@ lapic_init(vm_paddr_t addr) lapic_et.et_priv = NULL; et_register(&lapic_et); } + +#ifdef SMP +#define LOOPS 1000000 + /* + * Calibrate the busy loop waiting for IPI ack in xAPIC mode. + * lapic_ipi_wait_mult contains the number of iterations which + * approximately delay execution for 1 microsecond (the + * argument to native_lapic_ipi_wait() is in microseconds). + * + * We assume that TSC is present and already measured. + * Possible TSC frequency jumps are irrelevant to the + * calibration loop below, the CPU clock management code is + * not yet started, and we do not enter sleep states. + */ + KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, + ("TSC not initialized")); + r = rdtsc(); + for (rx = 0; rx < LOOPS; rx++) { + (void)lapic->icr_lo; + ia32_pause(); + } + r = rdtsc() - r; + r1 = tsc_freq * LOOPS; + r2 = r * 1000000; + lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; + if (bootverbose) { + printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n", + (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, + (uintmax_t)tsc_freq); + } +#undef LOOPS +#endif /* SMP */ } /* @@ -1381,25 +1420,20 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ int lapic_ipi_wait(int delay) { - int x; - - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic->icr_lo & APIC_DELSTAT_MASK) != APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); - } + uint64_t rx; - for (x = 0; x < delay; x += 5) { + for (rx = 0; delay == -1 || rx < lapic_ipi_wait_mult * delay; rx++) { if ((lapic->icr_lo & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(5); + ia32_pause(); } return (0); } From owner-svn-src-all@freebsd.org Wed May 4 15:27:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 531C4B2D9FC; Wed, 4 May 2016 15:27:12 +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 220E71303; Wed, 4 May 2016 15:27:12 +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 u44FRBA2022926; Wed, 4 May 2016 15:27:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44FR9Ro022907; Wed, 4 May 2016 15:27:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605041527.u44FR9Ro022907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 4 May 2016 15:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r299068 - in releng: 10.1 10.1/crypto/openssl/crypto/asn1 10.1/crypto/openssl/crypto/evp 10.1/crypto/openssl/crypto/x509 10.1/sys/cddl/compat/opensolaris/kern 10.1/sys/conf 9.3 9.3/cryp... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:27:12 -0000 Author: delphij Date: Wed May 4 15:27:09 2016 New Revision: 299068 URL: https://svnweb.freebsd.org/changeset/base/299068 Log: Fix multiple OpenSSL vulnerabilitites. [SA-16:17] Fix memory leak in ZFS. [EN-16:08] Approved by: so Modified: releng/10.1/UPDATING releng/10.1/crypto/openssl/crypto/asn1/a_type.c releng/10.1/crypto/openssl/crypto/asn1/tasn_dec.c releng/10.1/crypto/openssl/crypto/asn1/tasn_enc.c releng/10.1/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c releng/10.1/crypto/openssl/crypto/evp/encode.c releng/10.1/crypto/openssl/crypto/evp/evp_enc.c releng/10.1/crypto/openssl/crypto/x509/x509_obj.c releng/10.1/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c releng/10.1/sys/conf/newvers.sh releng/9.3/UPDATING releng/9.3/crypto/openssl/crypto/asn1/a_type.c releng/9.3/crypto/openssl/crypto/asn1/tasn_dec.c releng/9.3/crypto/openssl/crypto/asn1/tasn_enc.c releng/9.3/crypto/openssl/crypto/evp/encode.c releng/9.3/crypto/openssl/crypto/evp/evp_enc.c releng/9.3/crypto/openssl/crypto/x509/x509_obj.c releng/9.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c releng/9.3/sys/conf/newvers.sh Modified: releng/10.1/UPDATING ============================================================================== --- releng/10.1/UPDATING Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/UPDATING Wed May 4 15:27:09 2016 (r299068) @@ -16,7 +16,14 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. -20150429 p32 FreeBSD-SA-16:16.ntp +20160504 p33 FreeBSD-SA-16:17.openssl + FreeBSD-EN-16:08.zfs + + Fix multiple OpenSSL vulnerabilitites. [SA-16:17] + + Fix memory leak in ZFS. [EN-16:08] + +20160429 p32 FreeBSD-SA-16:16.ntp Fix multiple vulnerabilities of ntp. Modified: releng/10.1/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:27:09 2016 (r299068) @@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: releng/10.1/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:27:09 2016 (r299068) @@ -903,9 +903,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: releng/10.1/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:27:09 2016 (r299068) @@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: releng/10.1/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c Wed May 4 15:27:09 2016 (r299068) @@ -59,6 +59,7 @@ # include # include # include "evp_locl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -286,6 +287,8 @@ static int aesni_cbc_hmac_sha1_cipher(EV maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; Modified: releng/10.1/crypto/openssl/crypto/evp/encode.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/evp/encode.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/evp/encode.c Wed May 4 15:27:09 2016 (r299068) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -134,13 +135,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -157,7 +158,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -166,6 +167,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: releng/10.1/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:27:09 2016 (r299068) @@ -334,7 +334,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: releng/10.1/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- releng/10.1/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:27:09 2016 (r299068) @@ -117,8 +117,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif Modified: releng/10.1/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- releng/10.1/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:27:09 2016 (r299068) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Wed May 4 15:26:23 2016 (r299067) +++ releng/10.1/sys/conf/newvers.sh Wed May 4 15:27:09 2016 (r299068) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p32" +BRANCH="RELEASE-p33" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/UPDATING Wed May 4 15:27:09 2016 (r299068) @@ -11,7 +11,14 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. -20150429 p40 FreeBSD-SA-16:16.ntp +20160504 p41 FreeBSD-SA-16:17.openssl + FreeBSD-EN-16:08.zfs + + Fix multiple OpenSSL vulnerabilitites. [SA-16:17] + + Fix memory leak in ZFS. [EN-16:08] + +20160429 p40 FreeBSD-SA-16:16.ntp Fix multiple vulnerabilities of ntp. Modified: releng/9.3/crypto/openssl/crypto/asn1/a_type.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/asn1/a_type.c Wed May 4 15:27:09 2016 (r299068) @@ -123,9 +123,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, co result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: case V_ASN1_BIT_STRING: case V_ASN1_OCTET_STRING: case V_ASN1_SEQUENCE: Modified: releng/9.3/crypto/openssl/crypto/asn1/tasn_dec.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/asn1/tasn_dec.c Wed May 4 15:27:09 2016 (r299068) @@ -901,9 +901,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: tint = (ASN1_INTEGER **)pval; if (!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; Modified: releng/9.3/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/asn1/tasn_enc.c Wed May 4 15:27:09 2016 (r299068) @@ -610,9 +610,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsig break; case V_ASN1_INTEGER: - case V_ASN1_NEG_INTEGER: case V_ASN1_ENUMERATED: - case V_ASN1_NEG_ENUMERATED: /* * These are all have the same content format as ASN1_INTEGER */ Modified: releng/9.3/crypto/openssl/crypto/evp/encode.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/evp/encode.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/evp/encode.c Wed May 4 15:27:09 2016 (r299068) @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -134,13 +135,13 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct const unsigned char *in, int inl) { int i, j; - unsigned int total = 0; + size_t total = 0; *outl = 0; if (inl == 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); - if ((ctx->num + inl) < ctx->length) { + if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return; @@ -157,7 +158,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total = j + 1; } - while (inl >= ctx->length) { + while (inl >= ctx->length && total <= INT_MAX) { j = EVP_EncodeBlock(out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -166,6 +167,11 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ct *out = '\0'; total += j + 1; } + if (total > INT_MAX) { + /* Too much output data! */ + *outl = 0; + return; + } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; Modified: releng/9.3/crypto/openssl/crypto/evp/evp_enc.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/evp/evp_enc.c Wed May 4 15:27:09 2016 (r299068) @@ -166,7 +166,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ct bl = ctx->cipher->block_size; OPENSSL_assert(bl <= (int)sizeof(ctx->buf)); if (i != 0) { - if (i + inl < bl) { + if (bl - i > inl) { memcpy(&(ctx->buf[i]), in, inl); ctx->buf_len += inl; *outl = 0; Modified: releng/9.3/crypto/openssl/crypto/x509/x509_obj.c ============================================================================== --- releng/9.3/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/crypto/openssl/crypto/x509/x509_obj.c Wed May 4 15:27:09 2016 (r299068) @@ -117,8 +117,9 @@ char *X509_NAME_oneline(X509_NAME *a, ch type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { - ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf) - ? sizeof ebcdic_buf : num); + if (num > (int)sizeof(ebcdic_buf)) + num = sizeof(ebcdic_buf); + ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif Modified: releng/9.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- releng/9.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed May 4 15:27:09 2016 (r299068) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Wed May 4 15:26:23 2016 (r299067) +++ releng/9.3/sys/conf/newvers.sh Wed May 4 15:27:09 2016 (r299068) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p40" +BRANCH="RELEASE-p41" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed May 4 15:49:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B08B2DDC1; Wed, 4 May 2016 15:49:05 +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 951431EE3; Wed, 4 May 2016 15:49:04 +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 u44Fn37v029091; Wed, 4 May 2016 15:49:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44FmxAq029042; Wed, 4 May 2016 15:48:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605041548.u44FmxAq029042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 4 May 2016 15:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299069 - in head/sys/arm: amlogic/aml8726 arm at91 broadcom/bcm2835 cavium/cns11xx freescale/imx freescale/vybrid mv samsung/exynos ti ti/omap4 xilinx xscale/i8134x xscale/ixp425 xscal... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:49:05 -0000 Author: pfg Date: Wed May 4 15:48:59 2016 New Revision: 299069 URL: https://svnweb.freebsd.org/changeset/base/299069 Log: sys/arm: Minor spelling fixes. Only affects comments: no functional change. Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_mmc.h head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h head/sys/arm/arm/cpufunc_asm_arm11.S head/sys/arm/arm/exception.S head/sys/arm/arm/gic.c head/sys/arm/arm/machdep.c head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/swtch-v4.S head/sys/arm/at91/at91_cfata.c head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_reset.S head/sys/arm/at91/at91reg.h head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/if_ate.c head/sys/arm/at91/if_atereg.h head/sys/arm/broadcom/bcm2835/bcm2835_audio.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/cavium/cns11xx/if_ece.c head/sys/arm/freescale/imx/imx6_ipu.c head/sys/arm/freescale/imx/imx6_ssi.c head/sys/arm/freescale/vybrid/vf_uart.c head/sys/arm/mv/mpic.c head/sys/arm/mv/mv_common.c head/sys/arm/samsung/exynos/exynos5_usb_phy.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm/ti/ti_i2c.c head/sys/arm/ti/ti_pinmux.c head/sys/arm/ti/ti_prcm.c head/sys/arm/ti/ti_scm.c head/sys/arm/ti/ti_sdma.c head/sys/arm/xilinx/zy7_slcr.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/i8134x/i81342reg.h head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/ixp425/cambria_gpio.c head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/arm/xscale/ixp425/ixp425_npereg.h head/sys/arm/xscale/ixp425/ixp425_qmgr.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Wed May 4 15:48:59 2016 (r299069) @@ -240,7 +240,7 @@ aml8726_mmc_start_command(struct aml8726 * Start and transmission bits are per section 4.7.2 of the: * * SD Specifications Part 1 - * Physicaly Layer Simplified Specification + * Physical Layer Simplified Specification * Version 4.10 */ cmdr = AML_MMC_CMD_START_BIT | AML_MMC_CMD_TRANS_BIT_HOST | cmd->opcode; Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.h ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.h Wed May 4 15:48:59 2016 (r299069) @@ -39,7 +39,7 @@ * Read and write are per section 4.6.2 of the: * * SD Specifications Part 1 - * Physicaly Layer Simplified Specification + * Physical Layer Simplified Specification * Version 4.10 */ #define AML_MMC_CMD_TIMEOUT 50 Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Wed May 4 15:48:59 2016 (r299069) @@ -484,7 +484,7 @@ aml8726_sdxc_finish_command(struct aml87 if (stop_cmd != NULL) { /* - * If the original command executed successfuly, then + * If the original command executed successfully, then * the hardware will also have automatically executed * a stop command so don't bother with the one supplied * with the original request. Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h Wed May 4 15:48:59 2016 (r299069) @@ -38,7 +38,7 @@ * Read and write are per section 4.6.2 of the: * * SD Specifications Part 1 - * Physicaly Layer Simplified Specification + * Physical Layer Simplified Specification * Version 4.10 */ #define AML_SDXC_CMD_TIMEOUT 50 Modified: head/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11.S Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/cpufunc_asm_arm11.S Wed May 4 15:48:59 2016 (r299069) @@ -30,7 +30,7 @@ * * ARM11 assembly functions for CPU / MMU / TLB specific operations * - * XXX We make no attempt at present to take advantage of the v6 memroy + * XXX We make no attempt at present to take advantage of the v6 memory * architecture or physically tagged cache. */ Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/exception.S Wed May 4 15:48:59 2016 (r299069) @@ -175,7 +175,7 @@ _C_LABEL(dtrace_invop_jump_addr): ldr r4, [r5, #4]; /* reset it to point at the */ \ cmp r4, #0xffffffff; /* end of memory if necessary; */ \ movne r1, #0xffffffff; /* leave value in r4 for later */ \ - strne r1, [r5, #4]; /* comparision against PC. */ \ + strne r1, [r5, #4]; /* comparison against PC. */ \ ldr r3, [r5]; /* Retrieve global RAS_START */ \ cmp r3, #0; /* and reset it if non-zero. */ \ movne r1, #0; /* If non-zero RAS_START and */ \ Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/gic.c Wed May 4 15:48:59 2016 (r299069) @@ -1231,7 +1231,7 @@ arm_gic_next_irq(struct arm_gic_softc *s active_irq = gic_c_read_4(sc, GICC_IAR); /* - * Immediatly EOIR the SGIs, because doing so requires the other + * Immediately EOIR the SGIs, because doing so requires the other * bits (ie CPU number), not just the IRQ number, and we do not * have this information later. */ Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/machdep.c Wed May 4 15:48:59 2016 (r299069) @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Machine dependant functions for kernel setup + * Machine dependent functions for kernel setup * * Created : 17/09/94 * Updated : 18/04/01 updated for new wscons Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/mpcore_timer.c Wed May 4 15:48:59 2016 (r299069) @@ -367,7 +367,7 @@ attach_et(struct arm_tmr_softc *sc) * globally and registers both the timecount and eventtimer objects. * * RETURNS - * Zero on sucess or ENXIO if an error occuried. + * Zero on success or ENXIO if an error occuried. */ static int arm_tmr_attach(device_t dev) @@ -457,7 +457,7 @@ EARLY_DRIVER_MODULE(mp_tmr, ofwbus, arm_ /* * Handle a change in clock frequency. The mpcore timer runs at half the CPU * frequency. When the CPU frequency changes due to power-saving or thermal - * managment, the platform-specific code that causes the frequency change calls + * management, the platform-specific code that causes the frequency change calls * this routine to inform the clock driver, and we in turn inform the event * timer system, which actually updates the value in et->frequency for us and * reschedules the current event(s) in a way that's atomic with respect to Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/pmap-v4.c Wed May 4 15:48:59 2016 (r299069) @@ -126,7 +126,7 @@ * * pmap.c * - * Machine dependant vm stuff + * Machine dependent vm stuff * * Created : 20/09/94 */ @@ -1386,9 +1386,9 @@ pmap_clearbit(struct vm_page *pg, u_int * * Don't turn caching on again if this is a * modified emulation. This would be - * inconsitent with the settings created by + * inconsistent with the settings created by * pmap_fix_cache(). Otherwise, it's safe - * to re-enable cacheing. + * to re-enable caching. * * There's no need to call pmap_fix_cache() * here: all pages are losing their write Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/pmap-v6.c Wed May 4 15:48:59 2016 (r299069) @@ -705,7 +705,7 @@ pmap_preboot_get_pages(u_int num) } /* - * The fundamental initalization of PMAP stuff. + * The fundamental initialization of PMAP stuff. * * Some things already happened in locore.S and some things could happen * before pmap_bootstrap_prepare() is called, so let's recall what is done: @@ -1210,7 +1210,7 @@ pmap_bootstrap(vm_offset_t firstaddr) /* * Note that in very short time in initarm(), we are going to - * initialize phys_avail[] array and no futher page allocation + * initialize phys_avail[] array and no further page allocation * can happen after that until vm subsystem will be initialized. */ kernel_vm_end_new = kernel_vm_end; Modified: head/sys/arm/arm/swtch-v4.S ============================================================================== --- head/sys/arm/arm/swtch-v4.S Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/arm/swtch-v4.S Wed May 4 15:48:59 2016 (r299069) @@ -296,7 +296,7 @@ ENTRY(cpu_switch) beq .Lcs_context_switched /* yes! */ /* - * Definately need to flush the cache. + * Definitely need to flush the cache. */ ldr r1, .Lcpufuncs Modified: head/sys/arm/at91/at91_cfata.c ============================================================================== --- head/sys/arm/at91/at91_cfata.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91_cfata.c Wed May 4 15:48:59 2016 (r299069) @@ -26,7 +26,7 @@ * common memory mode. Interrupts are driven by polling. The driver * implements an ATA bridge and attached ATA channel driver on top * of it. - * NOTE WELL: this driver uses polling mode. To achive an acceptable + * NOTE WELL: this driver uses polling mode. To achieve an acceptable * operating speed you will probably want to use HZ=2000 in kernel * config. */ Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91_machdep.c Wed May 4 15:48:59 2016 (r299069) @@ -36,7 +36,7 @@ * * machdep.c * - * Machine dependant functions for kernel setup + * Machine dependent functions for kernel setup * * This file needs a lot of work. * Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91_mci.c Wed May 4 15:48:59 2016 (r299069) @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); * speed is 25MHz and the next highest speed is 15MHz or less. This appears * to work on virtually all SD cards, since it is what this driver has been * doing prior to the introduction of this option, where the overclocking vs - * underclocking decision was automaticly "overclock". Modern SD cards can + * underclocking decision was automatically "overclock". Modern SD cards can * run at 45mhz/1-bit in standard mode (high speed mode enable commands not * sent) without problems. * @@ -212,7 +212,7 @@ at91_bswap_buf(struct at91_mci_softc *sc /* * If the hardware doesn't need byte-swapping, let bcopy() do the * work. Use bounce buffer even if we don't need byteswap, since - * buffer may straddle a page boundry, and we don't handle + * buffer may straddle a page boundary, and we don't handle * multi-segment transfers in hardware. Seen from 'bsdlabel -w' which * uses raw geom access to the volume. Greg Ansley (gja (at) * ansley.com) Modified: head/sys/arm/at91/at91_reset.S ============================================================================== --- head/sys/arm/at91/at91_reset.S Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91_reset.S Wed May 4 15:48:59 2016 (r299069) @@ -14,7 +14,7 @@ __FBSDID("$FreeBSD$"); /* * From AT91SAM9G20 Datasheet errata 44:3.5: * - * When User Reset occurs durring SDRAM read acces, eh SDRAM clock is turned + * When User Reset occurs during SDRAM read access, the SDRAM clock is turned * off while data are ready to be read on the data bus. The SDRAM maintains * the data until the clock restarts. * Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91reg.h Wed May 4 15:48:59 2016 (r299069) @@ -39,9 +39,9 @@ #define AT91_PA_BASE 0xf0000000 /* A few things that we count on being the same - * throught the whole family of SOCs */ + * throughout the whole family of SOCs */ -/* SYSC System Controler */ +/* SYSC System Controller */ /* System Registers */ #define AT91_SYS_BASE 0xffff000 #define AT91_SYS_SIZE 0x1000 Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/at91sam9260.c Wed May 4 15:48:59 2016 (r299069) @@ -188,7 +188,7 @@ at91_clock_init(void) * PMC alogrithm choose the divisor that causes the input clock * to be near the optimal 2 MHz per datasheet. We know * we are going to be using this for the USB clock at 96 MHz. - * Causes no extra frequency deviation for all recomended crystal + * Causes no extra frequency deviation for all recommended crystal * values. See Note 1, table 40-16 SAM9260 doc. */ clk = at91_pmc_clock_ref("pllb"); Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/if_ate.c Wed May 4 15:48:59 2016 (r299069) @@ -651,7 +651,7 @@ ate_activate(device_t dev) ate_getaddr, &sc->tx_desc_phys, 0) != 0) goto errout; - /* Initilize descriptors; mark all empty */ + /* Initialize descriptors; mark all empty */ for (i = 0; i < ATE_MAX_TX_BUFFERS; i++) { sc->tx_descs[i].addr =0; sc->tx_descs[i].status = ETHB_TX_USED; @@ -919,7 +919,7 @@ ate_intr(void *xsc) /* * Simulate SAM9 FIRST/LAST bits for RM9200. * RM9200 EMAC has only on Rx buffer per packet. - * But sometime we are handed a zero lenght packet. + * But sometime we are handed a zero length packet. */ if ((rxdhead->status & ETH_LEN_MASK) == 0) rxdhead->status = 0; /* Mark error */ @@ -980,7 +980,7 @@ ate_intr(void *xsc) do { /* Last buffer may just be 1-4 bytes of FCS so remain - * may be zero for last decriptor. */ + * may be zero for last descriptor. */ if (remain > 0) { /* Make sure we get the current bytes */ bus_dmamap_sync(sc->rx_tag, sc->rx_map[sc->rxhead], @@ -989,7 +989,7 @@ ate_intr(void *xsc) count = MIN(remain, sc->rx_buf_size); /* XXX Performance robbing copy. Could - * recieve directly to mbufs if not an + * receive directly to mbufs if not an * RM9200. And even then we could likely * copy just the protocol headers. XXX */ m_append(mb, count, sc->rx_buf[sc->rxhead]); @@ -1468,7 +1468,7 @@ ate_miibus_readreg(device_t dev, int phy int val; /* - * XXX if we implement agressive power savings, then we need + * XXX if we implement aggressive power savings, then we need * XXX to make sure that the clock to the emac is on here */ @@ -1488,7 +1488,7 @@ ate_miibus_writereg(device_t dev, int ph struct ate_softc *sc; /* - * XXX if we implement agressive power savings, then we need + * XXX if we implement aggressive power savings, then we need * XXX to make sure that the clock to the emac is on here */ Modified: head/sys/arm/at91/if_atereg.h ============================================================================== --- head/sys/arm/at91/if_atereg.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/at91/if_atereg.h Wed May 4 15:48:59 2016 (r299069) @@ -28,7 +28,7 @@ #ifndef ARM_AT91_IF_ATEREG_H #define ARM_AT91_IF_ATEREG_H -/* deines begining ETHB_ are EMACB (newer SAM9 hardware) versions only */ +/* Defines beginning ETHB_ are EMACB (newer SAM9 hardware) versions only. */ #define ETH_CTL 0x00 /* EMAC Control Register */ #define ETH_CFG 0x04 /* EMAC Configuration Register */ @@ -191,7 +191,7 @@ typedef struct { #define ETH_MAC_LOCAL_3 (1U << 24) /* Packet matched addr 3 */ #define ETH_MAC_LOCAL_2 (1U << 25) /* Packet matched addr 2 */ #define ETH_MAC_LOCAL_1 (1U << 26) /* Packet matched addr 1 */ -#define ETH_MAC_UNK (1U << 27) /* Unkown source address RFU */ +#define ETH_MAC_UNK (1U << 27) /* Unknown source address RFU */ #define ETH_MAC_EXT (1U << 28) /* External Address */ #define ETH_MAC_UCAST (1U << 29) /* Unicast hash match */ #define ETH_MAC_MCAST (1U << 30) /* Multicast hash match */ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Wed May 4 15:48:59 2016 (r299069) @@ -828,7 +828,7 @@ bcm2835_audio_attach(device_t dev) /* * We need interrupts enabled for VCHI to work properly, - * so delay intialization until it happens + * so delay initialization until it happens. */ sc->intr_hook.ich_func = bcm2835_audio_delayed_init; sc->intr_hook.ich_arg = sc; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 4 15:48:59 2016 (r299069) @@ -278,7 +278,7 @@ bcm_dma_init(device_t dev) /* * Least alignment for busdma-allocated stuff is cache - * line size, so just make sure nothing stupid happend + * line size, so just make sure nothing stupid happened * and we got properly aligned address */ if ((uintptr_t)cb_virt & 0x1f) { @@ -539,7 +539,7 @@ bcm_dma_reg_dump(int ch) * ch - channel number * src, dst - source and destination address in * ARM physical memory address space. - * len - amount of bytes to be transfered + * len - amount of bytes to be transferred * * Returns 0 on success, -1 otherwise */ Modified: head/sys/arm/cavium/cns11xx/if_ece.c ============================================================================== --- head/sys/arm/cavium/cns11xx/if_ece.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/cavium/cns11xx/if_ece.c Wed May 4 15:48:59 2016 (r299069) @@ -1685,7 +1685,7 @@ ece_encap(struct ece_softc *sc, struct m /* * After all descriptors are set, we set the flags to start the - * sending proces. + * sending process. */ for (seg = 0; seg < nsegs; seg++) { desc->cown = 0; Modified: head/sys/arm/freescale/imx/imx6_ipu.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ipu.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/freescale/imx/imx6_ipu.c Wed May 4 15:48:59 2016 (r299069) @@ -872,7 +872,7 @@ ipu_init_buffer(struct ipu_softc *sc) stride = sc->sc_mode->hdisplay * MODE_BPP / 8; - /* init channel paramters */ + /* init channel parameters */ CH_PARAM_RESET(¶m); /* XXX: interlaced modes are not supported yet */ CH_PARAM_SET_FW(¶m, sc->sc_mode->hdisplay - 1); Modified: head/sys/arm/freescale/imx/imx6_ssi.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ssi.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/freescale/imx/imx6_ssi.c Wed May 4 15:48:59 2016 (r299069) @@ -738,7 +738,7 @@ ssi_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "ssi softc"); if (sc->lock == NULL) { - device_printf(dev, "Cant create mtx\n"); + device_printf(dev, "Can't create mtx\n"); return (ENXIO); } @@ -764,7 +764,7 @@ ssi_attach(device_t dev) /* * Maximum possible DMA buffer. - * Will be used partialy to match 24 bit word. + * Will be used partially to match 24 bit word. */ sc->dma_size = 131072; Modified: head/sys/arm/freescale/vybrid/vf_uart.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_uart.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/freescale/vybrid/vf_uart.c Wed May 4 15:48:59 2016 (r299069) @@ -205,7 +205,7 @@ uart_reinit(struct uart_softc *sc, int c bas = &sc->sc_bas; if (!bas) { - printf("Error: cant reconfigure bas\n"); + printf("Error: can't reconfigure bas\n"); return; } Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/mv/mpic.c Wed May 4 15:48:59 2016 (r299069) @@ -564,7 +564,7 @@ mv_msi_data(int irq, uint64_t *addr, uin node = ofw_bus_get_node(mv_mpic_sc->sc_dev); - /* Get physical addres of register space */ + /* Get physical address of register space */ error = fdt_get_range(OF_parent(node), 0, &phys, &size); if (error) { printf("%s: Cannot get register physical address, err:%d", Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/mv/mv_common.c Wed May 4 15:48:59 2016 (r299069) @@ -1398,7 +1398,7 @@ decode_win_pcie_setup(u_long base) /* * Upper 16 bits in BAR register is interpreted as BAR size - * (in 64 kB units) plus 64kB, so substract 0x10000 + * (in 64 kB units) plus 64kB, so subtract 0x10000 * form value passed to register to get correct value. */ size -= 0x10000; Modified: head/sys/arm/samsung/exynos/exynos5_usb_phy.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_usb_phy.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/samsung/exynos/exynos5_usb_phy.c Wed May 4 15:48:59 2016 (r299069) @@ -161,7 +161,7 @@ vbus_on(struct usb_phy_softc *sc) gpio_dev = devclass_get_device(devclass_find("gpio"), 0); if (gpio_dev == NULL) { - device_printf(sc->dev, "cant find gpio_dev\n"); + device_printf(sc->dev, "can't find gpio_dev\n"); return (1); } Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed May 4 15:48:59 2016 (r299069) @@ -1329,7 +1329,7 @@ omap4_clk_hsusbhost_accessible(struct ti * Inherits the locks from the omap_prcm driver, no internal locking. * * RETURNS: - * Returns 0 if sucessful otherwise a negative error code on failure. + * Returns 0 if successful otherwise a negative error code on failure. */ static int omap4_clk_hsusbhost_set_source(struct ti_clock_dev *clkdev, Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/ti_i2c.c Wed May 4 15:48:59 2016 (r299069) @@ -236,7 +236,7 @@ ti_i2c_transfer_intr(struct ti_i2c_softc if (status & I2C_STAT_RDR) { /* * Receive draining interrupt - last data received. - * The set FIFO threshold wont be reached to trigger + * The set FIFO threshold won't be reached to trigger * RRDY. */ ti_i2c_dbg(sc, "Receive draining interrupt\n"); @@ -272,7 +272,7 @@ ti_i2c_transfer_intr(struct ti_i2c_softc /* * Transmit draining interrupt - FIFO level is below * the set threshold and the amount of data still to - * be transferred wont reach the set FIFO threshold. + * be transferred won't reach the set FIFO threshold. */ ti_i2c_dbg(sc, "Transmit draining interrupt\n"); Modified: head/sys/arm/ti/ti_pinmux.c ============================================================================== --- head/sys/arm/ti/ti_pinmux.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/ti_pinmux.c Wed May 4 15:48:59 2016 (r299069) @@ -394,7 +394,7 @@ ti_pinmux_probe(device_t dev) * @dev: new device * * RETURNS - * Zero on sucess or ENXIO if an error occuried. + * Zero on success or ENXIO if an error occuried. */ static int ti_pinmux_attach(device_t dev) Modified: head/sys/arm/ti/ti_prcm.c ============================================================================== --- head/sys/arm/ti/ti_prcm.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/ti_prcm.c Wed May 4 15:48:59 2016 (r299069) @@ -31,7 +31,7 @@ */ /** - * Power, Reset and Clock Managment Module + * Power, Reset and Clock Management Module * * This is a very simple driver wrapper around the PRCM set of registers in * the OMAP3 chip. It allows you to turn on and off things like the functional Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/ti_scm.c Wed May 4 15:48:59 2016 (r299069) @@ -111,7 +111,7 @@ ti_scm_probe(device_t dev) * globally and registers both the timecount and eventtimer objects. * * RETURNS - * Zero on sucess or ENXIO if an error occuried. + * Zero on success or ENXIO if an error occuried. */ static int ti_scm_attach(device_t dev) Modified: head/sys/arm/ti/ti_sdma.c ============================================================================== --- head/sys/arm/ti/ti_sdma.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/ti/ti_sdma.c Wed May 4 15:48:59 2016 (r299069) @@ -446,7 +446,7 @@ ti_sdma_deactivate_channel(unsigned int * ti_sdma_disable_channel_irq - disables IRQ's on the given channel * @ch: the channel to disable IRQ's on * - * Disable interupt generation for the given channel. + * Disable interrupt generation for the given channel. * * LOCKING: * DMA registers protected by internal mutex @@ -608,7 +608,7 @@ ti_sdma_get_channel_status(unsigned int /** * ti_sdma_start_xfer - starts a DMA transfer - * @ch: the channel number to set the endianess of + * @ch: the channel number to set the endianness of * @src_paddr: the source phsyical address * @dst_paddr: the destination phsyical address * @frmcnt: the number of frames per block @@ -707,7 +707,7 @@ ti_sdma_start_xfer(unsigned int ch, unsi * frmcnt = 1, elmcnt = 512, pktsize = 128 * * Total transfer bytes = 1 * 512 = 512 elements or 2048 bytes - * Packets transfered = 128 / 512 = 4 + * Packets transferred = 128 / 512 = 4 * * * LOCKING: @@ -787,7 +787,7 @@ ti_sdma_start_xfer_packet(unsigned int c /** * ti_sdma_stop_xfer - stops any currently active transfers - * @ch: the channel number to set the endianess of + * @ch: the channel number to set the endianness of * * This function call is effectively a NOP if no transaction is in progress. * @@ -835,10 +835,10 @@ ti_sdma_stop_xfer(unsigned int ch) } /** - * ti_sdma_set_xfer_endianess - sets the endianess of subsequent transfers - * @ch: the channel number to set the endianess of - * @src: the source endianess (either DMA_ENDIAN_LITTLE or DMA_ENDIAN_BIG) - * @dst: the destination endianess (either DMA_ENDIAN_LITTLE or DMA_ENDIAN_BIG) + * ti_sdma_set_xfer_endianess - sets the endianness of subsequent transfers + * @ch: the channel number to set the endianness of + * @src: the source endianness (either DMA_ENDIAN_LITTLE or DMA_ENDIAN_BIG) + * @dst: the destination endianness (either DMA_ENDIAN_LITTLE or DMA_ENDIAN_BIG) * * * LOCKING: @@ -879,9 +879,9 @@ ti_sdma_set_xfer_endianess(unsigned int /** * ti_sdma_set_xfer_burst - sets the source and destination element size * @ch: the channel number to set the burst settings of - * @src: the source endianess (either DMA_BURST_NONE, DMA_BURST_16, DMA_BURST_32 + * @src: the source endianness (either DMA_BURST_NONE, DMA_BURST_16, DMA_BURST_32 * or DMA_BURST_64) - * @dst: the destination endianess (either DMA_BURST_NONE, DMA_BURST_16, + * @dst: the destination endianness (either DMA_BURST_NONE, DMA_BURST_16, * DMA_BURST_32 or DMA_BURST_64) * * This function sets the size of the elements for all subsequent transfers. @@ -923,7 +923,7 @@ ti_sdma_set_xfer_burst(unsigned int ch, /** * ti_sdma_set_xfer_data_type - driver attach function - * @ch: the channel number to set the endianess of + * @ch: the channel number to set the endianness of * @type: the xfer data type (either DMA_DATA_8BITS_SCALAR, DMA_DATA_16BITS_SCALAR * or DMA_DATA_32BITS_SCALAR) * @@ -1065,7 +1065,7 @@ ti_sdma_sync_params(unsigned int ch, uns /** * ti_sdma_set_addr_mode - driver attach function - * @ch: the channel number to set the endianess of + * @ch: the channel number to set the endianness of * @rd_mode: the xfer source addressing mode (either DMA_ADDR_CONSTANT, * DMA_ADDR_POST_INCREMENT, DMA_ADDR_SINGLE_INDEX or * DMA_ADDR_DOUBLE_INDEX) Modified: head/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xilinx/zy7_slcr.c Wed May 4 15:48:59 2016 (r299069) @@ -177,7 +177,7 @@ zy7_slcr_preload_pl(void) /* After PL configuration, enable level shifters and deassert top-level * PL resets. Called from zy7_devcfg.c. Optionally, the level shifters * can be left disabled but that's rare of an FPGA application. That option - * is controled by a sysctl in the devcfg driver. + * is controlled by a sysctl in the devcfg driver. */ void zy7_slcr_postload_pl(int en_level_shifters) Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Wed May 4 15:48:59 2016 (r299069) @@ -38,7 +38,7 @@ * * machdep.c * - * Machine dependant functions for kernel setup + * Machine dependent functions for kernel setup * * This file needs a lot of work. * Modified: head/sys/arm/xscale/i8134x/i81342reg.h ============================================================================== --- head/sys/arm/xscale/i8134x/i81342reg.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/i8134x/i81342reg.h Wed May 4 15:48:59 2016 (r299069) @@ -184,7 +184,7 @@ #define ATU_IATVR2 0x005c /* Inbound ATU Translate Value Register 2 */ #define ATU_IAUTVR2 0x0060 /* Inbound ATU Upper Translate Value Register 2*/ #define ATU_ERLR 0x0064 /* Expansion ROM Limit Register */ -#define ATU_ERTVR 0x0068 /* Expansion ROM Translater Value Register */ +#define ATU_ERTVR 0x0068 /* Expansion ROM Translator Value Register */ #define ATU_ERUTVR 0x006c /* Expansion ROM Upper Translate Value Register*/ #define ATU_CR 0x0070 /* ATU Configuration Register */ #define ATU_CR_OUT_EN (1 << 1) Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Wed May 4 15:48:59 2016 (r299069) @@ -38,7 +38,7 @@ * * machdep.c * - * Machine dependant functions for kernel setup + * Machine dependent functions for kernel setup * * This file needs a lot of work. * Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_gpio.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Wed May 4 15:48:59 2016 (r299069) @@ -32,7 +32,7 @@ * The Cambria PLD does not set the i2c ack bit after each write, if we used the * regular iicbus interface it would abort the xfer after the address byte * times out and not write our latch. To get around this we grab the iicbus and - * then do our own bit banging. This is a comprimise to changing all the iicbb + * then do our own bit banging. This is a compromise to changing all the iicbb * device methods to allow a flag to be passed down and is similir to how Linux * does it. * Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Wed May 4 15:48:59 2016 (r299069) @@ -507,7 +507,7 @@ ixpnpe_load_firmware(struct ixpnpe_softc /* * If download was successful, store image Id in list of - * currently loaded images. If a critical error occured + * currently loaded images. If a critical error occurred * during download, record that the NPE has an invalid image */ mtx_lock(&sc->sc_mtx); @@ -864,7 +864,7 @@ npe_cpu_reset(struct ixpnpe_softc *sc) while (npe_checkbits(sc, IX_NPEDL_REG_OFFSET_STAT, IX_NPEDL_MASK_STAT_IFNE)) { /* - * Step execution of the NPE intruction to read inFIFO using + * Step execution of the NPE instruction to read inFIFO using * the Debug Executing Context stack. */ error = npe_cpu_step(sc, IX_NPEDL_INSTR_RD_FIFO, 0, 0); @@ -1307,7 +1307,7 @@ npe_logical_reg_write(struct ixpnpe_soft ((regVal & IX_NPEDL_MASK_IMMED_INSTR_COPROC_DATA) << IX_NPEDL_DISPLACE_IMMED_INSTR_COPROC_DATA); - /* step execution of NPE intruction using Debug ECS */ + /* step execution of NPE instruction using Debug ECS */ error = npe_cpu_step(sc, npeInstruction, ctxtNum, IX_NPEDL_WR_INSTR_LDUR); } Modified: head/sys/arm/xscale/ixp425/ixp425_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed May 4 15:48:59 2016 (r299069) @@ -125,7 +125,7 @@ /* * Reset value for Mailbox (MBST) register - * NOTE that if used, it should be complemented with an NPE intruction + * NOTE that if used, it should be complemented with an NPE instruction * to clear the Mailbox at the NPE side as well */ #define IX_NPEDL_REG_RESET_MBST 0x0000F0F0 Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_qmgr.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c Wed May 4 15:48:59 2016 (r299069) @@ -421,7 +421,7 @@ ixpqmgr_qwrite(int qId, uint32_t entry) return ENOSPC; } /* - * No overflow occured : someone is draining the queue + * No overflow occurred : someone is draining the queue * and the current counter needs to be * updated from the current number of entries in the queue */ Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Wed May 4 15:27:09 2016 (r299068) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Wed May 4 15:48:59 2016 (r299069) @@ -38,7 +38,7 @@ * * machdep.c * - * Machine dependant functions for kernel setup + * Machine dependent functions for kernel setup * * This file needs a lot of work. * From owner-svn-src-all@freebsd.org Wed May 4 15:52:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9644B2B099; Wed, 4 May 2016 15:52:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5925134B; Wed, 4 May 2016 15:52:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44Fqe7v031833; Wed, 4 May 2016 15:52:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44Fqexs031831; Wed, 4 May 2016 15:52:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605041552.u44Fqexs031831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 4 May 2016 15:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299070 - in head/sys/sparc64: sbus sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 15:52:42 -0000 Author: pfg Date: Wed May 4 15:52:40 2016 New Revision: 299070 URL: https://svnweb.freebsd.org/changeset/base/299070 Log: sys/sparc64: minor spelling fixes. Only affects comments: no functional change. Modified: head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/intr_machdep.c Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Wed May 4 15:48:59 2016 (r299069) +++ head/sys/sparc64/sbus/sbus.c Wed May 4 15:52:40 2016 (r299070) @@ -341,7 +341,7 @@ sbus_attach(device_t dev) sc->sc_burst = (SBUS_BURST64_DEF << SBUS_BURST64_SHIFT) | SBUS_BURST_DEF; - /* initalise the IOMMU */ + /* initialise the IOMMU */ /* punch in our copies */ sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(SBUS_IOMMU_BITS); Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Wed May 4 15:48:59 2016 (r299069) +++ head/sys/sparc64/sparc64/intr_machdep.c Wed May 4 15:52:40 2016 (r299070) @@ -367,7 +367,7 @@ inthand_add(const char *name, int vec, d /* * Check if we need to upgrade from PIL_ITHREAD to PIL_FILTER. * Given that apart from the on-board SCCs and UARTs shared - * interrupts are rather uncommon on sparc64 this sould be + * interrupts are rather uncommon on sparc64 this should be * pretty rare in practice. */ filter = 0; From owner-svn-src-all@freebsd.org Wed May 4 16:09:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE72B2B64E; Wed, 4 May 2016 16:09:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0C21CB4; Wed, 4 May 2016 16:09:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44G9p3S035012; Wed, 4 May 2016 16:09:51 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44G9p4k035011; Wed, 4 May 2016 16:09:51 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605041609.u44G9p4k035011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 4 May 2016 16:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299071 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 16:09:52 -0000 Author: bz Date: Wed May 4 16:09:51 2016 New Revision: 299071 URL: https://svnweb.freebsd.org/changeset/base/299071 Log: The ARM generic timer keeps ticking even if disabled or it expired. In case of updating it with a very low value it might expire again after writing the tval but before updating ctrl. In that case we do lose the status bit saying that the timer expired and we will consequently not get an interrupt for it, leaving the timer in a "dead" state. In order to solve this increase the minimum period with what the timer can be loaded to something higher. Found & analysed with: gem5 Debugged with: andrew Sponsored by: DARPA/AFRL Reviewed by: andrew MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6202 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed May 4 15:52:40 2016 (r299070) +++ head/sys/arm/arm/generic_timer.c Wed May 4 16:09:51 2016 (r299071) @@ -417,7 +417,7 @@ arm_tmr_attach(device_t dev) sc->et.et_quality = 1000; sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; + sc->et.et_min_period = (0x00000010LLU << 32) / sc->et.et_frequency; sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; sc->et.et_start = arm_tmr_start; sc->et.et_stop = arm_tmr_stop; From owner-svn-src-all@freebsd.org Wed May 4 16:15:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D51B2B8B6; Wed, 4 May 2016 16:15:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAA51114C; Wed, 4 May 2016 16:15:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44GFdC3038041; Wed, 4 May 2016 16:15:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44GFd3F038040; Wed, 4 May 2016 16:15:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605041615.u44GFd3F038040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 4 May 2016 16:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299072 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 16:15:41 -0000 Author: bz Date: Wed May 4 16:15:39 2016 New Revision: 299072 URL: https://svnweb.freebsd.org/changeset/base/299072 Log: The virtual timer is optional on ARM64. Properly handle that condition. [1] In case we do not have an interrupt assignment for the virtual timer, force the physical timer. Also skip resource allocation for any timer we do not have an interrupt assignment for. In collaboration with: andrew Submitted by: br ([1] from his gem5 arm64 work) Sponsored by: DARPA/AFRL Reviewed by: andrew MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6203 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed May 4 16:09:51 2016 (r299071) +++ head/sys/arm/arm/generic_timer.c Wed May 4 16:15:39 2016 (r299072) @@ -100,7 +100,7 @@ static struct arm_tmr_softc *arm_tmr_sc static struct resource_spec timer_spec[] = { { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Secure */ { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Non-secure */ - { SYS_RES_IRQ, 2, RF_ACTIVE }, /* Virt */ + { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, /* Virt */ { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, /* Hyp */ { -1, 0 } }; @@ -392,13 +392,17 @@ arm_tmr_attach(device_t dev) #ifdef __arm__ sc->physical = true; #else /* __aarch64__ */ - sc->physical = false; + /* If we do not have a virtual timer use the physical. */ + sc->physical = (sc->res[2] == NULL) ? true : false; #endif arm_tmr_sc = sc; /* Setup secure, non-secure and virtual IRQs handler */ for (i = 0; i < 3; i++) { + /* If we do not have the interrupt, skip it. */ + if (sc->res[i] == NULL) + continue; error = bus_setup_intr(dev, sc->res[i], INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, &sc->ihl[i]); if (error) { From owner-svn-src-all@freebsd.org Wed May 4 16:24:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33611B2BAA1; Wed, 4 May 2016 16:24:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05A8B17A1; Wed, 4 May 2016 16:24:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44GOCbA041076; Wed, 4 May 2016 16:24:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44GOCqm041075; Wed, 4 May 2016 16:24:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605041624.u44GOCqm041075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 4 May 2016 16:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299073 - head/sys/arm/qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 16:24:13 -0000 Author: bz Date: Wed May 4 16:24:12 2016 New Revision: 299073 URL: https://svnweb.freebsd.org/changeset/base/299073 Log: While gem5 is not qemu, we treat it as "simulators" or "virtual environments". Add the needed hardcoded gem5 attachments for the UART there, re-using all the other bits. In collaboration with: andrew Sponsored by: DARPA/AFRL Reviewed by: andrew MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6204 Modified: head/sys/arm/qemu/virt_machdep.c Modified: head/sys/arm/qemu/virt_machdep.c ============================================================================== --- head/sys/arm/qemu/virt_machdep.c Wed May 4 16:15:39 2016 (r299072) +++ head/sys/arm/qemu/virt_machdep.c Wed May 4 16:24:12 2016 (r299073) @@ -97,3 +97,20 @@ static platform_method_t virt_methods[] }; FDT_PLATFORM_DEF(virt, "virt", 0, "linux,dummy-virt", 1); + +static int +gem5_devmap_init(platform_t plat) +{ + + devmap_add_entry(0x1c090000, 0x100000); /* Uart */ + return (0); +} + +static platform_method_t gem5_methods[] = { + PLATFORMMETHOD(platform_devmap_init, gem5_devmap_init), + PLATFORMMETHOD(platform_lastaddr, virt_lastaddr), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(gem5, "gem5", 0, "arm,vexpress", 1); From owner-svn-src-all@freebsd.org Wed May 4 16:37:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2140EB2BCCB; Wed, 4 May 2016 16:37:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D07F91FD1; Wed, 4 May 2016 16:37:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x232.google.com with SMTP id f89so59572794ioi.0; Wed, 04 May 2016 09:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=71+WbPJzEmyl/oUpBFef22sgKkdBhpQEEdJ/9KpKOrI=; b=RygQx8u+B83I45WYvq9sMRxvPdaw3tu+AIKeRquhPoiNm1fV1xIpFomMuM5gAJoNQq fHYRNHwm7hZWHXBltXRVQU6HUdqnpT/OsuRg7GrrSaSWbFBZtr0A+p5LZKgR6r6Alg9g mZoIZR7FGguY753hhhDL71vtzcqGxMrSYvdpK5dsS+q6VGfCzVP8bfB7pppzrETQVFPC KbJ3bhG8RPkrvbSzzF63R4khtqHAJHGxb1GnNH/l7WXvxNR6vZGE5MfRcmCfO66MOvaj ZU74ZxVklhA7Tx/cwrwIhEatVYqPfWiaARGLA5oIj6I8MsFQakpCKrQAXknl9SrJgx5K q9nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=71+WbPJzEmyl/oUpBFef22sgKkdBhpQEEdJ/9KpKOrI=; b=bm9kB+SPgOI0F8PoKIVtMVEACSvULA8Q9uxhvxT2VghrercXlF75dSEqrP6z61Q23j TcuI0SW+viTn8O9h7h5BeYpsXLXJpMI4nJ+hGbX06vYxKEDSLzns2PEKgbbum4Tsoy1R nnhtKyT9kXv9ALSjH1sFcG5djauiTUIJhtZ0IDG7OTLdOq+xI3JYRHQH2Y1XValzEOr5 LragMEiuMiIJ/maUKwvyeV5Iash7LdT34UMPwUtGBjdsRPOtCA9r7j8tiBOEAsARAcEU 2EZStXZtXrSadyq0UAWyR7jmxRghFe2TZQZCWlzgSFyRUqf18qLIl/idPwwTMyTk7Yyt f7Sw== X-Gm-Message-State: AOPr4FVuBRE3kZhqu/Kj/vDbU2JPDDGAId0lajZud4PSJGGQAlS3SC0DUwPhQLi3yETK4s5zrkfRqbhuw5FFRg== MIME-Version: 1.0 X-Received: by 10.107.144.135 with SMTP id s129mr11542368iod.165.1462379826126; Wed, 04 May 2016 09:37:06 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 4 May 2016 09:37:06 -0700 (PDT) In-Reply-To: <201605041251.u44CpRD2075433@repo.freebsd.org> References: <201605041251.u44CpRD2075433@repo.freebsd.org> Date: Wed, 4 May 2016 09:37:06 -0700 Message-ID: Subject: Re: svn commit: r299063 - head/sys/dev/iwn From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 16:37:07 -0000 good catch! Same goes for scanning, btw. Let's see if someone (who isn't me, I'm still working on work related wifi things) can test out the scan patch to just reset things. -a From owner-svn-src-all@freebsd.org Wed May 4 16:42:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B205B2BF1B; Wed, 4 May 2016 16:42:55 +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 DCB8C13C8; Wed, 4 May 2016 16:42:54 +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 u44Ggs6Z047177; Wed, 4 May 2016 16:42:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44GgsUO047176; Wed, 4 May 2016 16:42:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605041642.u44GgsUO047176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 4 May 2016 16:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299074 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 16:42:55 -0000 Author: adrian Date: Wed May 4 16:42:53 2016 New Revision: 299074 URL: https://svnweb.freebsd.org/changeset/base/299074 Log: [net80211] add extra debugging around negotiated A-MPDU parameters. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Wed May 4 16:24:12 2016 (r299073) +++ head/sys/net80211/ieee80211_ht.c Wed May 4 16:42:53 2016 (r299074) @@ -2742,6 +2742,14 @@ ieee80211_add_htcap_body(uint8_t *frm, s rxmax = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); density = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_11N, + "%s: advertised rxmax=%d, density=%d, vap rxmax=%d, density=%d\n", + __func__, + rxmax, + density, + vap->iv_ampdu_rxmax, + vap->iv_ampdu_density); + /* Cap at VAP rxmax */ if (rxmax > vap->iv_ampdu_rxmax) rxmax = vap->iv_ampdu_rxmax; From owner-svn-src-all@freebsd.org Wed May 4 17:21:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A91B2C87B; Wed, 4 May 2016 17:21:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D1C1815; Wed, 4 May 2016 17:21:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44HLYNd057352; Wed, 4 May 2016 17:21:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44HLYiJ057351; Wed, 4 May 2016 17:21:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605041721.u44HLYiJ057351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 4 May 2016 17:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299077 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 17:21:35 -0000 Author: glebius Date: Wed May 4 17:21:34 2016 New Revision: 299077 URL: https://svnweb.freebsd.org/changeset/base/299077 Log: Make it possible to override NO_INSTALLEXTRAKERNELS. Reviewed by: gjb Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 4 17:02:37 2016 (r299076) +++ head/Makefile.inc1 Wed May 4 17:21:34 2016 (r299077) @@ -1152,7 +1152,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1183,7 +1183,7 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) @echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1214,7 +1214,7 @@ packagekernel: .PHONY tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' \ @@ -1235,7 +1235,7 @@ packagekernel: .PHONY cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' . | \ @@ -1345,7 +1345,7 @@ create-kernel-packages: _pkgbootstrap .P -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} .if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) .for flavor in "" -debug From owner-svn-src-all@freebsd.org Wed May 4 17:22:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06113B2C8E0; Wed, 4 May 2016 17:22:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA3211A70; Wed, 4 May 2016 17:22:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44HMZ1p059427; Wed, 4 May 2016 17:22:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44HMZN6059426; Wed, 4 May 2016 17:22:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605041722.u44HMZN6059426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 4 May 2016 17:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299078 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 17:22:37 -0000 Author: avos Date: Wed May 4 17:22:35 2016 New Revision: 299078 URL: https://svnweb.freebsd.org/changeset/base/299078 Log: net80211: do not hardcode size of ic_modecaps field. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed May 4 17:21:34 2016 (r299077) +++ head/sys/net80211/ieee80211_var.h Wed May 4 17:22:35 2016 (r299078) @@ -148,7 +148,8 @@ struct ieee80211com { uint32_t ic_htcaps; /* HT capabilities */ uint32_t ic_htextcaps; /* HT extended capabilities */ uint32_t ic_cryptocaps; /* crypto capabilities */ - uint8_t ic_modecaps[2]; /* set of mode capabilities */ + /* set of mode capabilities */ + uint8_t ic_modecaps[IEEE80211_MODE_BYTES]; uint8_t ic_promisc; /* vap's needing promisc mode */ uint8_t ic_allmulti; /* vap's needing all multicast*/ uint8_t ic_nrunning; /* vap's marked running */ From owner-svn-src-all@freebsd.org Wed May 4 17:27:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61D4B2CA02; Wed, 4 May 2016 17:27:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E351ECB; Wed, 4 May 2016 17:27:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44HRngn059670; Wed, 4 May 2016 17:27:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44HRntK059668; Wed, 4 May 2016 17:27:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605041727.u44HRntK059668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 4 May 2016 17:27: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: r299079 - in stable/10: . release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 17:27:50 -0000 Author: glebius Date: Wed May 4 17:27:49 2016 New Revision: 299079 URL: https://svnweb.freebsd.org/changeset/base/299079 Log: Merge r299077, which provides ability to override NO_INSTALLEXTRAKERNELS. Override NO_INSTALLEXTRAKERNELS for the release build. Historically, in the stable/10 branch the regular 'installkernel' target DID NOT install extra kernels, while the release build DID. This change finally restores POLA, I hope. Reported by: Fedor Reviewed by: gjb Modified: stable/10/Makefile.inc1 stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed May 4 17:22:35 2016 (r299078) +++ stable/10/Makefile.inc1 Wed May 4 17:27:49 2016 (r299079) @@ -1110,7 +1110,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1141,7 +1141,7 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1167,7 +1167,7 @@ packagekernel: tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ @@ -1180,7 +1180,7 @@ packagekernel: tar cvf - . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) +.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Wed May 4 17:22:35 2016 (r299078) +++ stable/10/release/Makefile Wed May 4 17:27:49 2016 (r299079) @@ -70,6 +70,8 @@ VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${B .endfor .endif +NO_INSTALLEXTRAKERNELS=no + .if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) VOLUME_LABEL= FreeBSD_Install .endif From owner-svn-src-all@freebsd.org Wed May 4 17:29:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDB8B2CAAE; Wed, 4 May 2016 17:29:08 +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 90EF8107B; Wed, 4 May 2016 17:29:08 +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 u44HT7SZ059767; Wed, 4 May 2016 17:29:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44HT7HW059766; Wed, 4 May 2016 17:29:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605041729.u44HT7HW059766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 4 May 2016 17:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299080 - head/tools/tools/locale/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 17:29:08 -0000 Author: pfg Date: Wed May 4 17:29:07 2016 New Revision: 299080 URL: https://svnweb.freebsd.org/changeset/base/299080 Log: tools: minor spelling fix in locales template. No functional change. Modified: head/tools/tools/locale/etc/charmaps.xml Modified: head/tools/tools/locale/etc/charmaps.xml ============================================================================== --- head/tools/tools/locale/etc/charmaps.xml Wed May 4 17:27:49 2016 (r299079) +++ head/tools/tools/locale/etc/charmaps.xml Wed May 4 17:29:07 2016 (r299080) @@ -2,13 +2,13 @@ 32B of garbage (i.e. 0xccccccc) * was added in the beginning of each cqe (the real data is in the corresponding 32B). - * The following calc ensures that when factor==1, it means we are alligned to 64B + * The following calc ensures that when factor==1, it means we are aligned to 64B * and we get the real cqe data*/ #define CQE_FACTOR_INDEX(index, factor) ((index << factor) + factor) int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget) Modified: head/sys/ofed/drivers/net/mlx4/fw.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/fw.c Fri May 6 15:15:31 2016 (r299178) +++ head/sys/ofed/drivers/net/mlx4/fw.c Fri May 6 15:16:13 2016 (r299179) @@ -1901,7 +1901,7 @@ void mlx4_opreq_action(struct work_struc MLX4_CMD_GET_OP_REQ, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) { - mlx4_err(dev, "Failed to retreive required operation: %d\n", err); + mlx4_err(dev, "Failed to retrieve required operation: %d\n", err); return; } MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Fri May 6 15:15:31 2016 (r299178) +++ head/sys/ofed/drivers/net/mlx4/main.c Fri May 6 15:16:13 2016 (r299179) @@ -159,7 +159,7 @@ MODULE_PARM_DESC(high_rate_steer, "Enabl static int fast_drop; module_param_named(fast_drop, fast_drop, int, 0444); MODULE_PARM_DESC(fast_drop, - "Enable fast packet drop when no recieve WQEs are posted"); + "Enable fast packet drop when no receive WQEs are posted"); int mlx4_enable_64b_cqe_eqe = 1; module_param_named(enable_64b_cqe_eqe, mlx4_enable_64b_cqe_eqe, int, 0644); @@ -2452,7 +2452,7 @@ EXPORT_SYMBOL_GPL(mlx4_counter_alloc); void __mlx4_counter_free(struct mlx4_dev *dev, int slave, int port, u32 idx) { - /* check if native or slave and deletes acordingly */ + /* check if native or slave and deletes accordingly */ struct mlx4_priv *priv = mlx4_priv(dev); struct counter_index *pf, *tmp_pf; struct counter_index *vf, *tmp_vf; Modified: head/sys/ofed/drivers/net/mlx4/mlx4.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mlx4.h Fri May 6 15:15:31 2016 (r299178) +++ head/sys/ofed/drivers/net/mlx4/mlx4.h Fri May 6 15:16:13 2016 (r299179) @@ -164,7 +164,7 @@ enum mlx4_res_tracker_free_type { /* *Virtual HCR structures. - * mlx4_vhcr is the sw representation, in machine endianess + * mlx4_vhcr is the sw representation, in machine endianness * * mlx4_vhcr_cmd is the formalized structure, the one that is passed * to FW to go through communication channel. Modified: head/sys/ofed/drivers/net/mlx4/resource_tracker.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/resource_tracker.c Fri May 6 15:15:31 2016 (r299178) +++ head/sys/ofed/drivers/net/mlx4/resource_tracker.c Fri May 6 15:16:13 2016 (r299179) @@ -2916,7 +2916,7 @@ int mlx4_WRITE_MTT_wrapper(struct mlx4_d /* Call the SW implementation of write_mtt: * - Prepare a dummy mtt struct - * - Translate inbox contents to simple addresses in host endianess */ + * - Translate inbox contents to simple addresses in host endianness */ mtt.offset = 0; /* TBD this is broken but I don't handle it since we don't really use it */ mtt.order = 0; From owner-svn-src-all@freebsd.org Fri May 6 15:36:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12007B2E1FA; Fri, 6 May 2016 15:36:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D711412F5; Fri, 6 May 2016 15:36:26 +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 u46FaQNv007787; Fri, 6 May 2016 15:36:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46FaQST007786; Fri, 6 May 2016 15:36:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605061536.u46FaQST007786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 15:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299180 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 15:36:27 -0000 Author: pfg Date: Fri May 6 15:36:25 2016 New Revision: 299180 URL: https://svnweb.freebsd.org/changeset/base/299180 Log: sys/cam/scsi: unsigned some loop indexes. Although usually small, values produced by nitems() are unsigned. One more case where unsgining the index may be useful. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri May 6 15:16:13 2016 (r299179) +++ head/sys/cam/scsi/scsi_cd.c Fri May 6 15:36:25 2016 (r299180) @@ -1264,7 +1264,7 @@ cdgetpage(struct cd_mode_params *mode_pa static int cdgetpagesize(int page_num) { - int i; + u_int i; for (i = 0; i < nitems(cd_page_size_table); i++) { if (cd_page_size_table[i].page == page_num) From owner-svn-src-all@freebsd.org Fri May 6 15:37:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5949BB2E258; Fri, 6 May 2016 15:37:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29417149E; Fri, 6 May 2016 15:37:07 +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 u46Fb635007853; Fri, 6 May 2016 15:37:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46Fb6qM007852; Fri, 6 May 2016 15:37:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605061537.u46Fb6qM007852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 15:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299181 - head/sys/ofed/include/linux/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 15:37:07 -0000 Author: pfg Date: Fri May 6 15:37:06 2016 New Revision: 299181 URL: https://svnweb.freebsd.org/changeset/base/299181 Log: sys/ofed: minor spelling fix. No functional change. Reviewed by: hselasky Modified: head/sys/ofed/include/linux/mlx4/device.h Modified: head/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- head/sys/ofed/include/linux/mlx4/device.h Fri May 6 15:36:25 2016 (r299180) +++ head/sys/ofed/include/linux/mlx4/device.h Fri May 6 15:37:06 2016 (r299181) @@ -106,7 +106,7 @@ enum { MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) }; -/* Driver supports 3 diffrent device methods to manage traffic steering: +/* Driver supports 3 different device methods to manage traffic steering: * -device managed - High level API for ib and eth flow steering. FW is * managing flow steering tables. * - B0 steering mode - Common low level API for ib and (if supported) eth. From owner-svn-src-all@freebsd.org Fri May 6 15:41:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD09B2E445; Fri, 6 May 2016 15:41:39 +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 914A0195B; Fri, 6 May 2016 15:41:39 +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 u46FfckW010184; Fri, 6 May 2016 15:41:38 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46FfcQo010183; Fri, 6 May 2016 15:41:38 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061541.u46FfcQo010183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 15:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299182 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 15:41:39 -0000 Author: sbruno Date: Fri May 6 15:41:38 2016 New Revision: 299182 URL: https://svnweb.freebsd.org/changeset/base/299182 Log: If ALTQ is defined in the kern conf, switch to Legacy Mode. PR: 208409 Submitted by: freebsd@mcwest.org MFC after: 2 weeks Modified: head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Fri May 6 15:37:06 2016 (r299181) +++ head/sys/dev/e1000/if_igb.h Fri May 6 15:41:38 2016 (r299182) @@ -35,6 +35,10 @@ #ifndef _IF_IGB_H_ #define _IF_IGB_H_ +#ifdef ALTQ +#define IGB_LEGACY_TX +#endif + #include #include #ifndef IGB_LEGACY_TX From owner-svn-src-all@freebsd.org Fri May 6 16:03:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A901FB2EB0B; Fri, 6 May 2016 16:03:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79FF31746; Fri, 6 May 2016 16:03:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46G3ePK017202; Fri, 6 May 2016 16:03:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46G3eXZ017201; Fri, 6 May 2016 16:03:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605061603.u46G3eXZ017201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 16:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299183 - head/lib/libc/xdr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 16:03:41 -0000 Author: pfg Date: Fri May 6 16:03:40 2016 New Revision: 299183 URL: https://svnweb.freebsd.org/changeset/base/299183 Log: libc/xdr: unsign some loop indexes. Although usually small, values produced by nitems() are unsigned. Unsign inxdeing variables related to nitems() macros to avoid signed vs. unsigned comparisons. Modified: head/lib/libc/xdr/xdr_float.c Modified: head/lib/libc/xdr/xdr_float.c ============================================================================== --- head/lib/libc/xdr/xdr_float.c Fri May 6 15:41:38 2016 (r299182) +++ head/lib/libc/xdr/xdr_float.c Fri May 6 16:03:40 2016 (r299183) @@ -101,7 +101,7 @@ xdr_float(XDR *xdrs, float *fp) struct ieee_single is; struct vax_single vs, *vsp; struct sgl_limits *lim; - int i; + u_int i; #endif switch (xdrs->x_op) { @@ -203,7 +203,7 @@ xdr_double(XDR *xdrs, double *dp) struct ieee_double id; struct vax_double vd; struct dbl_limits *lim; - int i; + u_int i; #endif switch (xdrs->x_op) { From owner-svn-src-all@freebsd.org Fri May 6 16:41:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DE9AB2F2C9; Fri, 6 May 2016 16:41:25 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB01195D; Fri, 6 May 2016 16:41:24 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46GfOWL026239; Fri, 6 May 2016 16:41:24 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46GfOY2026236; Fri, 6 May 2016 16:41:24 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605061641.u46GfOY2026236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 6 May 2016 16:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299184 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 16:41:25 -0000 Author: royger Date: Fri May 6 16:41:23 2016 New Revision: 299184 URL: https://svnweb.freebsd.org/changeset/base/299184 Log: bitset: introduce helpers to allocate a bitset at runtime Introduce some new helpers to declare and allocate a dynamic bitset, whose size is not a constant. Sponsored by: Citrix Systems R&D Reviewed by: kib jhb Differential revision: https://reviews.freebsd.org/D6226 Modified: head/sys/sys/_bitset.h head/sys/sys/bitset.h Modified: head/sys/sys/_bitset.h ============================================================================== --- head/sys/sys/_bitset.h Fri May 6 16:03:40 2016 (r299183) +++ head/sys/sys/_bitset.h Fri May 6 16:41:23 2016 (r299184) @@ -47,4 +47,12 @@ struct t { \ long __bits[__bitset_words((_s))]; \ } +/* + * Helper to declare a bitset without it's size being a constant. + * + * Sadly we cannot declare a bitset struct with '__bits[]', because it's + * the only member of the struct and the compiler complains. + */ +#define BITSET_DEFINE_VAR(t) BITSET_DEFINE(t, 1) + #endif /* !_SYS__BITSET_H_ */ Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Fri May 6 16:03:40 2016 (r299183) +++ head/sys/sys/bitset.h Fri May 6 16:41:23 2016 (r299184) @@ -199,4 +199,10 @@ #define BITSET_FSET(n) \ [ 0 ... ((n) - 1) ] = (-1L) +/* + * Dynamically allocate a bitset. + */ +#define BITSET_ALLOC(_s, mt, mf) \ + malloc(__bitset_words(_s) * sizeof(long), mt, (mf)) + #endif /* !_SYS_BITSET_H_ */ From owner-svn-src-all@freebsd.org Fri May 6 16:44:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF7FCB2F441; Fri, 6 May 2016 16:44:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7151D1CF2; Fri, 6 May 2016 16:44:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46GikpQ029155; Fri, 6 May 2016 16:44:46 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46Gikrd029154; Fri, 6 May 2016 16:44:46 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605061644.u46Gikrd029154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 6 May 2016 16:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299185 - head/sys/dev/xen/privcmd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 16:44:47 -0000 Author: royger Date: Fri May 6 16:44:46 2016 New Revision: 299185 URL: https://svnweb.freebsd.org/changeset/base/299185 Log: xen/privcmd: fix integer truncation in IOCTL_PRIVCMD_MMAPBATCH The size field in the XENMEM_add_to_physmap_range is an uint16_t, and the privcmd driver was doing an implicit truncation of an int into an uint16_t when filling the hypercall parameters. Fix this by adding a loop and making sure privcmd splits ioctl request into 2^16 chunks when issuing the hypercalls. Reported and tested by: Marcin Cieslak Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/privcmd/privcmd.c Modified: head/sys/dev/xen/privcmd/privcmd.c ============================================================================== --- head/sys/dev/xen/privcmd/privcmd.c Fri May 6 16:41:23 2016 (r299184) +++ head/sys/dev/xen/privcmd/privcmd.c Fri May 6 16:44:46 2016 (r299185) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -72,7 +73,7 @@ struct privcmd_map { int pseudo_phys_res_id; vm_paddr_t phys_base_addr; boolean_t mapped; - int *errs; + BITSET_DEFINE_VAR() *err; }; static d_ioctl_t privcmd_ioctl; @@ -138,7 +139,7 @@ retry: rm.gpfn = atop(map->phys_base_addr) + i; HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &rm); } - free(map->errs, M_PRIVCMD); + free(map->err, M_PRIVCMD); } error = xenmem_free(privcmd_dev, map->pseudo_phys_res_id, @@ -160,7 +161,7 @@ privcmd_pg_fault(vm_object_t object, vm_ return (VM_PAGER_FAIL); pidx = OFF_TO_IDX(offset); - if (pidx >= map->size || map->errs[pidx] != 0) + if (pidx >= map->size || BIT_ISSET(map->size, pidx, map->err)) return (VM_PAGER_FAIL); page = PHYS_TO_VM_PAGE(map->phys_base_addr + offset); @@ -249,14 +250,15 @@ privcmd_ioctl(struct cdev *dev, unsigned vm_map_t map; vm_map_entry_t entry; vm_object_t mem; - vm_pindex_t index; + vm_pindex_t pindex; vm_prot_t prot; boolean_t wired; struct xen_add_to_physmap_range add; xen_ulong_t *idxs; xen_pfn_t *gpfns; - int *errs; + int *errs, index; struct privcmd_map *umap; + uint16_t num; mmap = (struct ioctl_privcmd_mmapbatch *)arg; @@ -268,7 +270,7 @@ privcmd_ioctl(struct cdev *dev, unsigned map = &td->td_proc->p_vmspace->vm_map; error = vm_map_lookup(&map, mmap->addr, VM_PROT_NONE, &entry, - &mem, &index, &prot, &wired); + &mem, &pindex, &prot, &wired); if (error != KERN_SUCCESS) { error = EINVAL; break; @@ -289,54 +291,72 @@ privcmd_ioctl(struct cdev *dev, unsigned add.domid = DOMID_SELF; add.space = XENMAPSPACE_gmfn_foreign; - add.size = mmap->num; add.foreign_domid = mmap->dom; - idxs = malloc(sizeof(*idxs) * mmap->num, M_PRIVCMD, - M_WAITOK | M_ZERO); - gpfns = malloc(sizeof(*gpfns) * mmap->num, M_PRIVCMD, - M_WAITOK | M_ZERO); - errs = malloc(sizeof(*errs) * mmap->num, M_PRIVCMD, - M_WAITOK | M_ZERO); + /* + * The 'size' field in the xen_add_to_physmap_range only + * allows for UINT16_MAX mappings in a single hypercall. + */ + num = MIN(mmap->num, UINT16_MAX); + + idxs = malloc(sizeof(*idxs) * num, M_PRIVCMD, M_WAITOK); + gpfns = malloc(sizeof(*gpfns) * num, M_PRIVCMD, M_WAITOK); + errs = malloc(sizeof(*errs) * num, M_PRIVCMD, M_WAITOK); set_xen_guest_handle(add.idxs, idxs); set_xen_guest_handle(add.gpfns, gpfns); set_xen_guest_handle(add.errs, errs); - error = copyin(&mmap->arr[0], idxs, - sizeof(idxs[0]) * mmap->num); - if (error != 0) - goto mmap_out; - - for (i = 0; i < mmap->num; i++) - gpfns[i] = atop(umap->phys_base_addr + i * PAGE_SIZE); - - error = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &add); - if (error) { - error = xen_translate_error(error); - goto mmap_out; - } + /* Allocate a bitset to store broken page mappings. */ + umap->err = BITSET_ALLOC(mmap->num, M_PRIVCMD, + M_WAITOK | M_ZERO); - for (i = 0; i < mmap->num; i++) { - if (errs[i] != 0) - errs[i] = xen_translate_error(errs[i]); + for (index = 0; index < mmap->num; index += num) { + num = MIN(mmap->num - index, UINT16_MAX); + add.size = num; + + error = copyin(&mmap->arr[index], idxs, + sizeof(idxs[0]) * num); + if (error != 0) + goto mmap_out; + + for (i = 0; i < num; i++) + gpfns[i] = atop(umap->phys_base_addr + + (i + index) * PAGE_SIZE); + + bzero(errs, sizeof(*errs) * num); + + error = HYPERVISOR_memory_op( + XENMEM_add_to_physmap_range, &add); + if (error != 0) { + error = xen_translate_error(error); + goto mmap_out; + } + + for (i = 0; i < num; i++) { + if (errs[i] != 0) { + errs[i] = xen_translate_error(errs[i]); + + /* Mark the page as invalid. */ + BIT_SET(mmap->num, index + i, + umap->err); + } + } + + error = copyout(errs, &mmap->err[index], + sizeof(errs[0]) * num); + if (error != 0) + goto mmap_out; } - /* - * Save errs, so we know which pages have been - * successfully mapped. - */ - umap->errs = errs; umap->mapped = true; - error = copyout(errs, &mmap->err[0], - sizeof(errs[0]) * mmap->num); - mmap_out: free(idxs, M_PRIVCMD); free(gpfns, M_PRIVCMD); + free(errs, M_PRIVCMD); if (!umap->mapped) - free(errs, M_PRIVCMD); + free(umap->err, M_PRIVCMD); break; } From owner-svn-src-all@freebsd.org Fri May 6 16:51:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4120EB2F5F0; Fri, 6 May 2016 16:51:58 +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 0E4ED1026; Fri, 6 May 2016 16:51:57 +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 u46Gpvnd032145; Fri, 6 May 2016 16:51:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46GpvOf032144; Fri, 6 May 2016 16:51:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605061651.u46GpvOf032144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 16:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299186 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 16:51:58 -0000 Author: pfg Date: Fri May 6 16:51:56 2016 New Revision: 299186 URL: https://svnweb.freebsd.org/changeset/base/299186 Log: cam/scsi: Remove mostly unused scsi_quirk_table_size. It was only being used only once and it can be directly replaced instead. Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Fri May 6 16:44:46 2016 (r299185) +++ head/sys/cam/scsi/scsi_xpt.c Fri May 6 16:51:56 2016 (r299186) @@ -556,8 +556,6 @@ static struct scsi_quirk_entry scsi_quir }, }; -static const int scsi_quirk_table_size = nitems(scsi_quirk_table); - static cam_status proberegister(struct cam_periph *periph, void *arg); static void probeschedule(struct cam_periph *probe_periph); @@ -2365,7 +2363,7 @@ scsi_alloc_device(struct cam_eb *bus, st * Take the default quirk entry until we have inquiry * data and can determine a better quirk to use. */ - quirk = &scsi_quirk_table[scsi_quirk_table_size - 1]; + quirk = &scsi_quirk_table[nitems(scsi_quirk_table) - 1]; device->quirk = (void *)quirk; device->mintags = quirk->mintags; device->maxtags = quirk->maxtags; From owner-svn-src-all@freebsd.org Fri May 6 16:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1692B2F7F2; Fri, 6 May 2016 16:59:06 +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 7C5AD1503; Fri, 6 May 2016 16:59:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46Gx5eS032625; Fri, 6 May 2016 16:59:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46Gx5oM032618; Fri, 6 May 2016 16:59:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605061659.u46Gx5oM032618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 16:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299187 - in head/sys/security: mac mac_biba mac_lomac mac_mls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 16:59:06 -0000 Author: pfg Date: Fri May 6 16:59:04 2016 New Revision: 299187 URL: https://svnweb.freebsd.org/changeset/base/299187 Log: sys/security: minor spelling fixes. No functional change. Modified: head/sys/security/mac/mac_cred.c head/sys/security/mac/mac_framework.c head/sys/security/mac_biba/mac_biba.h head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_lomac/mac_lomac.h head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_mls/mac_mls.h Modified: head/sys/security/mac/mac_cred.c ============================================================================== --- head/sys/security/mac/mac_cred.c Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac/mac_cred.c Fri May 6 16:59:04 2016 (r299187) @@ -174,7 +174,7 @@ mac_cred_internalize_label(struct label /* * When a new process is created, its label must be initialized. Generally, - * this involves inheritence from the parent process, modulo possible deltas. + * this involves inheritance from the parent process, modulo possible deltas. * This function allows that processing to take place. */ void Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac/mac_framework.c Fri May 6 16:59:04 2016 (r299187) @@ -437,7 +437,7 @@ mac_policy_register(struct mac_policy_co * Per-policy initialization. Currently, this takes place under the * exclusive lock, so policies must not sleep in their init method. * In the future, we may want to separate "init" from "start", with - * "init" occuring without the lock held. Likewise, on tear-down, + * "init" occurring without the lock held. Likewise, on tear-down, * breaking out "stop" from "destroy". */ if (mpc->mpc_ops->mpo_init != NULL) Modified: head/sys/security/mac_biba/mac_biba.h ============================================================================== --- head/sys/security/mac_biba/mac_biba.h Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac_biba/mac_biba.h Fri May 6 16:59:04 2016 (r299187) @@ -54,7 +54,7 @@ * MAC_BIBA_TYPE_LABEL. */ #define MAC_BIBA_TYPE_HIGH 3 /* Dominates any * MAC_BIBA_TYPE_LABEL. */ -#define MAC_BIBA_TYPE_EQUAL 4 /* Equivilent to any +#define MAC_BIBA_TYPE_EQUAL 4 /* Equivalent to any * MAC_BIBA_TYPE_LABEL. */ /* Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac_lomac/mac_lomac.c Fri May 6 16:59:04 2016 (r299187) @@ -1472,7 +1472,7 @@ lomac_netinet_firewall_send(struct mbuf dest = SLOT(mlabel); - /* XXX: where is the label for the firewall really comming from? */ + /* XXX: where is the label for the firewall really coming from? */ lomac_set_single(dest, MAC_LOMAC_TYPE_EQUAL, 0); } Modified: head/sys/security/mac_lomac/mac_lomac.h ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.h Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac_lomac/mac_lomac.h Fri May 6 16:59:04 2016 (r299187) @@ -56,7 +56,7 @@ * MAC_LOMAC_TYPE_LABEL. */ #define MAC_LOMAC_TYPE_HIGH 3 /* Dominates any * MAC_LOMAC_TYPE_LABEL. */ -#define MAC_LOMAC_TYPE_EQUAL 4 /* Equivilent to any +#define MAC_LOMAC_TYPE_EQUAL 4 /* Equivalent to any * MAC_LOMAC_TYPE_LABEL. */ /* Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac_mls/mac_mls.c Fri May 6 16:59:04 2016 (r299187) @@ -1276,7 +1276,7 @@ mls_netinet_firewall_send(struct mbuf *m dest = SLOT(mlabel); - /* XXX: where is the label for the firewall really comming from? */ + /* XXX: where is the label for the firewall really coming from? */ mls_set_effective(dest, MAC_MLS_TYPE_EQUAL, 0, NULL); } Modified: head/sys/security/mac_mls/mac_mls.h ============================================================================== --- head/sys/security/mac_mls/mac_mls.h Fri May 6 16:51:56 2016 (r299186) +++ head/sys/security/mac_mls/mac_mls.h Fri May 6 16:59:04 2016 (r299187) @@ -54,7 +54,7 @@ * MAC_MLS_TYPE_LABEL. */ #define MAC_MLS_TYPE_HIGH 3 /* Dominates any * MAC_MLS_TYPE_LABEL. */ -#define MAC_MLS_TYPE_EQUAL 4 /* Equivilent to any +#define MAC_MLS_TYPE_EQUAL 4 /* Equivalent to any * MAC_MLS_TYPE_LABEL. */ /* From owner-svn-src-all@freebsd.org Fri May 6 17:00:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE0FFB2F8B6; Fri, 6 May 2016 17:00:46 +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 908411883; Fri, 6 May 2016 17:00:46 +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 u46H0j3b032750; Fri, 6 May 2016 17:00:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46H0jJK032749; Fri, 6 May 2016 17:00:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061700.u46H0jJK032749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 17:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299188 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 17:00:46 -0000 Author: sbruno Date: Fri May 6 17:00:45 2016 New Revision: 299188 URL: https://svnweb.freebsd.org/changeset/base/299188 Log: Since igb_detach() cleans up all the data structures that will be free'd by the functions following its call, we can simply return instead of crashing and burning in the event of igb_detach() failing. PR: 197139 Submitted by: rupavath@juniper.net MFC after: 2 weeks Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri May 6 16:59:04 2016 (r299187) +++ head/sys/dev/e1000/if_igb.c Fri May 6 17:00:45 2016 (r299188) @@ -659,7 +659,8 @@ igb_attach(device_t dev) return (0); err_late: - igb_detach(dev); + if (igb_detach(dev) == 0) /* igb_detach() already did the cleanup */ + return(error); igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); igb_release_hw_control(adapter); From owner-svn-src-all@freebsd.org Fri May 6 17:39:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8CC8B31218; Fri, 6 May 2016 17:39:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1FB1BC0; Fri, 6 May 2016 17:39:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46HdCrb044569; Fri, 6 May 2016 17:39:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46HdCMn044568; Fri, 6 May 2016 17:39:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605061739.u46HdCMn044568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 6 May 2016 17:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299189 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 17:39:13 -0000 Author: avos Date: Fri May 6 17:39:12 2016 New Revision: 299189 URL: https://svnweb.freebsd.org/changeset/base/299189 Log: iwn: fix comments for iwn_read_eeprom_channels(). It's used for all channels (20MHz and 40MHz). Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri May 6 17:00:45 2016 (r299188) +++ head/sys/dev/iwn/if_iwn.c Fri May 6 17:39:12 2016 (r299189) @@ -2212,7 +2212,7 @@ iwn4965_read_eeprom(struct iwn_softc *sc /* Read regulatory domain (4 ASCII characters). */ iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); - /* Read the list of authorized channels (20MHz ones only). */ + /* Read the list of authorized channels (20MHz & 40MHz). */ for (i = 0; i < IWN_NBANDS - 1; i++) { addr = iwn4965_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); @@ -2303,7 +2303,7 @@ iwn5000_read_eeprom(struct iwn_softc *sc iwn_read_prom_data(sc, base + IWN5000_EEPROM_DOMAIN, sc->eeprom_domain, 4); - /* Read the list of authorized channels (20MHz ones only). */ + /* Read the list of authorized channels (20MHz & 40MHz). */ for (i = 0; i < IWN_NBANDS - 1; i++) { addr = base + sc->base_params->regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); From owner-svn-src-all@freebsd.org Fri May 6 17:55:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69980B314B0; Fri, 6 May 2016 17:55:12 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF8613C1; Fri, 6 May 2016 17:55:12 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46HtBRM050654; Fri, 6 May 2016 17:55:11 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46HtBEQ050653; Fri, 6 May 2016 17:55:11 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201605061755.u46HtBEQ050653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Fri, 6 May 2016 17:55: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: r299190 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 17:55:12 -0000 Author: bcr (doc committer) Date: Fri May 6 17:55:11 2016 New Revision: 299190 URL: https://svnweb.freebsd.org/changeset/base/299190 Log: MFC r298893: Provide an example to the kqueue man page, showing a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D6082 Modified: stable/10/lib/libc/sys/kqueue.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Fri May 6 17:39:12 2016 (r299189) +++ stable/10/lib/libc/sys/kqueue.2 Fri May 6 17:55:11 2016 (r299190) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2015 +.Dd May 1, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -577,6 +577,57 @@ will be set to indicate the error condit If the time limit expires, then .Fn kevent returns 0. +.Sh EXAMPLES +.Bd -literal -compact +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + struct kevent event; /* Event we want to monitor */ + struct kevent tevent; /* Event triggered */ + int kq, fd, ret; + + if (argc != 2) + err(EXIT_FAILURE, "Usage: %s path\en", argv[0]); + fd = open(argv[1], O_RDONLY); + if (fd == -1) + err(EXIT_FAILURE, "Failed to open '%s'", argv[1]); + + /* Create kqueue. */ + kq = kqueue(); + if (kq == -1) + err(EXIT_FAILURE, "kqueue() failed"); + + /* Initialize kevent structure. */ + EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE, + 0, NULL); + /* Attach event to the kqueue. */ + ret = kevent(kq, &event, 1, NULL, 0, NULL); + if (ret == -1) + err(EXIT_FAILURE, "kevent register"); + if (event.flags & EV_ERROR) + errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); + + for (;;) { + /* Sleep until something happens. */ + ret = kevent(kq, NULL, 0, &tevent, 1, NULL); + if (ret == -1) { + err(EXIT_FAILURE, "kevent wait"); + } else if (ret > 0) { + printf("Something was written in '%s'\en", argv[1]); + } + } +} +.Ed .Sh ERRORS The .Fn kqueue From owner-svn-src-all@freebsd.org Fri May 6 19:11:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279CDB315C4; Fri, 6 May 2016 19:11:49 +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 EBAE61BAF; Fri, 6 May 2016 19:11:48 +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 u46JBmeN075260; Fri, 6 May 2016 19:11:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JBmHB075259; Fri, 6 May 2016 19:11:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061911.u46JBmHB075259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299191 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 19:11:49 -0000 Author: sbruno Date: Fri May 6 19:11:47 2016 New Revision: 299191 URL: https://svnweb.freebsd.org/changeset/base/299191 Log: MFC r298279 Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non- null terminated ASCII string. PR: 207626 Submitted by: cturt@hardenedbsd.org Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri May 6 17:55:11 2016 (r299190) +++ stable/10/sys/cam/ctl/ctl.c Fri May 6 19:11:47 2016 (r299191) @@ -2447,6 +2447,7 @@ ctl_copyin_args(int num_args, struct ctl && (tmpptr[args[i].vallen - 1] != '\0')) { snprintf(error_str, error_str_len, "Argument " "%d value is not NUL-terminated", i); + free(tmpptr, M_CTL); goto bailout; } args[i].kvalue = tmpptr; From owner-svn-src-all@freebsd.org Fri May 6 19:14:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46B34B316CE; Fri, 6 May 2016 19:14:59 +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 F1DAF1FA7; Fri, 6 May 2016 19:14:58 +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 u46JEw2Y076049; Fri, 6 May 2016 19:14:58 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JEvZr076045; Fri, 6 May 2016 19:14:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061914.u46JEvZr076045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:14: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: r299192 - in stable/10/sys/dev: e1000 ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 19:14:59 -0000 Author: sbruno Date: Fri May 6 19:14:57 2016 New Revision: 299192 URL: https://svnweb.freebsd.org/changeset/base/299192 Log: MFC r298224 Correct possible underflow conditions when checking for available space in the tx h/w ring buffer. Sponsored by: Limelight Networks Modified: stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/ixgbe/ix_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_em.c Fri May 6 19:14:57 2016 (r299192) @@ -2099,7 +2099,7 @@ retry: txr->tx_tso = FALSE; } - if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) { + if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_igb.c Fri May 6 19:14:57 2016 (r299192) @@ -1843,7 +1843,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/e1000/if_lem.c ============================================================================== --- stable/10/sys/dev/e1000/if_lem.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/e1000/if_lem.c Fri May 6 19:14:57 2016 (r299192) @@ -1694,7 +1694,7 @@ lem_xmit(struct adapter *adapter, struct return (error); } - if (nsegs > (adapter->num_tx_desc_avail - 2)) { + if (adapter->num_tx_desc_avail < (nsegs + 2)) { adapter->no_tx_desc_avail2++; bus_dmamap_unload(adapter->txtag, map); return (ENOBUFS); Modified: stable/10/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- stable/10/sys/dev/ixgbe/ix_txrx.c Fri May 6 19:11:47 2016 (r299191) +++ stable/10/sys/dev/ixgbe/ix_txrx.c Fri May 6 19:14:57 2016 (r299192) @@ -401,7 +401,7 @@ retry: } /* Make certain there are enough descriptors */ - if (nsegs > txr->tx_avail - 2) { + if (txr->tx_avail < (nsegs + 2)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); From owner-svn-src-all@freebsd.org Fri May 6 19:18:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C2CB31910; Fri, 6 May 2016 19:18:46 +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 E49681226; Fri, 6 May 2016 19:18:45 +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 u46JIjnn076344; Fri, 6 May 2016 19:18:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46JIjDH076342; Fri, 6 May 2016 19:18:45 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605061918.u46JIjDH076342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 6 May 2016 19:18: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: r299193 - in stable/10/sys/dev: aac aacraid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 19:18:46 -0000 Author: sbruno Date: Fri May 6 19:18:44 2016 New Revision: 299193 URL: https://svnweb.freebsd.org/changeset/base/299193 Log: MFC r298280 aacraid(4): Sanely copyin userland pointers and ensure that we don't get anything janky from a user. (cturt) aac(4) landergriffith+freebsdbugzilla@gmail.com pointed out that aac(4) had the same issue and handling of pointers, so let's change that too. PR: 206573 Submitted by: cturt@hardenedbsd.org Modified: stable/10/sys/dev/aac/aac.c stable/10/sys/dev/aacraid/aacraid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aac/aac.c ============================================================================== --- stable/10/sys/dev/aac/aac.c Fri May 6 19:14:57 2016 (r299192) +++ stable/10/sys/dev/aac/aac.c Fri May 6 19:18:44 2016 (r299193) @@ -3103,18 +3103,30 @@ aac_ioctl_send_raw_srb(struct aac_softc /* Retrieve correct SG entries. */ if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { + struct aac_sg_entry sg; + sge = srbcmd->sg_map.SgEntry; sge64 = NULL; - srb_sg_bytecount = sge->SgByteCount; - srb_sg_address = (void *)(uintptr_t)sge->SgAddress; + + if ((error = copyin(sge, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)(uintptr_t)sg.SgAddress; } #ifdef __amd64__ else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { + struct aac_sg_entry64 sg; + sge = NULL; sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sge64->SgByteCount; - srb_sg_address = (void *)sge64->SgAddress; + + if ((error = copyin(sge64, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (void *)sg.SgAddress; if (sge64->SgAddress > 0xffffffffull && (sc->flags & AAC_FLAGS_SG_64BIT) == 0) { error = EINVAL; Modified: stable/10/sys/dev/aacraid/aacraid.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid.c Fri May 6 19:14:57 2016 (r299192) +++ stable/10/sys/dev/aacraid/aacraid.c Fri May 6 19:18:44 2016 (r299193) @@ -2873,15 +2873,25 @@ aac_ioctl_send_raw_srb(struct aac_softc if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { struct aac_sg_entry *sgp = srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = (u_int64_t)sgp->SgAddress; + struct aac_sg_entry sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = (u_int64_t)sg.SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { #ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; - srb_sg_bytecount = sgp->SgByteCount; - srb_sg_address = sgp->SgAddress; + struct aac_sg_entry64 sg; + + if ((error = copyin(sgp, &sg, sizeof(sg))) != 0) + goto out; + + srb_sg_bytecount = sg.SgByteCount; + srb_sg_address = sg.SgAddress; if (srb_sg_address > 0xffffffffull && !(sc->flags & AAC_FLAGS_SG_64BIT)) #endif From owner-svn-src-all@freebsd.org Fri May 6 20:28:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2965EB2C8AD; Fri, 6 May 2016 20:28:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB11A136B; Fri, 6 May 2016 20:28:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46KSTJ8097253; Fri, 6 May 2016 20:28:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46KSTMV097252; Fri, 6 May 2016 20:28:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605062028.u46KSTMV097252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 20:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299194 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 20:28:30 -0000 Author: pfg Date: Fri May 6 20:28:28 2016 New Revision: 299194 URL: https://svnweb.freebsd.org/changeset/base/299194 Log: Revert r298938: Change x/a to work similar to gdb. This badly breaks x/ia: ddb and gdb syntax are quite different and it is unclear if they can be reconciled. Modified: head/sys/ddb/db_examine.c Modified: head/sys/ddb/db_examine.c ============================================================================== --- head/sys/ddb/db_examine.c Fri May 6 19:18:44 2016 (r299193) +++ head/sys/ddb/db_examine.c Fri May 6 20:28:28 2016 (r299194) @@ -89,6 +89,15 @@ db_examine(db_addr_t addr, char *fmt, in case 'g': size = 8; break; + case 'a': /* address */ + size = sizeof(void *); + /* always forces a new line */ + if (db_print_position() != 0) + db_printf("\n"); + db_prev = addr; + db_printsym(addr, DB_STGY_ANY); + db_printf(":\t"); + break; default: if (db_print_position() == 0) { /* Print the address. */ @@ -99,18 +108,6 @@ db_examine(db_addr_t addr, char *fmt, in width = size * 4; switch (c) { - case 'a': /* address */ - size = sizeof(void *); - value = db_get_value(addr, size, TRUE); - addr += size; - db_printsym(value, DB_STGY_ANY); - break; - case 'p': - size = sizeof(void *); - value = db_get_value(addr, size, TRUE); - addr += size; - db_printf("%p", (void *)value); - break; case 'r': /* signed, current radix */ value = db_get_value(addr, size, true); addr += size; @@ -176,7 +173,7 @@ db_examine(db_addr_t addr, char *fmt, in default: break; } - if (db_print_position() != 0 || c == 'a' || c == 'p') + if (db_print_position() != 0) db_end_line(1); break; } From owner-svn-src-all@freebsd.org Fri May 6 20:32:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1307CB2CA65; Fri, 6 May 2016 20:32:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFEB71959; Fri, 6 May 2016 20:32:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46KWd8Y000292; Fri, 6 May 2016 20:32:39 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46KWdOl000291; Fri, 6 May 2016 20:32:39 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201605062032.u46KWdOl000291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 6 May 2016 20:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299195 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 20:32:41 -0000 Author: sobomax Date: Fri May 6 20:32:39 2016 New Revision: 299195 URL: https://svnweb.freebsd.org/changeset/base/299195 Log: Add missing include "opt_geom.h" to make GEOM_UZIP_DEBUG option working, also rename enum member so it does not conflict with GEOM_UZIP option name. Submitted by: mizhka@gmail.com Differential Revision: https://reviews.freebsd.org/D6207 Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Fri May 6 20:28:28 2016 (r299194) +++ head/sys/geom/uzip/g_uzip.c Fri May 6 20:32:39 2016 (r299195) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_geom.h" + MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); FEATURE(geom_uzip, "GEOM read-only compressed disks support"); @@ -576,8 +578,8 @@ g_uzip_taste(struct g_class *mp, struct struct g_provider *pp2; struct g_uzip_softc *sc; enum { - GEOM_UZIP = 1, - GEOM_ULZMA + G_UZIP = 1, + G_ULZMA } type; g_trace(G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name); @@ -621,7 +623,7 @@ g_uzip_taste(struct g_class *mp, struct switch (header->magic[CLOOP_OFS_COMPR]) { case CLOOP_COMP_LZMA: case CLOOP_COMP_LZMA_DDP: - type = GEOM_ULZMA; + type = G_ULZMA; if (header->magic[CLOOP_OFS_VERSN] < CLOOP_MINVER_LZMA) { DPRINTF(GUZ_DBG_ERR, ("%s: image version too old\n", gp->name)); @@ -632,7 +634,7 @@ g_uzip_taste(struct g_class *mp, struct break; case CLOOP_COMP_LIBZ: case CLOOP_COMP_LIBZ_DDP: - type = GEOM_UZIP; + type = G_UZIP; if (header->magic[CLOOP_OFS_VERSN] < CLOOP_MINVER_ZLIB) { DPRINTF(GUZ_DBG_ERR, ("%s: image version too old\n", gp->name)); @@ -728,7 +730,7 @@ g_uzip_taste(struct g_class *mp, struct sc->req_total = 0; sc->req_cached = 0; - if (type == GEOM_UZIP) { + if (type == G_UZIP) { sc->dcp = g_uzip_zlib_ctor(sc->blksz); } else { sc->dcp = g_uzip_lzma_ctor(sc->blksz); From owner-svn-src-all@freebsd.org Fri May 6 20:49:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9279B2CEF1; Fri, 6 May 2016 20:49:15 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 735AF1106; Fri, 6 May 2016 20:49:15 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46KnE4Q003508; Fri, 6 May 2016 20:49:14 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46KnEwk003507; Fri, 6 May 2016 20:49:14 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201605062049.u46KnEwk003507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Fri, 6 May 2016 20:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299196 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 20:49:15 -0000 Author: garga (ports committer) Date: Fri May 6 20:49:14 2016 New Revision: 299196 URL: https://svnweb.freebsd.org/changeset/base/299196 Log: Add missing parameters -N and -l to reroot and halt usage() Approved by: bapt Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D6173 Modified: head/sbin/reboot/reboot.c Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Fri May 6 20:32:39 2016 (r299195) +++ head/sbin/reboot/reboot.c Fri May 6 20:49:14 2016 (r299196) @@ -248,8 +248,8 @@ usage(void) { (void)fprintf(stderr, dohalt ? - "usage: halt [-lnpq] [-k kernel]\n" : - "usage: reboot [-dlnpq] [-k kernel]\n"); + "usage: halt [-lNnpq] [-k kernel]\n" : + "usage: reboot [-dlNnpqr] [-k kernel]\n"); exit(1); } From owner-svn-src-all@freebsd.org Fri May 6 20:55:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3102B2D0D7; Fri, 6 May 2016 20:55:15 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0BA716E5; Fri, 6 May 2016 20:55:15 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46KtEYM006347; Fri, 6 May 2016 20:55:14 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46KtEff006346; Fri, 6 May 2016 20:55:14 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605062055.u46KtEff006346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 6 May 2016 20:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299197 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 20:55:16 -0000 Author: skra Date: Fri May 6 20:55:14 2016 New Revision: 299197 URL: https://svnweb.freebsd.org/changeset/base/299197 Log: INTRNG - use gpio interrupt modes definitions added in r298738 and implement also GPIO_INTR_EDGE_BOTH mode. All reasonable interrupt modes are supported now. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri May 6 20:49:14 2016 (r299196) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri May 6 20:55:14 2016 (r299197) @@ -88,7 +88,7 @@ struct bcm_gpio_sysctl { struct bcm_gpio_irqsrc { struct intr_irqsrc bgi_isrc; uint32_t bgi_irq; - uint32_t bgi_reg; + uint32_t bgi_mode; uint32_t bgi_mask; }; #endif @@ -894,6 +894,17 @@ bcm_gpio_detach(device_t dev) #ifdef INTRNG static inline void +bcm_gpio_modify(struct bcm_gpio_softc *sc, uint32_t reg, uint32_t mask, + bool set_bits) +{ + + if (set_bits) + BCM_GPIO_SET_BITS(sc, reg, mask); + else + BCM_GPIO_CLEAR_BITS(sc, reg, mask); +} + +static inline void bcm_gpio_isrc_eoi(struct bcm_gpio_softc *sc, struct bcm_gpio_irqsrc *bgi) { uint32_t bank; @@ -906,28 +917,64 @@ bcm_gpio_isrc_eoi(struct bcm_gpio_softc static inline bool bcm_gpio_isrc_is_level(struct bcm_gpio_irqsrc *bgi) { - uint32_t bank; - bank = BCM_GPIO_BANK(bgi->bgi_irq); - return (bgi->bgi_reg == BCM_GPIO_GPHEN(bank) || - bgi->bgi_reg == BCM_GPIO_GPLEN(bank)); + return (bgi->bgi_mode == GPIO_INTR_LEVEL_LOW || + bgi->bgi_mode == GPIO_INTR_LEVEL_HIGH); } static inline void bcm_gpio_isrc_mask(struct bcm_gpio_softc *sc, struct bcm_gpio_irqsrc *bgi) { + uint32_t bank; + bank = BCM_GPIO_BANK(bgi->bgi_irq); BCM_GPIO_LOCK(sc); - BCM_GPIO_CLEAR_BITS(sc, bgi->bgi_reg, bgi->bgi_mask); - BCM_GPIO_UNLOCK(bcm_gpio_sc); + switch (bgi->bgi_mode) { + case GPIO_INTR_LEVEL_LOW: + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPLEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_LEVEL_HIGH: + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPHEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_RISING: + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_FALLING: + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_BOTH: + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask); + BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask); + break; + } + BCM_GPIO_UNLOCK(sc); } static inline void bcm_gpio_isrc_unmask(struct bcm_gpio_softc *sc, struct bcm_gpio_irqsrc *bgi) { + uint32_t bank; + bank = BCM_GPIO_BANK(bgi->bgi_irq); BCM_GPIO_LOCK(sc); - BCM_GPIO_SET_BITS(sc, bgi->bgi_reg, bgi->bgi_mask); + switch (bgi->bgi_mode) { + case GPIO_INTR_LEVEL_LOW: + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPLEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_LEVEL_HIGH: + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPHEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_RISING: + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_FALLING: + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask); + break; + case GPIO_INTR_EDGE_BOTH: + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask); + BCM_GPIO_SET_BITS(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask); + break; + } BCM_GPIO_UNLOCK(sc); } @@ -983,7 +1030,7 @@ bcm_gpio_pic_attach(struct bcm_gpio_soft for (irq = 0; irq < BCM_GPIO_PINS; irq++) { sc->sc_isrcs[irq].bgi_irq = irq; sc->sc_isrcs[irq].bgi_mask = BCM_GPIO_MASK(irq); - sc->sc_isrcs[irq].bgi_reg = 0; + sc->sc_isrcs[irq].bgi_mode = GPIO_INTR_CONFORM; error = intr_isrc_register(&sc->sc_isrcs[irq].bgi_isrc, sc->sc_dev, 0, "%s,%u", name, irq); @@ -1007,6 +1054,26 @@ bcm_gpio_pic_detach(struct bcm_gpio_soft } static void +bcm_gpio_pic_config_intr(struct bcm_gpio_softc *sc, struct bcm_gpio_irqsrc *bgi, + uint32_t mode) +{ + uint32_t bank; + + bank = BCM_GPIO_BANK(bgi->bgi_irq); + BCM_GPIO_LOCK(sc); + bcm_gpio_modify(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask, + mode == GPIO_INTR_EDGE_RISING || mode == GPIO_INTR_EDGE_BOTH); + bcm_gpio_modify(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask, + mode == GPIO_INTR_EDGE_FALLING || mode == GPIO_INTR_EDGE_BOTH); + bcm_gpio_modify(sc, BCM_GPIO_GPHEN(bank), bgi->bgi_mask, + mode == GPIO_INTR_LEVEL_HIGH); + bcm_gpio_modify(sc, BCM_GPIO_GPLEN(bank), bgi->bgi_mask, + mode == GPIO_INTR_LEVEL_LOW); + bgi->bgi_mode = mode; + BCM_GPIO_UNLOCK(sc); +} + +static void bcm_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) { struct bcm_gpio_softc *sc = device_get_softc(dev); @@ -1027,10 +1094,10 @@ bcm_gpio_pic_enable_intr(device_t dev, s static int bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, u_int ncells, pcell_t *cells, - u_int *irqp, uint32_t *regp) + u_int *irqp, uint32_t *modep) { u_int irq; - uint32_t reg, bank; + uint32_t mode, bank; /* * The first cell is the interrupt number. @@ -1048,27 +1115,24 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_sof if (irq >= BCM_GPIO_PINS || bcm_gpio_pin_is_ro(sc, irq)) return (EINVAL); - /* - * All interrupt types could be set for an interrupt at one moment. - * At least, the combination of 'low-to-high' and 'high-to-low' edge - * triggered interrupt types can make a sense. However, no combo is - * supported now. - */ + /* Only reasonable modes are supported. */ bank = BCM_GPIO_BANK(irq); if (cells[1] == 1) - reg = BCM_GPIO_GPREN(bank); + mode = GPIO_INTR_EDGE_RISING; else if (cells[1] == 2) - reg = BCM_GPIO_GPFEN(bank); + mode = GPIO_INTR_EDGE_FALLING; + else if (cells[1] == 3) + mode = GPIO_INTR_EDGE_BOTH; else if (cells[1] == 4) - reg = BCM_GPIO_GPHEN(bank); + mode = GPIO_INTR_LEVEL_HIGH; else if (cells[1] == 8) - reg = BCM_GPIO_GPLEN(bank); + mode = GPIO_INTR_LEVEL_LOW; else return (EINVAL); *irqp = irq; - if (regp != NULL) - *regp = reg; + if (modep != NULL) + *modep = mode; return (0); } @@ -1126,7 +1190,7 @@ bcm_gpio_pic_setup_intr(device_t dev, st struct resource *res, struct intr_map_data *data) { u_int irq; - uint32_t bank, reg; + uint32_t mode; struct bcm_gpio_softc *sc; struct bcm_gpio_irqsrc *bgi; struct intr_map_data_fdt *daf; @@ -1140,7 +1204,7 @@ bcm_gpio_pic_setup_intr(device_t dev, st /* Get and check config for an interrupt. */ if (bcm_gpio_pic_map_fdt(sc, daf->ncells, daf->cells, &irq, - ®) != 0 || bgi->bgi_irq != irq) + &mode) != 0 || bgi->bgi_irq != irq) return (EINVAL); /* @@ -1148,17 +1212,9 @@ bcm_gpio_pic_setup_intr(device_t dev, st * only check that its configuration match. */ if (isrc->isrc_handlers != 0) - return (bgi->bgi_reg == reg ? 0 : EINVAL); + return (bgi->bgi_mode == mode ? 0 : EINVAL); - bank = BCM_GPIO_BANK(irq); - BCM_GPIO_LOCK(sc); - BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPREN(bank), bgi->bgi_mask); - BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPFEN(bank), bgi->bgi_mask); - BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPHEN(bank), bgi->bgi_mask); - BCM_GPIO_CLEAR_BITS(sc, BCM_GPIO_GPLEN(bank), bgi->bgi_mask); - bgi->bgi_reg = reg; - BCM_GPIO_SET_BITS(sc, reg, bgi->bgi_mask); - BCM_GPIO_UNLOCK(sc); + bcm_gpio_pic_config_intr(sc, bgi, mode); return (0); } @@ -1169,12 +1225,8 @@ bcm_gpio_pic_teardown_intr(device_t dev, struct bcm_gpio_softc *sc = device_get_softc(dev); struct bcm_gpio_irqsrc *bgi = (struct bcm_gpio_irqsrc *)isrc; - if (isrc->isrc_handlers == 0) { - BCM_GPIO_LOCK(sc); - BCM_GPIO_CLEAR_BITS(sc, bgi->bgi_reg, bgi->bgi_mask); - bgi->bgi_reg = 0; - BCM_GPIO_UNLOCK(sc); - } + if (isrc->isrc_handlers == 0) + bcm_gpio_pic_config_intr(sc, bgi, GPIO_INTR_CONFORM); return (0); } From owner-svn-src-all@freebsd.org Fri May 6 20:57:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5833BB2D17D; Fri, 6 May 2016 20:57:42 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3019A18CB; Fri, 6 May 2016 20:57:42 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46KvfvL006487; Fri, 6 May 2016 20:57:41 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46KvfR3006486; Fri, 6 May 2016 20:57:41 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605062057.u46KvfR3006486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 6 May 2016 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299198 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 20:57:42 -0000 Author: skra Date: Fri May 6 20:57:41 2016 New Revision: 299198 URL: https://svnweb.freebsd.org/changeset/base/299198 Log: INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO introduced in r298738. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri May 6 20:55:14 2016 (r299197) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri May 6 20:57:41 2016 (r299198) @@ -1093,7 +1093,7 @@ bcm_gpio_pic_enable_intr(device_t dev, s } static int -bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, u_int ncells, pcell_t *cells, +bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct intr_map_data_fdt *daf, u_int *irqp, uint32_t *modep) { u_int irq; @@ -1108,24 +1108,24 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_sof * 4 = active high level-sensitive. * 8 = active low level-sensitive. */ - if (ncells != 2) + if (daf->ncells != 2) return (EINVAL); - irq = cells[0]; + irq = daf->cells[0]; if (irq >= BCM_GPIO_PINS || bcm_gpio_pin_is_ro(sc, irq)) return (EINVAL); /* Only reasonable modes are supported. */ bank = BCM_GPIO_BANK(irq); - if (cells[1] == 1) + if (daf->cells[1] == 1) mode = GPIO_INTR_EDGE_RISING; - else if (cells[1] == 2) + else if (daf->cells[1] == 2) mode = GPIO_INTR_EDGE_FALLING; - else if (cells[1] == 3) + else if (daf->cells[1] == 3) mode = GPIO_INTR_EDGE_BOTH; - else if (cells[1] == 4) + else if (daf->cells[1] == 4) mode = GPIO_INTR_LEVEL_HIGH; - else if (cells[1] == 8) + else if (daf->cells[1] == 8) mode = GPIO_INTR_LEVEL_LOW; else return (EINVAL); @@ -1137,21 +1137,54 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_sof } static int -bcm_gpio_pic_map_intr(device_t dev, struct intr_map_data *data, - struct intr_irqsrc **isrcp) +bcm_gpio_pic_map_gpio(struct bcm_gpio_softc *sc, struct intr_map_data_gpio *dag, + u_int *irqp, uint32_t *modep) { - int error; u_int irq; - struct intr_map_data_fdt *daf; - struct bcm_gpio_softc *sc; + uint32_t mode; + + irq = dag->gpio_pin_num; + if (irq >= BCM_GPIO_PINS || bcm_gpio_pin_is_ro(sc, irq)) + return (EINVAL); + + mode = dag->gpio_intr_mode; + if (mode != GPIO_INTR_LEVEL_LOW && mode != GPIO_INTR_LEVEL_HIGH && + mode != GPIO_INTR_EDGE_RISING && mode != GPIO_INTR_EDGE_FALLING && + mode != GPIO_INTR_EDGE_BOTH) + return (EINVAL); - if (data->type != INTR_MAP_DATA_FDT) + *irqp = irq; + if (modep != NULL) + *modep = mode; + return (0); +} + +static int +bcm_gpio_pic_map(struct bcm_gpio_softc *sc, struct intr_map_data *data, + u_int *irqp, uint32_t *modep) +{ + + switch (data->type) { + case INTR_MAP_DATA_FDT: + return (bcm_gpio_pic_map_fdt(sc, + (struct intr_map_data_fdt *)data, irqp, modep)); + case INTR_MAP_DATA_GPIO: + return (bcm_gpio_pic_map_gpio(sc, + (struct intr_map_data_gpio *)data, irqp, modep)); + default: return (ENOTSUP); + } +} - sc = device_get_softc(dev); - daf = (struct intr_map_data_fdt *)data; +static int +bcm_gpio_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + int error; + u_int irq; + struct bcm_gpio_softc *sc = device_get_softc(dev); - error = bcm_gpio_pic_map_fdt(sc, daf->ncells, daf->cells, &irq, NULL); + error = bcm_gpio_pic_map(sc, data, &irq, NULL); if (error == 0) *isrcp = &sc->sc_isrcs[irq].bgi_isrc; return (error); @@ -1193,18 +1226,15 @@ bcm_gpio_pic_setup_intr(device_t dev, st uint32_t mode; struct bcm_gpio_softc *sc; struct bcm_gpio_irqsrc *bgi; - struct intr_map_data_fdt *daf; - if (data == NULL || data->type != INTR_MAP_DATA_FDT) + if (data == NULL) return (ENOTSUP); sc = device_get_softc(dev); bgi = (struct bcm_gpio_irqsrc *)isrc; - daf = (struct intr_map_data_fdt *)data; /* Get and check config for an interrupt. */ - if (bcm_gpio_pic_map_fdt(sc, daf->ncells, daf->cells, &irq, - &mode) != 0 || bgi->bgi_irq != irq) + if (bcm_gpio_pic_map(sc, data, &irq, &mode) != 0 || bgi->bgi_irq != irq) return (EINVAL); /* From owner-svn-src-all@freebsd.org Fri May 6 21:19:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B251BB2D7B0; Fri, 6 May 2016 21:19:29 +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 82E061734; Fri, 6 May 2016 21:19:29 +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 u46LJSiv012862; Fri, 6 May 2016 21:19:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46LJSww012861; Fri, 6 May 2016 21:19:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605062119.u46LJSww012861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 6 May 2016 21:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299199 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 21:19:29 -0000 Author: emaste Date: Fri May 6 21:19:28 2016 New Revision: 299199 URL: https://svnweb.freebsd.org/changeset/base/299199 Log: Add nid_namelen bounds check to nfssvc system call This is only allowed by root and only used by the nfs daemon, which should not provide an incorrect value. However, it's still good practice to validate data provided by userland. PR: 206626 Reported by: CTurt Reviewed by: rmacklem MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D6201 Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri May 6 20:57:41 2016 (r299198) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri May 6 21:19:28 2016 (r299199) @@ -3174,6 +3174,10 @@ nfssvc_idname(struct nfsd_idargs *nidp) static int onethread = 0; static time_t lasttime = 0; + if (nidp->nid_namelen <= 0 || nidp->nid_namelen > MAXHOSTNAMELEN) { + error = EINVAL; + goto out; + } if (nidp->nid_flag & NFSID_INITIALIZE) { cp = malloc(nidp->nid_namelen + 1, M_NFSSTRING, M_WAITOK); error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp, From owner-svn-src-all@freebsd.org Fri May 6 22:54:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF70B31247; Fri, 6 May 2016 22:54:58 +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 7B93D1E1C; Fri, 6 May 2016 22:54:58 +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 u46MsvFg043136; Fri, 6 May 2016 22:54:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46MsuV7043124; Fri, 6 May 2016 22:54:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605062254.u46MsuV7043124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 22:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299200 - in head/sys/dev: e1000 ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 22:54:58 -0000 Author: pfg Date: Fri May 6 22:54:56 2016 New Revision: 299200 URL: https://svnweb.freebsd.org/changeset/base/299200 Log: dev/e1000,ixgbe: minor spelling fixes. No functional change. Differential Revision: https://reviews.freebsd.org/D6177 Modified: head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_mbx.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_mbx.c head/sys/dev/ixgbe/ixgbe_type.h Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/e1000/e1000_82571.c Fri May 6 22:54:56 2016 (r299200) @@ -396,7 +396,7 @@ static s32 e1000_init_mac_params_82571(s } /* Ensure that the inter-port SWSM.SMBI lock bit is clear before - * first NVM or PHY acess. This should be done for single-port + * first NVM or PHY access. This should be done for single-port * devices, and for one port only on dual-port devices so that * for those devices we can still use the SMBI lock to synchronize * inter-port accesses to the PHY & NVM. Modified: head/sys/dev/e1000/e1000_mbx.c ============================================================================== --- head/sys/dev/e1000/e1000_mbx.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/e1000/e1000_mbx.c Fri May 6 22:54:56 2016 (r299200) @@ -67,7 +67,7 @@ static s32 e1000_null_mbx_transact(struc * @size: Length of buffer * @mbx_id: id of mailbox to read * - * returns SUCCESS if it successfuly read message from buffer + * returns SUCCESS if it successfully read message from buffer **/ s32 e1000_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) { @@ -493,7 +493,7 @@ out_no_write: * @size: Length of buffer * @mbx_id: id of mailbox to read * - * returns SUCCESS if it successfuly read message from buffer + * returns SUCCESS if it successfully read message from buffer **/ static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, u16 E1000_UNUSEDARG mbx_id) Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/e1000/if_em.c Fri May 6 22:54:56 2016 (r299200) @@ -582,7 +582,7 @@ em_attach(device_t dev) } /* ** In the new SPT device flash is not a - ** seperate BAR, rather it is also in BAR0, + ** separate BAR, rather it is also in BAR0, ** so use the same tag and an offset handle for the ** FLASH read/write macros in the shared code. */ @@ -1929,7 +1929,7 @@ em_xmit(struct tx_ring *txr, struct mbuf * so we firstly get a writable mbuf chain then coalesce ethernet/ * IP/TCP header into a single buffer to meet the requirement of * controller. This also simplifies IP/TCP/UDP checksum offloading - * which also has similiar restrictions. + * which also has similar restrictions. */ if (do_tso || m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) { if (do_tso || (m_head->m_next != NULL && @@ -2595,7 +2595,7 @@ em_allocate_legacy(struct adapter *adapt * * Setup the MSIX Interrupt handlers * This is not really Multiqueue, rather - * its just seperate interrupt vectors + * its just separate interrupt vectors * for TX, RX, and Link. * **********************************************************************/ @@ -3083,7 +3083,7 @@ em_reset(struct adapter *adapter) * received after sending an XOFF. * - Low water mark works best when it is very near the high water mark. * This allows the receiver to restart by sending XON when it has - * drained a bit. Here we use an arbitary value of 1500 which will + * drained a bit. Here we use an arbitrary value of 1500 which will * restart after one full frame is pulled from the buffer. There * could be several smaller frames in the buffer and if so they will * not trigger the XON until their total number reduces the buffer Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/e1000/if_igb.c Fri May 6 22:54:56 2016 (r299200) @@ -304,7 +304,7 @@ SYSCTL_INT(_hw_igb, OID_AUTO, buf_ring_s /* ** Header split causes the packet header to -** be dma'd to a seperate mbuf from the payload. +** be dma'd to a separate mbuf from the payload. ** this can have memory alignment benefits. But ** another plus is that small packets often fit ** into the header and thus use no cluster. Its @@ -4483,7 +4483,7 @@ skip_head: ** Now set up the LRO interface, we ** also only do head split when LRO ** is enabled, since so often they - ** are undesireable in similar setups. + ** are undesirable in similar setups. */ if (ifp->if_capenable & IFCAP_LRO) { error = tcp_lro_init(lro); Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/e1000/if_lem.c Fri May 6 22:54:56 2016 (r299200) @@ -2412,7 +2412,7 @@ lem_hardware_init(struct adapter *adapte * received after sending an XOFF. * - Low water mark works best when it is very near the high water mark. * This allows the receiver to restart by sending XON when it has - * drained a bit. Here we use an arbitary value of 1500 which will + * drained a bit. Here we use an arbitrary value of 1500 which will * restart after one full frame is pulled from the buffer. There * could be several smaller frames in the buffer and if so they will * not trigger the XON until their total number reduces the buffer @@ -3838,7 +3838,7 @@ discard: * copy ethernet header to the new mbuf. The new mbuf is prepended into the * existing mbuf chain. * - * Be aware, best performance of the 8254x is achived only when jumbo frame is + * Be aware, best performance of the 8254x is achieved only when jumbo frame is * not used at all on architectures with strict alignment. */ static int Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/ixgbe/if_ixv.c Fri May 6 22:54:56 2016 (r299200) @@ -195,7 +195,7 @@ TUNABLE_INT("hw.ixv.flow_control", &ixv_ /* * Header split: this causes the hardware to DMA - * the header into a seperate mbuf from the payload, + * the header into a separate mbuf from the payload, * it can be a performance win in some workloads, but * in others it actually hurts, its off by default. */ @@ -1141,7 +1141,7 @@ ixv_local_timer(void *arg) } - /* Only truely watchdog if all queues show hung */ + /* Only truly watchdog if all queues show hung */ if (hung == adapter->num_queues) goto watchdog; else if (queues != 0) { /* Force an IRQ on queues with work */ @@ -1958,7 +1958,7 @@ ixv_handle_mbx(void *context, int pendin } /* -** The VF stats registers never have a truely virgin +** The VF stats registers never have a truly virgin ** starting point, so this routine tries to make an ** artificial one, marking ground zero on attach as ** it were. Modified: head/sys/dev/ixgbe/ixgbe_api.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_api.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/ixgbe/ixgbe_api.c Fri May 6 22:54:56 2016 (r299200) @@ -879,7 +879,7 @@ s32 ixgbe_update_eeprom_checksum(struct * @vmdq: VMDq pool to assign * * Puts an ethernet address into a receive address register, or - * finds the rar that it is aleady in; adds to the pool list + * finds the rar that it is already in; adds to the pool list **/ s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq) { Modified: head/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/ixgbe/ixgbe_common.c Fri May 6 22:54:56 2016 (r299200) @@ -3610,7 +3610,7 @@ u16 ixgbe_get_pcie_msix_count_generic(st * @vmdq: VMDq pool to assign * * Puts an ethernet address into a receive address register, or - * finds the rar that it is aleady in; adds to the pool list + * finds the rar that it is already in; adds to the pool list **/ s32 ixgbe_insert_mac_addr_generic(struct ixgbe_hw *hw, u8 *addr, u32 vmdq) { Modified: head/sys/dev/ixgbe/ixgbe_mbx.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_mbx.c Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/ixgbe/ixgbe_mbx.c Fri May 6 22:54:56 2016 (r299200) @@ -42,7 +42,7 @@ * @size: Length of buffer * @mbx_id: id of mailbox to read * - * returns SUCCESS if it successfuly read message from buffer + * returns SUCCESS if it successfully read message from buffer **/ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { @@ -462,7 +462,7 @@ out_no_write: * @size: Length of buffer * @mbx_id: id of mailbox to read * - * returns SUCCESS if it successfuly read message from buffer + * returns SUCCESS if it successfully read message from buffer **/ static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) Modified: head/sys/dev/ixgbe/ixgbe_type.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_type.h Fri May 6 21:19:28 2016 (r299199) +++ head/sys/dev/ixgbe/ixgbe_type.h Fri May 6 22:54:56 2016 (r299200) @@ -47,7 +47,7 @@ * * - IXGBE_ERROR_POLLING * This category is for errors related to polling/timeout issues and should be - * used in any case where the timeout occured, or a failure to obtain a lock, or + * used in any case where the timeout occurred, or a failure to obtain a lock, or * failure to receive data within the time limit. * * - IXGBE_ERROR_CAUTION @@ -2078,7 +2078,7 @@ enum { #define IXGBE_MACC_FS 0x00040000 #define IXGBE_MAC_RX2TX_LPBK 0x00000002 -/* Veto Bit definiton */ +/* Veto Bit definition */ #define IXGBE_MMNGC_MNG_VETO 0x00000001 /* LINKS Bit Masks */ From owner-svn-src-all@freebsd.org Fri May 6 23:26:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FCA3B31A75; Fri, 6 May 2016 23:26:19 +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 E9EFD1ED7; Fri, 6 May 2016 23:26:18 +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 u46NQIw2052318; Fri, 6 May 2016 23:26:18 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NQIog052317; Fri, 6 May 2016 23:26:18 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605062326.u46NQIog052317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 May 2016 23:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299201 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:26:19 -0000 Author: rmacklem Date: Fri May 6 23:26:17 2016 New Revision: 299201 URL: https://svnweb.freebsd.org/changeset/base/299201 Log: Give mountd -S priority over outstanding RPC requests when suspending the nfsd. It was reported via email that under certain heavy RPC loads long delays before the exports would be updated was observed when using "mountd -S". This patch reverses the priority between the exclusive lock request to suspend the nfsd threads and the shared lock request for performing RPCs. As such, when mountd attempts to suspend the nfsd threads, it gets priority over outstanding RPC requests to do this. I suspect that the case reported was an artificial test load, but this patch did fix the problem for the reporter. Reported and Tested by: josephlai@qnap.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 6 22:54:56 2016 (r299200) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 6 23:26:17 2016 (r299201) @@ -231,10 +231,16 @@ nfssvc_program(struct svc_req *rqst, SVC * Get a refcnt (shared lock) on nfsd_suspend_lock. * NFSSVC_SUSPENDNFSD will take an exclusive lock on * nfsd_suspend_lock to suspend these threads. + * The call to nfsv4_lock() that preceeds nfsv4_getref() + * ensures that the acquisition of the exclusive lock + * takes priority over acquisition of the shared lock by + * waiting for any exclusive lock request to complete. * This must be done here, before the check of * nfsv4root exports by nfsvno_v4rootexport(). */ NFSLOCKV4ROOTMUTEX(); + nfsv4_lock(&nfsd_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); NFSUNLOCKV4ROOTMUTEX(); From owner-svn-src-all@freebsd.org Fri May 6 23:37:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B16CB31D51; Fri, 6 May 2016 23:37:21 +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 18CD914D3; Fri, 6 May 2016 23:37:21 +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 u46NbK8g055306; Fri, 6 May 2016 23:37:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NbK71055303; Fri, 6 May 2016 23:37:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605062337.u46NbK71055303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 23:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299202 - head/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:37:21 -0000 Author: pfg Date: Fri May 6 23:37:19 2016 New Revision: 299202 URL: https://svnweb.freebsd.org/changeset/base/299202 Log: sys/opencrypto: minor spelling fixes. No functional change. Reviewed by: jmg Modified: head/sys/opencrypto/cast.c head/sys/opencrypto/crypto.c head/sys/opencrypto/gfmult.c Modified: head/sys/opencrypto/cast.c ============================================================================== --- head/sys/opencrypto/cast.c Fri May 6 23:26:17 2016 (r299201) +++ head/sys/opencrypto/cast.c Fri May 6 23:37:19 2016 (r299202) @@ -127,7 +127,7 @@ u_int32_t t, l, r; } -/***** Key Schedual *****/ +/***** Key Schedule *****/ void cast_setkey(cast_key* key, u_int8_t* rawkey, int keybytes) { Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Fri May 6 23:26:17 2016 (r299201) +++ head/sys/opencrypto/crypto.c Fri May 6 23:37:19 2016 (r299202) @@ -911,7 +911,7 @@ again: } /* - * Dispatch an assymetric crypto request. + * Dispatch an asymmetric crypto request. */ static int crypto_kinvoke(struct cryptkop *krp, int crid) Modified: head/sys/opencrypto/gfmult.c ============================================================================== --- head/sys/opencrypto/gfmult.c Fri May 6 23:26:17 2016 (r299201) +++ head/sys/opencrypto/gfmult.c Fri May 6 23:37:19 2016 (r299202) @@ -40,7 +40,7 @@ static const uint8_t nib_rev[] = { 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf, }; -/* calulate v * 2 */ +/* calculate v * 2 */ static inline struct gf128 gf128_mulalpha(struct gf128 v) { From owner-svn-src-all@freebsd.org Fri May 6 23:40:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75FB4B31E18; Fri, 6 May 2016 23:40:38 +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 43DED179E; Fri, 6 May 2016 23:40:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46NebNJ056095; Fri, 6 May 2016 23:40:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NebO2056094; Fri, 6 May 2016 23:40:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605062340.u46NebO2056094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 6 May 2016 23:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299203 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:40:38 -0000 Author: pfg Date: Fri May 6 23:40:37 2016 New Revision: 299203 URL: https://svnweb.freebsd.org/changeset/base/299203 Log: nfsserver: minor spelling fix in comment. No functional change. Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 6 23:37:19 2016 (r299202) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 6 23:40:37 2016 (r299203) @@ -231,7 +231,7 @@ nfssvc_program(struct svc_req *rqst, SVC * Get a refcnt (shared lock) on nfsd_suspend_lock. * NFSSVC_SUSPENDNFSD will take an exclusive lock on * nfsd_suspend_lock to suspend these threads. - * The call to nfsv4_lock() that preceeds nfsv4_getref() + * The call to nfsv4_lock() that precedes nfsv4_getref() * ensures that the acquisition of the exclusive lock * takes priority over acquisition of the shared lock by * waiting for any exclusive lock request to complete. From owner-svn-src-all@freebsd.org Fri May 6 23:44:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D228FB31FDE; Fri, 6 May 2016 23:44:25 +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 88DC81BCC; Fri, 6 May 2016 23:44:25 +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 u46NiOnx058226; Fri, 6 May 2016 23:44:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NiO5e058224; Fri, 6 May 2016 23:44:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605062344.u46NiO5e058224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 May 2016 23:44: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: r299204 - in stable/10/sys/fs: nfs nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:44:25 -0000 Author: rmacklem Date: Fri May 6 23:44:24 2016 New Revision: 299204 URL: https://svnweb.freebsd.org/changeset/base/299204 Log: MFC: r297837 Bruce Evans reported that there was a performance regression between the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Modified: stable/10/sys/fs/nfs/nfsport.h stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfsport.h ============================================================================== --- stable/10/sys/fs/nfs/nfsport.h Fri May 6 23:40:37 2016 (r299203) +++ stable/10/sys/fs/nfs/nfsport.h Fri May 6 23:44:24 2016 (r299204) @@ -787,12 +787,14 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); /* * Set the n_time in the client write rpc, as required. */ -#define NFSWRITERPC_SETTIME(w, n, v4) \ +#define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - (n)->n_mtime = (n)->n_vattr.na_vattr.va_mtime; \ + mtx_lock(&((n)->n_mtx)); \ + (n)->n_mtime = (a)->na_mtime; \ if (v4) \ - (n)->n_change = (n)->n_vattr.na_vattr.va_filerev; \ + (n)->n_change = (a)->na_filerev; \ + mtx_unlock(&((n)->n_mtx)); \ } \ } while (0) Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:40:37 2016 (r299203) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:44:24 2016 (r299204) @@ -1731,7 +1731,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * } if (error) goto nfsmout; - NFSWRITERPC_SETTIME(wccflag, np, (nd->nd_flag & ND_NFSV4)); + NFSWRITERPC_SETTIME(wccflag, np, nap, (nd->nd_flag & ND_NFSV4)); mbuf_freem(nd->nd_mrep); nd->nd_mrep = NULL; tsiz -= len; From owner-svn-src-all@freebsd.org Fri May 6 23:46:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0575B31091; Fri, 6 May 2016 23:46:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC9601D91; Fri, 6 May 2016 23:46:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46NkZQS058340; Fri, 6 May 2016 23:46:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NkZvB058339; Fri, 6 May 2016 23:46:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605062346.u46NkZvB058339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 May 2016 23:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299205 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:46:37 -0000 Author: jhb Date: Fri May 6 23:46:35 2016 New Revision: 299205 URL: https://svnweb.freebsd.org/changeset/base/299205 Log: Restore name=value format of PCI location strings. When devctl was added, the location string for PCI devices was changed to use the PCI "selector" that pciconf and devctl accept. However, devd assumes that location strings are formatted as a list of name=value pairs. As a result, devd is no longer parsing any of the values out of PCI device events. Restore the previous format of the PCI location strings to restore the location and slot keywords in case any devd scripts are using this. Add the "selector" as a new 'dbsf' location variable. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D6253 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri May 6 23:44:24 2016 (r299204) +++ head/sys/dev/pci/pci.c Fri May 6 23:46:35 2016 (r299205) @@ -5427,7 +5427,8 @@ pci_child_location_str_method(device_t d size_t buflen) { - snprintf(buf, buflen, "pci%d:%d:%d:%d", pci_get_domain(child), + snprintf(buf, buflen, "slot=%d function=%d dbsf=pci%d:%d:%d:%d", + pci_get_slot(child), pci_get_function(child), pci_get_domain(child), pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); return (0); } From owner-svn-src-all@freebsd.org Fri May 6 23:49:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0168DB31107; Fri, 6 May 2016 23:49:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25221F28; Fri, 6 May 2016 23:49:11 +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 u46NnAIo058466; Fri, 6 May 2016 23:49:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NnAjs058464; Fri, 6 May 2016 23:49:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605062349.u46NnAjs058464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 May 2016 23:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299206 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:49:12 -0000 Author: jhb Date: Fri May 6 23:49:10 2016 New Revision: 299206 URL: https://svnweb.freebsd.org/changeset/base/299206 Log: Set the correct vnet in TOE event handlers. Differential Revision: https://reviews.freebsd.org/D6152 Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 6 23:46:35 2016 (r299205) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 6 23:49:10 2016 (r299206) @@ -267,6 +267,7 @@ make_established(struct toepcb *toep, ui uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; + CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -317,6 +318,7 @@ make_established(struct toepcb *toep, ui send_flowc_wr(toep, &ftxp); soisconnected(so); + CURVNET_RESTORE(); } static int @@ -1429,6 +1431,7 @@ do_rx_data(struct sge_iq *iq, const stru } /* receive buffer autosize */ + CURVNET_SET(so->so_vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1517,6 +1520,7 @@ do_rx_data(struct sge_iq *iq, const stru SOCKBUF_UNLOCK_ASSERT(sb); INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri May 6 23:46:35 2016 (r299205) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri May 6 23:49:10 2016 (r299206) @@ -1305,6 +1305,7 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; + CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1351,6 +1352,7 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ + CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), From owner-svn-src-all@freebsd.org Fri May 6 23:55:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8C90B31354; Fri, 6 May 2016 23:55:29 +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 7B64D1455; Fri, 6 May 2016 23:55:29 +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 u46NtSn0061499; Fri, 6 May 2016 23:55:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NtSZ0061497; Fri, 6 May 2016 23:55:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605062355.u46NtSZ0061497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 May 2016 23:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299207 - in stable/9/sys/fs: nfs nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:55:29 -0000 Author: rmacklem Date: Fri May 6 23:55:28 2016 New Revision: 299207 URL: https://svnweb.freebsd.org/changeset/base/299207 Log: MFC: r297837 Bruce Evans reported that there was a performance regression between the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Modified: stable/9/sys/fs/nfs/nfsport.h stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfsport.h ============================================================================== --- stable/9/sys/fs/nfs/nfsport.h Fri May 6 23:49:10 2016 (r299206) +++ stable/9/sys/fs/nfs/nfsport.h Fri May 6 23:55:28 2016 (r299207) @@ -706,12 +706,14 @@ MALLOC_DECLARE(M_NEWNFSDROLLBACK); /* * Set the n_time in the client write rpc, as required. */ -#define NFSWRITERPC_SETTIME(w, n, v4) \ +#define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - (n)->n_mtime = (n)->n_vattr.na_vattr.va_mtime; \ + mtx_lock(&((n)->n_mtx)); \ + (n)->n_mtime = (a)->na_mtime; \ if (v4) \ - (n)->n_change = (n)->n_vattr.na_vattr.va_filerev; \ + (n)->n_change = (a)->na_filerev; \ + mtx_unlock(&((n)->n_mtx)); \ } \ } while (0) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:49:10 2016 (r299206) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:55:28 2016 (r299207) @@ -1618,7 +1618,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * } if (error) goto nfsmout; - NFSWRITERPC_SETTIME(wccflag, np, (nd->nd_flag & ND_NFSV4)); + NFSWRITERPC_SETTIME(wccflag, np, nap, (nd->nd_flag & ND_NFSV4)); mbuf_freem(nd->nd_mrep); nd->nd_mrep = NULL; tsiz -= len; From owner-svn-src-all@freebsd.org Sat May 7 00:02:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B80FB31736; Sat, 7 May 2016 00:02:29 +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 4A56C19F4; Sat, 7 May 2016 00:02:29 +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 u4702STn064379; Sat, 7 May 2016 00:02:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4702S7o064378; Sat, 7 May 2016 00:02:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605070002.u4702S7o064378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 00:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299208 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 00:02:29 -0000 Author: rmacklem Date: Sat May 7 00:02:28 2016 New Revision: 299208 URL: https://svnweb.freebsd.org/changeset/base/299208 Log: MFC: r297869 If the VOP_SETATTR() call that saves the exclusive create verifier failed, the NFS server would leave the newly created vnode locked. This could result in a file system that would not unmount and processes wedged, waiting for the file to be unlocked. Since this VOP_SETATTR() never fails for most file systems, this bug doesn't normally manifest itself. I found it during testing of an exported GlusterFS file system, which can fail. This patch adds the vput() and changes the error to the correct NFS one. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Fri May 6 23:55:28 2016 (r299207) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Sat May 7 00:02:28 2016 (r299208) @@ -794,6 +794,11 @@ nfsvno_createsub(struct nfsrv_descript * nvap->na_atime.tv_nsec = cverf[1]; error = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred); + if (error != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + error = NFSERR_NOTSUPP; + } } } /* @@ -1422,6 +1427,11 @@ nfsvno_open(struct nfsrv_descript *nd, s nvap->na_atime.tv_nsec = cverf[1]; nd->nd_repstat = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, cred); + if (nd->nd_repstat != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + nd->nd_repstat = NFSERR_NOTSUPP; + } } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-all@freebsd.org Sat May 7 00:07:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3C4EB31807; Sat, 7 May 2016 00:07:04 +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 625391BD5; Sat, 7 May 2016 00:07:04 +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 u47073GX064578; Sat, 7 May 2016 00:07:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47073mF064577; Sat, 7 May 2016 00:07:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605070007.u47073mF064577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 00:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299209 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 00:07:04 -0000 Author: rmacklem Date: Sat May 7 00:07:03 2016 New Revision: 299209 URL: https://svnweb.freebsd.org/changeset/base/299209 Log: MFC: r297869 If the VOP_SETATTR() call that saves the exclusive create verifier failed, the NFS server would leave the newly created vnode locked. This could result in a file system that would not unmount and processes wedged, waiting for the file to be unlocked. Since this VOP_SETATTR() never fails for most file systems, this bug doesn't normally manifest itself. I found it during testing of an exported GlusterFS file system, which can fail. This patch adds the vput() and changes the error to the correct NFS one. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat May 7 00:02:28 2016 (r299208) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sat May 7 00:07:03 2016 (r299209) @@ -788,6 +788,11 @@ nfsvno_createsub(struct nfsrv_descript * nvap->na_atime.tv_nsec = cverf[1]; error = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred); + if (error != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + error = NFSERR_NOTSUPP; + } } } /* @@ -1413,6 +1418,11 @@ nfsvno_open(struct nfsrv_descript *nd, s nvap->na_atime.tv_nsec = cverf[1]; nd->nd_repstat = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, cred); + if (nd->nd_repstat != 0) { + vput(ndp->ni_vp); + ndp->ni_vp = NULL; + nd->nd_repstat = NFSERR_NOTSUPP; + } } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-all@freebsd.org Sat May 7 00:33:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E43B2E323; Sat, 7 May 2016 00:33:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D511318FB; Sat, 7 May 2016 00:33:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u470Xasg075574; Sat, 7 May 2016 00:33:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u470XZCs075568; Sat, 7 May 2016 00:33:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605070033.u470XZCs075568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 7 May 2016 00:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299210 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 00:33:37 -0000 Author: jhb Date: Sat May 7 00:33:35 2016 New Revision: 299210 URL: https://svnweb.freebsd.org/changeset/base/299210 Log: Use DDP to implement zerocopy TCP receive with aio_read(). Chelsio's TCP offload engine supports direct DMA of received TCP payload into wired user buffers. This feature is known as Direct-Data Placement. However, to scale well the adapter needs to prepare buffers for DDP before data arrives. aio_read() is more amenable to this requirement than read() as applications often call read() only after data is available in the socket buffer. When DDP is enabled, TOE sockets use the recently added pru_aio_queue protocol hook to claim aio_read(2) requests instead of letting them use the default AIO socket logic. The DDP feature supports scheduling DMA to two buffers at a time so that the second buffer is ready for use after the first buffer is filled. The aio/DDP code optimizes the case of an application ping-ponging between two buffers (similar to the zero-copy bpf(4) code) by keeping the two most recently used AIO buffers wired. If a buffer is reused, the aio/DDP code is able to reuse the vm_page_t array as well as page pod mappings (a kind of MMU mapping the Chelsio NIC uses to describe user buffers). The generation of the vmspace of the calling process is used in conjunction with the user buffer's address and length to determine if a user buffer matches a previously used buffer. If an application queues a buffer for AIO that does not match a previously used buffer then the least recently used buffer is unwired before the new buffer is wired. This ensures that no more than two user buffers per socket are ever wired. Note that this feature is best suited to applications sending a steady stream of data vs short bursts of traffic. Discussed with: np Relnotes: yes Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Sat May 7 00:07:03 2016 (r299209) +++ head/sys/dev/cxgbe/offload.h Sat May 7 00:33:35 2016 (r299210) @@ -145,8 +145,6 @@ struct uld_info { struct tom_tunables { int sndbuf; int ddp; - int indsz; - int ddp_thres; int rx_coalesce; int tx_align; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat May 7 00:07:03 2016 (r299209) +++ head/sys/dev/cxgbe/t4_main.c Sat May 7 00:33:35 2016 (r299210) @@ -4901,15 +4901,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", CTLFLAG_RW, &sc->tt.ddp, 0, "DDP allowed"); - sc->tt.indsz = G_INDICATESIZE(t4_read_reg(sc, A_TP_PARA_REG5)); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "indsz", CTLFLAG_RW, - &sc->tt.indsz, 0, "DDP max indicate size allowed"); - - sc->tt.ddp_thres = - G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp_thres", CTLFLAG_RW, - &sc->tt.ddp_thres, 0, "DDP threshold"); - sc->tt.rx_coalesce = 1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat May 7 00:07:03 2016 (r299209) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat May 7 00:33:35 2016 (r299210) @@ -343,7 +343,7 @@ send_rx_credits(struct adapter *sc, stru } void -t4_rcvd(struct toedev *tod, struct tcpcb *tp) +t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) { struct adapter *sc = tod->tod_softc; struct inpcb *inp = tp->t_inpcb; @@ -354,7 +354,7 @@ t4_rcvd(struct toedev *tod, struct tcpcb INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK(sb); + SOCKBUF_LOCK_ASSERT(sb); KASSERT(toep->sb_cc >= sbused(sb), ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sbused(sb), toep->sb_cc)); @@ -372,6 +372,17 @@ t4_rcvd(struct toedev *tod, struct tcpcb tp->rcv_wnd += credits; tp->rcv_adv += credits; } +} + +void +t4_rcvd(struct toedev *tod, struct tcpcb *tp) +{ + struct inpcb *inp = tp->t_inpcb; + struct socket *so = inp->inp_socket; + struct sockbuf *sb = &so->so_rcv; + + SOCKBUF_LOCK(sb); + t4_rcvd_locked(tod, tp); SOCKBUF_UNLOCK(sb); } @@ -1042,7 +1053,6 @@ do_peer_close(struct sge_iq *iq, const s struct inpcb *inp = toep->inp; struct tcpcb *tp = NULL; struct socket *so; - struct sockbuf *sb; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1088,12 +1098,14 @@ do_peer_close(struct sge_iq *iq, const s tp->rcv_nxt++; /* FIN */ so = inp->inp_socket; - sb = &so->so_rcv; - SOCKBUF_LOCK(sb); - if (__predict_false(toep->ddp_flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) { - handle_ddp_close(toep, tp, sb, cpl->rcv_nxt); + if (toep->ulp_mode == ULP_MODE_TCPDDP) { + DDP_LOCK(toep); + if (__predict_false(toep->ddp_flags & + (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) + handle_ddp_close(toep, tp, cpl->rcv_nxt); + DDP_UNLOCK(toep); } - socantrcvmore_locked(so); /* unlocks the sockbuf */ + socantrcvmore(so); if (toep->ulp_mode != ULP_MODE_RDMA) { KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt), @@ -1409,6 +1421,8 @@ do_rx_data(struct sge_iq *iq, const stru tp->rcv_wnd -= len; tp->t_rcvtime = ticks; + if (toep->ulp_mode == ULP_MODE_TCPDDP) + DDP_LOCK(toep); so = inp_inpcbtosocket(inp); sb = &so->so_rcv; SOCKBUF_LOCK(sb); @@ -1418,6 +1432,8 @@ do_rx_data(struct sge_iq *iq, const stru __func__, tid, len); m_freem(m); SOCKBUF_UNLOCK(sb); + if (toep->ulp_mode == ULP_MODE_TCPDDP) + DDP_UNLOCK(toep); INP_WUNLOCK(inp); INP_INFO_RLOCK(&V_tcbinfo); @@ -1446,6 +1462,10 @@ do_rx_data(struct sge_iq *iq, const stru toep->rx_credits += newsize - hiwat; } + if (toep->ddp_waiting_count != 0 || toep->ddp_active_count != 0) + CTR3(KTR_CXGBE, "%s: tid %u, non-ddp rx (%d bytes)", __func__, + tid, len); + if (toep->ulp_mode == ULP_MODE_TCPDDP) { int changed = !(toep->ddp_flags & DDP_ON) ^ cpl->ddp_off; @@ -1458,47 +1478,22 @@ do_rx_data(struct sge_iq *iq, const stru __func__)); /* Fell out of DDP mode */ - toep->ddp_flags &= ~(DDP_ON | DDP_BUF0_ACTIVE | - DDP_BUF1_ACTIVE); + toep->ddp_flags &= ~DDP_ON; + CTR1(KTR_CXGBE, "%s: fell out of DDP mode", + __func__); - if (ddp_placed) - insert_ddp_data(toep, ddp_placed); + insert_ddp_data(toep, ddp_placed); } } - if ((toep->ddp_flags & DDP_OK) == 0 && - time_uptime >= toep->ddp_disabled + DDP_RETRY_WAIT) { - toep->ddp_score = DDP_LOW_SCORE; - toep->ddp_flags |= DDP_OK; - CTR3(KTR_CXGBE, "%s: tid %u DDP_OK @ %u", - __func__, tid, time_uptime); - } - if (toep->ddp_flags & DDP_ON) { - /* - * CPL_RX_DATA with DDP on can only be an indicate. Ask - * soreceive to post a buffer or disable DDP. The - * payload that arrived in this indicate is appended to - * the socket buffer as usual. + * CPL_RX_DATA with DDP on can only be an indicate. + * Start posting queued AIO requests via DDP. The + * payload that arrived in this indicate is appended + * to the socket buffer as usual. */ - -#if 0 - CTR5(KTR_CXGBE, - "%s: tid %u (0x%x) DDP indicate (seq 0x%x, len %d)", - __func__, tid, toep->flags, be32toh(cpl->seq), len); -#endif - sb->sb_flags |= SB_DDP_INDICATE; - } else if ((toep->ddp_flags & (DDP_OK|DDP_SC_REQ)) == DDP_OK && - tp->rcv_wnd > DDP_RSVD_WIN && len >= sc->tt.ddp_thres) { - - /* - * DDP allowed but isn't on (and a request to switch it - * on isn't pending either), and conditions are ripe for - * it to work. Switch it on. - */ - - enable_ddp(sc, toep); + handle_ddp_indicate(toep); } } @@ -1516,8 +1511,16 @@ do_rx_data(struct sge_iq *iq, const stru tp->rcv_wnd += credits; tp->rcv_adv += credits; } + + if (toep->ddp_waiting_count > 0 && sbavail(sb) != 0) { + CTR2(KTR_CXGBE, "%s: tid %u queueing AIO task", __func__, + tid); + ddp_queue_toep(toep); + } sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(sb); + if (toep->ulp_mode == ULP_MODE_TCPDDP) + DDP_UNLOCK(toep); INP_WUNLOCK(inp); CURVNET_RESTORE(); @@ -1680,6 +1683,7 @@ do_set_tcb_rpl(struct sge_iq *iq, const struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *cpl = (const void *)(rss + 1); unsigned int tid = GET_TID(cpl); + struct toepcb *toep; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1691,6 +1695,12 @@ do_set_tcb_rpl(struct sge_iq *iq, const if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ + toep = lookup_tid(sc, tid); + if (toep->ulp_mode == ULP_MODE_TCPDDP) { + handle_ddp_tcb_rpl(toep, cpl); + return (0); + } + /* * TOM and/or other ULPs don't request replies for CPL_SET_TCB or * CPL_SET_TCB_FIELD requests. This can easily change and when it does @@ -1732,6 +1742,31 @@ t4_set_tcb_field(struct adapter *sc, str } void +t4_set_tcb_field_rpl(struct adapter *sc, struct toepcb *toep, int ctrl, + uint16_t word, uint64_t mask, uint64_t val, uint8_t cookie) +{ + struct wrqe *wr; + struct cpl_set_tcb_field *req; + + KASSERT((cookie & ~M_COOKIE) == 0, ("%s: invalid cookie %#x", __func__, + cookie)); + wr = alloc_wrqe(sizeof(*req), ctrl ? toep->ctrlq : toep->ofld_txq); + if (wr == NULL) { + /* XXX */ + panic("%s: allocation failure.", __func__); + } + req = wrtod(wr); + + INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, toep->tid); + req->reply_ctrl = htobe16(V_QUEUENO(toep->ofld_rxq->iq.abs_id)); + req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(cookie)); + req->mask = htobe64(mask); + req->val = htobe64(val); + + t4_wrq_tx(sc, wr); +} + +void t4_init_cpl_io_handlers(struct adapter *sc) { Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Sat May 7 00:07:03 2016 (r299209) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sat May 7 00:33:35 2016 (r299210) @@ -31,7 +31,8 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include -#include +#include +#include #include #include #include @@ -41,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,7 +74,10 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -static struct mbuf *get_ddp_mbuf(int len); +static void aio_ddp_requeue_task(void *context, int pending); +static void ddp_complete_all(struct toepcb *toep, int error); +static void t4_aio_cancel_active(struct kaiocb *job); +static void t4_aio_cancel_queued(struct kaiocb *job); #define PPOD_SZ(n) ((n) * sizeof(struct pagepod)) #define PPOD_SIZE (PPOD_SZ(1)) @@ -80,6 +85,10 @@ static struct mbuf *get_ddp_mbuf(int len /* XXX: must match A_ULP_RX_TDDP_PSZ */ static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6}; +static TAILQ_HEAD(, pageset) ddp_orphan_pagesets; +static struct mtx ddp_orphan_pagesets_lock; +static struct task ddp_orphan_task; + #define MAX_DDP_BUFFER_SIZE (M_TCB_RX_DDP_BUF0_LEN) static int alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr) @@ -112,33 +121,199 @@ pages_to_nppods(int npages, int ddp_pgsz return (howmany(nsegs, PPOD_PAGES)); } +/* + * A page set holds information about a buffer used for DDP. The page + * set holds resources such as the VM pages backing the buffer (either + * held or wired) and the page pods associated with the buffer. + * Recently used page sets are cached to allow for efficient reuse of + * buffers (avoiding the need to re-fault in pages, hold them, etc.). + * Note that cached page sets keep the backing pages wired. The + * number of wired pages is capped by only allowing for two wired + * pagesets per connection. This is not a perfect cap, but is a + * trade-off for performance. + * + * If an application ping-pongs two buffers for a connection via + * aio_read(2) then those buffers should remain wired and expensive VM + * fault lookups should be avoided after each buffer has been used + * once. If an application uses more than two buffers then this will + * fall back to doing expensive VM fault lookups for each operation. + */ +static void +free_pageset(struct tom_data *td, struct pageset *ps) +{ + vm_page_t p; + int i; + + if (ps->nppods > 0) + free_ppods(td, ps->ppod_addr, ps->nppods); + + if (ps->flags & PS_WIRED) { + for (i = 0; i < ps->npages; i++) { + p = ps->pages[i]; + vm_page_lock(p); + vm_page_unwire(p, PQ_INACTIVE); + vm_page_unlock(p); + } + } else + vm_page_unhold_pages(ps->pages, ps->npages); + mtx_lock(&ddp_orphan_pagesets_lock); + TAILQ_INSERT_TAIL(&ddp_orphan_pagesets, ps, link); + taskqueue_enqueue(taskqueue_thread, &ddp_orphan_task); + mtx_unlock(&ddp_orphan_pagesets_lock); +} + +static void +ddp_free_orphan_pagesets(void *context, int pending) +{ + struct pageset *ps; + + mtx_lock(&ddp_orphan_pagesets_lock); + while (!TAILQ_EMPTY(&ddp_orphan_pagesets)) { + ps = TAILQ_FIRST(&ddp_orphan_pagesets); + TAILQ_REMOVE(&ddp_orphan_pagesets, ps, link); + mtx_unlock(&ddp_orphan_pagesets_lock); + if (ps->vm) + vmspace_free(ps->vm); + free(ps, M_CXGBE); + mtx_lock(&ddp_orphan_pagesets_lock); + } + mtx_unlock(&ddp_orphan_pagesets_lock); +} + +static void +recycle_pageset(struct toepcb *toep, struct pageset *ps) +{ + + DDP_ASSERT_LOCKED(toep); + if (!(toep->ddp_flags & DDP_DEAD) && ps->flags & PS_WIRED) { + KASSERT(toep->ddp_cached_count + toep->ddp_active_count < + nitems(toep->db), ("too many wired pagesets")); + TAILQ_INSERT_HEAD(&toep->ddp_cached_pagesets, ps, link); + toep->ddp_cached_count++; + } else + free_pageset(toep->td, ps); +} + +static void +ddp_complete_one(struct kaiocb *job, int error) +{ + long copied; + + /* + * If this job had copied data out of the socket buffer before + * it was cancelled, report it as a short read rather than an + * error. + */ + copied = job->uaiocb._aiocb_private.status; + if (copied != 0 || error == 0) + aio_complete(job, copied, 0); + else + aio_complete(job, -1, error); +} + static void free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db) { - if (db == NULL) - return; + if (db->job) { + /* + * XXX: If we are un-offloading the socket then we + * should requeue these on the socket somehow. If we + * got a FIN from the remote end, then this completes + * any remaining requests with an EOF read. + */ + if (!aio_clear_cancel_function(db->job)) + ddp_complete_one(db->job, 0); + } + + if (db->ps) + free_pageset(td, db->ps); +} + +void +ddp_init_toep(struct toepcb *toep) +{ - if (db->pages) - free(db->pages, M_CXGBE); + TAILQ_INIT(&toep->ddp_aiojobq); + TASK_INIT(&toep->ddp_requeue_task, 0, aio_ddp_requeue_task, toep); + toep->ddp_active_id = -1; + mtx_init(&toep->ddp_lock, "t4 ddp", NULL, MTX_DEF); +} - if (db->nppods > 0) - free_ppods(td, db->ppod_addr, db->nppods); +void +ddp_uninit_toep(struct toepcb *toep) +{ - free(db, M_CXGBE); + mtx_destroy(&toep->ddp_lock); } void release_ddp_resources(struct toepcb *toep) { + struct pageset *ps; int i; + DDP_LOCK(toep); + toep->flags |= DDP_DEAD; for (i = 0; i < nitems(toep->db); i++) { - if (toep->db[i] != NULL) { - free_ddp_buffer(toep->td, toep->db[i]); - toep->db[i] = NULL; - } + free_ddp_buffer(toep->td, &toep->db[i]); + } + while ((ps = TAILQ_FIRST(&toep->ddp_cached_pagesets)) != NULL) { + TAILQ_REMOVE(&toep->ddp_cached_pagesets, ps, link); + free_pageset(toep->td, ps); + } + ddp_complete_all(toep, 0); + DDP_UNLOCK(toep); +} + +#ifdef INVARIANTS +void +ddp_assert_empty(struct toepcb *toep) +{ + int i; + + MPASS(!(toep->ddp_flags & DDP_TASK_ACTIVE)); + for (i = 0; i < nitems(toep->db); i++) { + MPASS(toep->db[i].job == NULL); + MPASS(toep->db[i].ps == NULL); } + MPASS(TAILQ_EMPTY(&toep->ddp_cached_pagesets)); + MPASS(TAILQ_EMPTY(&toep->ddp_aiojobq)); +} +#endif + +static void +complete_ddp_buffer(struct toepcb *toep, struct ddp_buffer *db, + unsigned int db_idx) +{ + unsigned int db_flag; + + toep->ddp_active_count--; + if (toep->ddp_active_id == db_idx) { + if (toep->ddp_active_count == 0) { + KASSERT(toep->db[db_idx ^ 1].job == NULL, + ("%s: active_count mismatch", __func__)); + toep->ddp_active_id = -1; + } else + toep->ddp_active_id ^= 1; + CTR2(KTR_CXGBE, "%s: ddp_active_id = %d", __func__, + toep->ddp_active_id); + } else { + KASSERT(toep->ddp_active_count != 0 && + toep->ddp_active_id != -1, + ("%s: active count mismatch", __func__)); + } + + db->cancel_pending = 0; + db->job = NULL; + recycle_pageset(toep, db->ps); + db->ps = NULL; + + db_flag = db_idx == 1 ? DDP_BUF1_ACTIVE : DDP_BUF0_ACTIVE; + KASSERT(toep->ddp_flags & db_flag, + ("%s: DDP buffer not active. toep %p, ddp_flags 0x%x", + __func__, toep, toep->ddp_flags)); + toep->ddp_flags &= ~db_flag; } /* XXX: handle_ddp_data code duplication */ @@ -147,28 +322,59 @@ insert_ddp_data(struct toepcb *toep, uin { struct inpcb *inp = toep->inp; struct tcpcb *tp = intotcpcb(inp); - struct sockbuf *sb = &inp->inp_socket->so_rcv; - struct mbuf *m; + struct ddp_buffer *db; + struct kaiocb *job; + size_t placed; + long copied; + unsigned int db_flag, db_idx; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK_ASSERT(sb); + DDP_ASSERT_LOCKED(toep); - m = get_ddp_mbuf(n); tp->rcv_nxt += n; #ifndef USE_DDP_RX_FLOW_CONTROL KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); tp->rcv_wnd -= n; #endif - - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); -#ifdef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ +#ifndef USE_DDP_RX_FLOW_CONTROL + toep->rx_credits += n; #endif - sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); + CTR2(KTR_CXGBE, "%s: placed %u bytes before falling out of DDP", + __func__, n); + while (toep->ddp_active_count > 0) { + MPASS(toep->ddp_active_id != -1); + db_idx = toep->ddp_active_id; + db_flag = db_idx == 1 ? DDP_BUF1_ACTIVE : DDP_BUF0_ACTIVE; + MPASS((toep->ddp_flags & db_flag) != 0); + db = &toep->db[db_idx]; + job = db->job; + copied = job->uaiocb._aiocb_private.status; + placed = n; + if (placed > job->uaiocb.aio_nbytes - copied) + placed = job->uaiocb.aio_nbytes - copied; + if (!aio_clear_cancel_function(job)) { + /* + * Update the copied length for when + * t4_aio_cancel_active() completes this + * request. + */ + job->uaiocb._aiocb_private.status += placed; + } else if (copied + placed != 0) { + CTR4(KTR_CXGBE, + "%s: completing %p (copied %ld, placed %lu)", + __func__, job, copied, placed); + /* XXX: This always completes if there is some data. */ + aio_complete(job, copied + placed, 0); + } else if (aio_set_cancel_function(job, t4_aio_cancel_queued)) { + TAILQ_INSERT_HEAD(&toep->ddp_aiojobq, job, list); + toep->ddp_waiting_count++; + } else + aio_cancel(job); + n -= placed; + complete_ddp_buffer(toep, db, db_idx); + } + + MPASS(n == 0); } /* SET_TCB_FIELD sent as a ULP command looks like this */ @@ -236,42 +442,10 @@ mk_rx_data_ack_ulp(struct ulp_txpkt *ulp return (ulpsc); } -static inline uint64_t -select_ddp_flags(struct socket *so, int flags, int db_idx) -{ - uint64_t ddp_flags = V_TF_DDP_INDICATE_OUT(0); - int waitall = flags & MSG_WAITALL; - int nb = so->so_state & SS_NBIO || flags & (MSG_DONTWAIT | MSG_NBIO); - - KASSERT(db_idx == 0 || db_idx == 1, - ("%s: bad DDP buffer index %d", __func__, db_idx)); - - if (db_idx == 0) { - ddp_flags |= V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_ACTIVE_BUF(0); - if (waitall) - ddp_flags |= V_TF_DDP_PUSH_DISABLE_0(1); - else if (nb) - ddp_flags |= V_TF_DDP_BUF0_FLUSH(1); - else - ddp_flags |= V_TF_DDP_BUF0_FLUSH(0); - } else { - ddp_flags |= V_TF_DDP_BUF1_VALID(1) | V_TF_DDP_ACTIVE_BUF(1); - if (waitall) - ddp_flags |= V_TF_DDP_PUSH_DISABLE_1(1); - else if (nb) - ddp_flags |= V_TF_DDP_BUF1_FLUSH(1); - else - ddp_flags |= V_TF_DDP_BUF1_FLUSH(0); - } - - return (ddp_flags); -} - static struct wrqe * mk_update_tcb_for_ddp(struct adapter *sc, struct toepcb *toep, int db_idx, - int offset, uint64_t ddp_flags) + struct pageset *ps, int offset, uint64_t ddp_flags, uint64_t ddp_flags_mask) { - struct ddp_buffer *db = toep->db[db_idx]; struct wrqe *wr; struct work_request_hdr *wrh; struct ulp_txpkt *ulpmc; @@ -302,7 +476,7 @@ mk_update_tcb_for_ddp(struct adapter *sc ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_BUF0_TAG + db_idx, V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG), - V_TCB_RX_DDP_BUF0_TAG(db->tag)); + V_TCB_RX_DDP_BUF0_TAG(ps->tag)); /* Update the current offset in the DDP buffer and its total length */ if (db_idx == 0) @@ -311,21 +485,18 @@ mk_update_tcb_for_ddp(struct adapter *sc V_TCB_RX_DDP_BUF0_OFFSET(M_TCB_RX_DDP_BUF0_OFFSET) | V_TCB_RX_DDP_BUF0_LEN(M_TCB_RX_DDP_BUF0_LEN), V_TCB_RX_DDP_BUF0_OFFSET(offset) | - V_TCB_RX_DDP_BUF0_LEN(db->len)); + V_TCB_RX_DDP_BUF0_LEN(ps->len)); else ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_BUF1_OFFSET, V_TCB_RX_DDP_BUF1_OFFSET(M_TCB_RX_DDP_BUF1_OFFSET) | V_TCB_RX_DDP_BUF1_LEN((u64)M_TCB_RX_DDP_BUF1_LEN << 32), V_TCB_RX_DDP_BUF1_OFFSET(offset) | - V_TCB_RX_DDP_BUF1_LEN((u64)db->len << 32)); + V_TCB_RX_DDP_BUF1_LEN((u64)ps->len << 32)); /* Update DDP flags */ ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_FLAGS, - V_TF_DDP_BUF0_FLUSH(1) | V_TF_DDP_BUF1_FLUSH(1) | - V_TF_DDP_PUSH_DISABLE_0(1) | V_TF_DDP_PUSH_DISABLE_1(1) | - V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_BUF1_VALID(1) | - V_TF_DDP_ACTIVE_BUF(1) | V_TF_DDP_INDICATE_OUT(1), ddp_flags); + ddp_flags_mask, ddp_flags); /* Gratuitous RX_DATA_ACK with RX_MODULATE set to speed up delivery. */ ulpmc = mk_rx_data_ack_ulp(ulpmc, toep); @@ -333,30 +504,20 @@ mk_update_tcb_for_ddp(struct adapter *sc return (wr); } -static void -discourage_ddp(struct toepcb *toep) -{ - - if (toep->ddp_score && --toep->ddp_score == 0) { - toep->ddp_flags &= ~DDP_OK; - toep->ddp_disabled = time_uptime; - CTR3(KTR_CXGBE, "%s: tid %u !DDP_OK @ %u", - __func__, toep->tid, time_uptime); - } -} - static int handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) { uint32_t report = be32toh(ddp_report); - unsigned int db_flag; + unsigned int db_idx; struct inpcb *inp = toep->inp; + struct ddp_buffer *db; struct tcpcb *tp; struct socket *so; struct sockbuf *sb; - struct mbuf *m; + struct kaiocb *job; + long copied; - db_flag = report & F_DDP_BUF_IDX ? DDP_BUF1_ACTIVE : DDP_BUF0_ACTIVE; + db_idx = report & F_DDP_BUF_IDX ? 1 : 0; if (__predict_false(!(report & F_DDP_INV))) CXGBE_UNIMPLEMENTED("DDP buffer still valid"); @@ -364,19 +525,24 @@ handle_ddp_data(struct toepcb *toep, __b INP_WLOCK(inp); so = inp_inpcbtosocket(inp); sb = &so->so_rcv; - if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT))) { + DDP_LOCK(toep); + KASSERT(toep->ddp_active_id == db_idx, + ("completed DDP buffer (%d) != active_id (%d) for tid %d", db_idx, + toep->ddp_active_id, toep->tid)); + db = &toep->db[db_idx]; + job = db->job; + + if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT))) { /* - * XXX: think a bit more. - * tcpcb probably gone, but socket should still be around - * because we always wait for DDP completion in soreceive no - * matter what. Just wake it up and let it clean up. + * This can happen due to an administrative tcpdrop(8). + * Just fail the request with ECONNRESET. */ - CTR5(KTR_CXGBE, "%s: tid %u, seq 0x%x, len %d, inp_flags 0x%x", __func__, toep->tid, be32toh(rcv_nxt), len, inp->inp_flags); - SOCKBUF_LOCK(sb); - goto wakeup; + if (aio_clear_cancel_function(job)) + ddp_complete_one(job, ECONNRESET); + goto completed; } tp = intotcpcb(inp); @@ -386,7 +552,7 @@ handle_ddp_data(struct toepcb *toep, __b * sequence number of the next byte to receive. The length of * the data received for this message must be computed by * comparing the new and old values of rcv_nxt. - * + * * For RX_DATA_DDP, len might be non-zero, but it is only the * length of the most recent DMA. It does not include the * total length of the data received since the previous update @@ -400,15 +566,14 @@ handle_ddp_data(struct toepcb *toep, __b KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); tp->rcv_wnd -= len; #endif - m = get_ddp_mbuf(len); - - SOCKBUF_LOCK(sb); - if (report & F_DDP_BUF_COMPLETE) - toep->ddp_score = DDP_HIGH_SCORE; - else - discourage_ddp(toep); +#ifdef VERBOSE_TRACES + CTR4(KTR_CXGBE, "%s: DDP[%d] placed %d bytes (%#x)", __func__, db_idx, + len, report); +#endif /* receive buffer autosize */ + CURVNET_SET(so->so_vnet); + SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -422,57 +587,185 @@ handle_ddp_data(struct toepcb *toep, __b else toep->rx_credits += newsize - hiwat; } + SOCKBUF_UNLOCK(sb); + CURVNET_RESTORE(); - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); -#ifdef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ +#ifndef USE_DDP_RX_FLOW_CONTROL + toep->rx_credits += len; #endif - sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); -wakeup: - KASSERT(toep->ddp_flags & db_flag, - ("%s: DDP buffer not active. toep %p, ddp_flags 0x%x, report 0x%x", - __func__, toep, toep->ddp_flags, report)); - toep->ddp_flags &= ~db_flag; - sorwakeup_locked(so); - SOCKBUF_UNLOCK_ASSERT(sb); + if (db->cancel_pending) { + /* + * Update the job's length but defer completion to the + * TCB_RPL callback. + */ + job->uaiocb._aiocb_private.status += len; + goto out; + } else if (!aio_clear_cancel_function(job)) { + /* + * Update the copied length for when + * t4_aio_cancel_active() completes this request. + */ + job->uaiocb._aiocb_private.status += len; + } else { + copied = job->uaiocb._aiocb_private.status; +#ifdef VERBOSE_TRACES + CTR4(KTR_CXGBE, "%s: completing %p (copied %ld, placed %d)", + __func__, job, copied, len); +#endif + aio_complete(job, copied + len, 0); + t4_rcvd(&toep->td->tod, tp); + } + +completed: + complete_ddp_buffer(toep, db, db_idx); + if (toep->ddp_waiting_count > 0) + ddp_queue_toep(toep); +out: + DDP_UNLOCK(toep); INP_WUNLOCK(inp); + return (0); } void -handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, struct sockbuf *sb, - __be32 rcv_nxt) +handle_ddp_indicate(struct toepcb *toep) { - struct mbuf *m; - int len; - SOCKBUF_LOCK_ASSERT(sb); + DDP_ASSERT_LOCKED(toep); + MPASS(toep->ddp_active_count == 0); + MPASS((toep->ddp_flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE)) == 0); + if (toep->ddp_waiting_count == 0) { + /* + * The pending requests that triggered the request for an + * an indicate were cancelled. Those cancels should have + * already disabled DDP. Just ignore this as the data is + * going into the socket buffer anyway. + */ + return; + } + CTR3(KTR_CXGBE, "%s: tid %d indicated (%d waiting)", __func__, + toep->tid, toep->ddp_waiting_count); + ddp_queue_toep(toep); +} + +enum { + DDP_BUF0_INVALIDATED = 0x2, + DDP_BUF1_INVALIDATED +}; + +void +handle_ddp_tcb_rpl(struct toepcb *toep, const struct cpl_set_tcb_rpl *cpl) +{ + unsigned int db_idx; + struct inpcb *inp = toep->inp; + struct ddp_buffer *db; + struct kaiocb *job; + long copied; + + if (cpl->status != CPL_ERR_NONE) + panic("XXX: tcp_rpl failed: %d", cpl->status); + + switch (cpl->cookie) { + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF0_INVALIDATED): + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF1_INVALIDATED): + /* + * XXX: This duplicates a lot of code with handle_ddp_data(). + */ + db_idx = G_COOKIE(cpl->cookie) - DDP_BUF0_INVALIDATED; + INP_WLOCK(inp); + DDP_LOCK(toep); + db = &toep->db[db_idx]; + + /* + * handle_ddp_data() should leave the job around until + * this callback runs once a cancel is pending. + */ + MPASS(db != NULL); + MPASS(db->job != NULL); + MPASS(db->cancel_pending); + + /* + * XXX: It's not clear what happens if there is data + * placed when the buffer is invalidated. I suspect we + * need to read the TCB to see how much data was placed. + * + * For now this just pretends like nothing was placed. + * + * XXX: Note that if we did check the PCB we would need to + * also take care of updating the tp, etc. + */ + job = db->job; + copied = job->uaiocb._aiocb_private.status; + if (copied == 0) { + CTR2(KTR_CXGBE, "%s: cancelling %p", __func__, job); + aio_cancel(job); + } else { + CTR3(KTR_CXGBE, "%s: completing %p (copied %ld)", + __func__, job, copied); + aio_complete(job, copied, 0); + t4_rcvd(&toep->td->tod, intotcpcb(inp)); + } + + complete_ddp_buffer(toep, db, db_idx); + if (toep->ddp_waiting_count > 0) + ddp_queue_toep(toep); + DDP_UNLOCK(toep); + INP_WUNLOCK(inp); + break; + default: + panic("XXX: unknown tcb_rpl offset %#x, cookie %#x", + G_WORD(cpl->cookie), G_COOKIE(cpl->cookie)); + } +} + +void +handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) +{ + struct ddp_buffer *db; + struct kaiocb *job; + long copied; + unsigned int db_flag, db_idx; + int len, placed; + INP_WLOCK_ASSERT(toep->inp); + DDP_ASSERT_LOCKED(toep); len = be32toh(rcv_nxt) - tp->rcv_nxt; - /* Signal handle_ddp() to break out of its sleep loop. */ - toep->ddp_flags &= ~(DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE); - if (len == 0) - return; - tp->rcv_nxt += len; - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); -#ifdef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ +#ifndef USE_DDP_RX_FLOW_CONTROL + toep->rx_credits += len; #endif - m = get_ddp_mbuf(len); + while (toep->ddp_active_count > 0) { + MPASS(toep->ddp_active_id != -1); + db_idx = toep->ddp_active_id; + db_flag = db_idx == 1 ? DDP_BUF1_ACTIVE : DDP_BUF0_ACTIVE; + MPASS((toep->ddp_flags & db_flag) != 0); + db = &toep->db[db_idx]; + job = db->job; + copied = job->uaiocb._aiocb_private.status; + placed = len; + if (placed > job->uaiocb.aio_nbytes - copied) + placed = job->uaiocb.aio_nbytes - copied; + if (!aio_clear_cancel_function(job)) { + /* + * Update the copied length for when + * t4_aio_cancel_active() completes this + * request. + */ + job->uaiocb._aiocb_private.status += placed; + } else { + CTR4(KTR_CXGBE, "%s: tid %d completed buf %d len %d", + __func__, toep->tid, db_idx, placed); + aio_complete(job, copied + placed, 0); + } + len -= placed; + complete_ddp_buffer(toep, db, db_idx); + } - sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); + MPASS(len == 0); + ddp_complete_all(toep, 0); } #define DDP_ERR (F_DDP_PPOD_MISMATCH | F_DDP_LLIMIT_ERR | F_DDP_ULIMIT_ERR |\ @@ -529,7 +822,7 @@ do_rx_ddp_complete(struct sge_iq *iq, co return (0); } -void +static void enable_ddp(struct adapter *sc, struct toepcb *toep) { @@ -540,6 +833,7 @@ enable_ddp(struct adapter *sc, struct to CTR3(KTR_CXGBE, "%s: tid %u (time %u)", __func__, toep->tid, time_uptime); + DDP_ASSERT_LOCKED(toep); toep->ddp_flags |= DDP_SC_REQ; t4_set_tcb_field(sc, toep, 1, W_TCB_RX_DDP_FLAGS, V_TF_DDP_OFF(1) | V_TF_DDP_INDICATE_OUT(1) | @@ -550,81 +844,6 @@ enable_ddp(struct adapter *sc, struct to V_TF_RCV_COALESCE_ENABLE(1), 0); } -static inline void -disable_ddp(struct adapter *sc, struct toepcb *toep) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 7 01:15:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D5F2B2EC48; Sat, 7 May 2016 01:15:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 E229C19BD; Sat, 7 May 2016 01:15:43 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id EA2C1B97D; Fri, 6 May 2016 21:15:42 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Date: Fri, 06 May 2016 17:52:15 -0700 Message-ID: <3138889.ZBJ52FyIMB@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605070033.u470XZCs075568@repo.freebsd.org> References: <201605070033.u470XZCs075568@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 06 May 2016 21:15:43 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 01:15:44 -0000 On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > Author: jhb > Date: Sat May 7 00:33:35 2016 > New Revision: 299210 > URL: https://svnweb.freebsd.org/changeset/base/299210 > > Log: > Use DDP to implement zerocopy TCP receive with aio_read(). > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > into wired user buffers. This feature is known as Direct-Data Placement. > However, to scale well the adapter needs to prepare buffers for DDP > before data arrives. aio_read() is more amenable to this requirement than > read() as applications often call read() only after data is available in > the socket buffer. > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > protocol hook to claim aio_read(2) requests instead of letting them use > the default AIO socket logic. The DDP feature supports scheduling DMA > to two buffers at a time so that the second buffer is ready for use > after the first buffer is filled. The aio/DDP code optimizes the case > of an application ping-ponging between two buffers (similar to the > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > wired. If a buffer is reused, the aio/DDP code is able to reuse the > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > Chelsio NIC uses to describe user buffers). The generation of the > vmspace of the calling process is used in conjunction with the user > buffer's address and length to determine if a user buffer matches a > previously used buffer. If an application queues a buffer for AIO that > does not match a previously used buffer then the least recently used > buffer is unwired before the new buffer is wired. This ensures that no > more than two user buffers per socket are ever wired. > > Note that this feature is best suited to applications sending a steady > stream of data vs short bursts of traffic. > > Discussed with: np > Relnotes: yes > Sponsored by: Chelsio Communications The primary tool I used for evaluating performance was netperf's TCP stream test. It is a best case for this (constant stream of traffic), but that is also the intended use case for this feature. Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream used about about two full CPUs (~190% CPU usage) on a single-package Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the usage down to about 110% CPU. With DDP, the usage is around 30% of a single CPU. With two 1MB buffers the the stock and TOE numbers are about the same, but the DDP usage is about 5% of single CPU. Note that these numbers are with aio_read(). read() fares a bit better (180% for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() with two buffers in a ping-pong used twice as much CPU as bare read(), but aio_read() in general is now fairly comparable to read() at least in terms of CPU overhead. -- John Baldwin From owner-svn-src-all@freebsd.org Sat May 7 01:44:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F40DB2F42C; Sat, 7 May 2016 01:44:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2DB1447; Sat, 7 May 2016 01:44:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u471iMi2096966; Sat, 7 May 2016 01:44:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u471iMDi096965; Sat, 7 May 2016 01:44:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605070144.u471iMDi096965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 7 May 2016 01:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299211 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 01:44:23 -0000 Author: pfg Date: Sat May 7 01:44:22 2016 New Revision: 299211 URL: https://svnweb.freebsd.org/changeset/base/299211 Log: sed: rewrite the main loop. Rewrite the main loop of the "sed s/..." command, shortening it by ten lines and simplifying it by removing the switch statement implementing /g, /1, and /2 separately and repetitively. This will be needed to bring a fix from OpenBSD later. Obtained from: OpenBSD (schwarze CVS Rev. 1.18) MFC after: 3 weeks Modified: head/usr.bin/sed/process.c Modified: head/usr.bin/sed/process.c ============================================================================== --- head/usr.bin/sed/process.c Sat May 7 00:33:35 2016 (r299210) +++ head/usr.bin/sed/process.c Sat May 7 01:44:22 2016 (r299211) @@ -379,7 +379,7 @@ substitute(struct s_command *cp) { SPACE tspace; regex_t *re; - regoff_t re_off, slen; + regoff_t slen; int lastempty, n; char *s; @@ -400,61 +400,55 @@ substitute(struct s_command *cp) n = cp->u.s->n; lastempty = 1; - switch (n) { - case 0: /* Global */ - do { - if (lastempty || match[0].rm_so != match[0].rm_eo) { - /* Locate start of replaced string. */ - re_off = match[0].rm_so; - /* Copy leading retained string. */ - cspace(&SS, s, re_off, APPEND); - /* Add in regular expression. */ + do { + /* Copy the leading retained string. */ + if (n <= 1 && match[0].rm_so) + cspace(&SS, s, match[0].rm_so, APPEND); + + /* Skip zero-length matches right after other matches. */ + if (lastempty || match[0].rm_so || + match[0].rm_so != match[0].rm_eo) { + if (n <= 1) { + /* Want this match: append replacement. */ regsub(&SS, s, cp->u.s->new); - } - - /* Move past this match. */ - if (match[0].rm_so != match[0].rm_eo) { - s += match[0].rm_eo; - slen -= match[0].rm_eo; - lastempty = 0; + if (n == 1) + n = -1; } else { - if (match[0].rm_so < slen) - cspace(&SS, s + match[0].rm_so, 1, - APPEND); - s += match[0].rm_so + 1; - slen -= match[0].rm_so + 1; - lastempty = 1; + /* Want a later match: append original. */ + if (match[0].rm_eo) + cspace(&SS, s, match[0].rm_eo, APPEND); + n--; } - } while (slen >= 0 && regexec_e(re, s, REG_NOTBOL, 0, slen)); - /* Copy trailing retained string. */ - if (slen > 0) - cspace(&SS, s, slen, APPEND); - break; - default: /* Nth occurrence */ - while (--n) { - if (match[0].rm_eo == match[0].rm_so) - match[0].rm_eo = match[0].rm_so + 1; - s += match[0].rm_eo; - slen -= match[0].rm_eo; - if (slen < 0) - return (0); - if (!regexec_e(re, s, REG_NOTBOL, 0, slen)) - return (0); } - /* FALLTHROUGH */ - case 1: /* 1st occurrence */ - /* Locate start of replaced string. */ - re_off = match[0].rm_so + (s - ps); - /* Copy leading retained string. */ - cspace(&SS, ps, re_off, APPEND); - /* Add in regular expression. */ - regsub(&SS, s, cp->u.s->new); - /* Copy trailing retained string. */ + + /* Move past this match. */ s += match[0].rm_eo; slen -= match[0].rm_eo; + + /* + * After a zero-length match, advance one byte, + * and at the end of the line, terminate. + */ + if (match[0].rm_so == match[0].rm_eo) { + if (*s == '\0' || *s == '\n') + slen = -1; + else + slen--; + if (*s != '\0') + cspace(&SS, s++, 1, APPEND); + lastempty = 1; + } else + lastempty = 0; + + } while (n >= 0 && slen >= 0 && regexec_e(re, s, REG_NOTBOL, 0, slen)); + + /* Did not find the requested number of matches. */ + if (n > 1) + return (0); + + /* Copy the trailing retained string. */ + if (slen > 0) cspace(&SS, s, slen, APPEND); - break; - } /* * Swap the substitute space and the pattern space, and make sure From owner-svn-src-all@freebsd.org Sat May 7 02:28:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FBE9B2E11F for ; Sat, 7 May 2016 02:28:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm21.bullet.mail.bf1.yahoo.com (nm21.bullet.mail.bf1.yahoo.com [98.139.212.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4A716CD for ; Sat, 7 May 2016 02:28:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462586421; bh=Rd1vObGXpEjXNA+VHkR0BiRo9DVDBBRBHwrUYNMfGtY=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=NKcjMaRwt2UzGmiAo9VyY8VQFfVUTnkDYCD1Dqo3v3P8EnplK34RXoozPKSSA4k/oMu4s3Ps3BloH793mTwFb1if1KtE/3tZIdJ9flf0GeQr0M61AanDiL8+beuWWvh01KFeGTDJk99/RAQZ5rB2QwSN+/S24Xbw1Hl6psXQMsNStPSut/6KTfI6enSuYF9NjY07mj7VQaJsEDb9ULWe0UmCFmdxU3sb+1SqqVoV6394CZAo1mGOIfx2Dk9yt7WdpjIV2C9Puahib/QAQK81PNStxzfpbADDMa22++h9bY30r88DTu6cpaWyPu1QMS4S8oS2lVjRTPh/H3rWunCRJg== Received: from [66.196.81.174] by nm21.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 Received: from [98.139.211.194] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 X-Yahoo-Newman-Id: 268771.56365.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: wBZtvPMVM1m0NiQ1tPG8CXFLLjBcpSXJVE6iAMrHWxq7Wai zk7xvtZgPvMPvu7_RYOctA8ANuZX8wMZ9TyxM0Z3ctMmqid1I9YAS4IRJtMi kKaGxkdkL62B83xUcObrOH04MR_7d_Ov23bON5npkXxRclfqWcZXnWzXwhLx QTo1UA5ryZ_07Rd22YlCMmKx_VW_DvG6.NT1LTF7w1QDD1T9Fve9UoTd7e.F K5NRbJ_VC3bL_cMwkY4_MHZLv0IpqLo2y80BxW5EOMuLNowBAqfZFBk5HN.x fiHQFqPzAr89XciWyKnADMwXES1Xa1v9sy0iB3kQnB6_1PfyeGNSad4PDlvA 7_FHEdWyxsWkfnJUmOo_y1zg0zSELaTiAJLBmmoIp1PCtc1rtVf5ZgTpu1aN OSNOTUA2Y3F639NM7aw6debmUfiit98LnOFTiP.pKiH5uIfX9Uc8OkJvZT2P Xu7PKXLZydeo5D6ftP6P4TD._K7w3PcmsVjmk6VQxnKac8h10By5_OBu.phz DGYSorw9skkp.JbN9NFV4PKd9GhM4ssom X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r299211 - head/usr.bin/sed To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605070144.u471iMDi096965@repo.freebsd.org> From: Pedro Giffuni Message-ID: <6501f64e-145e-f515-8cd5-d7eca139195d@FreeBSD.org> Date: Fri, 6 May 2016 21:00:31 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605070144.u471iMDi096965@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 02:28:41 -0000 On 05/06/16 20:44, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat May 7 01:44:22 2016 > New Revision: 299211 > URL: https://svnweb.freebsd.org/changeset/base/299211 > > Log: > sed: rewrite the main loop. > > Rewrite the main loop of the "sed s/..." command, shortening it by ten > lines and simplifying it by removing the switch statement implementing > /g, /1, and /2 separately and repetitively. > > This will be needed to bring a fix from OpenBSD later. > For the curious, from PR 209352. $ echo a,a,a,a,a | sed -r 's/\<.,/X&/g' Xa,a,Xa,a,a $ echo a,a,a,a,a | gsed -r 's/\<.,/X&/g' Xa,Xa,Xa,Xa,a Cheers, Pedro. From owner-svn-src-all@freebsd.org Sat May 7 03:32:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E6E3B2EFEC; Sat, 7 May 2016 03:32:31 +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 C807C1304; Sat, 7 May 2016 03:32:30 +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 u473WTcN032124; Sat, 7 May 2016 03:32:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u473WTdd032123; Sat, 7 May 2016 03:32:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605070332.u473WTdd032123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 7 May 2016 03:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299212 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 03:32:31 -0000 Author: markj Date: Sat May 7 03:32:29 2016 New Revision: 299212 URL: https://svnweb.freebsd.org/changeset/base/299212 Log: Remove two useless local variables from prelist_update(). MFC after: 1 week Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sat May 7 01:44:22 2016 (r299211) +++ head/sys/netinet6/nd6_rtr.c Sat May 7 03:32:29 2016 (r299212) @@ -1081,7 +1081,6 @@ prelist_update(struct nd_prefixctl *new, struct ifnet *ifp = new->ndpr_ifp; struct nd_prefix *pr; int error = 0; - int newprefix = 0; int auth; struct in6_addrlifetime lt6_tmp; char ip6buf[INET6_ADDRSTRLEN]; @@ -1139,23 +1138,19 @@ prelist_update(struct nd_prefixctl *new, if (dr && pfxrtr_lookup(pr, dr) == NULL) pfxrtr_add(pr, dr); } else { - struct nd_prefix *newpr = NULL; - - newprefix = 1; - if (new->ndpr_vltime == 0) goto end; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) goto end; - error = nd6_prelist_add(new, dr, &newpr); - if (error != 0 || newpr == NULL) { + error = nd6_prelist_add(new, dr, &pr); + if (error != 0 || pr == NULL) { nd6log((LOG_NOTICE, "prelist_update: " "nd6_prelist_add failed for %s/%d on %s " "errno=%d, returnpr=%p\n", ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), new->ndpr_plen, if_name(new->ndpr_ifp), - error, newpr)); + error, pr)); goto end; /* we should just give up in this case. */ } @@ -1166,13 +1161,11 @@ prelist_update(struct nd_prefixctl *new, * addresses. Thus, we explicitly make sure that the prefix * itself expires now. */ - if (newpr->ndpr_raf_onlink == 0) { - newpr->ndpr_vltime = 0; - newpr->ndpr_pltime = 0; - in6_init_prefix_ltimes(newpr); + if (pr->ndpr_raf_onlink == 0) { + pr->ndpr_vltime = 0; + pr->ndpr_pltime = 0; + in6_init_prefix_ltimes(pr); } - - pr = newpr; } /* From owner-svn-src-all@freebsd.org Sat May 7 03:41:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B4EB2F13D; Sat, 7 May 2016 03:41:30 +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 502F41704; Sat, 7 May 2016 03:41:30 +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 u473fTaN032463; Sat, 7 May 2016 03:41:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u473fTD8032461; Sat, 7 May 2016 03:41:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605070341.u473fTD8032461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 7 May 2016 03:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299213 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 03:41:30 -0000 Author: markj Date: Sat May 7 03:41:29 2016 New Revision: 299213 URL: https://svnweb.freebsd.org/changeset/base/299213 Log: Clean up callers of nd6_prelist_add(). nd6_prelist_add() sets *newp if and only if it is successful, so there's no need for code that handles the case where the return value is 0 and *newp == NULL. Fix some style bugs in nd6_prelist_add() while here. MFC after: 1 week Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat May 7 03:32:29 2016 (r299212) +++ head/sys/netinet6/in6.c Sat May 7 03:41:29 2016 (r299213) @@ -669,14 +669,6 @@ in6_control(struct socket *so, u_long cm (*carp_detach_p)(&ia->ia_ifa); goto out; } - if (pr == NULL) { - if (carp_attached) - (*carp_detach_p)(&ia->ia_ifa); - log(LOG_ERR, "nd6_prelist_add succeeded but " - "no prefix\n"); - error = EINVAL; - goto out; - } } /* relate the address to the prefix */ Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sat May 7 03:32:29 2016 (r299212) +++ head/sys/netinet6/nd6_rtr.c Sat May 7 03:41:29 2016 (r299213) @@ -993,11 +993,9 @@ nd6_prelist_add(struct nd_prefixctl *pr, new->ndpr_flags = pr->ndpr_flags; if ((error = in6_init_prefix_ltimes(new)) != 0) { free(new, M_IP6NDP); - return(error); + return (error); } new->ndpr_lastupdate = time_uptime; - if (newp != NULL) - *newp = new; /* initialization */ LIST_INIT(&new->ndpr_advrtrs); @@ -1021,10 +1019,11 @@ nd6_prelist_add(struct nd_prefixctl *pr, } } - if (dr) + if (dr != NULL) pfxrtr_add(new, dr); - - return 0; + if (newp != NULL) + *newp = new; + return (0); } void @@ -1144,13 +1143,11 @@ prelist_update(struct nd_prefixctl *new, goto end; error = nd6_prelist_add(new, dr, &pr); - if (error != 0 || pr == NULL) { + if (error != 0) { nd6log((LOG_NOTICE, "prelist_update: " - "nd6_prelist_add failed for %s/%d on %s " - "errno=%d, returnpr=%p\n", + "nd6_prelist_add failed for %s/%d on %s errno=%d\n", ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), - new->ndpr_plen, if_name(new->ndpr_ifp), - error, pr)); + new->ndpr_plen, if_name(new->ndpr_ifp), error)); goto end; /* we should just give up in this case. */ } From owner-svn-src-all@freebsd.org Sat May 7 08:26:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D2C9B31E81; Sat, 7 May 2016 08:26:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 039691059; Sat, 7 May 2016 08:26:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u478Q6dU019972; Sat, 7 May 2016 08:26:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u478Q5hN019966; Sat, 7 May 2016 08:26:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605070826.u478Q5hN019966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 08:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299214 - in stable/9/sys: compat/svr4 dev/streams modules/streams modules/svr4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 08:26:07 -0000 Author: dchagin Date: Sat May 7 08:26:05 2016 New Revision: 299214 URL: https://svnweb.freebsd.org/changeset/base/299214 Log: MFC r298519: Fix streams and svr4 module dependency. Both modules are complaining about undefined symbol svr4_delete_socket which was moved from streams to the svr4 module in r160558 that created a two-way dependency between them. MFC r298520: Allow to build svr4 module with SYSV support separatelly from the kernel build. PR: 208464 Reported by: Kristoffer Eriksson Modified: stable/9/sys/compat/svr4/svr4_ipc.c stable/9/sys/compat/svr4/svr4_socket.c stable/9/sys/compat/svr4/svr4_sysvec.c stable/9/sys/dev/streams/streams.c stable/9/sys/modules/streams/Makefile stable/9/sys/modules/svr4/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/svr4/ (props changed) Modified: stable/9/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_ipc.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_ipc.c Sat May 7 08:26:05 2016 (r299214) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, @@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const s static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, @@ -112,9 +105,6 @@ static int svr4_msgsnd(struct thread *, static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, @@ -123,9 +113,6 @@ static int svr4_shmat(struct thread *, v static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif - -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(spp, bpp) @@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp) spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; @@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; @@ -421,7 +403,7 @@ svr4_msgrcv(td, v) return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; @@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(bds, sds) @@ -657,7 +635,7 @@ svr4_shmctl(td, v) default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); @@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap) } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); Modified: stable/9/sys/compat/svr4/svr4_socket.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_socket.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_socket.c Sat May 7 08:26:05 2016 (r299214) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ @@ -168,6 +169,19 @@ svr4_delete_socket(p, fp) mtx_unlock(&svr4_sockcache_lock); } +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; +} + void svr4_purge_sockcache(arg, p) void *arg; Modified: stable/9/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_sysvec.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:26:05 2016 (r299214) @@ -311,4 +311,4 @@ static moduledata_t svr4_elf_mod = { 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Modified: stable/9/sys/dev/streams/streams.c ============================================================================== --- stable/9/sys/dev/streams/streams.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/dev/streams/streams.c Sat May 7 08:26:05 2016 (r299214) @@ -175,6 +175,7 @@ static moduledata_t streams_mod = { }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() @@ -328,19 +329,6 @@ svr4_ptm_alloc(td) } -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} - static int svr4_soo_close(struct file *fp, struct thread *td) { Modified: stable/9/sys/modules/streams/Makefile ============================================================================== --- stable/9/sys/modules/streams/Makefile Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/modules/streams/Makefile Sat May 7 08:26:05 2016 (r299214) @@ -5,10 +5,6 @@ KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif Modified: stable/9/sys/modules/svr4/Makefile ============================================================================== --- stable/9/sys/modules/svr4/Makefile Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/modules/svr4/Makefile Sat May 7 08:26:05 2016 (r299214) @@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h From owner-svn-src-all@freebsd.org Sat May 7 08:30:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CB0B310AA; Sat, 7 May 2016 08:30:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20DBE134A; Sat, 7 May 2016 08:30:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u478UMAh020417; Sat, 7 May 2016 08:30:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u478ULX6020410; Sat, 7 May 2016 08:30:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605070830.u478ULX6020410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 08:30: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: r299215 - in stable/10/sys: compat/svr4 dev/streams modules/streams modules/svr4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 08:30:23 -0000 Author: dchagin Date: Sat May 7 08:30:21 2016 New Revision: 299215 URL: https://svnweb.freebsd.org/changeset/base/299215 Log: MFC r298519: Fix streams and svr4 module dependency. Both modules are complaining about undefined symbol svr4_delete_socket which was moved from streams to the svr4 module in r160558 that created a two-way dependency between them. MFC r298520: Allow to build svr4 module with SYSV support separatelly from the kernel build. PR: 208464 Reported by: Kristoffer Eriksson Modified: stable/10/sys/compat/svr4/svr4_ipc.c stable/10/sys/compat/svr4/svr4_socket.c stable/10/sys/compat/svr4/svr4_sysvec.c stable/10/sys/dev/streams/streams.c stable/10/sys/modules/streams/Makefile stable/10/sys/modules/svr4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_ipc.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_ipc.c Sat May 7 08:30:21 2016 (r299215) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, @@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const s static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, @@ -112,9 +105,6 @@ static int svr4_msgsnd(struct thread *, static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, @@ -123,9 +113,6 @@ static int svr4_shmat(struct thread *, v static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif - -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(spp, bpp) @@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp) spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; @@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; @@ -421,7 +403,7 @@ svr4_msgrcv(td, v) return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; @@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(bds, sds) @@ -657,7 +635,7 @@ svr4_shmctl(td, v) default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); @@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap) } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); Modified: stable/10/sys/compat/svr4/svr4_socket.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_socket.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_socket.c Sat May 7 08:30:21 2016 (r299215) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ @@ -168,6 +169,19 @@ svr4_delete_socket(p, fp) mtx_unlock(&svr4_sockcache_lock); } +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; +} + void svr4_purge_sockcache(arg, p) void *arg; Modified: stable/10/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:30:21 2016 (r299215) @@ -313,4 +313,4 @@ static moduledata_t svr4_elf_mod = { 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Modified: stable/10/sys/dev/streams/streams.c ============================================================================== --- stable/10/sys/dev/streams/streams.c Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/dev/streams/streams.c Sat May 7 08:30:21 2016 (r299215) @@ -176,6 +176,7 @@ static moduledata_t streams_mod = { }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() @@ -329,19 +330,6 @@ svr4_ptm_alloc(td) } -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} - static int svr4_soo_close(struct file *fp, struct thread *td) { Modified: stable/10/sys/modules/streams/Makefile ============================================================================== --- stable/10/sys/modules/streams/Makefile Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/modules/streams/Makefile Sat May 7 08:30:21 2016 (r299215) @@ -5,10 +5,6 @@ KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif Modified: stable/10/sys/modules/svr4/Makefile ============================================================================== --- stable/10/sys/modules/svr4/Makefile Sat May 7 08:26:05 2016 (r299214) +++ stable/10/sys/modules/svr4/Makefile Sat May 7 08:30:21 2016 (r299215) @@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h From owner-svn-src-all@freebsd.org Sat May 7 14:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7E65B319D3; Sat, 7 May 2016 14:09:24 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9C291015; Sat, 7 May 2016 14:09:24 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1az2XL-000B51-7i; Sat, 07 May 2016 16:44:51 +0300 Date: Sat, 7 May 2016 16:44:51 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Message-ID: <20160507134451.GA39874@zxy.spb.ru> References: <201605070033.u470XZCs075568@repo.freebsd.org> <3138889.ZBJ52FyIMB@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3138889.ZBJ52FyIMB@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 14:09:25 -0000 On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > Author: jhb > > Date: Sat May 7 00:33:35 2016 > > New Revision: 299210 > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > Log: > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > into wired user buffers. This feature is known as Direct-Data Placement. > > However, to scale well the adapter needs to prepare buffers for DDP > > before data arrives. aio_read() is more amenable to this requirement than > > read() as applications often call read() only after data is available in > > the socket buffer. > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > protocol hook to claim aio_read(2) requests instead of letting them use > > the default AIO socket logic. The DDP feature supports scheduling DMA > > to two buffers at a time so that the second buffer is ready for use > > after the first buffer is filled. The aio/DDP code optimizes the case > > of an application ping-ponging between two buffers (similar to the > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > Chelsio NIC uses to describe user buffers). The generation of the > > vmspace of the calling process is used in conjunction with the user > > buffer's address and length to determine if a user buffer matches a > > previously used buffer. If an application queues a buffer for AIO that > > does not match a previously used buffer then the least recently used > > buffer is unwired before the new buffer is wired. This ensures that no > > more than two user buffers per socket are ever wired. > > > > Note that this feature is best suited to applications sending a steady > > stream of data vs short bursts of traffic. > > > > Discussed with: np > > Relnotes: yes > > Sponsored by: Chelsio Communications > > The primary tool I used for evaluating performance was netperf's TCP stream > test. It is a best case for this (constant stream of traffic), but that is > also the intended use case for this feature. > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > used about about two full CPUs (~190% CPU usage) on a single-package > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > but the DDP usage is about 5% of single CPU. > > Note that these numbers are with aio_read(). read() fares a bit better (180% > for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() > with two buffers in a ping-pong used twice as much CPU as bare read(), but > aio_read() in general is now fairly comparable to read() at least in terms of > CPU overhead. Can be this impovement of nfsclient and etc? From owner-svn-src-all@freebsd.org Sat May 7 17:57:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441A6B32B19; Sat, 7 May 2016 17:57:06 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1478E1E75; Sat, 7 May 2016 17:57:06 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id r187so14854649pfr.2; Sat, 07 May 2016 10:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QXry2BuMmOOEyrKd6jI0asiTXdRO1jfwheak53m4t8E=; b=mHC/NwS3COAoWViWI7Y3oiGKLv9PfYJhACOVQ4szF+LyHMCjfPTUFSrggqjYR/sizd XH7Vr8szbwScOV+Byvwmmf79mOrFxSH3mcprgmX868QJr4bUVE694dFSgckdtJteBY9r rKuA2ifFDc36yovvWsXiGhr/q+GHxI5IE3XI7J7ZoQbluF1zTT4PvpWjLkBfrTOMRAmO VYL/J/ZGTyTlS/T2qg+BKMTC0uBLAayqZzeBxt956h2oBcbDJZQYxgo4HQII7hrLYdA7 aVK5M7PadZ3Q+21upJV4d4rdMhLFBGgRowopuGJGRSpxdFXZMOnxfiJWahTO6zjoDkDg at6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=QXry2BuMmOOEyrKd6jI0asiTXdRO1jfwheak53m4t8E=; b=bWAaV4iBCHJttpBjxKlv0HKyneXeIcYrJ6T7g/IUv7jFXgWKAF92zaelvw1AxJYJ0m YZhlnJLMO/rTxJCKhWDYI5hOAwARAm+XQ+4eZwa+K9qz1EfvNuRtcbB63SdAFXlyb2zr qLVKx1QVgu23rUsz/Bs5rKCY62IS3yfpWLtHTr836NRPSMnnxioZ9m7KynnxlRTrlWiT SN8mbQPQIKFYNJ0JmWtKy4KkAkOfA1A0rf/pXEtNCnkFqjEtj1R+yCUEHBzhC07rJlpi 6nGYFC3wNqSo3LOD+XapLD84okEZ64j0z0psg2GTZc6d4SUOX9EsrHCoG94N70f8vUqr eg9g== X-Gm-Message-State: AOPr4FWXYHeMF1Plf/7LlnDO7V1Oc6kfTn4VKLVG4nmpHsdgxiSqHxEMNhFQlaruYLSlbA== X-Received: by 10.98.49.134 with SMTP id x128mr37413619pfx.45.1462643825661; Sat, 07 May 2016 10:57:05 -0700 (PDT) Received: from ox ([2601:641:c000:e00:ecd5:8987:c6cf:c947]) by smtp.gmail.com with ESMTPSA id d13sm29508067pfd.80.2016.05.07.10.57.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 May 2016 10:57:04 -0700 (PDT) Sender: Navdeep Parhar Date: Sat, 7 May 2016 10:56:58 -0700 From: Navdeep Parhar To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Message-ID: <20160507175658.GA4513@ox> Mail-Followup-To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605070033.u470XZCs075568@repo.freebsd.org> <3138889.ZBJ52FyIMB@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3138889.ZBJ52FyIMB@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 17:57:06 -0000 On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > Author: jhb > > Date: Sat May 7 00:33:35 2016 > > New Revision: 299210 > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > Log: > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > into wired user buffers. This feature is known as Direct-Data Placement. > > However, to scale well the adapter needs to prepare buffers for DDP > > before data arrives. aio_read() is more amenable to this requirement than > > read() as applications often call read() only after data is available in > > the socket buffer. > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > protocol hook to claim aio_read(2) requests instead of letting them use > > the default AIO socket logic. The DDP feature supports scheduling DMA > > to two buffers at a time so that the second buffer is ready for use > > after the first buffer is filled. The aio/DDP code optimizes the case > > of an application ping-ponging between two buffers (similar to the > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > Chelsio NIC uses to describe user buffers). The generation of the > > vmspace of the calling process is used in conjunction with the user > > buffer's address and length to determine if a user buffer matches a > > previously used buffer. If an application queues a buffer for AIO that > > does not match a previously used buffer then the least recently used > > buffer is unwired before the new buffer is wired. This ensures that no > > more than two user buffers per socket are ever wired. > > > > Note that this feature is best suited to applications sending a steady > > stream of data vs short bursts of traffic. > > > > Discussed with: np > > Relnotes: yes > > Sponsored by: Chelsio Communications > > The primary tool I used for evaluating performance was netperf's TCP stream > test. It is a best case for this (constant stream of traffic), but that is > also the intended use case for this feature. > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > used about about two full CPUs (~190% CPU usage) on a single-package > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > but the DDP usage is about 5% of single CPU. 5% of a single core on modern systems (with 4+ cores) means top/vmstat will report around 1% aggregate CPU use or less while receiving full 40Gbps line rate @ 1500 MTU. The idea here is to let applications written against standard BSD sockets and POSIX AIO APIs make full use of hardware TCP zero copy features when available. Zero copy on the transmit side will also be implemented (it's simpler than the receive side) in time for FreeBSD 11. Regards, Navdeep From owner-svn-src-all@freebsd.org Sat May 7 18:21:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 771E3B31032; Sat, 7 May 2016 18:21:59 +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 44B5F1A63; Sat, 7 May 2016 18:21:59 +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 u47ILwDb001185; Sat, 7 May 2016 18:21:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47ILwHv001182; Sat, 7 May 2016 18:21:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605071821.u47ILwHv001182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 7 May 2016 18:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299216 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:21:59 -0000 Author: bapt Date: Sat May 7 18:21:58 2016 New Revision: 299216 URL: https://svnweb.freebsd.org/changeset/base/299216 Log: Replace fparseln(3) with getline(3) It removes a dependency on libutil. Modified: head/usr.bin/sdiff/Makefile head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/Makefile ============================================================================== --- head/usr.bin/sdiff/Makefile Sat May 7 08:30:21 2016 (r299215) +++ head/usr.bin/sdiff/Makefile Sat May 7 18:21:58 2016 (r299216) @@ -6,7 +6,6 @@ PROG= sdiff SRCS= common.c edit.c sdiff.c WARNS= 3 -LIBADD= util MAN1= sdiff.1 .if ${MK_TESTS} != "no" Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Sat May 7 08:30:21 2016 (r299215) +++ head/usr.bin/sdiff/sdiff.c Sat May 7 18:21:58 2016 (r299216) @@ -22,11 +22,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include #include -#include #include "common.h" #include "extern.h" @@ -693,20 +693,23 @@ println(const char *s1, const char div, static char * xfgets(FILE *file) { - const char delim[3] = {'\0', '\0', '\0'}; + size_t linecap; + ssize_t l; char *s; - /* XXX - Is this necessary? */ clearerr(file); + linecap = 0; + s = NULL; - if (!(s = fparseln(file, NULL, NULL, delim, 0)) && - ferror(file)) - err(2, "error reading file"); - - if (!s) { + if ((l = getline(&s, &linecap, file)) == -1) { + if (ferror(file)) + err(2, "error reading file"); return (NULL); } + if (s[l-1] == '\n') + s[l-1] = '\0'; + return (s); } From owner-svn-src-all@freebsd.org Sat May 7 18:44:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA9F4B31384; Sat, 7 May 2016 18:44:31 +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 BCD9B1187; Sat, 7 May 2016 18:44:31 +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 u47IiUZP007358; Sat, 7 May 2016 18:44:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47IiUkS007357; Sat, 7 May 2016 18:44:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605071844.u47IiUkS007357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 7 May 2016 18:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299217 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:44:32 -0000 Author: bapt Date: Sat May 7 18:44:30 2016 New Revision: 299217 URL: https://svnweb.freebsd.org/changeset/base/299217 Log: Directly call the editor if needed instead of spawning /bin/sh Modified: head/usr.bin/sdiff/edit.c Modified: head/usr.bin/sdiff/edit.c ============================================================================== --- head/usr.bin/sdiff/edit.c Sat May 7 18:21:58 2016 (r299216) +++ head/usr.bin/sdiff/edit.c Sat May 7 18:44:30 2016 (r299217) @@ -35,19 +35,16 @@ int editit(const char *); int editit(const char *pathname) { - char *argp[] = {"sh", "-c", NULL, NULL}, *ed, *p; sig_t sighup, sigint, sigquit, sigchld; pid_t pid; int saved_errno, st, ret = -1; + const char *ed; ed = getenv("VISUAL"); - if (ed == NULL || ed[0] == '\0') + if (ed == NULL) ed = getenv("EDITOR"); - if (ed == NULL || ed[0] == '\0') + if (ed == NULL) ed = _PATH_VI; - if (asprintf(&p, "%s %s", ed, pathname) == -1) - return (-1); - argp[2] = p; sighup = signal(SIGHUP, SIG_IGN); sigint = signal(SIGINT, SIG_IGN); @@ -56,7 +53,7 @@ editit(const char *pathname) if ((pid = fork()) == -1) goto fail; if (pid == 0) { - execv(_PATH_BSHELL, argp); + execlp(ed, ed, pathname, (char *)NULL); _exit(127); } while (waitpid(pid, &st, 0) == -1) @@ -73,7 +70,6 @@ editit(const char *pathname) (void)signal(SIGINT, sigint); (void)signal(SIGQUIT, sigquit); (void)signal(SIGCHLD, sigchld); - free(p); errno = saved_errno; return (ret); } From owner-svn-src-all@freebsd.org Sat May 7 18:48:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35460B31459; Sat, 7 May 2016 18:48:50 +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 036CB132C; Sat, 7 May 2016 18:48:49 +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 u47Imnst007535; Sat, 7 May 2016 18:48:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47Imnpc007533; Sat, 7 May 2016 18:48:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605071848.u47Imnpc007533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 7 May 2016 18:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299218 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:48:50 -0000 Author: bapt Date: Sat May 7 18:48:48 2016 New Revision: 299218 URL: https://svnweb.freebsd.org/changeset/base/299218 Log: Only use EDITOR as a variable to specify which text editor to use Modified: head/usr.bin/sdiff/edit.c head/usr.bin/sdiff/sdiff.1 Modified: head/usr.bin/sdiff/edit.c ============================================================================== --- head/usr.bin/sdiff/edit.c Sat May 7 18:44:30 2016 (r299217) +++ head/usr.bin/sdiff/edit.c Sat May 7 18:48:48 2016 (r299218) @@ -40,10 +40,7 @@ editit(const char *pathname) int saved_errno, st, ret = -1; const char *ed; - ed = getenv("VISUAL"); - if (ed == NULL) - ed = getenv("EDITOR"); - if (ed == NULL) + if ((ed = getenv("EDITOR")) == NULL) ed = _PATH_VI; sighup = signal(SIGHUP, SIG_IGN); Modified: head/usr.bin/sdiff/sdiff.1 ============================================================================== --- head/usr.bin/sdiff/sdiff.1 Sat May 7 18:44:30 2016 (r299217) +++ head/usr.bin/sdiff/sdiff.1 Sat May 7 18:48:48 2016 (r299218) @@ -4,7 +4,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd $Mdocdate: July 5 2012 $ +.Dd May 7, 2016 .Dt SDIFF 1 .Os .Sh NAME @@ -50,8 +50,6 @@ into In this mode, the user is prompted for each set of differences. See .Ev EDITOR -and -.Ev VISUAL , below, for details of which editor, if any, is invoked. .Pp @@ -133,22 +131,10 @@ Change the size of tabs (default is 8.) .El .Sh ENVIRONMENT .Bl -tag -width Ds -.It Ev EDITOR , VISUAL +.It Ev EDITOR Specifies an editor to use with the .Fl o option. -If both -.Ev EDITOR -and -.Ev VISUAL -are set, -.Ev VISUAL -takes precedence. -If neither -.Ev EDITOR -nor -.Ev VISUAL -are set, the default is .Xr vi 1 . .It Ev TMPDIR From owner-svn-src-all@freebsd.org Sat May 7 18:50:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B63E2B316AE; Sat, 7 May 2016 18:50:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B76E1741; Sat, 7 May 2016 18:50:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ob0-x236.google.com with SMTP id x1so66385474obt.0; Sat, 07 May 2016 11:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=CX3lVA7HpaWcq1lognNfmd7omzZN4Z0RsYDdkO7eMqY=; b=oswnv5rRFwH6ruvipIPRNEL/9kC1l6R+rUHiME8hnmT6KToMxtJh69fMfDhEMYCZvr l4xMmSHBkQwSgDAr7O2qpg0z3geTiFcFBE8F+tP2/gRwhZTE1+fswlnMurwVmLVkuMHs xa7G2HcCh80HywRRwGL2cUUnFLOXNU0d42ZBktHKbQh22OA3nOGsbgmuNK73IUpKZOM9 8H249J9Nc8o8lx2zbdAAQrBzPHxX25wG3OKOkOjrhQLujdevBOVC6lnxm7RcW3w3urE6 NKs3JYDVynmoR554le3voO43rrP95OGf41hIkVIAnwV7j6flvgYddx/4l8BDNBKxKGzp bjzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=CX3lVA7HpaWcq1lognNfmd7omzZN4Z0RsYDdkO7eMqY=; b=Tb9IU3SkUzxI4mR1f4Hu4Hx1cOAFkLK2i9aw7C7NHFpGcdj3a2SKrxryJrO1Gs5qRq +U7usQjaWKSLyCohOglI4lroeSpcL3nUQjkZGH1NOQPLEC1jh3c7d6evxmhLEvYFsX9Q 0DUWnqv+cBsEwZC8w/5roKjEsyMoP9bmKV3ns0iJqyfmm6+BBeMgyJnwNiJyGxdpkbOc MLRwyJXz60Dr9MBpUb1NAA6UuNm6miC+CiffNxUJPOKn+JdnSOqw4RO4PNUyqODk8vo7 gYyEjA3jThl13tcjmc9LSap/JCBmM0ELWKUHcqo39WRW5hm6AOpr6uhAmuh3o8k3folW +l1A== X-Gm-Message-State: AOPr4FVmUvbGsQtmKlfbAPJK8QzSZ0UbXSB4BCYk56iTkF+lpKYwKYgSWx11pWt89yZyVG67BkkcRAmMavX2jQ== MIME-Version: 1.0 X-Received: by 10.182.135.129 with SMTP id ps1mr9305134obb.59.1462647056706; Sat, 07 May 2016 11:50:56 -0700 (PDT) Received: by 10.157.11.77 with HTTP; Sat, 7 May 2016 11:50:56 -0700 (PDT) In-Reply-To: <201605071848.u47Imnpc007533@repo.freebsd.org> References: <201605071848.u47Imnpc007533@repo.freebsd.org> Date: Sat, 7 May 2016 13:50:56 -0500 Message-ID: Subject: Re: svn commit: r299218 - head/usr.bin/sdiff From: Benjamin Kaduk To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:50:57 -0000 On Sat, May 7, 2016 at 1:48 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat May 7 18:48:48 2016 > New Revision: 299218 > URL: https://svnweb.freebsd.org/changeset/base/299218 > > Log: > Only use EDITOR as a variable to specify which text editor to use > > Why? VISUAL can still be terminal-based, as I understand it. -Ben From owner-svn-src-all@freebsd.org Sat May 7 18:54:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E062FB31844; Sat, 7 May 2016 18:54:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0F871A6A; Sat, 7 May 2016 18:54:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47IsZ5M010351; Sat, 7 May 2016 18:54:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47IsZ8V010350; Sat, 7 May 2016 18:54:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605071854.u47IsZ8V010350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 18: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: r299219 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:54:37 -0000 Author: dchagin Date: Sat May 7 18:54:35 2016 New Revision: 299219 URL: https://svnweb.freebsd.org/changeset/base/299219 Log: MFC r285394 (by mjg@): vref the vnode passed to vn_fullpath. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:48:48 2016 (r299218) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:54:35 2016 (r299219) @@ -858,10 +858,20 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) static int linprocfs_doproccwd(PFS_FILL_ARGS) { + struct filedesc *fdp; + struct vnode *vp; char *fullpath = "unknown"; char *freepath = NULL; - vn_fullpath(td, p->p_fd->fd_cdir, &fullpath, &freepath); + fdp = p->p_fd; + FILEDESC_SLOCK(fdp); + vp = fdp->fd_cdir; + if (vp != NULL) + VREF(vp); + FILEDESC_SUNLOCK(fdp); + vn_fullpath(td, vp, &fullpath, &freepath); + if (vp != NULL) + vrele(vp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -874,12 +884,20 @@ linprocfs_doproccwd(PFS_FILL_ARGS) static int linprocfs_doprocroot(PFS_FILL_ARGS) { - struct vnode *rvp; + struct filedesc *fdp; + struct vnode *vp; char *fullpath = "unknown"; char *freepath = NULL; - rvp = jailed(p->p_ucred) ? p->p_fd->fd_jdir : p->p_fd->fd_rdir; - vn_fullpath(td, rvp, &fullpath, &freepath); + fdp = p->p_fd; + FILEDESC_SLOCK(fdp); + vp = jailed(p->p_ucred) ? fdp->fd_jdir : fdp->fd_rdir; + if (vp != NULL) + VREF(vp); + FILEDESC_SUNLOCK(fdp); + vn_fullpath(td, vp, &fullpath, &freepath); + if (vp != NULL) + vrele(vp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); From owner-svn-src-all@freebsd.org Sat May 7 18:55:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94DA6B318D8; Sat, 7 May 2016 18:55:27 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29ACD1BE6; Sat, 7 May 2016 18:55:27 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id a17so124716693wme.0; Sat, 07 May 2016 11:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zjnWQ7wWIRYb9p4DRwWz9o/Sidm1OUVr/32R3cNRcCk=; b=TnvjxNGRYlCuy0ohi3QboXsLXn2H1wl428n+DYjwqCknX0qakdW2ji/NRevzbK9usD yuGGaL0aYCyy4Ch505KLvAaRug/wEdn8WAJrNONrq8ZYjUMEgBIFs7sIkEZbA1KZsG1T 05U+l9rSdypBZuRDxpBOYBKRw8YYvt7lt0TGpK3dmpDQPZ61ki4CoQbh9SEQP9pE/eQ1 wBZCeWhlwn6C8zj+xxEss+EU+e1r9MMzR8GPQKvVHUkno2R88u0hZMs51IhI4CMif5rb TRt6Lnez0lAEei4isG8ZZUH1wYAP1Im7mZth+9vBxU4Od2fSjoT38//NG5/UR2WDwyPy cHWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=zjnWQ7wWIRYb9p4DRwWz9o/Sidm1OUVr/32R3cNRcCk=; b=cFfWWBTyb5K8pheatiiZeVAdMIi3LmUq9ESgXpqlw9jTl23Kl7mQZuN2EapdwVQeE9 vuEAp7dX6s4HP5sDxppZuuau49NOe//DYBRfepUdOpzKy9ALA/5tBZkLcoizI3+tAHBg iQSM8RD4/jbRwZT9A9LdnswJhIhA3aDdmHESNRnNBiqQAbsl2s7oGVvQwFoL2B0vSLD3 68Oq6TFPyKXOrODt0rU91PWcJ9RIzl34QT2Lmb/BJwKoPBIlEZhW77zsJE7Stu3ELmrg RN3q6v22wzDnD3r1G0A26+Yp45ngAzkGNqfatw7w01DQCGUx2M3LF2ueFARC8E+XJWeM cFKA== X-Gm-Message-State: AOPr4FWTIpIizleej0wLSE6jGDwyP8xPRN3phoUUN2TorYihCp4g7XWmGVHIt1DJTznE2Q== X-Received: by 10.28.4.149 with SMTP id 143mr3217278wme.44.1462647325821; Sat, 07 May 2016 11:55:25 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id ju3sm21629042wjb.11.2016.05.07.11.55.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 May 2016 11:55:24 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 7 May 2016 20:55:23 +0200 From: Baptiste Daroussin To: Benjamin Kaduk Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r299218 - head/usr.bin/sdiff Message-ID: <20160507185523.GE84309@ivaldir.etoilebsd.net> References: <201605071848.u47Imnpc007533@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XuV1QlJbYrcVoo+x" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:55:27 -0000 --XuV1QlJbYrcVoo+x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 07, 2016 at 01:50:56PM -0500, Benjamin Kaduk wrote: > On Sat, May 7, 2016 at 1:48 PM, Baptiste Daroussin wro= te: >=20 > > Author: bapt > > Date: Sat May 7 18:48:48 2016 > > New Revision: 299218 > > URL: https://svnweb.freebsd.org/changeset/base/299218 > > > > Log: > > Only use EDITOR as a variable to specify which text editor to use > > > > > Why? VISUAL can still be terminal-based, as I understand it. >=20 Hey my bad, I don't know why my brain kept seeing PAGER instead of VISUAL. = I'll backout sorry. Bapt --XuV1QlJbYrcVoo+x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXLjobAAoJEGOJi9zxtz5a10QP/RPvjSkiOLLLb3scllRCgmUf LKQzsHM1emxzfAZJlhFtUEGb86rwBNz8S+nLqz4TKzG7XVHZN4GGMkRhHWtu6JYJ QqUpT/JZkXj/jztx7W/m6YlZCg+sXSwZrmxeRS260mlSA9oOUoQPQ62DIPeTOd4m 3i+MvIHlT2wV4PjoHyOCympL1Hur4eh9SMxDx2XdRbNmG3w3Ab7po6YZ+4nGnUKU A60mACQaks/pu8VtQml7ahAHu6rWMibhRpHqD2IxhjCXL6VVbY4JT/+4A3/UtN2l WrlKj5dBxSWJTeqRarCRv3weyjENTkWSZ7xEBEfKg+VarCsxcRucYTO3qIemkpy4 y4EgcMqPAYaNDBS0qfWlVVedQn97Jp+z8W/SssA83CWbIR+8054LNVNet0BouezP WD+IcmYB8fgLC6AYsSpGbLv4Oet/7d8FAxtBp4UaQHrTP6xWi6W+emY6IfCzGpw2 OoVFGlnWZFwIfyK8QDtj6wC2A94E1IToeRZPfhDs6/AJUDtmjMkuaPjqLKl/x7ZO gacu9WwpqpITJmRvmdwfj9c1ZKjPMrI2LyT0P+NmlZqrchtDFnnGTjdqiyzzG8Ow 2S0lQ1hH6AMtwKPVi/yycxj/RfnMM5yF2/Ea0oco7LNHzXIwttUi+hmBgRLxhAtK 9YZcH0sZIhStHppbJBsi =WFBS -----END PGP SIGNATURE----- --XuV1QlJbYrcVoo+x-- From owner-svn-src-all@freebsd.org Sat May 7 18:58:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8753DB31A01; Sat, 7 May 2016 18:58: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 587B51DB9; Sat, 7 May 2016 18:58:08 +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 u47Iw7UV010533; Sat, 7 May 2016 18:58:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47Iw7eE010531; Sat, 7 May 2016 18:58:07 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605071858.u47Iw7eE010531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 7 May 2016 18:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299220 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 18:58:08 -0000 Author: bapt Date: Sat May 7 18:58:07 2016 New Revision: 299220 URL: https://svnweb.freebsd.org/changeset/base/299220 Log: Revert r299218 VISUAL is actually a perfecly valid env to specify an editor Modified: head/usr.bin/sdiff/edit.c head/usr.bin/sdiff/sdiff.1 Modified: head/usr.bin/sdiff/edit.c ============================================================================== --- head/usr.bin/sdiff/edit.c Sat May 7 18:54:35 2016 (r299219) +++ head/usr.bin/sdiff/edit.c Sat May 7 18:58:07 2016 (r299220) @@ -40,7 +40,10 @@ editit(const char *pathname) int saved_errno, st, ret = -1; const char *ed; - if ((ed = getenv("EDITOR")) == NULL) + ed = getenv("VISUAL"); + if (ed == NULL) + ed = getenv("EDITOR"); + if (ed == NULL) ed = _PATH_VI; sighup = signal(SIGHUP, SIG_IGN); Modified: head/usr.bin/sdiff/sdiff.1 ============================================================================== --- head/usr.bin/sdiff/sdiff.1 Sat May 7 18:54:35 2016 (r299219) +++ head/usr.bin/sdiff/sdiff.1 Sat May 7 18:58:07 2016 (r299220) @@ -4,7 +4,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd May 7, 2016 +.Dd $Mdocdate: July 5 2012 $ .Dt SDIFF 1 .Os .Sh NAME @@ -50,6 +50,8 @@ into In this mode, the user is prompted for each set of differences. See .Ev EDITOR +and +.Ev VISUAL , below, for details of which editor, if any, is invoked. .Pp @@ -131,10 +133,22 @@ Change the size of tabs (default is 8.) .El .Sh ENVIRONMENT .Bl -tag -width Ds -.It Ev EDITOR +.It Ev EDITOR , VISUAL Specifies an editor to use with the .Fl o option. +If both +.Ev EDITOR +and +.Ev VISUAL +are set, +.Ev VISUAL +takes precedence. +If neither +.Ev EDITOR +nor +.Ev VISUAL +are set, the default is .Xr vi 1 . .It Ev TMPDIR From owner-svn-src-all@freebsd.org Sat May 7 19:05:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E832B31BA0; Sat, 7 May 2016 19:05:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB0511AD; Sat, 7 May 2016 19:05:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47J5dJS013588; Sat, 7 May 2016 19:05:39 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47J5dgG013586; Sat, 7 May 2016 19:05:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605071905.u47J5dgG013586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 19:05:39 +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: r299221 - in stable/10/sys/compat: linprocfs linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 19:05:40 -0000 Author: dchagin Date: Sat May 7 19:05:39 2016 New Revision: 299221 URL: https://svnweb.freebsd.org/changeset/base/299221 Log: MFC r295856 (by des@): Implement /proc/$$/limits. MFC r297781 (by dchagin@): More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. MFC r298318, 298319 (by cem@): Don't print uninitialized values and initialize error return before use. PR: 207386 Modified: stable/10/sys/compat/linprocfs/linprocfs.c stable/10/sys/compat/linux/linux_misc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 18:58:07 2016 (r299220) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat May 7 19:05:39 2016 (r299221) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1350,6 +1351,97 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) return (0); } +/* + * Filler function for proc/pid/limits + */ +static const struct linux_rlimit_ident { + const char *desc; + const char *unit; + unsigned int rlim_id; +} linux_rlimits_ident[] = { + { "Max cpu time", "seconds", RLIMIT_CPU }, + { "Max file size", "bytes", RLIMIT_FSIZE }, + { "Max data size", "bytes", RLIMIT_DATA }, + { "Max stack size", "bytes", RLIMIT_STACK }, + { "Max core file size", "bytes", RLIMIT_CORE }, + { "Max resident set", "bytes", RLIMIT_RSS }, + { "Max processes", "processes", RLIMIT_NPROC }, + { "Max open files", "files", RLIMIT_NOFILE }, + { "Max locked memory", "bytes", RLIMIT_MEMLOCK }, + { "Max address space", "bytes", RLIMIT_AS }, + { "Max file locks", "locks", LINUX_RLIMIT_LOCKS }, + { "Max pending signals", "signals", LINUX_RLIMIT_SIGPENDING }, + { "Max msgqueue size", "bytes", LINUX_RLIMIT_MSGQUEUE }, + { "Max nice priority", "", LINUX_RLIMIT_NICE }, + { "Max realtime priority", "", LINUX_RLIMIT_RTPRIO }, + { "Max realtime timeout", "us", LINUX_RLIMIT_RTTIME }, + { 0, 0, 0 } +}; + +static int +linprocfs_doproclimits(PFS_FILL_ARGS) +{ + const struct linux_rlimit_ident *li; + struct plimit *limp; + struct rlimit rl; + ssize_t size; + int res, error; + + error = 0; + + PROC_LOCK(p); + limp = lim_hold(p->p_limit); + PROC_UNLOCK(p); + size = sizeof(res); + sbuf_printf(sb, "%-26s%-21s%-21s%-21s\n", "Limit", "Soft Limit", + "Hard Limit", "Units"); + for (li = linux_rlimits_ident; li->desc != NULL; ++li) { + switch (li->rlim_id) + { + case LINUX_RLIMIT_LOCKS: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTTIME: + rl.rlim_cur = RLIM_INFINITY; + break; + case LINUX_RLIMIT_SIGPENDING: + error = kernel_sysctlbyname(td, + "kern.sigqueue.max_pending_per_proc", + &res, &size, 0, 0, 0, 0); + if (error != 0) + goto out; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_MSGQUEUE: + error = kernel_sysctlbyname(td, + "kern.ipc.msgmnb", &res, &size, 0, 0, 0, 0); + if (error != 0) + goto out; + rl.rlim_cur = res; + rl.rlim_max = res; + break; + case LINUX_RLIMIT_NICE: + /* FALLTHROUGH */ + case LINUX_RLIMIT_RTPRIO: + rl.rlim_cur = 0; + rl.rlim_max = 0; + break; + default: + rl = limp->pl_rlimit[li->rlim_id]; + break; + } + if (rl.rlim_cur == RLIM_INFINITY) + sbuf_printf(sb, "%-26s%-21s%-21s%-10s\n", + li->desc, "unlimited", "unlimited", li->unit); + else + sbuf_printf(sb, "%-26s%-21llu%-21llu%-10s\n", + li->desc, (unsigned long long)rl.rlim_cur, + (unsigned long long)rl.rlim_max, li->unit); + } +out: + lim_free(limp); + return (error); +} /* * Filler function for proc/sys/kernel/random/uuid @@ -1488,6 +1580,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); pfs_create_file(dir, "auxv", &linprocfs_doauxv, NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD); + pfs_create_file(dir, "limits", &linprocfs_doproclimits, + NULL, NULL, NULL, PFS_RD); /* /proc/scsi/... */ dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat May 7 18:58:07 2016 (r299220) +++ stable/10/sys/compat/linux/linux_misc.h Sat May 7 19:05:39 2016 (r299221) @@ -141,6 +141,13 @@ extern int stclohz; #define LINUX_P_PID 1 #define LINUX_P_PGID 2 +#define LINUX_RLIMIT_LOCKS RLIM_NLIMITS + 1 +#define LINUX_RLIMIT_SIGPENDING RLIM_NLIMITS + 2 +#define LINUX_RLIMIT_MSGQUEUE RLIM_NLIMITS + 3 +#define LINUX_RLIMIT_NICE RLIM_NLIMITS + 4 +#define LINUX_RLIMIT_RTPRIO RLIM_NLIMITS + 5 +#define LINUX_RLIMIT_RTTIME RLIM_NLIMITS + 6 + #define LINUX_RLIM_INFINITY (~0UL) int linux_common_wait(struct thread *td, int pid, int *status, From owner-svn-src-all@freebsd.org Sat May 7 20:09:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD45AB32910; Sat, 7 May 2016 20:09:16 +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 8CE051D03; Sat, 7 May 2016 20:09:16 +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 u47K9FZS032275; Sat, 7 May 2016 20:09:15 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47K9FJv032273; Sat, 7 May 2016 20:09:15 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072009.u47K9FJv032273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 20:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299222 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 20:09:17 -0000 Author: rmacklem Date: Sat May 7 20:09:15 2016 New Revision: 299222 URL: https://svnweb.freebsd.org/changeset/base/299222 Log: MFC: r298495 Fix a LOR in the NFSv4.1 server. The ordering of acquisition of the state and session mutexes was reversed in two cases executed when an NFSv4.1 client created/freed a session. Since clients will typically do this only when mounting and dismounting, the likelyhood of causing a deadlock was low but possible. This can only occur for NFSv4.1 mounts, since the others do not use sessions. This was detected while testing the pNFS server/client where the client crashed during dismounting. The patch also reorders the unlocks, although that isn't necessary for correct operation. Modified: stable/10/sys/fs/nfs/nfsrvstate.h stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfsrvstate.h ============================================================================== --- stable/10/sys/fs/nfs/nfsrvstate.h Sat May 7 19:05:39 2016 (r299221) +++ stable/10/sys/fs/nfs/nfsrvstate.h Sat May 7 20:09:15 2016 (r299222) @@ -113,7 +113,7 @@ struct nfsclient { * Structure for an NFSv4.1 session. * Locking rules for this structure. * To add/delete one of these structures from the lists, you must lock - * both: NFSLOCKSESSION(session hashhead) and NFSLOCKSTATE() in that order. + * both: NFSLOCKSTATE() and NFSLOCKSESSION(session hashhead) in that order. * To traverse the lists looking for one of these, you must hold one * of these two locks. * The exception is if the thread holds the exclusive root sleep lock. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 7 19:05:39 2016 (r299221) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 7 20:09:15 2016 (r299222) @@ -629,13 +629,13 @@ nfsrv_getclient(nfsquad_t clientid, int NFSBCOPY(sessid, nsep->sess_cbsess.nfsess_sessionid, NFSX_V4SESSIONID); shp = NFSSESSIONHASH(nsep->sess_sessionid); + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); - NFSLOCKSTATE(); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); } } } else if (clp->lc_flags & LCL_NEEDSCONFIRM) { @@ -5915,6 +5915,7 @@ nfsrv_freesession(struct nfsdsession *se struct nfssessionhash *shp; int i; + NFSLOCKSTATE(); if (sep == NULL) { shp = NFSSESSIONHASH(sessionid); NFSLOCKSESSION(shp); @@ -5924,18 +5925,17 @@ nfsrv_freesession(struct nfsdsession *se NFSLOCKSESSION(shp); } if (sep != NULL) { - NFSLOCKSTATE(); sep->sess_refcnt--; if (sep->sess_refcnt > 0) { - NFSUNLOCKSTATE(); NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (0); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); - NFSUNLOCKSTATE(); } NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); if (sep == NULL) return (NFSERR_BADSESSION); for (i = 0; i < NFSV4_SLOTS; i++) From owner-svn-src-all@freebsd.org Sat May 7 20:17:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 398D3B32B1D; Sat, 7 May 2016 20:17:25 +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 0261E118A; Sat, 7 May 2016 20:17:24 +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 u47KHOPX035187; Sat, 7 May 2016 20:17:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47KHOJu035186; Sat, 7 May 2016 20:17:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072017.u47KHOJu035186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 20:17: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: r299223 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 20:17:25 -0000 Author: rmacklem Date: Sat May 7 20:17:23 2016 New Revision: 299223 URL: https://svnweb.freebsd.org/changeset/base/299223 Log: MFC: r298523 Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation. It was reported via email that a Linux client couldn't do a Kerberized NFS mount when only "sec=krb5" was specified for the exports. The Linux client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT. Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I think it is the correct reply, so this patch enables that. I do not know if this fixes the mount attempt, but adding "krb5i" to the list of allowed security flavours does allow the mount to work. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 20:09:15 2016 (r299222) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 20:17:23 2016 (r299223) @@ -1144,6 +1144,7 @@ static short nfsv4err_setclientid[] = { NFSERR_INVAL, NFSERR_RESOURCE, NFSERR_SERVERFAULT, + NFSERR_WRONGSEC, 0, }; From owner-svn-src-all@freebsd.org Sat May 7 20:23:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26151B32D2C; Sat, 7 May 2016 20:23:28 +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 E802D1815; Sat, 7 May 2016 20:23:27 +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 u47KNRY5038019; Sat, 7 May 2016 20:23:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47KNRR1038018; Sat, 7 May 2016 20:23:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605072023.u47KNRR1038018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 7 May 2016 20:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299224 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 20:23:28 -0000 Author: bapt Date: Sat May 7 20:23:26 2016 New Revision: 299224 URL: https://svnweb.freebsd.org/changeset/base/299224 Log: Only one program is build in usr.bin/sdiff use the right include Modified: head/usr.bin/sdiff/Makefile Modified: head/usr.bin/sdiff/Makefile ============================================================================== --- head/usr.bin/sdiff/Makefile Sat May 7 20:17:23 2016 (r299223) +++ head/usr.bin/sdiff/Makefile Sat May 7 20:23:26 2016 (r299224) @@ -12,4 +12,4 @@ MAN1= sdiff.1 SUBDIR+= tests .endif -.include +.include From owner-svn-src-all@freebsd.org Sat May 7 21:34:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD3EB32946; Sat, 7 May 2016 21:34:05 +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 900431371; Sat, 7 May 2016 21:34:05 +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 u47LY4pv058787; Sat, 7 May 2016 21:34:04 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47LY4vU058786; Sat, 7 May 2016 21:34:04 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072134.u47LY4vU058786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 21:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299225 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 21:34:05 -0000 Author: rmacklem Date: Sat May 7 21:34:04 2016 New Revision: 299225 URL: https://svnweb.freebsd.org/changeset/base/299225 Log: MFC: r298523 Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation. It was reported via email that a Linux client couldn't do a Kerberized NFS mount when only "sec=krb5" was specified for the exports. The Linux client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT. Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I think it is the correct reply, so this patch enables that. I do not know if this fixes the mount attempt, but adding "krb5i" to the list of allowed security flavours does allow the mount to work. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 20:23:26 2016 (r299224) +++ stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Sat May 7 21:34:04 2016 (r299225) @@ -1130,6 +1130,7 @@ static short nfsv4err_setclientid[] = { NFSERR_INVAL, NFSERR_RESOURCE, NFSERR_SERVERFAULT, + NFSERR_WRONGSEC, 0, }; From owner-svn-src-all@freebsd.org Sat May 7 22:45:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25C3FB31B26; Sat, 7 May 2016 22:45:10 +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 EA8B41FDE; Sat, 7 May 2016 22:45:09 +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 u47Mj9pS079619; Sat, 7 May 2016 22:45:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47Mj93n079618; Sat, 7 May 2016 22:45:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605072245.u47Mj93n079618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 7 May 2016 22:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299226 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 22:45:10 -0000 Author: rmacklem Date: Sat May 7 22:45:08 2016 New Revision: 299226 URL: https://svnweb.freebsd.org/changeset/base/299226 Log: Don't increment srvrpccnt[] for the NFSv4.1 operations. When support for NFSv4.1 was added to the NFS server, it broke the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't have entries for the new NFSv4.1 operations. Without this patch, the code was incrementing bogus entries in newnfsstats for the new NFSv4.1 operations. This patch is an interim fix. The nfsstats structure needs to be updated and that will come in a future commit. Reported by: cem MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 7 21:34:04 2016 (r299225) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 7 22:45:08 2016 (r299226) @@ -771,7 +771,12 @@ nfsrvd_compound(struct nfsrv_descript *n } if (nfsv4_opflag[op].savereply) nd->nd_flag |= ND_SAVEREPLY; - NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); + /* + * For now, newnfsstats.srvrpccnt[] doesn't have entries + * for the NFSv4.1 operations. + */ + if (nd->nd_procnum < NFSV4OP_NOPS) + NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); switch (op) { case NFSV4OP_PUTFH: error = nfsrv_mtofh(nd, &fh);